/*
Theme Name: AgendaLink
Theme URI: https://turno.link
Author: Local Graph LLC
Description: App del dueño turno.link — UI mobile-first nativa.
Version: 0.3.1
Text Domain: agenda
*/

:root {
    --ag-primary: #0F766E;
    --ag-primary-dark: #0C5F59;
    --ag-primary-soft: #E6F4F2;
    --ag-on-primary: #FFFFFF;
    --ag-accent: #0F766E;
    --ag-accent-soft: #E6F4F2;
    --ag-btn: #171717;
    --ag-btn-hover: #2C2C30;
    --ag-on-btn: #fff;
    --ag-bg: #F2F2F4;
    --ag-surface: #FFFFFF;
    --ag-text: #111111;
    --ag-muted: #6B6B70;
    --ag-hairline: rgba(0, 0, 0, .08);
    --ag-shadow-card: none;
    --ag-shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .12);
    --ag-success: #00A650;
    --ag-success-bg: #E8F8EF;
    --ag-warning: #D97706;
    --ag-warning-bg: #FFF7ED;
    --ag-error: #F23D4F;
    --ag-gray-50: #F7F7F8;
    --ag-gray-100: #EEEEF0;
    --ag-gray-200: #E2E2E6;
    --ag-gray-300: #C8C8CE;
    --ag-gray-400: #8E8E94;
    --ag-gray-500: #6B6B70;
    --ag-gray-600: #4A4A4E;
    --ag-gray-700: #2E2E32;
    --ag-gray-800: #1C1C1F;
    --ag-gray-900: #111111;
    --ag-radius: 12px;
    --ag-radius-lg: 14px;
    --ag-radius-xl: 20px;
    --ag-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    --ag-safe-top: env(safe-area-inset-top, 0px);
    --ag-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ag-bottom-nav-h: 66px;
    --ag-topbar-h: 52px;
    --ag-phone-max: 480px;
    --ag-z-nav: 80;
    --ag-z-fab: 70;
    --ag-z-modal: 9000;
}
html.ag-native-app, body.ag-native-app { --ag-safe-top: 0px; --ag-safe-bottom: 0px; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { margin-top: 0 !important; }
#wpadminbar { display: none !important; }
html.ag-lock, html.ag-lock body { overflow: hidden; height: 100%; }
body {
    font-family: var(--ag-font);
    background: var(--ag-bg);
    color: var(--ag-text);
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
    touch-action: manipulation;
}
a { color: var(--ag-accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .35rem; letter-spacing: -.03em; font-weight: 700; line-height: 1.15; }

.ag-app { min-height: 100dvh; display: flex; flex-direction: column; background: var(--ag-bg); }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--ag-bottom-nav-h) + var(--ag-safe-bottom) + 4px); }
.ag-content { flex: 1; padding: 1rem 16px 1.75rem; width: 100%; max-width: 720px; margin: 0 auto; }
body.ag-no-bottom-nav .ag-main { padding-bottom: calc(1rem + var(--ag-safe-bottom)); }
body.ag-no-bottom-nav .ag-bottom-nav { display: none !important; }

.ag-topbar {
    position: sticky; top: 0; z-index: 40;
    min-height: calc(var(--ag-topbar-h) + var(--ag-safe-top));
    padding: var(--ag-safe-top) .65rem 0;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--ag-primary); color: var(--ag-on-primary);
}
.ag-topbar-title { font-weight: 700; font-size: 1.12rem; letter-spacing: -.025em; }
.ag-icon-btn {
    width: 40px; height: 40px; border: none; border-radius: 12px;
    background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none;
}
.ag-icon-btn svg { width: 22px; height: 22px; }

.ag-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; }
.ag-sidebar-backdrop.show { display: block; }
.ag-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 268px);
    background: var(--ag-surface); z-index: 100; display: flex; flex-direction: column;
    transform: translateX(-105%); transition: transform .22s ease; padding-top: var(--ag-safe-top);
}
.ag-sidebar.open { transform: translateX(0); }
.ag-sidebar-logo { padding: 1.05rem 1.15rem .7rem; font-weight: 800; font-size: 1.15rem; }
.ag-sidebar-logo .dot { width: 20px; height: 20px; border-radius: 6px; background: var(--ag-primary); display: inline-block; margin-right: .45rem; vertical-align: -3px; }
.ag-sidebar-nav { flex: 1; overflow-y: auto; padding: .35rem .7rem 1.25rem; }
.ag-nav-item { display: flex; align-items: center; gap: .75rem; padding: .78rem .85rem; border-radius: 14px; color: var(--ag-gray-600); font-weight: 600; }
.ag-nav-item.active { background: var(--ag-primary-soft); color: var(--ag-primary); }
.ag-nav-pro { margin-left: auto; font-size: .62rem; font-weight: 750; background: var(--ag-accent-soft); color: var(--ag-accent); padding: .12rem .38rem; border-radius: 6px; }
.ag-store-switcher { width: 100%; padding: .7rem .8rem; border: none; border-radius: 12px; margin-bottom: .5rem; font: inherit; background: var(--ag-gray-100); }

.ag-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ag-z-nav);
    height: calc(var(--ag-bottom-nav-h) + var(--ag-safe-bottom));
    padding: 6px 8px var(--ag-safe-bottom);
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.96); backdrop-filter: blur(18px);
    border-top: 1px solid var(--ag-hairline);
}
.ag-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem; color: var(--ag-gray-400); font-size: .75rem; font-weight: 650;
    border-radius: 16px; text-decoration: none; min-height: 52px;
}
.ag-bottom-nav a svg { width: 23px; height: 23px; }
.ag-nav-ico-fill { display: none; }
.ag-bottom-nav a.active { color: #111; font-weight: 750; background: var(--ag-primary-soft); }
.ag-bottom-nav a.active .ag-nav-ico-line { display: none; }
.ag-bottom-nav a.active .ag-nav-ico-fill { display: block; }

.ag-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 48px; padding: .78rem 1.15rem; border-radius: 12px; border: none;
    font: inherit; font-weight: 700; cursor: pointer;
    transition: transform .12s, background .15s, opacity .15s;
}
.ag-btn:active { transform: scale(.97); }
.ag-btn-primary { background: var(--ag-btn); color: var(--ag-on-btn); }
.ag-btn-primary:hover { background: var(--ag-btn-hover); }
.ag-btn-ghost { background: var(--ag-gray-100); color: var(--ag-text); }
.ag-btn-block { width: 100%; }
.ag-btn-danger { background: var(--ag-error); color: #fff; }

.ag-section {
    background: var(--ag-surface);
    border-radius: var(--ag-radius-lg);
    padding: 4px 16px;
    margin-bottom: 12px;
    box-shadow: var(--ag-shadow-card);
}
.ag-section-pad { padding: 16px; }
.ag-section-label {
    font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ag-muted); padding: 14px 4px 6px;
}
.ag-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 10px 0; border-bottom: 1px solid var(--ag-hairline);
    background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%;
    font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.ag-item:last-child { border-bottom: 0; }
.ag-item strong { font-weight: 650; }
.ag-item .chev { color: var(--ag-gray-400); font-size: 1.1rem; }
.ag-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ag-hairline); }
.ag-row:last-child { border-bottom: 0; }
.ag-muted { color: var(--ag-muted); font-size: .88rem; }
.ag-pill { font-size: .72rem; font-weight: 750; border-radius: 8px; padding: 3px 8px; display: inline-block; }
.ag-pill-ok { background: var(--ag-success-bg); color: var(--ag-success); }
.ag-pill-warn { background: var(--ag-warning-bg); color: var(--ag-warning); }

.ag-empty { text-align: center; padding: 36px 16px 24px; color: var(--ag-muted); }
.ag-empty-slots { display: flex; flex-direction: column; gap: 8px; margin: 0 auto 18px; max-width: 280px; }
.ag-empty-slots i { display: block; height: 48px; border-radius: 12px; background: var(--ag-gray-100); }
.ag-empty-slots i:nth-child(2) { width: 86%; }
.ag-empty-slots i:nth-child(3) { width: 72%; }
.ag-empty h3 { color: var(--ag-text); margin-bottom: 6px; }
.ag-empty .ag-btn { margin-top: 14px; }

.ag-field { margin-bottom: 12px; }
.ag-field label { display: block; font-size: .78rem; font-weight: 650; color: var(--ag-muted); margin-bottom: 4px; }
.ag-input, .ag-select, textarea.ag-input {
    width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--ag-hairline);
    font: inherit; background: #fff;
}
.ag-search { margin-bottom: 12px; }

.ag-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.ag-switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.ag-switch input { opacity: 0; width: 0; height: 0; }
.ag-switch i {
    position: absolute; inset: 0; background: var(--ag-gray-200); border-radius: 14px; transition: .2s;
}
.ag-switch i::after {
    content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.ag-switch input:checked + i { background: var(--ag-primary); }
.ag-switch input:checked + i::after { transform: translateX(18px); }

.ag-day-head { padding: 4px 4px 16px; }
.ag-day-head .dow { font-size: .85rem; color: var(--ag-muted); font-weight: 650; text-transform: capitalize; }
.ag-day-head h1 { font-size: 1.8rem; }

.ag-apt { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ag-hairline); cursor: pointer; }
.ag-apt:last-child { border-bottom: 0; }
.ag-apt time { width: 52px; font-weight: 750; color: var(--ag-primary); flex-shrink: 0; }
.ag-apt h3 { font-size: 1rem; margin: 0; }
.ag-fab {
    position: fixed; right: 16px; bottom: calc(var(--ag-bottom-nav-h) + var(--ag-safe-bottom) + 16px);
    width: 56px; height: 56px; border-radius: 18px; border: none;
    background: var(--ag-btn); color: #fff; font-size: 28px; z-index: var(--ag-z-fab);
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
}
body.ag-no-bottom-nav .ag-fab { bottom: calc(16px + var(--ag-safe-bottom)); }

.ag-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ag-z-modal);
    background: #fff; border-radius: 20px 20px 0 0;
    padding: 10px 16px calc(20px + var(--ag-safe-bottom));
    box-shadow: var(--ag-shadow-sheet); max-height: 88vh; overflow: auto;
    display: none;
}
.ag-sheet.open { display: block; animation: ag-sheet-up .22s ease; }
.ag-sheet::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
    background: var(--ag-gray-200); margin: 4px auto 14px;
}
.ag-sheet-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.42); backdrop-filter: blur(10px); z-index: 8990; }
.ag-sheet-bg.open { display: block; }
@keyframes ag-sheet-up { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }

.ag-cal-strip { display: flex; gap: 6px; overflow: auto; padding: 0 0 10px; -webkit-overflow-scrolling: touch; }
.ag-cal-strip button {
    flex: 0 0 56px; border: none; background: #fff; border-radius: 14px;
    padding: 10px 4px; font: inherit; min-height: 64px;
}
.ag-cal-strip button small { display: block; font-size: .68rem; color: var(--ag-muted); text-transform: capitalize; font-weight: 650; }
.ag-cal-strip button.on { background: var(--ag-btn); color: #fff; }
.ag-cal-strip button.on small { color: rgba(255,255,255,.75); }

.ag-more-group { margin-bottom: 8px; }
.ag-save-bar {
    position: sticky; bottom: 0; z-index: 20;
    margin: 16px -16px -16px; padding: 12px 16px calc(12px + var(--ag-safe-bottom));
    background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
    border-top: 1px solid var(--ag-hairline);
}

.ag-brand-preview {
    background: #F7F8FA; border-radius: var(--ag-radius-lg); padding: 16px; margin-bottom: 12px;
}
.ag-brand-preview-in {
    background: #fff; border: 1px solid var(--ag-hairline); border-radius: 16px; padding: 20px 18px;
    --bk-c: inherit;
}
.ag-brand-preview .bk-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--bk-c, var(--ag-primary));
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden;
}
.ag-brand-preview .bk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ag-brand-preview .bk-org { margin: 12px 0 0; font-size: .8rem; color: var(--ag-muted); font-weight: 650; }
.ag-brand-preview h2 { margin: 4px 0 10px; font-size: 1.25rem; }
.ag-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.ag-swatch.on { border-color: #111; }
.ag-color-native { width: 36px; height: 32px; padding: 0; border: none; background: none; }
.ag-skel {
    height: 52px; border-radius: 10px; margin: 8px 0;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: ag-shimmer 1.2s infinite linear;
}
@keyframes ag-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ag-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ag-sheet-head h2 { margin: 0; font-size: 1.15rem; }
.ag-sheet-head .ag-icon-btn { color: var(--ag-muted); }

.ag-hours-day { padding: 12px 0; border-bottom: 1px solid var(--ag-hairline); }
.ag-hours-day:last-child { border-bottom: 0; }
.ag-hours-day.is-closed .ag-h-body { display: none; }
.ag-hours-times { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 10px; }
.ag-hours-times span { color: var(--ag-muted); font-size: .8rem; }
.ag-sheet.dragging { transition: none; }

.ag-auth { min-height: 100dvh; display: flex; flex-direction: column; padding: 48px 20px 24px; max-width: 420px; margin: 0 auto; }
.ag-auth-brand { font-weight: 800; font-size: 1.4rem; color: var(--ag-primary); margin-bottom: 24px; }
.ag-auth-error { color: var(--ag-error); min-height: 1.2em; margin-bottom: 8px; }

.ag-landing { max-width: 560px; margin: 0 auto; padding: 56px 20px; }
.ag-landing h1 { font-size: 2.2rem; letter-spacing: -.04em; }
.ag-landing .lead { color: var(--ag-muted); font-size: 1.1rem; margin: 12px 0 28px; }

.ag-toast {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--ag-bottom-nav-h) + var(--ag-safe-bottom) + 14px);
    background: #111; color: #fff; padding: 10px 14px; border-radius: 12px;
    display: none; z-index: 9500; font-size: .88rem; font-weight: 650;
}
.ag-toast.show { display: block; }
body.ag-no-bottom-nav .ag-toast { bottom: calc(20px + var(--ag-safe-bottom)); }

@media (min-width: 900px) {
    .ag-menu-btn { display: none; }
    .ag-sidebar { transform: none; position: sticky; top: 0; height: 100dvh; }
    .ag-app { flex-direction: row; }
    .ag-bottom-nav { display: none; }
    .ag-main { padding-bottom: 0; }
    html.ag-native-app .ag-bottom-nav { display: grid; }
    html.ag-native-app .ag-main { padding-bottom: calc(var(--ag-bottom-nav-h) + var(--ag-safe-bottom) + 4px); }
    html.ag-native-app .ag-app { max-width: var(--ag-phone-max); margin: 0 auto; min-height: 100dvh; border-left: 1px solid var(--ag-hairline); border-right: 1px solid var(--ag-hairline); }
    html:not(.ag-native-app) .ag-item:hover,
    html:not(.ag-native-app) .ag-apt:hover,
    html:not(.ag-native-app) .ag-nav-item:hover:not(.active) { background: var(--ag-gray-50); }
    html:not(.ag-native-app) .ag-icon-btn:hover { background: rgba(0,0,0,.06); }
    html:not(.ag-native-app) .ag-btn:active,
    html:not(.ag-native-app) .ag-fab:active,
    html:not(.ag-native-app) .ag-icon-btn:active { transform: none; }
}

.ag-btn:focus-visible,
.ag-icon-btn:focus-visible,
.ag-item:focus-visible,
.ag-nav-item:focus-visible,
.ag-input:focus-visible,
.ag-select:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--ag-primary) 85%, #000);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
