:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eff6ff;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --slate-soft: #f1f5f9;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 12px rgba(15, 23, 42, .04);
    --shadow-lg: 0 22px 70px rgba(15, 23, 42, .18);
    --slot-height: 54px;
    --time-width: 70px;
    --header-height: 68px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    transform: translateY(-160%);
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.button,
.icon-button,
.segmented,
.status-action {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 750;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.button { padding: 10px 15px; }
.button.primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 7px 18px rgba(15, 23, 42, .13); }
.button.primary:hover { background: #1e293b; transform: translateY(-1px); }
.button.quiet { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.quiet:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.button.danger.subtle { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; box-shadow: none; }
.button.wide { width: 100%; }
.button:disabled, .status-action:disabled { opacity: .55; cursor: wait; transform: none; }
.icon-button {
    width: 44px;
    flex: 0 0 44px;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.icon-button:hover { background: var(--surface-soft); border-color: var(--border-strong); }
.icon-button:focus-visible,
.button:focus-visible,
.segmented:focus-visible,
.status-action:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.event-card:focus-visible,
.slot-cell:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 2px;
}

/* Login */
.login-body { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 18% 18%, #dbeafe 0, transparent 32%), radial-gradient(circle at 85% 82%, #dcfce7 0, transparent 30%), #f8fafc; }
.login-shell { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(340px, 450px) minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(226, 232, 240, .9); border-radius: 24px; background: rgba(255, 255, 255, .93); box-shadow: 0 30px 90px rgba(15, 23, 42, .14); backdrop-filter: blur(14px); }
.login-card { padding: 42px; }
.brand-lockup, .business-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-lockup > div, .business-copy { display: grid; min-width: 0; }
.brand-lockup strong, .business-copy strong { color: var(--ink); font-size: 16px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.brand-lockup span:not(.brand-mark), .business-copy span { color: var(--muted); font-size: 12px; font-weight: 650; margin-top: 3px; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--ink); color: #fff; font-size: 21px; font-weight: 900; box-shadow: 0 8px 18px rgba(15, 23, 42, .18); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 19px; }
.login-copy { margin: 52px 0 30px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; line-height: 1.2; text-transform: uppercase; letter-spacing: .11em; font-weight: 900; }
.login-copy h1 { margin: 0; color: var(--ink); font-size: clamp(29px, 4vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.login-copy > p:last-child { margin: 16px 0 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.login-form { display: grid; gap: 16px; }
.login-panel-link { display: block; width: max-content; margin: 22px auto 0; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.login-panel-link:hover { color: var(--accent); }
.login-preview { position: relative; min-height: 660px; padding: 80px 44px; overflow: hidden; display: grid; align-items: center; background: linear-gradient(150deg, #0f172a, #1e3a8a); }
.login-preview::before, .login-preview::after { content: ""; position: absolute; border-radius: 50%; filter: blur(1px); }
.login-preview::before { width: 340px; height: 340px; right: -100px; top: -100px; background: rgba(96, 165, 250, .24); }
.login-preview::after { width: 260px; height: 260px; left: -90px; bottom: -80px; background: rgba(52, 211, 153, .16); }
.preview-head, .preview-grid { position: relative; z-index: 1; background: rgba(255, 255, 255, .96); }
.preview-head { height: 58px; border-radius: 18px 18px 0 0; display: grid; grid-template-columns: 70px repeat(3, 1fr); gap: 1px; padding: 14px; border-bottom: 1px solid var(--border); }
.preview-head span { border-radius: 8px; background: #e2e8f0; }
.preview-head span:first-child { background: transparent; }
.preview-grid { min-height: 390px; border-radius: 0 0 18px 18px; display: grid; grid-template-columns: 70px repeat(3, 1fr); grid-template-rows: repeat(4, 92px); gap: 1px; padding: 0 14px 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .2); }
.preview-grid > div { border-bottom: 1px solid #edf2f7; border-right: 1px solid #edf2f7; }
.preview-time { display: grid; place-items: start center; padding-top: 12px; color: var(--faint); font-size: 11px; font-weight: 800; }
.preview-event { align-self: center; height: 68px; margin: 8px; border: 1px solid #bfdbfe !important; border-left: 4px solid #3b82f6 !important; border-radius: 10px; background: #eff6ff; }
.preview-event.two { height: 150px; align-self: start; border-color: #bbf7d0 !important; border-left-color: #10b981 !important; background: #ecfdf5; z-index: 2; }
.preview-event.three { border-color: #fde68a !important; border-left-color: #f59e0b !important; background: #fffbeb; }
.preview-event.four { border-color: #c4b5fd !important; border-left-color: #8b5cf6 !important; background: #f5f3ff; }

/* Application shell */
.app-body { overflow: hidden; }
.app-shell { height: 100vh; display: flex; flex-direction: column; }
.admin-mode-banner { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 16px; background: #7c2d12; color: #fff7ed; font-size: 12px; line-height: 1.35; }
.admin-mode-banner strong { color: #fff; }
.admin-mode-banner a { margin-left: 6px; color: #fff; font-weight: 850; }
.app-body:has(.admin-mode-banner) .app-shell { height: calc(100vh - 38px); }
.app-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 20px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .96); box-shadow: 0 1px 0 rgba(15, 23, 42, .02); z-index: 40; }
.business-copy { max-width: min(38vw, 420px); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.calendar-toolbar { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); z-index: 35; }
.date-navigator { display: flex; align-items: center; gap: 7px; min-width: 0; }
.date-picker-label { position: relative; min-width: 175px; height: 44px; padding: 6px 39px 6px 12px; display: grid; align-content: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.date-picker-label::after { content: ""; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.date-picker-label span { color: var(--ink); font-size: 13px; font-weight: 850; white-space: nowrap; }
.date-picker-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.toolbar-group { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.segmented { min-height: 36px; padding: 7px 13px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.segmented.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.staff-filter { height: 44px; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); }
.staff-filter svg { width: 18px; height: 18px; flex: 0 0 auto; }
.staff-filter select { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 750; cursor: pointer; }
.sync-status { margin-left: auto; min-width: 112px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px rgba(148, 163, 184, .13); }
.sync-status.ok .sync-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(5, 150, 105, .12); }
.sync-status.loading .sync-dot { background: var(--accent); animation: pulse 1s infinite; }
.sync-status.error .sync-dot { background: var(--danger); }
.add-button svg { width: 18px; height: 18px; }
.search-panel { min-height: 54px; padding: 7px 20px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.search-panel label { width: min(620px, 100%); margin: 0 auto; height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.search-panel label svg { color: var(--muted); flex: 0 0 auto; }
.search-panel input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.pending-banner { width: 100%; min-height: 47px; padding: 8px 20px; border: 0; border-bottom: 1px solid #fde68a; display: flex; align-items: center; gap: 10px; background: var(--warning-soft); color: #92400e; text-align: left; cursor: pointer; }
.pending-banner:hover { background: #fef3c7; }
.pending-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #f59e0b; color: #fff; font-weight: 900; }
.pending-banner > span:nth-child(2) { display: grid; gap: 1px; }
.pending-banner strong { color: #78350f; font-size: 13px; }
.pending-banner small { color: #a16207; font-size: 11px; }
.pending-link { margin-left: auto; font-size: 12px; font-weight: 850; white-space: nowrap; }
.mobile-view-controls { display: none; }
.calendar-stage { position: relative; min-height: 0; overflow: hidden; flex: 1 1 auto; background: var(--surface); }
.calendar-loading { position: absolute; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 9px; background: rgba(248, 250, 252, .9); color: var(--muted); }
.calendar-loading strong { color: var(--ink); font-size: 15px; }
.calendar-loading small { font-size: 12px; }
.spinner, .button-spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #dbeafe; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }

/* Desktop calendar */
.desktop-calendar { width: 100%; height: 100%; overflow: auto; overscroll-behavior: contain; background: #fff; }
.desktop-calendar[hidden], .mobile-calendar[hidden] { display: none !important; }
.calendar-grid { min-width: 760px; width: max(100%, calc(var(--calendar-columns) * 220px + var(--time-width))); }
.calendar-grid-header { position: sticky; top: 0; z-index: 28; height: var(--header-height); display: grid; grid-template-columns: var(--time-width) repeat(var(--calendar-columns), minmax(220px, 1fr)); border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .97); box-shadow: 0 5px 14px rgba(15, 23, 42, .045); }
.calendar-corner { position: sticky; left: 0; z-index: 30; display: grid; place-items: center; border-right: 1px solid var(--border); background: #fff; color: var(--faint); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.calendar-column-header { min-width: 0; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 10px; border-right: 1px solid var(--border); text-align: center; }
.calendar-column-header.today { background: linear-gradient(180deg, #eff6ff, rgba(239, 246, 255, .25)); }
.staff-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: var(--slate-soft); color: var(--ink); font-size: 12px; font-weight: 900; }
.staff-avatar img { width: 100%; height: 100%; object-fit: cover; }
.column-copy { display: grid; gap: 2px; min-width: 0; }
.column-copy strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.column-copy span { color: var(--muted); font-size: 10px; font-weight: 700; }
.calendar-grid-body { display: grid; grid-template-columns: var(--time-width) repeat(var(--calendar-columns), minmax(220px, 1fr)); min-height: var(--calendar-height, 800px); }
.time-rail { position: sticky; left: 0; z-index: 20; min-height: inherit; border-right: 1px solid var(--border); background: #fff; }
.time-label { position: absolute; left: 0; width: 100%; transform: translateY(-50%); padding-right: 12px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 750; text-align: right; }
.time-label:first-child { transform: none; }
.calendar-lane { position: relative; min-height: inherit; border-right: 1px solid var(--border); background: #fff; }
.calendar-lane.closed-day { background: repeating-linear-gradient(-45deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px); }
.slot-cell { position: absolute; left: 0; width: 100%; height: var(--slot-height); padding: 5px; border: 0; border-bottom: 1px solid #eef2f7; background: transparent; cursor: pointer; text-align: left; }
.slot-cell:nth-of-type(2n) { border-bottom-color: #e2e8f0; }
.slot-cell:hover { background: rgba(239, 246, 255, .62); }
.slot-cell::after { content: "+ Randevu"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 5px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 850; opacity: 0; pointer-events: none; transition: opacity .14s ease; }
.slot-cell:hover::after, .slot-cell:focus-visible::after { opacity: 1; }
.slot-cell.unavailable { cursor: default; background: rgba(241, 245, 249, .72); }
.slot-cell.unavailable::after { content: "Mesai dışı"; color: var(--faint); background: transparent; }
.slot-cell.holiday::after { content: "Kapalı"; opacity: 1; color: #a16207; background: rgba(255, 251, 235, .8); }
.slot-cell.manual-closed { background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 7px, #e2e8f0 7px, #e2e8f0 14px); cursor: default; }
.slot-cell.manual-closed::after { content: "Kapalı"; opacity: .8; color: #475569; background: #fff; }
.campaign-marker { position: absolute; z-index: 3; top: 5px; right: 7px; min-width: 34px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #99f6e4; border-radius: 999px; background: #f0fdfa; color: #0f766e; font-size: 9px; font-weight: 900; pointer-events: none; }
.pending-dot { position: absolute; z-index: 5; top: 7px; left: 7px; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .14); pointer-events: none; }
.event-card { position: absolute; z-index: 8; left: 5px; right: 5px; min-height: 36px; padding: 7px 9px; overflow: hidden; display: block; border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; border-radius: 9px; background: #eff6ff; color: #1e3a8a; text-align: left; cursor: pointer; box-shadow: 0 2px 7px rgba(37, 99, 235, .08); }
.event-card:hover { z-index: 11; filter: saturate(1.07); box-shadow: 0 7px 18px rgba(15, 23, 42, .14); }
.event-card.status-pending { border-color: #fde68a; border-left-color: #f59e0b; background: #fffbeb; color: #78350f; box-shadow: none; }
.event-card.status-arrived { border-color: #a7f3d0; border-left-color: #10b981; background: #ecfdf5; color: #065f46; }
.event-card.status-completed { border-color: #bbf7d0; border-left-color: #16a34a; background: #f0fdf4; color: #14532d; opacity: .9; }
.event-card.status-noshow { border-color: #fecaca; border-left-color: #ef4444; background: #fef2f2; color: #991b1b; }
.event-card.status-cancelled { border-color: #e2e8f0; border-left-color: #94a3b8; background: #f8fafc; color: #64748b; opacity: .68; text-decoration: line-through; }
.event-time { display: block; margin-bottom: 2px; font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.event-customer { display: block; overflow: hidden; color: currentColor; font-size: 12px; line-height: 1.25; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.event-service { display: block; margin-top: 2px; overflow: hidden; font-size: 10px; line-height: 1.25; font-weight: 650; opacity: .82; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 9px; font-weight: 800; opacity: .84; }
.event-card.compact .event-service, .event-card.compact .event-meta { display: none; }
.now-line { position: absolute; z-index: 16; left: 0; right: 0; height: 2px; background: #ef4444; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.empty-calendar-message { height: 100%; min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; }
.empty-calendar-message strong { color: var(--ink); }

/* Mobile calendar */
.mobile-calendar { height: 100%; overflow: auto; padding: 12px 12px 96px; background: var(--bg); }
.mobile-day-summary { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mobile-day-summary h2 { margin: 0; color: var(--ink); font-size: 17px; }
.mobile-day-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.mobile-flow-list { display: grid; gap: 9px; }
.mobile-time-group { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 9px; }
.mobile-time-label { padding-top: 13px; color: var(--muted); font-size: 11px; font-weight: 850; font-variant-numeric: tabular-nums; text-align: right; }
.mobile-time-events { display: grid; gap: 7px; }
.mobile-event-card { width: 100%; min-height: 68px; padding: 11px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; border-radius: 12px; background: #fff; color: var(--text); text-align: left; box-shadow: var(--shadow-sm); }
.mobile-event-card.status-pending { border-color: #fde68a; border-left-color: #f59e0b; }
.mobile-event-card.status-arrived, .mobile-event-card.status-completed { border-color: #a7f3d0; border-left-color: #10b981; }
.mobile-event-card.status-noshow { border-color: #fecaca; border-left-color: #ef4444; }
.mobile-event-main { min-width: 0; display: grid; gap: 3px; }
.mobile-event-main strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-event-main span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-source { align-self: start; padding: 4px 7px; border-radius: 999px; background: var(--slate-soft); color: var(--muted); font-size: 9px; font-weight: 850; }
.mobile-empty { padding: 45px 20px; display: grid; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.mobile-empty strong { color: var(--ink); }
.mobile-hours { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.mobile-hour-row { min-height: 62px; display: grid; grid-template-columns: 58px minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.mobile-hour-row:last-child { border-bottom: 0; }
.mobile-hour-time { padding: 14px 8px; color: var(--muted); font-size: 11px; font-weight: 850; text-align: center; }
.mobile-hour-action { min-width: 0; padding: 8px; border: 0; border-left: 1px solid var(--border); background: #fff; text-align: left; }
.mobile-hour-action.available { color: var(--success); font-size: 12px; font-weight: 800; cursor: pointer; }
.mobile-hour-action.available:hover { background: var(--success-soft); }
.mobile-hour-action.unavailable { background: var(--surface-soft); color: var(--faint); font-size: 11px; }
.mobile-hour-event { width: 100%; padding: 8px 10px; border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; border-radius: 9px; background: var(--accent-soft); color: #1e3a8a; text-align: left; }
.mobile-hour-event strong, .mobile-hour-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-hour-event strong { font-size: 12px; }
.mobile-hour-event span { margin-top: 2px; font-size: 10px; opacity: .8; }
.mobile-fab { display: none; }

/* Forms and drawers */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: var(--ink); font-size: 12px; font-weight: 800; }
.field > span b { color: var(--danger); }
.field > span small { color: var(--muted); font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.form-alert { padding: 11px 13px; border: 1px solid; border-radius: 9px; font-size: 12px; line-height: 1.45; font-weight: 700; }
.form-alert.error { border-color: #fecaca; background: var(--danger-soft); color: #991b1b; }
.form-alert.success { border-color: #a7f3d0; background: var(--success-soft); color: #065f46; }
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .4); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 100; top: 0; right: 0; width: min(540px, 100%); height: 100dvh; overflow: auto; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(0); }
.drawer-header { position: sticky; top: 0; z-index: 4; min-height: 80px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
.drawer-header h2 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.drawer-close { font-size: 26px; line-height: 1; }
.appointment-form { display: flex; min-height: calc(100% - 80px); flex-direction: column; }
.form-section { padding: 19px 20px; border-bottom: 1px solid var(--border); }
.form-section.compact-section { background: var(--surface-soft); }
.section-heading { margin-bottom: 15px; display: flex; align-items: flex-start; gap: 10px; }
.section-number { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
.section-heading h3 { margin: 1px 0 3px; color: var(--ink); font-size: 14px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: 1fr .72fr 1.25fr; }
.field-grid .full { grid-column: 1 / -1; }
.service-summary { min-height: 66px; padding: 9px 11px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 2px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.service-summary span { color: var(--muted); font-size: 10px; font-weight: 750; }
.service-summary strong { color: var(--ink); font-size: 14px; text-align: right; }
.service-summary small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.campaign-choice { position: relative; margin-top: 13px; min-height: 72px; padding: 12px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #99f6e4; border-radius: 12px; background: #f0fdfa; cursor: pointer; }
.campaign-choice input { position: absolute; opacity: 0; }
.campaign-check { width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #5eead4; border-radius: 7px; background: #fff; }
.campaign-choice input:checked + .campaign-check { border-color: #0f766e; background: #0f766e; }
.campaign-choice input:checked + .campaign-check::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 900; }
.campaign-copy { display: grid; gap: 3px; min-width: 0; }
.campaign-copy strong { color: #115e59; font-size: 12px; }
.campaign-copy small { color: #0f766e; font-size: 10px; line-height: 1.4; }
.campaign-badge { min-width: 42px; height: 26px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: #0f766e; color: #fff; font-size: 11px; font-weight: 900; }
.note-field { margin-top: 13px; }
.drawer-footer { position: sticky; bottom: 0; z-index: 4; margin-top: auto; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto minmax(180px, 1fr); gap: 10px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
.save-button { min-width: 190px; }
.button-spinner { display: none; width: 17px; height: 17px; border-width: 2px; }
.save-button.loading .button-label { opacity: .78; }
.save-button.loading .button-spinner { display: block; }
.detail-content { flex: 1; padding: 20px; }
.detail-hero { padding: 17px; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(180deg, #fff, var(--surface-soft)); }
.detail-hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-hero h3 { margin: 0; color: var(--ink); font-size: 21px; }
.detail-hero p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 900; white-space: nowrap; }
.status-badge.pending { background: var(--warning-soft); color: #92400e; }
.status-badge.completed, .status-badge.arrived { background: var(--success-soft); color: #065f46; }
.status-badge.noshow { background: var(--danger-soft); color: #991b1b; }
.status-badge.cancelled { background: var(--slate-soft); color: var(--muted); }
.detail-quick-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-link { min-height: 42px; padding: 9px 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 850; text-decoration: none; }
.detail-list { margin: 17px 0 0; display: grid; }
.detail-row { padding: 12px 2px; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--border); }
.detail-row span { color: var(--muted); font-size: 11px; font-weight: 750; }
.detail-row strong { color: var(--ink); font-size: 12px; line-height: 1.45; word-break: break-word; }
.detail-note { margin-top: 16px; padding: 13px; border-radius: 10px; background: var(--surface-soft); color: var(--text); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.detail-actions { position: sticky; bottom: 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); display: grid; gap: 10px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .97); }
.status-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.status-action { min-height: 40px; padding: 8px 10px; font-size: 11px; background: var(--surface-soft); border-color: var(--border); }
.status-action.approve { color: var(--accent-dark); background: var(--accent-soft); border-color: #bfdbfe; }
.status-action.arrived, .status-action.complete { color: #065f46; background: var(--success-soft); border-color: #a7f3d0; }
.status-action.no-show { color: #991b1b; background: var(--danger-soft); border-color: #fecaca; }
.pending-list { flex: 1; padding: 12px 16px 28px; overflow: auto; }
.drawer-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.pending-card { width: 100%; margin-bottom: 9px; padding: 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; border: 1px solid #fde68a; border-radius: 12px; background: #fffdf5; text-align: left; cursor: pointer; }
.pending-card:hover { border-color: #f59e0b; }
.pending-card-main { display: grid; gap: 3px; min-width: 0; }
.pending-card-main strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pending-card-main span { color: var(--muted); font-size: 10px; }
.pending-card-time { color: #92400e; font-size: 11px; font-weight: 900; white-space: nowrap; }
.confirm-dialog { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 18px; background: rgba(15, 23, 42, .48); backdrop-filter: blur(3px); }
.confirm-card { width: min(420px, 100%); padding: 24px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 900; }
.confirm-card h2 { margin: 15px 0 7px; color: var(--ink); font-size: 19px; }
.confirm-card > p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.confirm-actions { margin-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toast-region { position: fixed; z-index: 190; right: 18px; bottom: 18px; width: min(380px, calc(100% - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 11px; background: #fff; color: var(--text); box-shadow: var(--shadow-lg); font-size: 12px; line-height: 1.45; font-weight: 700; animation: toast-in .2s ease both; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
    .today-button { display: none; }
    .date-picker-label { min-width: 150px; }
    .staff-filter { min-width: 150px; }
    .sync-status { display: none; }
    .calendar-toolbar { gap: 8px; }
}

@media (max-width: 760px) {
    :root { --header-height: 58px; }
    .app-body { overflow: hidden; }
    .admin-mode-banner { justify-content: flex-start; flex-wrap: wrap; min-height: 44px; }
    .admin-mode-banner span { display: none; }
    .app-body:has(.admin-mode-banner) .app-shell { height: calc(100vh - 44px); }
    .app-header { min-height: 59px; padding: 8px 11px; }
    .brand-mark.small { width: 38px; height: 38px; border-radius: 11px; }
    .business-copy { max-width: 55vw; }
    .business-copy strong { font-size: 14px; }
    .panel-button, .desktop-search-trigger { display: none; }
    .calendar-toolbar { min-height: 59px; padding: 7px 9px; gap: 6px; }
    .date-navigator { flex: 1; }
    .date-navigator .icon-button { width: 44px; min-height: 44px; flex-basis: 44px; }
    .date-picker-label { flex: 1; min-width: 0; height: 44px; }
    .view-switch, .calendar-toolbar .staff-filter, .calendar-toolbar .sync-status, .calendar-toolbar .add-button { display: none; }
    .search-panel { padding: 7px 9px; }
    .pending-banner { min-height: 45px; padding: 7px 11px; }
    .pending-banner small { display: none; }
    .pending-link { font-size: 0; }
    .pending-link span { font-size: 18px; }
    .mobile-view-controls { min-height: 116px; padding: 8px 10px 7px; display: grid; gap: 7px; border-bottom: 1px solid var(--border); background: #fff; }
    .mobile-view-controls .toolbar-group { justify-self: start; }
    .mobile-view-controls .segmented { min-height: 44px; padding: 9px 14px; }
    .staff-chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
    .staff-chips::-webkit-scrollbar { display: none; }
    .staff-chip { min-height: 44px; padding: 9px 13px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 800; }
    .staff-chip.active { border-color: var(--ink); background: var(--ink); color: #fff; }
    .desktop-calendar { display: none !important; }
    .mobile-calendar { display: block !important; }
    .mobile-fab { position: fixed; z-index: 50; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); min-height: 50px; padding: 0 17px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 14px 30px rgba(15, 23, 42, .28); font-weight: 850; }
    .mobile-fab svg { width: 18px; height: 18px; }
    .drawer { width: 100%; }
    .drawer-header { min-height: 70px; padding: 13px 15px; }
    .drawer-header h2 { font-size: 18px; }
    .form-section { padding: 16px 15px; }
    .field-grid.three { grid-template-columns: 1fr 1fr; }
    .field-grid.three .field:last-child { grid-column: 1 / -1; }
    .drawer-footer { padding-left: 15px; padding-right: 15px; }
    .detail-content { padding: 15px; }
    .detail-actions { padding-left: 15px; padding-right: 15px; }
    .toast-region { right: 10px; bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px)); width: calc(100% - 20px); }
    .login-body { padding: 14px; }
    .login-shell { display: block; border-radius: 18px; }
    .login-card { padding: 27px 22px; }
    .login-copy { margin: 36px 0 24px; }
    .login-copy h1 { font-size: 31px; }
    .login-preview { display: none; }
}

@media (max-width: 430px) {
    .field-grid.two { grid-template-columns: 1fr; }
    .field-grid .full { grid-column: auto; }
    .drawer-footer { grid-template-columns: 1fr 1.6fr; }
    .save-button { min-width: 0; }
    .mobile-time-group { grid-template-columns: 43px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
