:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* palette-B: warm two-tone (sage = state/selection, terracotta = actions/accents) */
  --bg: #f8f3ec;
  --surface: #ffffff;
  --surface-tint: rgba(255, 255, 255, 0.82);
  --text: #231d18;
  --text-muted: #7d6f62;
  --text-soft: #4d443c;
  --border: rgba(60, 42, 30, 0.13);
  --border-strong: rgba(60, 42, 30, 0.28);
  --accent: #2f7d63; /* sage green = selection / active / status */
  --accent-contrast: #ffffff;
  --accent-soft: #eef7f1;
  --accent-soft-border: rgba(47, 125, 99, 0.32);
  --cta: #b5654d; /* terracotta = PRIMARY action buttons */
  --cta-hover: #a4573f;
  --cta-contrast: #ffffff;
  --danger: #b03a2e; /* destructive action, distinct from terracotta CTA */
  --danger-contrast: #ffffff;
  --chip-bg: #f6e9e2; /* category chip = terracotta tint */
  --chip-text: #a1553f;
  --st-green-bg: #dff2eb;
  --st-green-text: #256b4f;
  --st-amber-bg: #fbecc4;
  --st-amber-text: #7a5a12;
  --st-red-bg: #f6e2d9;
  --st-red-text: #9a4030;
  --badge-bg: #b5654d; /* calendar count badge = terracotta */
  --badge-text: #ffffff;
  --radius-card: 16px;
  --radius-control: 11px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 30px rgba(120, 70, 45, 0.1);
  --shadow-pop: 0 18px 55px rgba(60, 40, 28, 0.2);
  /* type scale */
  --fs-h1: 32px;
  --fs-h2: 21px;
  --fs-h3: 16px;
  --fs-body: 14px;
  --fs-label: 11px;
  --fw-reg: 600;
  --fw-med: 700;
  --fw-bold: 800;

  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(181, 101, 77, 0.12), transparent 30rem),
    linear-gradient(160deg, #f8f3ec 0%, #f3ebe2 55%, #eef5f0 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.kicker {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
}

h3 {
  margin-bottom: 12px;
  font-size: var(--fs-h3);
  font-weight: var(--fw-med);
}

.user-chip,
.notice,
.panel,
.service-row,
.appointment-row {
  border: 1px solid var(--border);
  background: var(--surface-tint);
  box-shadow: var(--shadow-card);
}

.user-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

.notice {
  margin-bottom: 16px;
  border-radius: var(--radius-control);
  padding: 12px 14px;
  color: var(--text-soft);
}

.notice.error {
  border-color: rgba(170, 42, 42, 0.3);
  color: #7e1f1f;
}

.notice.success {
  border-color: rgba(45, 125, 88, 0.3);
  color: #236346;
  text-align: center;
  font-weight: 700;
}

.toast-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  z-index: 20;
}

.toast-layer-top {
  inset: 14px 16px auto auto;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
}

.toast {
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(45, 125, 88, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(30, 34, 33, 0.18);
  padding: 18px 22px;
  text-align: center;
  font-weight: 700;
}

.toast.loading {
  border-color: rgba(47, 125, 99, 0.18);
  padding: 11px 14px;
  color: #315b4f;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(25, 22, 19, 0.28);
  padding: 16px;
}

.confirm-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: 18px;
}

.confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 0 0 16px;
  color: var(--text-soft);
}

.reschedule-modal {
  width: min(560px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.reschedule-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.reschedule-modal-head strong {
  font-size: 17px;
}

.reschedule-modal-body {
  overflow-y: auto;
  padding: 0;
}

.reschedule-modal-body .panel {
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

.danger-action {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-contrast);
}

.view-switch-row {
  display: block;
  max-width: 100%;
  margin-bottom: 16px;
}

.view-switch {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-tint);
  padding: 4px;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
}

.view-switch::-webkit-scrollbar {
  display: none;
}

.view-switch button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 12px;
  font-weight: var(--fw-med);
  white-space: nowrap;
}

.view-ico {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.view-ico svg {
  width: 16px;
  height: 16px;
}

.view-switch button.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.view-switch button.pending-attention:not(.active) {
  box-shadow: inset 0 0 0 2px rgba(181, 101, 77, 0.35);
  color: var(--cta);
}

.view-badge {
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1;
}

.view-switch button.active .view-badge {
  background: var(--accent-contrast);
  color: var(--accent);
}

.view-edit-button {
  flex: 0 0 auto;
  width: 38px;
  min-width: 38px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 17px;
  font-weight: var(--fw-bold);
  box-shadow: none;
}

.view-order-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--fw-bold);
}

.view-order-tools button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.layout.layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  border-radius: var(--radius-card);
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading span {
  color: var(--text-muted);
  font-size: 14px;
}

.step {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.service-list,
.appointment-list {
  display: grid;
  gap: 10px;
}

.service-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: var(--radius-card);
  padding: 12px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.service-row:has(input:checked) {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  box-shadow: 0 10px 28px rgba(47, 125, 99, 0.08);
}

.service-row input {
  width: 18px;
  height: 18px;
  margin-top: 0;
  accent-color: var(--accent);
}

.service-row strong,
.appointment-row strong {
  display: block;
  margin-bottom: 4px;
}

.service-row small,
.appointment-row small {
  color: var(--text-muted);
}

.svc-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}

.svc-dur {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.svc-clock {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.8;
}

.svc-dot {
  color: var(--text-muted);
}

.svc-cat {
  color: var(--text-muted);
}

.day-list,
.slot-list,
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-widget {
  display: grid;
  gap: 12px;
  max-width: 430px;
  min-height: 348px;
}

.booking-panel[data-booking-stage="calendar"] .service-list,
.booking-panel[data-booking-stage="slots"] .service-list,
.booking-panel[data-booking-stage="contact"] .service-list {
  gap: 8px;
}

.booking-panel[data-booking-stage="calendar"] .service-row,
.booking-panel[data-booking-stage="slots"] .service-row,
.booking-panel[data-booking-stage="contact"] .service-row {
  padding: 10px 12px;
}

.wizard-stage {
  animation: wizard-stage-in 220ms ease-out;
}

.slot-step {
  min-height: 220px;
}

.master-calendar-widget {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-header,
.slot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-header strong {
  text-transform: capitalize;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  font-weight: var(--fw-bold);
  line-height: 1;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--fw-bold);
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: var(--fw-bold);
}

.calendar-day.muted {
  opacity: 0.45;
}

.calendar-day.unavailable {
  background: #e9e5df;
  color: #82776f;
}

.calendar-day.partial {
  border-color: rgba(196, 143, 23, 0.55);
  background: #fff0bc;
}

.calendar-day.full {
  border-color: rgba(170, 42, 42, 0.28);
  background: #f3c9c1;
  color: #7e1f1f;
}

.calendar-day.free {
  background: #ffffff;
}

.calendar-day.clear {
  background: #ffffff;
}

.calendar-day.pending {
  border-color: rgba(196, 143, 23, 0.55);
  background: #fff0bc;
}

.calendar-day.confirmed {
  border-color: var(--accent-soft-border);
  background: var(--st-green-bg);
  color: var(--st-green-text);
}

.calendar-day.mixed {
  border-color: rgba(158, 85, 72, 0.4);
  background: #ead1cb;
  color: #6b342d;
}

.calendar-day.finalized {
  border-color: rgba(120, 116, 110, 0.4);
  background: #f1eeea;
  color: #5f5650;
}

.calendar-day.selected {
  outline: 3px solid rgba(47, 125, 99, 0.24);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.master-calendar-day {
  display: grid;
  place-items: center;
  position: relative;
}

.master-calendar-day > span {
  position: absolute;
  top: 4px;
  left: 6px;
}

.master-calendar-day small {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  min-width: 14px;
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 9px;
  font-weight: var(--fw-bold);
  line-height: 14px;
  padding: 0 4px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.78);
}

.master-calendar-day.past {
  opacity: 0.62;
  filter: saturate(0.7);
}

.master-calendar-day.past.selected {
  opacity: 1;
  filter: none;
}

.calendar-day:disabled {
  cursor: not-allowed;
}

.calendar-empty {
  grid-column: 1 / -1;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--fw-med);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(51, 45, 39, 0.13);
  border-radius: 999px;
  background: #ffffff;
}

.legend-dot.partial {
  background: #fff0bc;
}

.legend-dot.full {
  background: #f3c9c1;
}

.legend-dot.pending {
  background: #fff0bc;
}

.legend-dot.confirmed {
  background: #dff2eb;
}

.legend-dot.mixed {
  background: #ead1cb;
}

.legend-dot.finalized {
  background: #f1eeea;
}

.legend-dot.unavailable {
  background: #e9e5df;
}

.slot-list.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-list.two-column .empty {
  grid-column: 1 / -1;
}

.date-button,
.slot-button,
.ghost-button,
.primary-button {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: var(--fw-med);
}

.date-button,
.slot-button {
  min-height: 40px;
  padding: 9px 12px;
}

.date-button.selected,
.slot-button.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.slot-group {
  margin-bottom: 12px;
}

.slot-group-head {
  margin: 2px 0 8px;
}

.ghost-button {
  padding: 8px 10px;
}

.inline-action {
  flex: 0 0 auto;
}

.ghost-button.danger {
  border-color: rgba(170, 42, 42, 0.24);
  color: #7e1f1f;
}

.contact-form {
  display: grid;
  gap: 12px;
  animation: contact-form-in 220ms ease-out;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: var(--fw-med);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: var(--fw-reg);
}

.toggle-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--accent-soft-border);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: #315b4f !important;
  padding: 10px 12px;
}

.toggle-row input {
  width: 18px !important;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.summary span {
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--st-green-text);
  padding: 6px 9px;
  font-size: 13px;
  font-weight: var(--fw-med);
}

.primary-button {
  min-height: 46px;
  border-color: var(--cta);
  background: var(--cta);
  color: var(--cta-contrast);
}

.primary-button:hover,
.primary-button:active {
  border-color: var(--cta-hover);
  background: var(--cta-hover);
}

.primary-button.compact {
  min-height: 38px;
  padding: 8px 10px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.appointment-row {
  border-radius: var(--radius-card);
  padding: 13px;
}

.appointment-row span {
  display: block;
  margin-bottom: 4px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.date-input {
  min-height: 38px;
  border: 1px solid rgba(51, 45, 39, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #201d1a;
  padding: 8px 10px;
  font-weight: 700;
}

.admin-day-list {
  display: grid;
  gap: 10px;
}

.today-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.today-summary-heading {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.summary-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.summary-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-metric-row::-webkit-scrollbar {
  display: none;
}

.admin-day-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.summary-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #faf6f0;
  color: var(--text-soft);
  padding: 8px 9px;
  text-align: left;
}

.summary-tile-filter {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

/* Let the long filter label ("Ждут подтверждения") wrap inside the grid cell
   instead of overflowing and getting clipped at the screen edge. */
.summary-tile-filter span {
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
}

.summary-tile-metric {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: default;
}

.summary-tile-filter::before,
.summary-tile-metric::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, #9a8f83);
  flex: 0 0 auto;
}

.summary-tile.tone-confirmed {
  --dot: #2f7d63;
}

.summary-tile.tone-pending {
  --dot: #c69a2e;
}

.summary-tile.tone-danger {
  --dot: #c0503a;
}

.summary-tile.tone-neutral {
  --dot: #9a8f83;
}

.summary-tile.active {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 99, 0.14);
}

.admin-day-summary div {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.stat-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--fw-bold);
}

.stat-card strong {
  align-self: end;
  font-size: 22px;
  line-height: 1.05;
}

.notification-failure-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.notification-failure-list h3 {
  margin: 0;
}

.notification-failure-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fff8f6;
  padding: 10px;
}

.notification-failure-row small,
.notification-failure-row p {
  display: block;
  margin: 4px 0 0;
  color: var(--text-muted);
}

.notification-failure-row p {
  font-size: 13px;
}

.today-summary strong,
.today-summary span,
.admin-day-summary strong,
.admin-day-summary span {
  display: block;
}

.today-summary strong,
.admin-day-summary strong {
  font-size: 18px;
  line-height: 1;
}

.today-summary .summary-tile-filter strong {
  font-size: 15px;
}

.today-summary span,
.admin-day-summary span {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--fw-bold);
}

.summary-tile-metric strong {
  font-size: 13px;
}

.summary-tile-metric span {
  margin-top: 0;
  white-space: nowrap;
}

.records-daynav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.records-daynav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}

.records-daynav-btn:hover:not(:disabled) {
  background: var(--accent-soft-border);
}

.records-daynav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.records-daynav-label {
  flex: 1 1 auto;
  text-align: center;
  font-weight: var(--fw-bold);
  font-size: 15px;
  color: var(--text);
}

.settings-panel {
  display: grid;
  gap: 12px;
}

.settings-subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-tint);
  border: 1px solid var(--border);
}

.settings-subnav-btn {
  flex: 1 1 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.settings-subnav-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.confirmation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid rgba(47, 125, 80, 0.2);
  border-radius: 8px;
  background: #f4fbf6;
  color: #285d3f;
  padding: 8px 10px;
}

.confirmation-summary span,
.confirmation-summary small,
.confirmation-summary em {
  color: #3f7053;
  font-size: 12px;
  font-weight: 800;
}

.confirmation-summary span,
.confirmation-summary small {
  display: block;
}

.confirmation-summary strong {
  margin-left: auto;
  font-size: 17px;
  line-height: 1;
}

.confirmation-summary em {
  flex: 1 1 auto;
  font-style: normal;
}

.confirmation-summary.later {
  border-color: rgba(51, 45, 39, 0.12);
  background: #f8f7f4;
  color: #4d443c;
}

.confirmation-summary.waiting {
  border-color: rgba(210, 162, 46, 0.28);
  background: #fff8df;
}

.next-appointment {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--accent-soft-border);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  color: var(--st-green-text);
  padding: 14px;
}

.next-appointment small {
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.next-appointment strong {
  font-size: 20px;
}

.today-list {
  display: grid;
  gap: 10px;
}

.today-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  scroll-margin: 80px;
}

.today-card.expanded {
  border-color: rgba(47, 125, 99, 0.34);
  background: #fcfffd;
}

.today-card.nearest {
  border-color: rgba(47, 125, 99, 0.56);
  border-left-width: 5px;
  background:
    linear-gradient(90deg, rgba(47, 125, 99, 0.09), rgba(255, 255, 255, 0) 58%),
    #f6fbf8;
  box-shadow:
    0 14px 34px rgba(47, 125, 99, 0.13),
    inset 0 0 0 1px rgba(47, 125, 99, 0.08);
}

.today-card.nearest.expanded {
  border-color: rgba(47, 125, 99, 0.62);
}

.today-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.today-card-toggle {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-align: left;
}

.today-card-time,
.today-card-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.today-card-time strong {
  font-size: 20px;
}

.today-card-main strong {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
}

.today-card-main small {
  color: var(--accent);
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.today-card-main .appointment-source-line {
  flex: 1 1 100%;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--fw-med);
}

.today-card-main a {
  color: var(--accent);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.today-card-main span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: var(--fw-med);
}

.nearest-badge {
  border-radius: 999px;
  background: #eef5f2;
  color: #2f6d57;
  padding: 4px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.today-card p {
  margin: 0;
  color: var(--text-soft);
}

.today-card-details {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.appointment-status-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.appointment-status-lines small {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  background: #f4f0ec;
  color: #5d5148;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.appointment-status-lines small span {
  color: #4d443c;
}

.appointment-status-lines .status-value {
  color: #4d443c;
}

.appointment-status-lines .status-value::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--dot, #9a8f83);
}

.appointment-status-lines .status-value.confirmed,
.appointment-status-lines .status-value.completed {
  --dot: #2f7d63;
}

.appointment-status-lines .status-value.pending,
.appointment-status-lines .status-value.waiting,
.appointment-status-lines .status-value.scheduled,
.appointment-status-lines .status-value.call {
  --dot: #c69a2e;
}

.appointment-status-lines .status-value.danger {
  --dot: #c0503a;
}

.override-badge {
  width: fit-content;
  border-radius: 999px;
  background: #fff0bc;
  color: #7a5511;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.contact-actions {
  display: flex;
  gap: 6px;
}

.contact-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-soft-border);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.admin-override-box,
.admin-override-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fffaf7;
  padding: 12px;
}

.admin-override-box {
  display: grid;
  gap: 8px;
}

.manual-client-info {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(47, 125, 99, 0.16);
  border-radius: 8px;
  background: #f4fbf6;
  color: #315b4f;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.manual-client-info span {
  color: #5f6f67;
  font-weight: 600;
}

.form-grid.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid.compact-grid label {
  display: grid;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.form-grid.compact-grid input {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #211d19;
  font: inherit;
  padding: 10px;
}

.today-final-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid rgba(51, 45, 39, 0.1);
  padding-top: 10px;
}

.today-final-form label {
  display: grid;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.today-final-form input,
.today-final-form textarea {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #211d19;
  font: inherit;
  padding: 10px;
}

.today-final-form textarea {
  resize: vertical;
}

.customer-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  background: rgba(32, 29, 26, 0.32);
  backdrop-filter: blur(2px);
  padding: 18px;
}

.customer-detail-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  width: min(680px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: 18px;
}

.customer-detail-header {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -18px 0;
  border-bottom: 1px solid rgba(51, 45, 39, 0.1);
  background: #ffffff;
  padding: 16px 18px;
}

.customer-detail-header span {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.customer-detail-header h3 {
  margin: 3px 0;
}

.customer-detail-header a,
.customer-detail-summary a {
  color: var(--accent);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.customer-detail-summary {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #faf8f4;
  padding: 12px;
}

.customer-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.customer-detail-stats .status-pill {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  padding: 8px;
}

.customer-detail-stats .status-pill::before {
  content: none;
}

.customer-detail-stats strong {
  font-size: 18px;
}

.customer-notes-form {
  gap: 10px;
  border: 1px solid rgba(47, 125, 99, 0.12);
  border-radius: 8px;
  background: #f8fcfa;
  padding: 12px;
}

.customer-notes-heading,
.customer-history-heading,
.customer-notes-field {
  display: grid;
  gap: 8px;
}

.customer-notes-heading h4,
.customer-history-heading h4,
.customer-notes-field span {
  margin: 0;
  color: #4d443c;
  font-size: 14px;
  font-weight: 800;
}

.customer-notes-helper,
.customer-history-heading p {
  margin: 0;
}

.customer-notes-field textarea {
  min-height: 112px;
  resize: none;
}

.customer-crm-tools {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fffaf7;
  padding: 12px;
}

.customer-crm-tools h4 {
  margin: 0;
  color: #4d443c;
  font-size: 14px;
}

.customer-crm-form {
  gap: 10px;
  border-top: 1px solid rgba(166, 82, 70, 0.12);
  padding-top: 10px;
}

.customer-split-list {
  display: grid;
  gap: 8px;
}

.customer-split-option {
  align-items: start;
}

.customer-history-list {
  display: grid;
  gap: 10px;
}

.customer-history-row {
  display: grid;
  gap: 4px;
}

.customer-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.customer-search-form label {
  display: grid;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.customer-search-form input {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #201d1a;
  padding: 10px 12px;
}

.customer-search-list {
  display: grid;
  gap: 10px;
}

.customer-search-row button {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  gap: 6px;
  padding: 13px;
  color: #201d1a;
  text-align: left;
}

.customer-search-row span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.customer-search-row small {
  color: var(--text-muted);
}

.wide-field {
  grid-column: 1 / -1;
}

.admin-service-list {
  display: grid;
  gap: 12px;
}

.admin-service-card-list {
  display: grid;
  gap: 10px;
}

.admin-service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}

.admin-service-card.open {
  box-shadow: var(--shadow-card);
}

.admin-service-card-button {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.admin-service-card-main,
.admin-service-card-meta,
.admin-service-create-block,
.schedule-day-title {
  display: grid;
  gap: 4px;
}

.admin-service-card-main span,
.admin-service-card-meta small,
.schedule-day-title small {
  color: var(--text-muted);
}

.admin-service-card-meta {
  justify-items: end;
}

.admin-service-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 12px;
}

.service-editor {
  margin: 0;
  border-top: 1px solid rgba(51, 45, 39, 0.08);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.schedule-section {
  display: grid;
  gap: 12px;
}

.schedule-section-collapsible {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.schedule-section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: #211d19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  text-align: left;
}

.schedule-section-toggle span {
  display: grid;
  gap: 3px;
}

.schedule-section-toggle strong {
  font-size: 16px;
}

.schedule-section-toggle small {
  color: #6f655c;
  font-weight: 600;
  line-height: 1.35;
}

.schedule-section-toggle i {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: #f2ebe6;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-muted);
  font-style: normal;
  font-weight: var(--fw-bold);
}

.schedule-section-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(51, 45, 39, 0.08);
  padding: 14px;
}

.weekly-schedule-list,
.blocked-slot-list,
.schedule-exception-list {
  display: grid;
  gap: 10px;
}

.weekly-schedule-list.compact {
  gap: 8px;
}

.weekly-day-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.weekly-day-tile {
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px 10px;
  text-align: left;
}

.weekly-day-tile strong {
  font-size: 15px;
}

.weekly-day-tile small {
  color: var(--text-muted);
  line-height: 1.3;
}

.weekly-day-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(47, 125, 99, 0.14);
}

.weekly-day-tile.working {
  background: #fffdfb;
}

.weekly-day-tile.off {
  background: #f7f3ef;
}

.weekly-schedule-editor {
  margin-top: 2px;
}

.schedule-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.schedule-card.compact {
  gap: 8px;
  padding: 10px 12px;
}

.schedule-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-day-heading {
  align-items: start;
}

.schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.booking-rule-toggle {
  justify-content: flex-start;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-time-grid.compact {
  gap: 8px;
}

.schedule-time-grid label {
  display: grid;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.schedule-time-grid input {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #211d19;
  font: inherit;
  padding: 10px;
}

.blocked-slot-row {
  background: #fffaf7;
}

.schedule-exception-row {
  background: #f8fbff;
}

.admin-service-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(51, 45, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.service-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-form-heading h3,
.admin-service-form h3 {
  margin: 0;
}

.service-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-form-grid label {
  display: grid;
  gap: 6px;
  color: #4d443c;
  font-size: 13px;
  font-weight: 800;
}

.service-form-grid input,
.service-form-grid textarea {
  width: 100%;
  border: 1px solid rgba(51, 45, 39, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #211d19;
  font: inherit;
  padding: 10px;
}

.checkbox-field {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
}

/* Variant 3 status pills: soft grey pill + neutral text + a tone-colored dot. */
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  background: #f3efe9;
  color: #4d443c;
  font-size: 12px;
  font-weight: var(--fw-bold);
}

.status-pill::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--dot, #9a8f83);
  flex: 0 0 auto;
}

.status-pill.completed,
.status-pill.success,
.status-pill.confirmed {
  --dot: #2f7d63;
}

.status-pill.pending,
.status-pill.waiting {
  --dot: #c69a2e;
}

.status-pill.danger,
.status-pill.no_show,
.status-pill.rejected,
.status-pill.cancelled_by_client,
.status-pill.cancelled_by_master {
  --dot: #c0503a;
}

.client-confirmation-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.client-confirmation-pill.confirmed {
  background: #e5f6ed;
  color: #2f7d50;
}

.client-confirmation-pill.pending {
  background: #f7e7e0;
  color: #8d3d2d;
}

.client-confirmation-pill.optional {
  background: #eef1ee;
  color: #516058;
}

.muted-text {
  color: var(--text-muted) !important;
}

.day-appointment-row {
  display: grid;
  gap: 2px;
}

.day-appointment-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.empty {
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-muted);
  padding: 14px;
}

.workday-empty {
  display: grid;
  gap: 5px;
}

.workday-empty strong {
  color: #221b16;
}

.workday-empty small {
  line-height: 1.35;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wizard-stage-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes contact-form-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .calendar-widget {
    max-width: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .slot-heading {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .today-card-time,
  .today-card-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .today-final-form {
    grid-template-columns: 1fr;
  }

  .schedule-layout,
  .form-grid.compact-grid,
  .service-form-grid {
    grid-template-columns: 1fr;
  }

  .schedule-time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-section-wide {
    grid-column: auto;
  }

  .admin-service-card-button {
    display: grid;
  }

  .admin-service-card-meta {
    justify-items: start;
  }

  .schedule-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .weekly-day-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .schedule-toggle {
    justify-self: start;
  }

  .customer-detail-backdrop {
    align-items: end;
    padding: 0;
  }

  .customer-detail-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
  }

  .customer-detail-header {
    align-items: center;
    flex-direction: row;
  }

  .customer-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .customer-detail-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .customer-detail-header .row-actions {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .customer-search-form,
  .customer-search-row span {
    grid-template-columns: 1fr;
  }

  .customer-search-row span {
    display: grid;
  }

  .weekly-day-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-time-grid {
    grid-template-columns: 1fr;
  }

  .admin-day-summary div {
    padding: 5px 7px;
  }

  .admin-day-summary strong {
    font-size: 14px;
  }

  .admin-day-summary span {
    font-size: 10px;
  }
}

@media (min-width: 920px) {
  .weekly-day-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
