/* MGrace polish layer: calmer, tighter dashboard look (Stripe / Linear feel). Loaded after mgrace.css. */
.dash {
  --p-radius: 14px; --p-line: color-mix(in srgb, var(--line-2) 55%, transparent);
  --p-shadow: 0 1px 2px rgba(10, 18, 51, .05), 0 0 0 1px var(--p-line);
}
html[data-theme="dark"] .dash { --p-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px var(--line); --p-line: var(--line); }

/* Page header */
.dash .topbar { margin-bottom: 24px; align-items: flex-end; }
.dash .topbar h1 { font-size: clamp(26px, 2.2vw, 32px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.dash .topbar .text-sub { font-size: 14px; max-width: 62ch; }
.dash .appdate { font-size: 10.5px; letter-spacing: .16em; margin-bottom: 8px; }

/* Cards, tables, KPIs: flatter, thinner borders, smaller radius */
.dash .card { border-radius: var(--p-radius); box-shadow: var(--p-shadow); padding: 20px; }
.dash .kpi { border-radius: var(--p-radius); box-shadow: var(--p-shadow); padding: 18px 20px; gap: 6px; }
.dash .kpi .serif { font-size: 28px; letter-spacing: -.03em; }
.dash .kpi .cap { font-size: 10.5px; letter-spacing: .06em; text-transform: none; font-weight: 600; color: var(--sub); }
.dash .table-wrap { border-radius: var(--p-radius); box-shadow: var(--p-shadow); background: var(--card); }
.dash .table { border-radius: 0; font-size: 13.5px; }
.dash .table th { padding: 11px 16px; font-size: 11px; letter-spacing: .04em; text-transform: none; font-weight: 600; color: var(--sub); background: var(--surface); border-bottom: 1px solid var(--line); }
.dash .table td { padding: 14px 16px; border-top: 1px solid var(--line); }
.dash .table tbody tr:first-child td { border-top: 0; }
.dash .table tbody tr:hover td { background: var(--surface-hover); }
.dash .table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Buttons: compact, squarer, quieter */
.dash .btn { min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; gap: 8px; }
.dash .btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.dash .btn-lg { min-height: 46px; padding: 0 22px; }
.dash .btn-navy, .dash .btn-gold { box-shadow: 0 1px 2px rgba(10, 18, 51, .18); }
.dash .btn-outline { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--card); }
.dash .btn-ghost { background: transparent; color: var(--sub); box-shadow: none; }
.dash .btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

/* Forms */
.dash .field { gap: 6px; }
.dash .field label, .dash .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.dash .field .hint { font-size: 12px; color: var(--sub); }
.dash .input { min-height: 40px; border-radius: 10px; padding: 8px 12px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line-2); }
.dash .input:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--gold) 28%, transparent); }
.dash textarea.input { min-height: 90px; }
.dash select.input { appearance: none; padding-right: 34px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A8F9E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; }

/* Chips: a touch smaller */
.dash .chip { height: 22px; padding: 0 9px; font-size: 11.5px; font-weight: 600; }
.chip--live { background: var(--ok-bg); color: var(--ok-fg); }
.chip--paused { background: var(--neutral-bg); color: var(--neutral-fg); }
.chip--ended { background: var(--bad-bg); color: var(--bad-fg); }
.chip--soon { background: var(--info-bg); color: var(--info-fg); }

/* Summary strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--p-radius, 14px); box-shadow: var(--p-shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat > span { font-size: 12.5px; font-weight: 600; color: var(--sub); }
.stat > b { font-family: var(--serif); font-size: 26px; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat > small { font-size: 12px; color: var(--faint); }

/* Panel: a titled block holding a table */
.panel { background: var(--card); border-radius: var(--p-radius, 14px); box-shadow: var(--p-shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.panel-head small { color: var(--sub); font-size: 12.5px; }
.panel .table-wrap { box-shadow: none; border-radius: 0; }
.panel .table th:first-child, .panel .table td:first-child { padding-left: 16px; }
.panel .table th:last-child, .panel .table td:last-child { padding-right: 16px; }

/* Code ticket + usage meter */
.code-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--gold-bg); color: var(--gold-fg); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; border: 1px dashed color-mix(in srgb, var(--gold-deep) 55%, transparent); }
.cell-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--sub); }
.meter { width: 120px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.meter.full > i { background: var(--disputed); }
.empty-state { padding: 44px 20px; text-align: center; color: var(--sub); }
.empty-state b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Slide-in drawer (native <dialog>) */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--card); color: var(--ink); box-shadow: -24px 0 60px -20px rgba(10, 18, 51, .35); animation: drawer-in .22s ease-out; }
dialog.drawer::backdrop { background: rgba(10, 18, 51, .45); backdrop-filter: blur(2px); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.drawer-head p { margin: 4px 0 0; font-size: 13px; color: var(--sub); }
.drawer-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; height: calc(100dvh - 160px); }
.drawer-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--card); display: flex; gap: 10px; justify-content: flex-end; }
.drawer .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer .check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.drawer .check input { accent-color: var(--navy); width: 16px; height: 16px; }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer { animation: none; } }

/* ---- Round 2: shared patterns used across many pages ---- */
.dash .main { padding-top: 32px; max-width: 1480px; }
.dash .topbar h1 em, .dash .topbar h1 .gold { color: inherit; }
.dash h2.serif, .dash .card h2, .dash .card h3 { letter-spacing: -.02em; }
.dash .card .serif { letter-spacing: -.025em; }
.dash .card-navy { border-radius: var(--p-radius); padding: 22px; }
.dash .small { font-size: 13px; }
.dash .text-sub { color: var(--sub); }
.dash .link-gold { color: var(--gold-text); font-weight: 600; text-underline-offset: 3px; }
.dash .link-gold:hover { text-decoration: underline; }
.dash .error { color: var(--danger); font-size: 12.5px; font-weight: 500; }

/* Filter tabs: segmented control */
.dash nav.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px !important; border-radius: 11px; background: var(--surface-2); flex-wrap: wrap; max-width: 100%; }
.dash nav.seg > .btn { min-height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13px; background: transparent; color: var(--sub); box-shadow: none; }
.dash nav.seg > .btn:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 55%, transparent); }
.dash nav.seg > .btn-navy { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(10, 18, 51, .12), 0 0 0 1px var(--p-line); }

/* Filter pills inside search forms */
.dash form.row > .btn-sm { border-radius: 8px; }
.dash form.row > .btn-outline { box-shadow: inset 0 0 0 1px var(--line-2); }

/* Empty states */
.dash .empty { text-align: center; padding: 40px 20px; color: var(--sub); font-size: 14px; }
.dash .empty .serif { display: block; font-size: 18px; color: var(--ink); margin-bottom: 4px; }

/* Pagination */
.dash nav[role="navigation"] { margin-top: 16px; font-size: 13px; }
.dash nav[role="navigation"] svg { width: 16px; height: 16px; display: inline; }
.dash nav[role="navigation"] a, .dash nav[role="navigation"] span[aria-current] > span { border-radius: 8px !important; }

/* Sidebar: tighter and calmer */
.dash .side nav a { border-radius: 9px; font-size: 14px; font-weight: 500; padding-top: 9px; padding-bottom: 9px; }
.dash .side nav a.active { background: rgba(233, 199, 102, .13); box-shadow: none; color: var(--gold-t); }
.dash .side .side-group { font-size: 10.5px; letter-spacing: .12em; opacity: .6; margin-top: 14px; }

/* Details/summary and notices */
.dash details > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.dash .notice, .dash .flash, .dash .status { border-radius: 10px; }

/* Entrance: subtle, respects reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .dash .main > * { animation: p-rise .32s ease-out both; }
  .dash .main > *:nth-child(2) { animation-delay: .04s; } .dash .main > *:nth-child(3) { animation-delay: .08s; } .dash .main > *:nth-child(n+4) { animation-delay: .12s; }
}
@keyframes p-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mobile */
@media (max-width: 700px) {
  .dash .main { padding-left: 16px; padding-right: 16px; }
  .dash .topbar { gap: 14px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .drawer-body { height: calc(100dvh - 170px); }
}

/* ---- Booking page (customer) ---- */
.bk-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); margin-bottom: 14px; }
.bk-crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.bk-crumb svg { transform: rotate(-90deg); opacity: .55; }
.bk-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 24px 26px; margin-bottom: 20px; border-radius: 18px; background: var(--card); box-shadow: var(--p-shadow); position: relative; overflow: hidden; }
.bk-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), transparent 70%); }
.bk-hero h1 { margin: 0; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.03em; line-height: 1.1; }
.bk-hero .bk-units { font-size: .55em; color: var(--sub); font-weight: 600; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.bk-meta li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; color: var(--ink); }
.bk-meta svg { color: var(--gold-text); }
.bk-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.bk-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.bk-total small { font-size: 12px; color: var(--sub); font-weight: 600; }
.bk-total b { font-family: var(--serif); font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.bk-side { gap: 20px; position: sticky; top: 20px; }
.bk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack.gap-20 { gap: 20px; }
@media (max-width: 1100px) { .bk-grid { grid-template-columns: 1fr; } .bk-side { position: static; } }
@media (max-width: 760px) { .bk-two { grid-template-columns: 1fr; } .bk-hero { padding: 20px; } .bk-hero-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; } .bk-total { align-items: flex-end; } }

.bk-card { padding: 22px; }
.bk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.bk-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.bk-sub, .bk-step { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.bk-step { padding: 4px 10px; border-radius: 999px; background: var(--gold-bg); color: var(--gold-fg); font-weight: 600; }

/* stepper */
.dash .progress { margin: 8px 0 0; }
.dash .progress li { font-size: 12.5px; }
.dash .progress li::after { top: 13px; height: 2px; }
.dash .progress .pdot { width: 26px; height: 26px; }
.dash .progress .now .pdot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 30%, transparent); }
.bk-card details { margin-top: 18px !important; padding-top: 14px; border-top: 1px solid var(--line); }

/* payment lines */
.bk-lines { margin: 0; display: flex; flex-direction: column; }
.bk-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.bk-lines dt { color: var(--sub); } .bk-lines dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.bk-lines .ok { color: var(--ok-fg); }
.bk-sum { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; }
.bk-sum span { font-weight: 600; }
.bk-sum b { font-family: var(--serif); font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bk-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--sub); }
.bk-note svg { flex: none; color: var(--gold-text); margin-top: 1px; }

/* payment timeline */
.bk-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.bk-tl li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding-bottom: 18px; position: relative; }
.bk-tl li:last-child { padding-bottom: 0; }
.bk-tl li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.bk-tl li:last-child::before { display: none; }
.bk-tl-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--card); box-shadow: inset 0 0 0 3px var(--gold); position: relative; z-index: 1; }
.bk-tl-body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.bk-tl-body b { font-weight: 600; }
.bk-tl-body time { font-size: 11.5px; color: var(--faint); }
.bk-tl-amt { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* facts */
.bk-facts { margin: 0; }
.bk-facts > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.bk-facts > div:first-child { border-top: 0; padding-top: 0; }
.bk-facts dt { color: var(--sub); } .bk-facts dd { margin: 0; font-weight: 500; word-break: break-word; }

/* calmer notice panel + share card */
.dash .panel-gold { border-radius: 12px; font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--gold-deep) 22%, transparent); }
#share-visit { padding: 18px 20px; }
#share-visit p { max-width: 60ch; }

/* Announcement banners: slim, calm, on brand */
.banner { gap: 12px; min-height: 42px; padding: 9px 52px 9px 20px; font-size: 13.5px; line-height: 1.45; letter-spacing: .005em; background: var(--navy); color: rgba(245, 238, 220, .92); box-shadow: inset 0 -1px 0 rgba(233, 199, 102, .35); }
.banner p { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; }
.banner b { font-weight: 700; color: #E9C766; }
.banner span { margin: 0; opacity: .92; }
.banner a { margin: 0; padding: 3px 12px; border-radius: 999px; background: #E9C766; color: #0A1233; font-size: 12.5px; text-decoration: none; transition: background .15s; }
.banner a:hover { background: #F2D78E; }
.banner-x { right: 10px; width: 28px; height: 28px; font-size: 18px; opacity: .75; transition: opacity .15s, background .15s; }
.banner-x:hover, .banner-x:focus-visible { opacity: 1; background: rgba(127, 127, 127, .22); }
.banner--promo { background: linear-gradient(90deg, #E1BC5A, #EDD27C 50%, #E1BC5A); color: #0A1233; box-shadow: inset 0 -1px 0 rgba(10, 18, 51, .12); }
.banner--promo b { color: #0A1233; }
.banner--promo a { background: #0A1233; color: #E9C766; }
.banner--promo a:hover { background: #13204F; }
.banner--warning { background: #FFF6E0; color: #5C4208; box-shadow: inset 0 -1px 0 #EBD59A; }
.banner--warning b { color: #7A4E04; }
.banner--warning p::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; background: #C98A12; color: #fff; font: 800 12px/1 var(--sans, sans-serif); }
.banner--warning a { background: #7A4E04; color: #fff; }
.banner--warning a:hover { background: #5C3A03; }
html[data-theme="dark"] .banner--warning { background: #3A2F14; color: #F2D78E; box-shadow: inset 0 -1px 0 rgba(233, 199, 102, .3); }
html[data-theme="dark"] .banner--warning b { color: #F5C451; }
html[data-theme="dark"] .banner--warning a { background: #E9C766; color: #0A1233; }
html[data-theme="dark"] .banner--promo { background: linear-gradient(90deg, #3A3220, #4A3F26 50%, #3A3220); color: #F2D78E; }
html[data-theme="dark"] .banner--promo b { color: #F2D78E; }
html[data-theme="dark"] .banner--promo a { background: #E9C766; color: #0A1233; }
@media (max-width: 640px) { .banner { padding: 9px 44px 9px 14px; font-size: 13px; } .banner p { justify-content: flex-start; text-align: left; } }
