:root {
  color-scheme: light;
  --navy: #203329;
  --blue: #0000ff;
  --blue-dark: #ff0000;
  --primary: #0000ff;
  --primary-soft: color-mix(in srgb, var(--blue) 12%, var(--surface));
  --success: #15803d;
  --warning: #c2410c;
  --info: #0789a1;
  --surface: #ffffff;
  --surface-muted: #fffdf4;
  --muted: #687568;
  --line: #e8dfbd;
  --bg: #fff9e5;
  --danger-bg: #fff1f2;
  --danger: #be123c;
  --radius-sm: .55rem;
  --radius-md: .8rem;
  --radius-lg: 1rem;
  --shadow-soft: 0 .5rem 1.5rem rgba(18, 32, 51, .06);
  --shadow-hover: 0 .8rem 2rem rgba(18, 32, 51, .1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --blue: #0000ff;
  --blue-dark: #ff0000;
  --navy: #e7f0ff;
  --primary: #0000ff;
  --primary-soft: color-mix(in srgb, var(--blue) 12%, var(--surface));
  --surface: #14243a;
  --surface-muted: #1a2e47;
  --muted: #a4b6cc;
  --line: #334c6a;
  --bg: #0b1728;
  --danger-bg: #3b202d;
  --danger: #fda4af;
  --shadow-soft: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
  --shadow-hover: 0 .8rem 2rem rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
  line-height: 1.55;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(100%, 25rem);
  padding: 2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { color: var(--navy); background: #152a43; }
[data-theme="dark"] .button-link.secondary,
[data-theme="dark"] button.secondary { color: var(--navy); background: #263c58; }
[data-theme="dark"] .report-metric,
[data-theme="dark"] .dashboard-finance > div { background: var(--surface-muted); }
.theme-toggle { position: fixed; z-index: 20; inset-inline-start: 1rem; bottom: 1rem; width: auto; min-height: 2.5rem; margin: 0; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--navy); background: var(--surface); box-shadow: var(--shadow-soft); font-size: .78rem; }
.theme-toggle:hover { background: var(--surface-muted); }
.admin-brand { display: flex; align-items: center; flex: 0 0 auto; gap: .5rem; margin-inline-end: .35rem; padding: .15rem .55rem .15rem .2rem; border-inline-end: 1px solid var(--line); color: var(--primary); font-size: .78rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.admin-brand img { width: 2rem; height: 2rem; border-radius: 50%; object-fit: contain; }
.admin-context-nav { display: flex; align-items: center; gap: .4rem; width: min(100% - 2rem, 70rem); margin: .75rem auto 0; padding: .35rem; overflow-x: auto; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); box-shadow: var(--shadow-soft); }
.admin-context-nav a { flex: 0 0 auto; padding: .5rem .7rem; border-radius: .5rem; color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-context-nav a:hover, .admin-context-nav a:focus-visible { color: var(--blue-dark); background: var(--primary-soft); outline: none; }
.dashboard-layout { display: flex; min-height: 100vh; }
.dashboard-sidebar { position: fixed; z-index: 30; inset: 0 0 0 auto; width: min(82vw, 17rem); display: flex; flex-direction: column; padding: 1.25rem; border-inline-start: 1px solid var(--line); background: var(--surface); transform: translateX(105%); transition: transform .2s ease; }
.dashboard-sidebar.is-open { transform: translateX(0); }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand-mark { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; margin: 0; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.sidebar-nav { display: grid; gap: .25rem; margin-top: 1.25rem; }
.sidebar-label { margin: .85rem .65rem .15rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.sidebar-link { display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem; border-radius: var(--radius-sm); color: var(--navy); font-size: .88rem; text-decoration: none; }
.sidebar-link span.sidebar-icon { display: inline-grid; place-items: center; flex: 0 0 1.35rem; width: 1.35rem; height: 1.35rem; color: var(--blue); font-family: "Segoe UI Symbol", Tahoma, sans-serif; font-size: 1rem; line-height: 1; text-align: center; }
.sidebar-link:hover, .sidebar-link.active { color: var(--blue-dark); background: var(--primary-soft); }
.sidebar-logout { margin-top: auto; }
.sidebar-logout button { margin-top: 1rem; }
.dashboard-main { width: 100%; padding: 1.25rem; }
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; max-width: 80rem; margin: 0 auto 1.5rem; }
.dashboard-header h1 { color: var(--primary); }
.dashboard-date { margin: .35rem 0 0; color: var(--muted); font-size: .82rem; }
.dashboard-header-actions { display: flex; gap: .5rem; align-items: center; }
.dashboard-header-actions .button-link { margin-top: 0; }
.header-icon-link { display: inline-flex; align-items: center; justify-content: center; width: 2.9rem; min-height: 2.9rem; border-radius: var(--radius-sm); color: var(--navy); background: #f2f3df; text-decoration: none; font-size: 1.1rem; }
.header-icon-link:hover { background: #e8edd1; }
.header-theme-toggle { position: static; width: auto; min-height: 2.9rem; padding: .65rem .8rem; box-shadow: none; font-size: .78rem; }
.dashboard-floating-theme { display: none; }
.mobile-menu-toggle { width: auto; margin: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; max-width: 80rem; margin: 1.25rem auto 0; }
.quick-action { display: grid; gap: .25rem; padding: .85rem; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--navy); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-soft); }
.quick-action:hover { border-color: var(--blue); box-shadow: var(--shadow-hover); }
.quick-action span { color: var(--muted); font-size: .75rem; }
.quick-action.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.quick-action.primary span { color: #e4f4df; }
.dashboard-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; max-width: 80rem; margin: 0 auto 1rem; }
.dashboard-stat { display: grid; gap: .2rem; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.dashboard-stat span, .dashboard-stat small { color: var(--muted); font-size: .72rem; }
.dashboard-stat strong { color: var(--primary); font-size: 1.35rem; overflow-wrap: anywhere; }
.dashboard-stat.warning-stat strong { color: var(--warning); }
.dashboard-stat.net-stat { border-color: #86efac; }
.dashboard-stat.net-stat strong { color: var(--success); }
.dashboard-content-grid { display: grid; gap: .85rem; max-width: 80rem; margin: 0 auto 1rem; }
.dashboard-panel { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.dashboard-time { color: var(--muted); font-size: .85rem; direction: ltr; }
.current-venue-card p { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; }
.venue-state { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: 1.15rem; }
.venue-state i { width: .8rem; height: .8rem; border-radius: 50%; background: currentColor; }
.state-empty { color: var(--success); }
.state-booked { color: var(--danger); }
.state-fixed { color: var(--info); }
.upcoming-panel .premium-section-title a { color: var(--blue); font-size: .8rem; text-decoration: none; }
.upcoming-list { display: grid; gap: .5rem; margin-top: .9rem; }
.upcoming-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.upcoming-item:last-child { border-bottom: 0; }
.upcoming-item div { display: grid; gap: .15rem; min-width: 0; }
.upcoming-item span { overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.payment-mini { flex: 0 0 auto; padding: .3rem .5rem; border-radius: 999px; font-size: .7rem; }
.payment-mini.paid { color: var(--success); background: #dcfce7; }
.payment-mini.due { color: var(--warning); background: #ffedd5; }

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  border-radius: .8rem;
  color: #fff;
  background: var(--blue);
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-mark.brand-logo { display: block; padding: 0; border-radius: 50%; background: transparent; object-fit: contain; }
.auth-card .brand-mark.brand-logo { width: 5.5rem; height: 5.5rem; margin: 0 auto 1rem; }
.sidebar-brand .brand-mark.brand-logo { width: 2.7rem; height: 2.7rem; }
.pwa-install-button { position: fixed; z-index: 50; inset-inline-end: 1rem; bottom: 1rem; width: auto; min-height: 2.8rem; margin: 0; padding: .7rem 1rem; border: 1px solid #b59c00; border-radius: 999px; color: #203329; background: #f5dc00; box-shadow: 0 .5rem 1.4rem rgba(32, 51, 41, .2); font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; }
.pwa-install-button:hover { background: #e8c900; }
.pwa-install-button:disabled { opacity: .65; cursor: wait; }

.eyebrow {
  margin: 0 0 .45rem;
  color: var(--blue);
  font-size: .82rem;
  font-weight: 700;
}

h1 { margin: 0; font-size: 1.65rem; }
h2 { margin: 0; font-size: 1.05rem; }
.muted { margin: .6rem 0 1.5rem; color: var(--muted); line-height: 1.7; }
.muted.compact { margin-bottom: 0; }

.login-form, .form-card { display: grid; gap: .55rem; }
.remember-me { display: flex; align-items: center; gap: .55rem; margin: .35rem 0; color: var(--muted); font-size: .9rem; font-weight: 600; cursor: pointer; }
.remember-me input[type="checkbox"] { width: 1.15rem; min-height: 1.15rem; margin: 0; padding: 0; accent-color: var(--blue); flex: 0 0 auto; }
.forgot-password-help { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); text-align: center; }
.forgot-password-help p { margin: 0; color: var(--muted); font-size: .85rem; }
label { margin-top: .55rem; font-size: .9rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--navy);
  background: #fff;
  font: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(37, 99, 235, .2); border-color: var(--blue); }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  margin-top: 1rem;
  padding: .65rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button { width: 100%; }
button:hover, .button-link:hover { background: var(--blue-dark); }
button.secondary, .button-link.secondary { color: var(--navy); background: #f2f3df; }
button.secondary:hover, .button-link.secondary:hover { background: #e8edd1; }

.alert {
  margin-bottom: 1rem;
  padding: .75rem;
  border-radius: .55rem;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: .9rem;
}
.alert.success { color: #166534; background: #ecfdf5; }
.alert.info { color: #164e63; background: #e0f2fe; }
[data-theme="dark"] .alert.info { color: #c7e7ff; background: #19324c; }

.page-shell {
  width: min(100%, 60rem);
  margin: 0 auto;
  padding: 1rem;
}
.page-shell.narrow { max-width: 38rem; }
.premium-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.premium-section-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.premium-section-title h2 { margin: 0; color: var(--primary); }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-header .button-link { flex: 0 0 auto; margin-top: 0; }
.schedule-meta {
  margin-bottom: 1.25rem;
  padding: .8rem 1rem;
  border: 1px solid #d9e6ad;
  border-radius: .7rem;
  color: #355c3e;
  background: #f8f5da;
  font-size: .9rem;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1.25rem 0 .75rem; }
.selected-date { color: var(--muted); font-size: .88rem; }
.calendar-month-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.calendar-month-nav .button-link { flex: 0 0 auto; margin-top: 0; }
.calendar-month-label { flex: 1; text-align: center; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.weekday-heading { padding: .45rem .1rem; color: var(--muted); text-align: center; font-size: .76rem; font-weight: 700; }
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-height: 3.7rem;
  padding: .35rem .1rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  color: var(--navy);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
  font-size: .92rem;
}
.calendar-day:hover, .calendar-day.selected { border-color: var(--blue); background: var(--primary-soft); }
.calendar-day.selected { box-shadow: inset 0 0 0 1px var(--blue); }
.calendar-day.today:not(.selected) { border-color: #d5bf21; }
.calendar-day small { color: var(--blue); font-size: .65rem; }
.calendar-day.empty { visibility: hidden; border-color: transparent; background: transparent; }
.days-strip {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  padding: .15rem .1rem .75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.day-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 0 0 8.5rem;
  min-height: 7rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--navy);
  background: var(--surface);
  text-decoration: none;
  scroll-snap-align: start;
}
.day-card:hover, .day-card.selected { border-color: var(--blue); background: var(--primary-soft); }
.day-card.selected { box-shadow: inset 0 0 0 1px var(--blue); }
.day-card.is-today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.day-name { color: var(--blue); font-size: .9rem; font-weight: 700; }
.day-date { font-size: .9rem; }
.day-booking-count { margin-top: auto; color: var(--muted); font-size: .8rem; }
.today-label { color: var(--muted); font-size: .76rem; }
.slots-list { display: grid; gap: .6rem; }
.booking-hours-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.hour-card {
  display: flex;
  min-width: 0;
  min-height: 7rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .25rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 32, 51, .04);
  transition: transform .12s ease, box-shadow .12s ease;
}
.hour-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(18, 32, 51, .1); }
.hour-card:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
.hour-time { display: flex; width: 100%; justify-content: center; direction: ltr; white-space: nowrap; font-size: clamp(.86rem, 2.4vw, 1.08rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.hour-time .time-range { width: 100%; justify-content: space-between; gap: .15rem; }
.time-range { display: inline-flex; align-items: center; justify-content: center; gap: .28rem; direction: ltr; white-space: nowrap; }
.time-label { display: inline-flex; align-items: center; gap: .16rem; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-clock { font-weight: 800; }
.time-period { padding: .04rem .28rem; border: 1px solid var(--line); border-radius: 999px; color: var(--blue-dark); background: var(--surface); font-size: .9em; font-weight: 800; line-height: 1.35; text-decoration: none; }
.time-range-separator { color: var(--muted); font-size: .85em; font-weight: 400; }
.hour-status { font-size: .82rem; font-weight: 700; }
.hour-status::before { display: inline-block; width: .55rem; height: .55rem; margin-left: .25rem; border-radius: 50%; background: currentColor; content: ""; vertical-align: .05rem; }
.hour-client, .hour-phone { max-width: 100%; overflow: hidden; color: inherit; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.hour-phone { direction: ltr; unicode-bidi: isolate; }
.status-available { border-color: #86efac; color: #166534; background: #f0fdf4; }
.status-booked { border-color: #fda4af; color: #9f1239; background: #fff1f2; }
.status-deposit { border-color: #fbbf24; color: #92400e; background: #fffbeb; }
.status-recurring { border-color: #c4b5fd; color: #5b21b6; background: #f5f3ff; }
.status-cancelled { border-color: #1e293b; color: #f8fafc; background: #334155; }
.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 3.4rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
  font-weight: 700;
}
.slot-available { color: var(--navy); text-decoration: none; }
.slot-available:hover { border-color: var(--blue); background: var(--primary-soft); }
.booked-slot { background: #f8fafc; }
.slot-description { display: flex; flex-direction: column; gap: .35rem; }
.booked-status { color: #b45309; }
.slot-card .button-link { flex: 0 0 auto; margin-top: 0; }
.slot-status { color: #15803d; font-size: .8rem; font-weight: 400; }
.booking-form { display: grid; gap: 1rem; }
.booking-fields { display: grid; gap: .8rem; }
.booking-field { display: grid; gap: .35rem; }
.booking-field label { margin: 0; }
.booking-field input[readonly] { background: #f8fafc; }
.time-readout { display: flex; align-items: center; min-height: 2.75rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: .6rem; color: var(--navy); background: var(--surface); direction: ltr; font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.client-picker { position: relative; }
.client-picker > input[type="search"] { padding-inline-end: 2.6rem; background: var(--surface); }
.client-picker::before { content: "⌕"; position: absolute; z-index: 1; inset-inline-end: .85rem; top: .7rem; color: var(--muted); font-size: 1.15rem; pointer-events: none; }
.client-suggestions { position: absolute; z-index: 10; inset-inline: 0; top: calc(100% + .3rem); display: grid; max-height: 15rem; overflow-y: auto; padding: .3rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); box-shadow: var(--shadow-hover); }
.client-suggestions[hidden] { display: none; }
.client-suggestion { display: flex; align-items: center; justify-content: space-between; gap: .7rem; width: 100%; min-height: 2.8rem; margin: 0; padding: .55rem .7rem; border-radius: .45rem; color: var(--navy); background: transparent; text-align: right; font-size: .85rem; }
.client-suggestion[hidden] { display: none; }
.client-suggestion:hover, .client-suggestion:focus-visible { color: var(--blue-dark); background: var(--primary-soft); outline: none; }
.client-suggestion span { color: var(--muted); direction: ltr; font-size: .76rem; unicode-bidi: isolate; }
.field-help { color: var(--muted); font-size: .78rem; }
.notes-field { grid-column: 1 / -1; }
.booking-actions { display: grid; gap: .65rem; }
.booking-actions button { margin-top: 0; }
.booking-actions button:disabled { opacity: .55; cursor: not-allowed; }
.client-required { margin-bottom: 1rem; }
.client-required .button-link { margin-top: .75rem; }
.payment-booking-list, .payment-history { display: grid; gap: .75rem; }
.payment-booking-card, .payment-summary-card, .payment-history-row {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
}
.payment-booking-heading, .payment-booking-footer, .payment-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.payment-booking-heading h3 { margin: 0; font-size: 1rem; }
.payment-booking-heading span, .payment-history-row span { color: var(--muted); font-size: .85rem; }
.payment-summary-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.payment-summary-values > div { display: grid; gap: .3rem; }
.payment-summary-values span { color: var(--muted); font-size: .78rem; }
.payment-summary-values strong { overflow-wrap: anywhere; }
.payment-state { display: inline-block; width: fit-content; padding: .35rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.payment-state.deposit { color: #92400e; background: #fef3c7; }
.payment-state.partial-payment { color: #92400e; background: #fef3c7; }
.payment-state.not-paid { color: var(--muted); background: var(--surface-muted); }
.payment-state.fully-paid { color: #166534; background: #dcfce7; }
.payment-state.invalid { color: var(--danger); background: var(--danger-bg); }
.payment-booking-footer .button-link { margin-top: 0; }
.payment-form { display: grid; gap: .8rem; margin-top: 1rem; }
.payment-form h2 { margin: 0; }
.payment-form button { margin-top: 0; }
.payment-notice { margin-top: 1rem; }
.payment-history-row strong { font-size: 1rem; }
.report-grid { display: grid; gap: .85rem; }
.report-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
}
.report-card-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.report-card-heading span { color: var(--muted); font-size: .85rem; }
.report-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.report-metric { display: grid; align-content: start; gap: .35rem; min-width: 0; padding: .75rem; border-radius: .6rem; background: #f8fafc; }
.report-metric span { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.report-metric strong { overflow-wrap: anywhere; font-size: 1rem; }
.finance-metrics { display: grid; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.finance-metrics > div { display: flex; justify-content: space-between; gap: .75rem; }
.finance-metrics span { color: var(--muted); font-size: .82rem; }
.finance-metrics strong { color: var(--blue-dark); }
.custom-report-form { gap: .8rem; }
.custom-report-form button { margin-top: 0; }
.custom-report-result { margin-top: 1rem; }
.settings-form { gap: .8rem; }
.settings-form button { margin-top: 0; }
.recurring-page { --recurring: #7c3aed; }
.recurring-eyebrow { color: var(--recurring); }
.recurring-notice { margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid #c4b5fd; border-radius: .7rem; color: #5b21b6; background: #f5f3ff; line-height: 1.7; }
.recurring-button { background: var(--recurring, #7c3aed); }
.recurring-button:hover { background: #6d28d9; }
.recurring-rules-section { margin-top: 1.5rem; }
.recurring-rules-filter { gap: .75rem; margin-bottom: .6rem; }
.recurring-rules-filter button { margin-top: 0; }
.recurring-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.recurring-filter-actions .button-link { margin-top: 0; }
.recurring-filter-count { margin: 0 0 .65rem; color: var(--muted); font-size: .85rem; }
.recurring-rules-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.recurring-rule-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.recurring-rule-details { display: grid; gap: .25rem; min-width: 0; line-height: 1.55; }
.recurring-rule-details > span { color: var(--muted); font-size: .82rem; }
.recurring-rule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; flex: 0 0 auto; }
.recurring-rule-actions form { margin: 0; }
.recurring-rule-actions button { width: auto; margin-top: 0; }
.recurring-delete-locked { color: var(--muted); font-size: .76rem; }
.recurring-conflict { color: var(--danger) !important; font-weight: 700; }
.recurring-booking-wrap { display: grid; gap: .3rem; min-width: 0; }
.recurring-booking-wrap .hour-card { width: 100%; }
.recurring-instance-link { color: var(--muted); text-align: center; font-size: .72rem; }
.recurring-payments-link { color: var(--primary); font-weight: 700; }
.settings-help { margin: 0; padding: .8rem; border-radius: .6rem; color: #355c3e; background: #f8f5da; font-size: .85rem; line-height: 1.7; }
.settings-color-heading h2 { margin: 0 0 .25rem; }
.settings-color-heading p { margin: 0; }
.color-setting input[type="color"] { min-height: 3.2rem; padding: .25rem; cursor: pointer; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input { flex: 1; }
.search-form button { width: auto; margin-top: 0; }
.toolbar > .button-link { margin-top: 0; }
.import-card { display: grid; gap: .65rem; margin-bottom: 1rem; }
.import-card h2, .import-card p { margin: 0; }
.import-card button { margin-top: .35rem; }
.helper-text { color: var(--muted); font-size: .88rem; line-height: 1.7; }
.import-card code { direction: ltr; unicode-bidi: isolate; }
.dashboard-finance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; text-align: right; }
.dashboard-finance > div { display: grid; gap: .2rem; padding: .65rem; border-radius: .6rem; background: #f8fafc; }
.dashboard-finance span { color: var(--muted); font-size: .75rem; }
.dashboard-insights-grid { display: grid; gap: .85rem; max-width: 80rem; margin: 0 auto 1rem; }
.insight-value { color: var(--primary); font-size: 1.05rem; font-weight: 800; }
.performance-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: .45rem; height: 12rem; margin-top: 1.15rem; padding-top: 1.5rem; }
.performance-bar-group { display: grid; grid-template-rows: 1.2rem 1fr 1.1rem; align-items: end; gap: .35rem; min-width: 0; height: 100%; text-align: center; }
.performance-bar-value, .performance-bar-label { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.performance-bar-track { display: flex; align-items: end; height: 100%; min-height: 2rem; border-radius: .4rem .4rem .2rem .2rem; background: var(--surface-muted); overflow: hidden; }
.performance-bar-track i { display: block; width: 100%; min-height: .18rem; border-radius: .4rem .4rem .2rem .2rem; background: linear-gradient(180deg, var(--blue), var(--blue-dark)); }
.occupancy-panel { display: grid; align-content: start; }
.occupancy-ring { display: grid; place-items: center; width: 9.5rem; height: 9.5rem; margin: 1.1rem auto .9rem; border-radius: 50%; background: conic-gradient(var(--blue) var(--occupancy), var(--surface-muted) 0); position: relative; }
.occupancy-ring::before { content: ""; position: absolute; inset: .75rem; border-radius: 50%; background: var(--surface); }
.occupancy-ring strong { position: relative; color: var(--primary); font-size: 2rem; }
.occupancy-ring small { font-size: .9rem; }
.occupancy-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.1rem; color: var(--muted); font-size: .78rem; }
.occupancy-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.occupancy-meta b { color: var(--navy); }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; }
.booked-dot { background: var(--blue); }
.available-dot { background: var(--success); }
.finance-filter { display: grid; gap: .8rem; margin-bottom: 1rem; }
.finance-filter button { margin-top: 0; }
.finance-list { display: grid; gap: .75rem; }
.finance-entry { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.finance-entry > div:first-child { display: grid; gap: .3rem; }
.finance-entry span { color: var(--muted); font-size: .82rem; }
.finance-entry .card-actions { flex-shrink: 0; align-items: center; }
.financial-form button { margin-top: 0; }
.public-schedule-page { max-width: 72rem; }
.public-schedule-header { margin-bottom: 1rem; text-align: center; }
.public-brand-logo { display: block; width: min(7rem, 28vw); height: auto; margin: 0 auto .7rem; border-radius: 50%; }
.public-schedule-header h1 { margin: .25rem 0 0; }
.policy-panel { width: min(100%, 48rem); margin: 1.25rem auto; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.policy-panel h2 { margin-bottom: .85rem; color: var(--primary); font-size: 1.2rem; }
.policy-content { padding: .9rem; border: 1px solid var(--line); border-radius: .65rem; color: var(--navy); background: var(--surface-muted); font-size: .95rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.policy-blocked { margin: .85rem 0 0; padding: .9rem; border-radius: .65rem; color: var(--danger); background: var(--danger-bg); line-height: 1.7; }
.policy-consent-form { display: grid; gap: .8rem; margin-top: 1rem; }
.policy-consent-form button { margin-top: 0; }
.policy-ack { display: flex; align-items: flex-start; gap: .65rem; margin: 0; padding: .85rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-muted); cursor: pointer; }
.policy-ack input { flex: 0 0 1.25rem; width: 1.25rem; min-width: 1.25rem; height: 1.25rem; min-height: 1.25rem; margin: .15rem 0 0; padding: 0; color: var(--navy); background: var(--surface); accent-color: var(--blue); }
.policy-ack span { font-size: .92rem; line-height: 1.6; }
.public-contact-links { display: flex; justify-content: center; gap: .6rem; margin-top: .8rem; }
.public-contact-links a { min-width: 5.5rem; padding: .55rem .8rem; border-radius: .6rem; color: #fff; background: var(--blue); font-size: .85rem; font-weight: 700; text-decoration: none; }
.public-contact-links a:last-child { background: #16a34a; }
.public-days { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .6rem; margin-bottom: 1rem; }
.public-day { display: grid; gap: .25rem; min-width: 5.8rem; padding: .75rem .6rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--text); background: var(--surface); text-align: center; text-decoration: none; }
.public-day span { color: var(--muted); font-size: .78rem; }
.public-day strong { font-size: .9rem; }
.public-day.selected { border-color: var(--blue); color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent); }
.public-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin: .5rem 0 1rem; color: var(--muted); font-size: .85rem; }
.public-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: .7rem; height: .7rem; border-radius: 50%; }
.legend-dot.empty { background: #22c55e; }
.legend-dot.booked { background: #ef4444; }
.legend-dot.fixed { background: #8b5cf6; }
.public-hours-grid { margin-top: .15rem; }
.public-hour { cursor: default; }
.public-hour:hover { transform: none; box-shadow: 0 1px 2px rgba(18, 32, 51, .04); }
.public-hour-client { font-size: .72rem; font-weight: 600; }

.client-list { display: grid; gap: .75rem; }
.client-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.client-detail-actions .button-link { margin-top: 0; }
.client-summary-note { margin: 0 0 .75rem; }
.deposit-client-section, .deposit-summary-card { margin: 1rem 0; padding: 1rem; border: 1px solid #c4b5fd; border-radius: .8rem; background: #f5f3ff; }
.deposit-summary-card { display: grid; gap: .7rem; }
.deposit-summary-card > div { display: flex; justify-content: space-between; align-items: center; }
.deposit-summary-card form { display: grid; gap: .5rem; }
.deposit-summary-card button { margin-top: 0; }
.deposit-ledger { display: grid; gap: .5rem; margin-top: 1rem; }
.deposit-ledger-row { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem; border-radius: .5rem; background: #fff; }
.client-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1.25rem; }
.client-stat { display: grid; gap: .35rem; padding: .9rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.client-stat span, .client-booking-values span { color: var(--muted); font-size: .8rem; }
.client-stat strong, .client-booking-values strong { overflow-wrap: anywhere; }
.client-booking-list { display: grid; gap: .75rem; }
.client-booking-entry { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.client-booking-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.client-booking-heading h3 { margin: 0; font-size: 1rem; }
.client-booking-heading p { margin: .3rem 0 0; color: var(--muted); }
.client-booking-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.client-booking-values > div { display: grid; gap: .3rem; }
.booking-status { display: inline-block; padding: .35rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.active-status { color: #166534; background: #dcfce7; }
.cancelled-status { color: #9f1239; background: #ffe4e6; }
.client-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
}
.client-name-label { display: block; margin-bottom: .15rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
.client-card h2.client-name { color: var(--primary); font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.phone, .notes { margin: .45rem 0 0; color: var(--muted); line-height: 1.6; }
.notes { white-space: pre-wrap; }
.card-actions { display: flex; gap: .5rem; }
.card-actions .button-link, .card-actions button { width: auto; min-width: 5rem; margin-top: 0; }
button.danger { color: var(--danger); background: var(--danger-bg); }
button.danger:hover { background: #ffe4e6; }
.button-link.small, button.small { min-height: 2.4rem; padding: .45rem .75rem; font-size: .88rem; }
.empty-state, .form-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface);
}
.empty-state p { margin-bottom: 0; color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .auth-card { padding: 2.5rem; }
  .page-shell { padding: 2rem 1.5rem; }
  .toolbar { grid-template-columns: 1fr auto; align-items: end; }
  .client-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .client-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .days-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; }
  .day-card { min-width: 0; }
  .booking-hours-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
  .booking-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .report-metrics { grid-template-columns: 1fr; }
}

@media (min-width: 960px) {
  .admin-context-nav { width: min(100% - 4rem, 60rem); margin-top: 1rem; }
  .dashboard-sidebar { position: fixed; transform: none; }
  .dashboard-main { width: calc(100% - 17rem); margin-inline-start: 17rem; padding: 2rem; }
  .mobile-menu-toggle { display: none; }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-content-grid { grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.2fr); }
  .dashboard-insights-grid { grid-template-columns: minmax(0, 1.35fr) minmax(15rem, .65fr); }
}

@media (min-width: 1200px) {
  .booking-hours-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .booking-hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hour-card { min-height: 6.5rem; }
  .booking-hours-header { flex-direction: column; align-items: stretch; gap: .65rem; }
  .booking-hours-header > .button-link { align-self: flex-start; }
}
@media (max-width: 560px) {
  .booking-hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recurring-rule-item { align-items: stretch; flex-direction: column; }
  .recurring-rule-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .recurring-rule-actions .button-link, .recurring-rule-actions button { width: 100%; text-align: center; }
  .dashboard-header { flex-direction: column; margin-bottom: 1rem; }
  .dashboard-header-actions { width: 100%; flex-wrap: wrap; }
  .dashboard-header-actions .button-link { flex: 1 1 auto; }
  .header-icon-link, .header-theme-toggle, .mobile-menu-toggle { flex: 0 0 2.9rem; width: 2.9rem; padding-inline: 0; }
  .header-theme-toggle { font-size: 1rem; }
  .dashboard-stat strong { font-size: 1.15rem; }
  .performance-chart { gap: .25rem; }
  .performance-bar-value { font-size: .54rem; }
}


.weekly-report-section { margin-top: 1.75rem; }
.weekly-report-heading { margin-bottom: .75rem; }
.weekly-report-heading h2 { margin: 0 0 .25rem; }
.weekly-report-heading p { margin: 0; }
.weekly-report-form { gap: .8rem; }
.weekly-report-form button { margin-top: 0; }
.weekly-report-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.weekly-report-form-actions .button-link { margin-top: 0; }
.weekly-report-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.weekly-report-summary > div { display: grid; gap: .35rem; min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.weekly-report-summary span, .weekly-occurrence-finance span { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.weekly-report-summary strong { overflow-wrap: anywhere; font-size: 1.05rem; }
.weekly-occurrence-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.weekly-occurrence-card { display: grid; gap: .75rem; min-width: 0; padding: .9rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.weekly-occurrence-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.weekly-occurrence-heading h3 { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.weekly-occurrence-heading time { color: var(--muted); font-size: .85rem; }
.weekly-occurrence-meta { display: inline-block; margin-top: .2rem; color: var(--muted); font-size: .8rem; }
.weekly-occurrence-details { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--muted); font-size: .88rem; }
.weekly-occurrence-finance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.weekly-occurrence-finance > div { display: grid; gap: .2rem; min-width: 0; }
.weekly-occurrence-finance strong { overflow-wrap: anywhere; font-size: .95rem; }
.weekly-report-empty { margin-top: .5rem; }

@media (min-width: 640px) {
  .weekly-report-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
