:root {
  --ink: #323264;
  --muted: #68708a;
  --line: #dce8ef;
  --canvas: #f5f9fc;
  --surface: #ffffff;
  --brand: #008dd2;
  --brand-2: #008dd2;
  --brand-deep: #323264;
  --teal-soft: #e3f6fd;
  --coral: #ef7f1a;
  --coral-soft: #fff0e2;
  --gold: #fecc00;
  --gold-soft: #fff8cf;
  --blue: #008dd2;
  --blue-soft: #e3f6fd;
  --danger: #ee2c37;
  --shadow: 0 16px 40px rgba(50, 50, 100, 0.11);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(0, 141, 210, 0.25);
  outline-offset: 2px;
}
svg { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 244px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  color: #fff;
  background: var(--brand);
}
.brand {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}
.brand img { width: 42px; height: 42px; padding: 5px; border-radius: 8px; object-fit: contain; background: #fff; }
.brand span, .profile span { min-width: 0; display: grid; gap: 2px; }
.brand strong { font-size: 18px; }
.brand small, .profile small { color: rgba(255,255,255,.62); font-size: 11px; }
.side-nav { flex: 1; margin-top: 28px; }
.nav-group { display: grid; gap: 4px; }
.nav-label {
  padding: 0 10px 8px;
  color: rgba(255,255,255,.43);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nav-item, .install-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: rgba(255,255,255,.72);
  background: transparent;
  text-align: left;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.09); }
.nav-item.active { box-shadow: inset 3px 0 var(--coral); }
.sidebar-footer { display: grid; gap: 14px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 9px; }
.legal-links a { color: rgba(255,255,255,.72); font-size: 9px; text-decoration: none; }
.legal-links a:hover { color: #fff; text-decoration: underline; }
.install-button {
  width: 100%;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--brand-deep);
  border-color: var(--gold);
  background: var(--gold);
}
.profile {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 9px;
  padding-top: 14px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.12);
  color: #fff;
  background: transparent;
  text-align: left;
}
.profile:hover { color: #fff; }
.profile strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 34px;
  height: 34px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.main-area { min-width: 0; grid-column: 2; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(18px, 3vw, 42px);
  border-bottom: 2px solid var(--gold);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: 0; }
.topbar p, .eyebrow {
  margin: 0;
  color: var(--brand-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mobile-brand-logo { display: none; width: 40px; height: 40px; padding: 4px; border-radius: 7px; object-fit: contain; background: #fff; }
.mobile-logout-button { display: none; }
.mode-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); }
.mode-switch button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.mode-switch button.active { color: var(--brand); background: #fff; box-shadow: 0 2px 8px rgba(50,50,100,.1); }
.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}
.icon-button:hover { color: var(--brand-2); border-color: #b6ceca; }
.icon-button:disabled { cursor: not-allowed; color: #aeb8bd; border-color: var(--line); background: #f4f6f7; }
.notification-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 9px; color: #fff; background: var(--coral); font-size: 8px; font-weight: 900; line-height: 1; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 6px;
  font-weight: 750;
  font-size: 13px;
}
.primary-button { border: 1px solid var(--coral); color: #fff; background: var(--coral); }
.primary-button:hover { background: var(--brand); border-color: var(--brand); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.secondary-button:hover, .ghost-button:hover { border-color: #b9cbc8; background: #f8faf9; }
.ghost-button { min-height: 34px; padding: 0 10px; border: 1px solid transparent; color: var(--brand-2); background: transparent; }
.danger-button { border: 1px solid #f1caca; color: var(--danger); background: #fff7f7; }
.compact { min-height: 38px; }
.secondary-button:disabled { cursor: not-allowed; opacity: .5; }

#appContent { width: min(1520px, 100%); margin: 0 auto; padding: 28px clamp(18px, 3vw, 42px) 54px; }
.view-stack { display: grid; gap: 22px; animation: fade-in .2s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: 18px; letter-spacing: 0; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-heading .actions { display: flex; gap: 8px; }

.welcome-band {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, .7fr);
  gap: 24px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand-deep);
  box-shadow: var(--shadow);
}
.welcome-band h2 { max-width: 610px; margin: 7px 0 8px; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; letter-spacing: 0; }
.welcome-band p { max-width: 600px; margin: 0; color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.6; }
.welcome-band .primary-button { margin-top: 20px; color: var(--brand); border-color: #fff; background: #fff; }
.welcome-art { min-height: 120px; display: grid; place-items: center; }
.welcome-art img { width: min(190px, 100%); aspect-ratio: 1; padding: 18px; border-radius: 22px; object-fit: contain; background: #fff; box-shadow: 0 18px 45px rgba(0,0,0,.22); transform: rotate(3deg); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 11px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; color: var(--brand-2); background: var(--teal-soft); }
.metric-card:nth-child(2) .metric-icon { color: var(--coral); background: var(--coral-soft); }
.metric-card:nth-child(3) .metric-icon { color: var(--gold); background: var(--gold-soft); }
.metric-card:nth-child(4) .metric-icon { color: var(--blue); background: var(--blue-soft); }
.metric-card strong { display: block; overflow-wrap: anywhere; font-size: 22px; }
.metric-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.payment-hero { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 17px 18px; border: 1px solid #ffe088; border-radius: var(--radius); background: var(--gold-soft); }
.payment-hero-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--brand); }
.payment-hero-icon svg { width: 23px; height: 23px; }
.payment-hero strong, .payment-hero small { display: block; }
.payment-hero strong { color: var(--brand-deep); font-size: 13px; }
.payment-hero small { max-width: 650px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.payment-hero small a { color: var(--brand); font-weight: 800; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 18px; align-items: start; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.service-card {
  min-width: 0;
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 176px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.service-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); }
.service-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: var(--brand-2); background: var(--teal-soft); }
.service-card:nth-child(3n+2) .service-icon { color: var(--coral); background: var(--coral-soft); }
.service-card:nth-child(3n+3) .service-icon { color: var(--gold); background: var(--gold-soft); }
.service-card h3 { margin: 0; font-size: 14px; }
.service-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.service-card .service-price { align-self: end; display: flex; align-items: baseline; gap: 3px; margin-top: auto; color: var(--brand); font-size: 18px; font-weight: 850; }
.service-card .service-price span { color: var(--muted); font-size: 10px; font-weight: 600; }
.service-tag { position: absolute; top: 12px; right: 12px; padding: 3px 6px; border-radius: 4px; color: var(--coral); background: var(--coral-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }

.next-booking { display: grid; gap: 14px; }
.date-block { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.date-tile { width: 58px; height: 62px; display: grid; place-items: center; align-content: center; border-radius: 7px; color: #fff; background: var(--coral); }
.date-tile strong { font-size: 24px; line-height: 1; }
.date-tile small { margin-top: 3px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.detail-list { display: grid; gap: 10px; }
.detail-item { display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.detail-item svg { width: 15px; color: var(--brand-2); }

.status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.confirmed { color: var(--brand-2); background: var(--teal-soft); }
.status.pending { color: #967017; background: var(--gold-soft); }
.status.completed, .status.paid { color: var(--blue); background: var(--blue-soft); }
.status.cancelled { color: var(--danger); background: #fff0f0; }
.status.unpaid { color: var(--coral); background: var(--coral-soft); }

.booking-list { display: grid; gap: 10px; }
.booking-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(130px, .8fr) minmax(130px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.booking-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.booking-main .service-icon { flex: 0 0 auto; }
.booking-main strong, .booking-main small { display: block; }
.booking-main strong { font-size: 12px; }
.booking-main small, .booking-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.booking-cell { min-width: 0; font-size: 11px; }
.booking-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.notification-banner {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid #ffd35c;
  border-radius: 7px;
  color: var(--ink);
  background: var(--gold-soft);
  text-align: left;
}
.notification-banner > span:nth-child(2) { min-width: 0; }
.notification-banner strong, .notification-banner small { display: block; }
.notification-banner strong { font-size: 12px; }
.notification-banner small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.notification-banner > svg { color: var(--coral); }
.edit-window-note { display: flex; align-items: center; gap: 10px; margin: 14px 20px 0; padding: 11px 12px; border: 1px solid #ffe088; border-radius: 6px; color: var(--brand-deep); background: var(--gold-soft); }
.edit-window-note svg { color: var(--coral); }
.edit-window-note strong, .edit-window-note small { display: block; }
.edit-window-note strong { font-size: 11px; }
.edit-window-note small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.empty-state { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state .service-icon { width: 48px; height: 48px; }
.empty-state h3 { margin: 5px 0 0; color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 300px; margin: 0; font-size: 11px; line-height: 1.5; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 10px 12px; color: var(--muted); background: #f8faf9; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
td .icon-button { width: 31px; height: 31px; }
td select { min-height: 31px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; font-size: 10px; }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; }

.calendar-strip { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.calendar-day { min-width: 90px; display: grid; place-items: center; gap: 3px; min-height: 72px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; }
.calendar-day strong { color: var(--ink); font-size: 18px; }
.calendar-day.today { color: #fff; border-color: var(--brand); background: var(--brand); }
.calendar-day.today strong { color: #fff; }
.calendar-day small { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.calendar-day span { font-size: 9px; }
.timeline { display: grid; gap: 8px; }
.timeline-item { display: grid; grid-template-columns: 62px 5px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-time { font-size: 11px; font-weight: 800; }
.timeline-mark { width: 5px; height: 38px; border-radius: 3px; background: var(--brand-2); }
.timeline-item:nth-child(3n+2) .timeline-mark { background: var(--coral); }
.timeline-item:nth-child(3n+3) .timeline-mark { background: var(--gold); }
.timeline-detail strong, .timeline-detail small { display: block; }
.timeline-detail strong { font-size: 12px; }
.timeline-detail small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.settings-card.full { grid-column: 1 / -1; }
.settings-card h3 { margin: 0 0 4px; font-size: 14px; }
.settings-card > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.service-admin-list { display: grid; gap: 8px; }
.service-admin-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .7fr) minmax(120px, .6fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.service-admin-row.inactive { background: #f7f8fa; opacity: .68; }
.service-admin-info { min-width: 0; display: flex; align-items: center; gap: 10px; }
.service-admin-info > span:last-child { min-width: 0; }
.service-admin-info strong, .service-admin-info small, .service-admin-price strong, .service-admin-price small { display: block; }
.service-admin-info strong { font-size: 12px; }
.service-admin-info small, .service-admin-price small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.service-admin-price strong { color: var(--brand-deep); font-size: 15px; }
.service-admin-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.service-admin-actions { display: flex; justify-content: flex-end; gap: 5px; }
.billing-pill { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 4px; color: var(--brand); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.billing-pill.fixed { color: var(--brand-deep); background: var(--gold-soft); }
.catalog-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-summary span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #fff; font-size: 10px; }
.admin-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-link {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  gap: 10px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.admin-link:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.admin-link > span:nth-child(2) { min-width: 0; }
.admin-link strong, .admin-link small { display: block; }
.admin-link strong { font-size: 12px; }
.admin-link small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.price-list { display: grid; gap: 8px; }
.price-row { display: grid; grid-template-columns: 38px 1fr 95px; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.price-row .service-icon { width: 34px; height: 34px; }
.price-row strong, .price-row small { display: block; }
.price-row strong { font-size: 11px; }
.price-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.price-control { position: relative; }
.price-control input { width: 100%; padding-right: 38px; text-align: right; }
.price-control span { position: absolute; top: 50%; right: 9px; color: var(--muted); font-size: 9px; transform: translateY(-50%); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { min-width: 0; display: grid; gap: 5px; color: var(--ink); font-size: 11px; font-weight: 700; }
label > span { min-width: 0; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #a0aaa8; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.toggle { position: relative; display: block; width: 40px; height: 23px; flex: 0 0 auto; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { position: absolute; inset: 0; border-radius: 20px; background: #cfd8d6; transition: .2s; }
.toggle span::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.toggle input:checked + span { background: var(--brand-2); }
.toggle input:checked + span::after { transform: translateX(17px); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(11, 30, 29, .68);
  backdrop-filter: blur(5px);
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.22);
}
.booking-modal { width: min(850px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.modal-header h2 { margin: 3px 0 0; font-size: 18px; }
.form-section { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.form-section h3 { margin: 0 0 12px; font-size: 12px; }
.booking-service-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.booking-service-option input { position: absolute; opacity: 0; pointer-events: none; }
.booking-service-option span { min-height: 78px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font-size: 10px; text-align: center; cursor: pointer; }
.booking-service-option svg { color: var(--brand-2); }
.booking-service-option input:checked + span { color: var(--brand); border-color: var(--brand-2); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--brand-2); }
.payment-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-options input { position: absolute; opacity: 0; pointer-events: none; }
.payment-options span { min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); cursor: pointer; }
.payment-options input:checked + span { color: var(--brand); border-color: var(--brand-2); background: var(--teal-soft); }
.booking-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #f8faf9; }
.booking-total small, .booking-total strong { display: block; }
.booking-total small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.booking-total strong { margin-top: 3px; font-size: 11px; }
.booking-total .price { color: var(--brand); font-size: 22px; font-weight: 900; white-space: nowrap; }
.privacy-layer { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; margin: 14px 20px 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f8fbfd; }
.privacy-layer svg { color: var(--brand); }
.privacy-layer strong, .privacy-layer small { display: block; }
.privacy-layer strong { color: var(--ink); font-size: 10px; }
.privacy-layer small { margin-top: 3px; font-size: 9px; line-height: 1.55; }
.privacy-layer a, .payment-consent a, .demo-payment-note a { color: var(--brand); font-weight: 800; }
.privacy-acknowledgement { display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 8px; align-items: start; margin: 11px 20px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.privacy-acknowledgement input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--brand); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.payment-modal { width: min(900px, 100%); }
.notification-modal { width: min(650px, 100%); }
.notification-summary { display: flex; align-items: center; gap: 11px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.notification-summary strong, .notification-summary small { display: block; }
.notification-summary strong { font-size: 12px; }
.notification-summary small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.notification-list { display: grid; max-height: min(55vh, 500px); overflow-y: auto; }
.notification-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 8px;
  gap: 11px;
  align-items: start;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.notification-item:hover { background: #f8fbfd; }
.notification-item.unread { background: #fffaf0; }
.notification-item strong, .notification-item small, .notification-item time { display: block; }
.notification-item strong { font-size: 12px; }
.notification-item small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.notification-item time { margin-top: 6px; color: var(--brand); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.notification-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; color: var(--brand); background: var(--blue-soft); }
.notification-icon.rescheduled { color: var(--brand-deep); background: var(--gold-soft); }
.notification-icon.cancelled { color: var(--danger); background: #fff0f0; }
.notification-icon.confirmed, .notification-icon.completed { color: var(--brand); background: var(--blue-soft); }
.notification-icon.updated { color: var(--coral); background: var(--coral-soft); }
.unread-mark { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--coral); }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); }
.checkout-form { border-bottom: 0; border-right: 1px solid var(--line); }
.secure-payment-title { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.secure-payment-title strong, .secure-payment-title small { display: block; }
.secure-payment-title strong { font-size: 12px; }
.secure-payment-title small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.payment-security-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.security-badge { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 3px 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--brand); background: #f8fbfd; }
.security-badge svg { grid-row: 1 / span 2; width: 16px; height: 16px; }
.security-badge strong, .security-badge small { min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-badge strong { color: var(--ink); font-size: 8px; }
.security-badge small { color: var(--muted); font-size: 7px; }
.security-badge.pending { color: var(--coral); background: var(--coral-soft); }
.security-badge.verified { color: var(--brand); border-color: #a6dff3; background: var(--blue-soft); }
.card-type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
.card-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.card-type-switch span { min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.card-type-switch input:checked + span { color: var(--brand-deep); border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.card-number-field { position: relative; }
.card-number-field input { padding-right: 70px; }
.card-number-field > strong { position: absolute; right: 10px; bottom: 12px; color: var(--brand); font-size: 9px; text-transform: uppercase; }
.payment-consent { display: grid; grid-template-columns: 17px 1fr; gap: 8px; align-items: start; margin-top: 14px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.payment-consent input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--brand); }
.payment-error { min-height: 16px; margin: 10px 0 0; color: var(--danger); font-size: 10px; font-weight: 700; }
.checkout-summary { padding: 20px; background: var(--canvas); }
.checkout-summary h3 { margin: 0 0 15px; font-size: 13px; }
.checkout-summary .service-icon { margin-bottom: 10px; }
.checkout-summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.checkout-summary-line span:first-child { color: var(--muted); }
.checkout-summary-line strong { text-align: right; }
.checkout-summary-total { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; color: var(--brand-deep); font-size: 12px; }
.checkout-summary-total strong:last-child { color: var(--coral); font-size: 20px; }
.demo-payment-note { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin: 0 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f8fafc; font-size: 9px; line-height: 1.45; }
.demo-payment-note svg { color: var(--brand); }
.transaction-ref { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--brand); font-size: 8px; font-weight: 800; }

.receipt-sheet { margin: 18px 20px 0; padding: 24px; border: 1px solid var(--line); border-radius: 6px; }
.receipt-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--brand); }
.receipt-brand img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; }
.receipt-brand > div:first-child { display: flex; align-items: center; gap: 10px; }
.receipt-brand h3 { margin: 0; font-size: 20px; }
.receipt-brand p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.receipt-number { text-align: right; }
.receipt-number strong, .receipt-number small { display: block; }
.receipt-number strong { font-size: 12px; }
.receipt-number small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.receipt-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.receipt-parties small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.receipt-parties strong, .receipt-parties span { display: block; font-size: 10px; line-height: 1.55; }
.receipt-line { display: grid; grid-template-columns: 1fr 80px 90px; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.receipt-line strong, .receipt-line small { display: block; }
.receipt-line small { margin-top: 3px; color: var(--muted); }
.receipt-line .right { text-align: right; }
.receipt-total { display: flex; justify-content: flex-end; gap: 30px; padding: 17px 0; font-size: 12px; }
.receipt-total strong:last-child { color: var(--brand); font-size: 18px; }
.receipt-note { padding: 12px; border-radius: 5px; color: var(--muted); background: var(--canvas); font-size: 9px; line-height: 1.5; }

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  border-radius: 7px;
  color: #fff;
  background: var(--brand-deep);
  box-shadow: var(--shadow);
  font-size: 12px;
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}
.toast.show { transform: none; opacity: 1; }
.is-hidden { display: none !important; }
.bottom-nav { display: none; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: var(--canvas);
}
.auth-pending .app-shell, .auth-pending .bottom-nav { display: none; }
.auth-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--brand-deep); }
.auth-brand img { width: 58px; height: 58px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; }
.auth-brand span { display: grid; gap: 2px; }
.auth-brand strong { font-size: 23px; }
.auth-brand small { color: var(--muted); }
.auth-copy { margin: 25px 0 18px; }
.auth-copy h1 { margin: 5px 0 7px; font-size: 28px; letter-spacing: 0; }
.auth-copy p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-weight: 800; }
.auth-tabs button.active { color: var(--brand); background: #fff; box-shadow: 0 2px 8px rgba(50,50,100,.1); }
.auth-form { display: grid; gap: 14px; margin-top: 16px; }
.auth-form > label, .auth-form .form-grid label { display: grid; gap: 6px; color: var(--ink); font-weight: 750; }
.auth-form .primary-button { width: 100%; min-height: 46px; }
.auth-form > small { color: var(--muted); line-height: 1.5; text-align: center; }
.auth-consent { grid-template-columns: 18px minmax(0, 1fr) !important; align-items: start; font-weight: 500 !important; }
.auth-consent input { width: 17px; min-height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.auth-consent a { color: var(--brand); font-weight: 800; }
.auth-error { min-height: 20px; margin: 12px 0 -4px; color: var(--danger); font-weight: 750; line-height: 1.4; }
.mode-switch button.restricted { color: #8e96a6; }

/* Legibilidad reforzada en toda la aplicacion. */
body { font-size: 15px; }
button, input, select, textarea, label { font-size: 14px; }
small { font-size: 12px !important; line-height: 1.45; }
.nav-label, .topbar p, .eyebrow, .service-tag, .booking-total small, .receipt-parties small { font-size: 11px; }
.profile strong, .mode-switch button, .panel-header h3, .service-card h3, .form-section h3, .notification-item strong { font-size: 14px; }
.section-heading p, .welcome-band p, .service-card p, .payment-hero strong { font-size: 14px; }
.bottom-nav button { font-size: 11px; }
.legal-links a, .detail-item, .status, .booking-cell, table, th, td select,
.calendar-day small, .calendar-day span, .timeline-time, .billing-pill,
.catalog-summary span, .price-control span, .booking-service-option span,
.privacy-acknowledgement, .notification-item time, .security-badge strong,
.card-type-switch span, .card-number-field > strong, .payment-consent,
.payment-error, .checkout-summary-line, .demo-payment-note, .transaction-ref,
.receipt-parties strong, .receipt-parties span, .receipt-line, .receipt-note {
  font-size: 12px;
}
.notification-count { font-size: 10px; }

@media (max-width: 1120px) {
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { display: block; }
  .topbar { min-height: 68px; padding: 10px 16px; }
  .mobile-brand-logo { display: block; }
  .mobile-logout-button { display: inline-grid; }
  .topbar .compact { width: 38px; padding: 0; }
  .topbar .compact span { display: none; }
  .topbar h1 { font-size: 18px; }
  #appContent { padding: 18px 14px 92px; }
  .bottom-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    min-height: calc(66px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    padding: 8px 6px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(16px);
  }
  .bottom-nav button { min-width: 0; min-height: 48px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
  .bottom-nav button.active { color: var(--brand-2); }
  .bottom-nav .bottom-action { width: 46px; height: 46px; min-height: 46px; justify-self: center; margin-top: -26px; border: 4px solid var(--canvas); border-radius: 50%; color: #fff; background: var(--coral); box-shadow: 0 9px 22px rgba(239,127,26,.3); }
  .welcome-band { grid-template-columns: 1fr; min-height: 0; }
  .welcome-art { display: none; }
  .two-column { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.full { grid-column: auto; }
  .admin-link-grid { grid-template-columns: 1fr; }
  .service-admin-row { grid-template-columns: minmax(0, 1fr) auto; }
  .service-admin-price, .service-admin-meta { display: none; }
  .payment-hero { grid-template-columns: 42px 1fr; }
  .payment-hero .primary-button, .payment-hero .status { grid-column: 1 / -1; width: 100%; }
  .booking-row { grid-template-columns: minmax(160px, 1fr) auto; }
  .booking-row .booking-cell { display: none; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 8px 8px 0 0; }
  .booking-service-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-form { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .mode-switch button { padding: 0 7px; font-size: 12px; }
  .mobile-brand-logo { width: 36px; height: 36px; }
  .topbar-title { gap: 7px; }
  .topbar-title p { display: none; }
  .topbar-actions { gap: 4px; }
  .topbar .icon-button { display: none; }
  .topbar .notification-button { display: inline-grid; }
  .topbar .mobile-logout-button { display: inline-grid; }
  .topbar .compact { display: none; }
  .welcome-band { padding: 22px; }
  .welcome-band h2 { font-size: 25px; }
  .metric-grid { gap: 8px; }
  .metric-card { grid-template-columns: 32px 1fr; gap: 7px; padding: 12px 10px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-card strong { font-size: 17px; }
  .metric-card small { font-size: 9px; }
  .service-grid { gap: 8px; }
  .service-card { min-height: 164px; padding: 12px; }
  .section-heading { align-items: start; }
  .section-heading .actions .secondary-button span { display: none; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .booking-service-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-options { grid-template-columns: 1fr; }
  .payment-security-badges { grid-template-columns: 1fr; }
  .card-type-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-total { align-items: start; }
  .receipt-sheet { margin: 12px 12px 0; padding: 14px; }
  .receipt-brand, .receipt-parties { align-items: start; grid-template-columns: 1fr; }
  .receipt-brand { display: grid; }
  .receipt-number { text-align: left; }
  .receipt-line { grid-template-columns: 1fr 60px 70px; }
}

@media print {
  body * { visibility: hidden; }
  #receiptModal, #receiptModal *, #receiptContent, #receiptContent * { visibility: visible; }
  #receiptModal { position: absolute; inset: 0; display: block; padding: 0; background: #fff; }
  .receipt-modal { width: 100%; max-height: none; box-shadow: none; }
  .receipt-sheet { margin: 0; border: 0; }
  .no-print { display: none !important; }
}
