:root { color-scheme: dark; font: 15px system-ui, sans-serif; background: #10151e; color: #f3f7ff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; padding: 12px clamp(12px,2vw,28px); background: linear-gradient(100deg,#184763,#111b2a); border-bottom: 1px solid #34465a; }
.topbar strong { letter-spacing: .1em; }
.topbar-brand { min-width: 0; }
.topbar-brand .eyebrow { margin: 4px 0 0; overflow-wrap: anywhere; }
main { max-width: 1680px; margin: auto; padding: 20px clamp(12px,2vw,28px); }
h1 { margin: 6px 0; font-size: 32px; }
h2 { font-size: 18px; margin: 0; }
.eyebrow { color: #ffd45b; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted, #message { color: #b7c7d9; }
.panel { background: #171f2c; border: 1px solid #34465a; border-radius: 14px; padding: 18px; margin-top: 18px; }
.login { max-width: 400px; margin: 35px auto 0; }
label { display: grid; gap: 6px; margin: 16px 0; }
input, button { font: inherit; padding: 8px 12px; border: 1px solid #52657a; border-radius: 7px; color: inherit; background: #101722; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button[type=submit] { background: #ffd45b; border-color: #ffd45b; color: #19253c; font-weight: 700; }
:focus-visible { outline: 2px solid #ffd45b; outline-offset: 2px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 8px; border-bottom: 1px solid #34465a; }
th { color: #b7c7d9; }
#more { margin-top: 14px; }
.lead-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 12px 0; }
.lead-filters label { margin: 0; gap: 4px; font-size: 13px; flex: 1 1 135px; }
.lead-filters input, .lead-filters select { width: 100%; min-width: 0; font: inherit; padding: 7px; border: 1px solid #52657a; border-radius: 7px; color: inherit; background: #101722; }
.lead-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.lead-pagination [aria-current=page] { background: #ffd45b; color: #19253c; }

#editor { width: min(820px, calc(100vw - 28px)); max-height: 90vh; padding: 22px; color: inherit; background: #171f2c; border: 1px solid #52657a; border-radius: 14px; }
#editor::backdrop { background: #080d15c9; }
#lead-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 0 14px; }
#lead-fields label { margin: 6px 0; }
#lead-fields .wide { grid-column: 1 / -1; }
#lead-fields input[type=checkbox] { justify-self: start; }
#lead-fields select, #lead-fields textarea { font: inherit; color: inherit; background: #101722; border: 1px solid #52657a; border-radius: 7px; padding: 8px; min-width: 0; }
#lead-fields textarea { min-height: 65px; resize: vertical; }
#recordings { margin: 4px 0 14px; padding: 12px; border: 1px solid #34465a; border-radius: 10px; background: #101722; }
#recordings h3 { margin: 0 0 8px; font-size: 15px; }
.recording-player { display: grid; gap: 4px; margin-top: 8px; }
.recording-player iframe { width: 100%; height: 72px; border: 0; border-radius: 8px; background: #0b1018; }
.recording-player a, .recording-links a { color: #9dd8ff; }
.recording-links a + a { margin-left: 8px; }
#original-sheet-values { margin: 12px 0; }
#original-sheet-values dl { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; gap: 6px; }
#original-sheet-values dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.full-leads { font-size: 13px; min-width: 850px; }
.full-leads th, .full-leads td { padding: 6px 7px; }
.full-leads th { white-space: nowrap; }
.full-leads td:nth-child(6) { white-space: nowrap; }
.full-leads th:first-child, .full-leads td:first-child { position: sticky; left: 0; white-space: nowrap; background: #171f2c; }
.full-leads button, .full-leads select { font: inherit; padding: 4px 6px; }
.full-leads select { border: 1px solid #52657a; border-radius: 6px; color: inherit; background: #101722; }
.full-leads a { color: #9dd8ff; white-space: nowrap; }
.client-completion { display: flex; gap: 5px; }
.client-completion select, .client-completion button { font: inherit; padding: 4px 6px; }
.client-completion select { border: 1px solid #52657a; border-radius: 6px; color: inherit; background: #101722; }
.new-booking { --lead-pulse: #805919; --lead-accent: #ffda69; }
.qa-passed { --lead-pulse: #146149; --lead-accent: #79efba; }
.new-booking td, .qa-passed td { animation: lead-highlight 2s ease-in-out 6; }
.new-booking td:first-child, .qa-passed td:first-child { box-shadow: inset 4px 0 var(--lead-accent); }
@keyframes lead-highlight { 0%, 100% { background-color: var(--lead-pulse); } 50% { background-color: #171f2c; } }
.qa-yes-badge { display: inline-block; padding: 2px 7px; border: 1px solid #59dca7; border-radius: 6px; background-color: #1b5943; color: #e1fff2; font-weight: 750; animation: qa-yes-pulse 2.4s ease-in-out infinite; }
@keyframes qa-yes-pulse { 50% { background-color: #287f5d; box-shadow: 0 0 8px #59dca7; } }
@media (prefers-reduced-motion: reduce) {
  .new-booking td, .qa-passed td { animation: none; background-color: var(--lead-pulse); }
  .qa-yes-badge { animation: none; }
}

#admin-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
#admin-navigation [aria-current="page"] { border-color: #ffd45b; color: #ffd45b; }
.admin-grid { display: grid; grid-template-columns: minmax(225px, 1fr) minmax(300px, 2fr); gap: 16px; align-items: start; }
.admin-grid select, .admin-grid textarea { font: inherit; color: inherit; background: #101722; border: 1px solid #52657a; border-radius: 7px; padding: 8px; min-width: 0; }
.admin-grid fieldset { border: 1px solid #34465a; border-radius: 7px; min-width: 0; margin: 12px 0; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); gap: 0 12px; }
.permission-grid label { margin: 7px 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .admin-grid { grid-template-columns: 1fr; } }
.overview-dates { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.overview-dates label { margin: 0; }
.overview-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.overview-metrics strong { display: block; margin-top: 6px; color: #ffd45b; font-size: 30px; }
.overview-table { min-width: 380px; margin-top: 10px; }
/* QA Weekly: summary, then one card per month (newest first) */
#qaweekly-filters select { width: 100%; min-width: 0; font: inherit; padding: 7px; border: 1px solid #52657a; border-radius: 7px; color: inherit; background: #101722; }
.qa-summary { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(100deg, #184763, #142235); border: 1px solid #2f5f80; }
.qa-summary h2 { color: #ffd45b; }
.qa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.qa-tile { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #101722; border: 1px solid #34465a; }
.qa-tile-label { color: #b7c7d9; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.qa-tile-value { font-size: 24px; font-variant-numeric: tabular-nums; }
.qa-tile.rate-good { border-color: #2ecc71; } .qa-tile.rate-good .qa-tile-value { color: #58d68d; }
.qa-tile.rate-bad { border-color: #e74c3c; } .qa-tile.rate-bad .qa-tile-value { color: #f1948a; }
.qa-tile.rate-none .qa-tile-value { color: #b7c7d9; }
.qa-month { border-left: 5px solid #2f5f80; }
.qa-month.is-current { border-left-color: #ffd45b; box-shadow: 0 0 0 1px #ffd45b33; }
.qa-month-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qa-month-header h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qa-badge { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #2c3e50; color: #b7c7d9; }
.qa-badge.is-current { background: #ffd45b; color: #19253c; }
.qa-weeks { margin-top: 14px; min-width: 640px; font-size: 14px; }
.qa-weeks th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.qa-weeks td.num, .qa-weeks th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.qa-weeks td:nth-child(n+6) { text-align: right; }
.qa-weeks tbody tr:first-child td { font-weight: 700; }
.qa-rate { display: inline-block; min-width: 52px; padding: 2px 8px; border-radius: 6px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qa-rate.rate-good { background: #1e8449; color: #fff; }
.qa-rate.rate-bad { background: #a93226; color: #fff; }
.qa-rate.rate-none { background: #4d5656; color: #fff; }
.qa-note { margin-top: 18px; font-size: 13px; }
.sends-heading { margin: 18px 0 2px; font-size: 18px; font-weight: 700; }
.sends-group .toolbar h2 { color: #ffd45b; }
.sends-table { font-size: 13px; min-width: 980px; }
.sends-table th, .sends-table td { padding: 6px 7px; white-space: nowrap; }
.sends-table tbody tr:nth-child(even) td { background: #1c2636; }
