:root {
  --ink: #18283f;
  --ink-soft: #627086;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --line: #e1e7ef;
  --cream: #eaf0f7;
  --accent: #183b65;
  --accent-strong: #102b4d;
  --danger: #d74949;
  --shadow: 0 18px 55px rgba(29, 28, 22, 0.08);
  --radius: 20px;
}

/* Shared reservation surfaces; large touch targets and no customer-data HTML interpolation. */
.public-booking a, #bookingLinkDialog a { text-decoration: none; }
#bookingLinkDialog a.outline-button { color: var(--ink); }
#bookingLinkDialog[open] { display: flex; flex-direction: column; }
.agenda-toolbar { display: flex; gap: 8px; align-items: center; }
.agenda-toolbar > input { flex: 1; min-width: 0; width: 0; padding: 0 10px; }
.agenda-toolbar .agenda-tool { position: relative; flex: 0 0 auto; min-width: 48px; min-height: 48px; padding: 0 12px; }
.agenda-tool-label { display: none; }
.agenda-tool .filter-badge { position: absolute; top: -6px; right: -4px; box-shadow: 0 0 0 2px var(--paper); }
.agenda-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.agenda-caption p { font-size: .78rem; }
.agenda-caption .icon-button { flex: 0 0 44px; }
.agenda-caption svg { width: 17px; height: 17px; }
.agenda-applied { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .78rem; color: var(--ink-soft); margin-bottom: 8px; }
.agenda-applied span { overflow-wrap: anywhere; }
.agenda-applied button { flex: 0 0 auto; }
#agendaError:empty { display: none; }
#agendaView .booking-list > .panel { margin-top: 0; }
.agenda-help summary, .public-booking summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 650; }
.booking-list { display: grid; gap: 14px; }
.booking-list[aria-busy=true] { opacity: .65; }
.booking-card, .booking-empty { padding: 20px; }
.booking-card h2 { font-size: 1.15rem; margin: 14px 0 4px; overflow-wrap: anywhere; }
.booking-card-heading { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.booking-card-heading > strong { font-size: .85rem; }
.booking-status { border-radius: 20px; padding: 5px 10px; font-size: .72rem; font-weight: 750; background: var(--cream); color: var(--accent); }
.booking-status--cancelled, .booking-status--no_show { background: #f3eeee; color: #795254; }
.booking-status--completed { background: #e9edf1; color: #48576a; }
.booking-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 12px 0; font-size: .85rem; }
.booking-contact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.booking-contact-actions a { color: var(--accent); text-decoration: none; min-height: 44px; }
.booking-actions .booking-delete { color: #b33333; }
.booking-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 14px; color: var(--ink-soft); }
.booking-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check-label input { width: 20px; min-height: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent); }
.hours-fieldset, .slots-fieldset { border: 0; padding: 0; margin: 8px 0; min-width: 0; }
.hours-fieldset legend, .slots-fieldset legend { font-weight: 750; margin-bottom: 12px; }
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.hours-row > .check-label { grid-column: 1 / -1; }
.hours-row input[type=time] { padding: 0 8px; min-width: 0; }
.hours-row input:disabled { background: var(--paper); color: var(--ink-soft); }
.public-booking { max-width: 620px; margin: 0 auto; padding: 24px 14px max(32px, env(safe-area-inset-bottom)); }
.booking-brand { display: flex; gap: 12px; align-items: center; font-weight: 750; padding: 6px 8px 24px; overflow-wrap: anywhere; }
.public-booking-panel { padding: 24px 18px; }
.public-booking-panel h1 { margin-bottom: 12px; }
#publicBookingForm { display: grid; gap: 18px; margin-top: 20px; }
.public-booking .field-row > label { min-width: 0; }
.public-booking .field-row { grid-template-columns: minmax(0, 1fr); }
.public-booking input[type=date] { min-width: 0; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.slot-button { min-height: 48px; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; }
.slot-button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.booking-selection, .booking-receipt { background: var(--cream); padding: 16px; border-radius: 14px; font-size: .9rem; overflow-wrap: anywhere; }
.booking-receipt { margin: 20px 0; }
.booking-receipt p:last-child { margin-bottom: 0; }
.booking-note-label { margin-top: 12px; }
#publicConfirmation { display: grid; gap: 14px; }
.public-booking-footer { text-align: center; color: var(--ink-soft); font-size: .75rem; margin-top: 24px; }
.saved-bookings { overflow: hidden; margin-bottom: 18px; }
.saved-bookings > summary { padding: 14px 18px; color: var(--accent); font-weight: 750; }
.saved-bookings > summary span { margin-left: 6px; font-size: .8rem; }
.saved-bookings-body { padding: 0 18px 12px; }
.saved-booking-list { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
.saved-booking { display: grid; gap: 5px; padding: 14px 4px; border-top: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; }
.saved-booking strong { font-size: .88rem; }
.saved-booking span { font-size: .78rem; color: var(--ink-soft); }
.saved-booking small { font-weight: 650; color: var(--accent); }
@media (min-width: 540px) {
  .public-booking .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hours-row { grid-template-columns: 1.2fr 1fr 1fr; align-items: center; }
  .hours-row > .check-label { grid-column: auto; }
  .agenda-toolbar > input { flex: 0 1 220px; }
  .agenda-tool-label { display: inline; }
  .agenda-toolbar #openAgendaFilters { margin-left: auto; }
  .public-booking { padding-top: 48px; }
  .public-booking-panel { padding: 32px; }
  .slot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(64, 119, 184, 0.6);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: 0.6; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.55rem, 4vw, 2rem); line-height: 1.14; letter-spacing: -0.035em; }
h2 { margin-bottom: 4px; font-size: 1.2rem; letter-spacing: -0.02em; }
h3 { margin-bottom: 6px; font-size: 1rem; }
.muted { color: var(--ink-soft); margin-bottom: 0; }
.eyebrow { margin-bottom: 6px; color: #77766e; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--ink); color: var(--accent); font-size: 0.79rem; font-weight: 900; letter-spacing: -0.08em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.brand-mark--large { width: 92px; height: 92px; border-radius: 26px; background: var(--accent); color: var(--ink); font-size: 1.5rem; transform: rotate(-5deg); }

label { display: grid; gap: 7px; color: #484741; font-size: 0.78rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 86px; padding-top: 13px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #cfcdc2; }
input:focus, select:focus, textarea:focus { border-color: #4976ad; box-shadow: 0 0 0 4px rgba(49, 93, 148, .12); outline: 0; }
input::placeholder, textarea::placeholder { color: #aaa89e; }
.optional { float: right; color: #96948a; font-weight: 500; }

.primary-button, .outline-button, .text-button, .danger-button, .icon-button, .close-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 750; transition: transform .15s, background .15s, border-color .15s;
}
.primary-button { padding: 0 18px; background: var(--accent); color: #ffffff; box-shadow: 0 5px 14px rgba(24, 59, 101, .16); }
.primary-button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.primary-button--wide { width: 100%; }
.outline-button { padding: 0 16px; border: 1px solid var(--line); background: #fff; }
.outline-button:hover { border-color: #c6c3b7; background: #faf9f5; }
.text-button { min-height: 40px; padding: 0 7px; background: transparent; color: #183b65; }
.danger-button { padding: 0 18px; background: var(--danger); color: white; }
.icon-button { width: 44px; min-width: 44px; padding: 0; background: transparent; color: #6d6b63; }
.close-button { width: 44px; min-width: 44px; background: #f0efe9; font-size: 1.65rem; font-weight: 400; }
.form-error { min-height: 18px; margin: 2px 0 4px; color: #bb3434; font-size: .78rem; font-weight: 650; }

.startup-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.startup-content { display: grid; justify-items: center; gap: 16px; text-align: center; }
.startup-content p { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.startup-spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: startup-spin .8s linear infinite; }
@keyframes startup-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .startup-spinner { animation: none; } }

.login-shell { min-height: 100dvh; display: grid; background: var(--surface); }
.login-art { display: none; }
.login-card { width: min(100%, 430px); margin: auto; padding: 34px 24px; }
.login-card h1 { font-size: 2rem; margin-top: 24px; }
.login-card form { display: grid; gap: 13px; margin-top: 30px; }
.mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 1.08rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-wrap .icon-button { position: absolute; right: 2px; top: 2px; }

.app-shell { min-height: 100dvh; }
.sidebar { display: none; }
.main-area { min-width: 0; }
.topbar { display: flex; min-height: 92px; align-items: center; justify-content: space-between; padding: 19px 18px 13px; background: var(--paper); }
.topbar h1 { font-size: 1.5rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.desktop-new { display: none; }
.connection-pill { display: none; align-items: center; gap: 7px; color: #627086; font-size: .76rem; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: #3c68a3; box-shadow: 0 0 0 3px rgba(60,104,163,.12); }
.connection-pill.offline i { background: #ca5656; box-shadow: 0 0 0 3px rgba(202,86,86,.12); }
.content { padding: 0 14px calc(105px + env(safe-area-inset-bottom)); }
.view { animation: fade-in .24s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

.period-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.period-row::-webkit-scrollbar { display: none; }
.segmented { display: inline-flex; flex: 0 0 auto; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #edece6; }
.segmented button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: #737168; cursor: pointer; font-size: .79rem; font-weight: 700; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 3px 10px rgba(20,20,16,.08); }
#openCustomRange { display: none; white-space: nowrap; }
.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin: -6px 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.custom-range .primary-button { grid-column: 1 / -1; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metric-card { min-height: 156px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 24px rgba(29,28,22,.035); }
.metric-card:first-child { grid-column: 1 / -1; }
.metric-card--dark { position: relative; overflow: hidden; border-color: #282824; background: var(--ink); color: white; }
.metric-card--dark::after { content: ""; position: absolute; width: 150px; height: 150px; right: -62px; bottom: -88px; border: 28px solid rgba(147,190,239,.12); border-radius: 50%; }
.metric-icon { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 22px; border-radius: 11px; background: var(--accent); color: var(--ink); }
.metric-icon--light { background: #edf2f8; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-card p { margin-bottom: 3px; color: #74736b; font-size: .76rem; font-weight: 650; }
.metric-card--dark p { color: #bdbdb4; }
.metric-card strong { display: block; margin-bottom: 2px; font-size: clamp(1.65rem, 6vw, 2.25rem); line-height: 1.12; letter-spacing: -0.045em; }
.metric-card small { color: #8d8b83; }

.panel { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 30px rgba(29,28,22,.03); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 18px 10px; }
.panel-heading p { font-size: .78rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); font-size: .72rem; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 3px; border-radius: 4px; }
.legend-revenue { background: var(--ink); }
.legend-cuts { background: #5289c5; }
.chart-wrap { position: relative; min-height: 255px; padding: 10px 6px 7px; overflow: hidden; }
#performanceChart { display: block; width: 100%; min-width: 0; height: 280px; overflow: visible; }
#performanceChart text { stroke: none; }
.chart-wrap:has(#performanceChart:not([hidden])) { overflow-x: auto; }
.chart-loading { height: 215px; margin: 10px 16px; border-radius: 13px; }
.skeleton, .loading-list::before { background: linear-gradient(90deg,#f0efe9 25%,#faf9f5 50%,#f0efe9 75%); background-size: 200% 100%; animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { display: grid; min-height: 225px; place-items: center; align-content: center; text-align: center; padding: 25px; }
.empty-state p { max-width: 300px; margin: 0; color: var(--ink-soft); }
.empty-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 12px; border-radius: 15px; background: #edf2f8; }

.recent-panel { margin-bottom: 10px; }
.cut-list { min-height: 84px; padding: 2px 14px 10px; }
.loading-list::before { content: ""; display: block; height: 72px; margin: 6px 0; border-radius: 13px; }
.cut-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; min-height: 76px; border-top: 1px solid #eeece5; }
.cut-row:first-child { border-top: 0; }
.cut-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #edf2f8; font-weight: 850; }
.cut-info { min-width: 0; }
.cut-info strong, .cut-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cut-info strong { margin-bottom: 3px; font-size: .9rem; }
.cut-info small { color: var(--ink-soft); font-size: .74rem; }
.cut-price { text-align: right; }
.cut-price strong { display: block; font-size: .95rem; }
.cut-actions { display: flex; justify-content: flex-end; gap: 3px; margin-top: 3px; }
.cut-actions button { width: 32px; height: 28px; min-height: 28px; border: 0; border-radius: 8px; background: transparent; color: #85837b; cursor: pointer; }
.cut-actions button:hover { background: #efeee8; color: var(--ink); }
.cut-actions svg { width: 15px; height: 15px; }
.list-empty { padding: 30px 18px 36px; text-align: center; color: var(--ink-soft); }
.list-empty h3 { color: var(--ink); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 8px 2px 14px; }
.section-heading h2 { font-size: 1.55rem; }
.section-heading > .primary-button { flex: 0 0 auto; }
.history-panel { margin-top: 14px; }
.history-panel .cut-list { padding: 4px 16px 14px; }
.barber-form { display: grid; gap: 10px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.barber-list { padding: 3px 18px 18px; }
.barber-row { display: flex; align-items: center; gap: 12px; min-height: 66px; border-top: 1px solid var(--line); }
.barber-row:first-child { border-top: 0; }
.barber-row .avatar { background: var(--ink); color: var(--accent); }
.barber-row div:last-child { display: grid; }
.barber-row small { color: var(--ink-soft); }
.barber-row .barber-info { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sync-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid #c6d6eb; border-radius: 14px; background: #eaf1fa; color: #183b65; font-size: .85rem; }
.sync-banner span { flex: 1 1 200px; }
.pending-label { color: #835b15 !important; white-space: normal !important; }
.cache-note { color: #835b15; font-size: .8rem; margin: 0 0 14px; }
.cache-note:empty { display: none; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--cream); font-size: .8rem; font-weight: 850; }

.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5,1fr); min-height: calc(72px + env(safe-area-inset-bottom)); padding: 6px 5px env(safe-area-inset-bottom); border-top: 1px solid rgba(220,218,208,.9); background: rgba(255,255,255,.94); box-shadow: 0 -8px 30px rgba(22,22,18,.06); backdrop-filter: blur(14px); }
.bottom-nav button { display: grid; min-height: 58px; place-items: center; align-content: center; gap: 4px; border: 0; background: transparent; color: #85837b; font-size: .65rem; font-weight: 650; cursor: pointer; }
.bottom-nav button.active { color: var(--ink); }
.bottom-nav svg { width: 20px; height: 20px; }
.bottom-nav .mobile-add { position: relative; color: var(--ink); }
.mobile-add span { display: grid; width: 50px; height: 50px; place-items: center; margin-top: -27px; border: 5px solid var(--paper); border-radius: 17px; background: var(--accent); box-shadow: 0 8px 20px rgba(24,59,101,.2); }
.mobile-add span svg { width: 23px; height: 23px; }
.mobile-add small { margin-top: 1px; font-size: .65rem; font-weight: 700; }

dialog { color: var(--ink); }
.sheet-dialog { inset: 0; width: min(calc(100% - 32px), 520px); max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.sheet-dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.sheet-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(18,18,16,.52); backdrop-filter: blur(3px); }
.sheet-dialog[open] { animation: sheet-up .24s ease-out; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.dialog-body { display: grid; gap: 12px; min-height: 0; padding: 8px 20px 18px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-header, .dialog-footer { flex-shrink: 0; }
.dialog-footer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; padding: 13px 20px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; }
.field-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 15px; top: 13px; color: var(--ink-soft); }
.money-input input { padding-left: 32px; font-size: 1.05rem; font-weight: 750; }
.select-with-action { display: grid; grid-template-columns: 1fr 48px; gap: 7px; }
.select-with-action .icon-button { border: 1px solid var(--line); }
.confirm-dialog { width: min(calc(100% - 32px), 400px); padding: 28px; border: 0; border-radius: 22px; text-align: center; box-shadow: var(--shadow); }
.confirm-dialog p { color: var(--ink-soft); }
.danger-icon { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 14px; border-radius: 16px; background: #fff0f0; color: var(--danger); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.toast-region { position: fixed; z-index: 100; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); left: 14px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; max-width: 410px; align-items: center; gap: 10px; margin-left: auto; padding: 13px 15px; border-radius: 13px; background: var(--ink); color: white; box-shadow: 0 12px 35px rgba(20,20,17,.25); animation: toast-in .22s ease both; }
.toast.error { background: #a93636; }
.toast svg { color: var(--accent); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

.brand-mark, .brand-mark--large, .barber-row .avatar, .mobile-add span, .metric-icon { background: var(--accent); color: white; }
.metric-icon--light { background: #edf2f8; color: var(--accent); }
.metric-card--dark { background: #142d50; border-color: #142d50; }
.metric-card--dark p, .metric-card--dark small { color: #c3d2e5; }
.metric-card--dark .metric-icon { background: #29486e; }
.toast svg { color: #bfd9fa; flex-shrink: 0; }
.history-toolbar, .toolbar-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-toolbar { min-height: 48px; }
.history-toolbar p { font-size: .82rem; }
.filter-badge { display: grid; place-items: center; min-width: 21px; height: 21px; border-radius: 7px; background: var(--accent); color: white; font-size: .7rem; }
.settings-form { display: grid; gap: 12px; padding: 20px; border-top: 1px solid var(--line); }
.field-help { margin: -5px 0 10px; font-size: .78rem; color: var(--ink-soft); }
.settings-stack { display: grid; gap: 16px; width: 100%; max-width: 760px; }
.settings-intro { margin: 0 0 4px; font-size: .88rem; }
.settings-group { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.settings-group > summary { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 18px 20px; cursor: pointer; list-style: none; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary:hover { background: #f8fafd; }
.settings-group > summary:focus-visible { outline: 3px solid #79abe0; outline-offset: -3px; border-radius: 17px; }
.settings-group-icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; background: #edf2f8; color: var(--accent); border-radius: 12px; }
.settings-group-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.settings-group-text strong { font-size: .94rem; }
.settings-group-text small { color: var(--ink-soft); font-size: .77rem; }
.settings-chevron { flex-shrink: 0; color: var(--ink-soft); transition: transform .15s; }
.settings-group[open] > summary .settings-chevron { transform: rotate(180deg); }
.settings-group-body { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.settings-group-body .barber-list { padding: 0 0 12px; }
.barber-add-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.settings-save { display: flex; justify-content: flex-end; padding-top: 8px; }
.settings-save button { width: 100%; }
.install-body { display: grid; justify-items: start; gap: 16px; padding-top: 18px; }
.install-body a { text-decoration: none; }
#installShortcut { padding: 0 10px; min-width: 44px; font-size: .75rem; }
.settings-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.settings-session strong { font-size: .86rem; }
.settings-session p { margin-top: 4px; font-size: .77rem; }
.nav-coming { margin-left: auto; font-size: .61rem; font-weight: 650; padding: 3px 6px; border-radius: 5px; background: #eaf0f7; color: #627086; }
.coming-panel { display: grid; justify-items: center; align-content: center; min-height: min(62dvh, 540px); max-width: 760px; padding: 32px 20px; text-align: center; }
.coming-illustration { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 24px; background: #eaf0f8; color: var(--accent); border: 1px solid #d9e3f0; border-radius: 28px; }
.coming-illustration svg { width: 40px; height: 40px; stroke-width: 1.3; }
.status-label { padding: 6px 12px; border: 1px solid #dbe5f2; border-radius: 20px; background: #edf2f8; color: var(--accent); font-size: .74rem; font-weight: 750; margin-bottom: 20px; }
.coming-panel h2 { font-size: clamp(1.3rem, 4vw, 1.75rem); margin-bottom: 12px; }
.coming-panel > p { max-width: 340px; }
.coming-panel .field-help { margin: 16px 0 0; }
.form-error:empty { display: none; }
.quick-price input { min-height: 76px; padding-left: 38px; font-size: 2rem; letter-spacing: -.04em; }
.quick-price span { top: 23px; font-size: 1.2rem; }
.quick-summary { margin: 0 0 4px; font-size: .8rem; color: var(--ink-soft); line-height: 1.6; overflow-wrap: anywhere; }
.cut-details { border-top: 1px solid var(--line); }
.cut-details summary { min-height: 58px; padding: 14px 0; cursor: pointer; color: var(--accent); font-size: .86rem; font-weight: 750; }
.cut-details summary span { display: block; margin: 3px 0 0 17px; color: var(--ink-soft); font-weight: 400; font-size: .75rem; }
.cut-details summary:focus-visible { outline: 3px solid #79abe0; outline-offset: 2px; border-radius: 6px; }
.details-fields { display: grid; gap: 12px; padding: 2px 0 8px; }
input, select, textarea, label { min-width: 0; }
input, select, textarea { font-size: 16px; }
.field-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.cut-actions button { width: 44px; height: 44px; min-height: 44px; }
.cut-info small { white-space: normal; overflow-wrap: anywhere; }

@media (min-width: 700px) {
  .login-shell { grid-template-columns: minmax(280px, .85fr) 1.15fr; }
  .login-art { display: flex; flex-direction: column; justify-content: space-between; padding: 60px; background: var(--ink); color: white; }
  .login-art p { margin: 0; font-size: clamp(2.4rem, 5vw, 4.8rem); font-weight: 780; line-height: .98; letter-spacing: -.065em; }
  .login-card { padding: 50px; }
  .mobile-brand { display: none; }
  .login-card h1 { margin-top: 0; font-size: 2.45rem; }
  .connection-pill, #openCustomRange, .chart-legend { display: flex; }
  .custom-range { grid-template-columns: 1fr 1fr auto; }
  .custom-range .primary-button { grid-column: auto; }
  .metric-grid { grid-template-columns: 1.25fr 1fr 1fr; gap: 15px; }
  .metric-card:first-child { grid-column: auto; }
  .metric-card { min-height: 175px; padding: 22px; }
  .metric-icon { margin-bottom: 27px; }
  .settings-save button { width: auto; }
  .sheet-dialog { margin: auto; border-radius: 24px; }
  .dialog-footer { padding-bottom: 16px; }
  .toast-region { right: 24px; bottom: 24px; left: auto; }
  .toast { min-width: 300px; }
}

@media (min-width: 1024px) {
  .topbar .connection-pill, .topbar #installShortcut { display: none; }
  .app-shell { display: grid; grid-template-columns: 248px minmax(0,1fr); }
  .sidebar { position: sticky; top: 0; display: flex; height: 100dvh; flex-direction: column; padding: 26px 18px 20px; border-right: 1px solid #e3e1d8; background: #fafbfd; }
  .brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 36px; color: inherit; text-decoration: none; }
  .brand strong, .brand small { display: block; }
  .brand strong { font-size: .94rem; }
  .brand small { color: var(--ink-soft); font-size: .66rem; }
  .side-nav { display: grid; gap: 5px; }
  .nav-item { display: flex; min-height: 47px; align-items: center; gap: 13px; width: 100%; padding: 0 13px; border: 0; border-radius: 12px; background: transparent; color: #727068; cursor: pointer; font-size: .83rem; font-weight: 700; text-align: left; }
  .nav-item.active, .nav-item:hover { background: #eaf0f8; color: var(--ink); }
  .nav-item.active svg { color: #183b65; }
  .sidebar-bottom { display: grid; gap: 13px; margin-top: auto; }
  .user-chip { display: flex; align-items: center; gap: 10px; padding: 0 9px 14px; border-bottom: 1px solid var(--line); }
  .user-chip strong, .user-chip small { display: block; }
  .user-chip strong { font-size: .8rem; }
  .user-chip small { color: var(--ink-soft); font-size: .67rem; }
  .topbar { min-height: 105px; padding: 22px clamp(28px,4vw,62px) 17px; }
  .desktop-new { display: inline-flex; }
  .content { max-width: 1440px; padding: 4px clamp(28px,4vw,62px) 52px; }
  .bottom-nav { display: none; }
  .metric-grid { gap: 18px; }
  .panel { margin-top: 18px; }
  .chart-panel { display: grid; grid-template-rows: auto 1fr; min-height: 350px; }
  .chart-wrap { min-height: 282px; }
  .recent-panel { margin-bottom: 0; }
  .cut-list { padding: 3px 22px 14px; }
}

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