/* =========================================================
   BUTTONS
   Two families:
   - .btn      functional app buttons (ink-filled, thin gold hairline, subtle sheen — never a flat gold gradient)
   - .link-cta marketing CTAs on the public site (text + animated underline, Direction A style)
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--touch-min); padding: 0 var(--space-lg);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; position: relative;
}
.btn-primary {
  background: var(--text); color: var(--text-on-ink); border-color: var(--gold-mid);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { border-color: var(--gold-light); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--gold-mid); color: var(--gold-text); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); text-decoration: underline; }
.btn-danger { background: transparent; color: var(--status-error); border-color: var(--status-error); }
.btn-danger:hover { background: var(--status-error-bg); }
.btn-sm { min-height: 36px; padding: 0 var(--space-md); font-size: var(--text-xs); }
.btn-icon { width: var(--touch-min); height: var(--touch-min); padding: 0; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* thin sheen sweep on hover/focus — restrained, not a filled gradient */
.gold-sheen { position: relative; overflow: hidden; }
.gold-sheen::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(216,190,132,0.45) 50%, transparent 65%);
  transform: translateX(-130%); pointer-events: none;
}
.gold-sheen:hover::after, .gold-sheen:focus-visible::after { animation: sheenSweep 0.9s var(--ease-standard); }

.link-cta {
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); display: inline-flex; align-items: center; gap: var(--space-sm);
}
.link-cta::after { content: ''; display: block; width: 26px; height: 1px; background: var(--gold-mid); transition: width var(--dur-base) var(--ease-out); }
.link-cta:hover::after { width: 42px; }
.link-cta-secondary {
  font-size: var(--text-sm); font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong); padding-bottom: 2px;
}
.link-cta-secondary:hover { color: var(--text); border-color: var(--gold-mid); }

/* =========================================================
   FORMS
   ========================================================= */
.field { margin-bottom: var(--space-md); }
.field label {
  display: block; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--space-2xs);
}
.input, .select, textarea.input {
  width: 100%; min-height: var(--touch-min); padding: 0 var(--space-md);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-raised); color: var(--text);
  font-family: var(--font-sans); font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
textarea.input { min-height: 96px; padding: var(--space-sm) var(--space-md); resize: vertical; }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus-visible, .select:focus-visible { border-color: var(--gold-mid); }
.field-hint { font-size: var(--text-xs); color: var(--text-faint); margin-top: var(--space-2xs); }
.field-error { font-size: var(--text-xs); color: var(--status-error); margin-top: var(--space-2xs); display: flex; gap: var(--space-2xs); align-items: center; }
.field.has-error .input { border-color: var(--status-error); }

.radio-card, .check-card {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: var(--space-xs);
}
.radio-card:hover, .check-card:hover { border-color: var(--border-strong); }
.radio-card.is-selected, .check-card.is-selected { border-color: var(--gold-mid); box-shadow: 0 0 0 1px var(--gold-mid) inset; background: var(--status-completed-bg); }

.toggle {
  position: relative; width: 44px; height: 26px; border-radius: var(--radius-pill);
  background: var(--border-strong); cursor: pointer; border: none; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface-raised); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring);
}
.toggle.is-on { background: var(--gold-mid); }
.toggle.is-on::after { transform: translateX(18px); }

/* =========================================================
   CARDS — hairline border, minimal shadow; elevation comes from the border, not a drop shadow
   ========================================================= */
.card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-lg); }
.card-hover { transition: border-color var(--dur-base) var(--ease-out); }
.card-hover:hover { border-color: var(--gold-mid); }

.stat-card { position: relative; }
.stat-card .stat-value { font-family: var(--font-display); font-weight: 500; font-size: var(--text-3xl); color: var(--text); margin: var(--space-2xs) 0; }
.stat-card .stat-delta { font-size: var(--text-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--status-confirmed); }
.stat-delta.down { color: var(--status-error); }
.stat-delta.down .icon { transform: scaleY(-1); }

/* =========================================================
   STATUS — square swatch + tracked-caps label (never a filled pill chip, never colour alone)
   ========================================================= */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.03em; }
.status i.sw { width: 7px; height: 7px; display: inline-block; flex-shrink: 0; }
.status-held { color: var(--status-held); } .status-held i { background: var(--status-held); }
.status-confirmed { color: var(--status-confirmed); } .status-confirmed i { background: var(--status-confirmed); }
.status-inservice { color: var(--status-inservice); } .status-inservice i { background: var(--status-inservice); }
.status-completed { color: var(--status-completed); } .status-completed i { background: var(--status-completed); }
.status-forfeited { color: var(--status-forfeited); } .status-forfeited i { background: var(--status-forfeited); }
.status-cancelled { color: var(--status-cancelled); } .status-cancelled i { background: var(--status-cancelled); }
.status-warning { color: var(--status-warning); } .status-warning i { background: var(--status-warning); }
.status-error { color: var(--status-error); } .status-error i { background: var(--status-error); }
.status-pending { color: var(--status-pending); } .status-pending i { background: var(--status-pending); }
.status-verbal { color: var(--status-verbal); } .status-verbal i { background: var(--status-verbal); }

/* compact badge variant, for tables */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border: 1px solid currentColor; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 700;
}

/* =========================================================
   TABLES
   ========================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  text-align: left; padding: var(--space-sm) var(--space-md); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.data-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface); }

/* =========================================================
   NAV / HEADER (public)
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--space-sm); flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; gap: var(--space-xl); align-items: center; }
.nav-links a { color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); border-color: var(--gold-mid); }
.nav-actions { display: flex; gap: var(--space-sm); align-items: center; }
.nav-toggle {
  display: none; width: var(--touch-min); height: var(--touch-min); align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text); cursor: pointer;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--gold-text); cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--surface-raised); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    padding: var(--space-sm) var(--space-lg) var(--space-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
  }
  .nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { width: 100%; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .nav-actions { gap: var(--space-2xs); }
  .nav-actions .btn-sm { padding: 0 var(--space-sm); font-size: 11px; }
}

/* =========================================================
   APP SIDEBAR
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 236px; background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md); display: flex; flex-direction: column; gap: var(--space-2xs); flex-shrink: 0;
}
.app-sidebar a {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: var(--text-sm); font-weight: 600;
}
.app-sidebar a:hover { color: var(--text); }
.app-sidebar a.is-active { color: var(--gold-text); border-bottom: 1px solid var(--gold-mid); border-radius: 0; }
.app-main { flex: 1; min-width: 0; padding: var(--space-lg); }

/* =========================================================
   TOASTS
   ========================================================= */
.toast-stack { position: fixed; bottom: var(--space-lg); right: var(--space-lg); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-sm); }
.toast {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  background: var(--surface-raised); border: 1px solid var(--border); border-left: 3px solid var(--gold-mid);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: var(--space-sm) var(--space-md); min-width: 280px; max-width: 360px; font-size: var(--text-sm);
}
.toast.toast-success { border-left-color: var(--status-confirmed); }
.toast.toast-error { border-left-color: var(--status-error); }
.toast.toast-warning { border-left-color: var(--status-warning); }

/* =========================================================
   MODAL / DRAWER / SHEET chrome
   ========================================================= */
.backdrop { position: fixed; inset: 0; background: rgba(20, 17, 11, 0.5); opacity: 0; transition: opacity var(--dur-base) var(--ease-standard); pointer-events: none; z-index: var(--z-modal); }
.backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  background: var(--surface-raised); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-spring);
  z-index: var(--z-drawer); display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(0.96); opacity: 0; pointer-events: none;
  transition: transform var(--dur-base) var(--ease-spring), opacity var(--dur-base) var(--ease-standard);
  z-index: var(--z-modal); width: min(520px, 92vw);
}
.modal.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

/* bottom sheet — the approver pop-up and confirm/dispute prompt */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  max-width: 440px; margin: 0 auto 0; width: 100%;
  background: var(--surface-raised); border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform var(--dur-slow) var(--ease-spring);
}
.sheet.is-open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; background: var(--border-strong); border-radius: var(--radius-pill); margin: var(--space-sm) auto; }
@media (min-width: 640px) {
  .sheet { right: var(--space-lg); left: auto; bottom: var(--space-lg); border-radius: var(--radius-lg); border-bottom: 1px solid var(--border); transform: translateY(calc(100% + var(--space-lg))); }
  .sheet.is-open { transform: translateY(0); }
}

.drawer-header, .modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--space-lg); overflow-y: auto; flex: 1; }
.drawer-footer, .modal-footer { padding: var(--space-lg); border-top: 1px solid var(--border); display: flex; gap: var(--space-sm); justify-content: flex-end; }
.modal-card { background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-body { padding: var(--space-lg); }

/* =========================================================
   EMPTY / ERROR / LOADING STATES
   ========================================================= */
.state-block { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-3xl) var(--space-lg); color: var(--text-muted); gap: var(--space-sm); }
.state-block .icon-lg { width: 40px; height: 40px; color: var(--gold-mid); margin-bottom: var(--space-sm); }

/* =========================================================
   MISC — hexagon used only as a rare accent (avatar mask, small divider, loading mark)
   ========================================================= */
.divider-hex { display: flex; justify-content: center; align-items: center; gap: var(--space-sm); color: var(--gold-mid); margin: var(--space-2xl) 0; }
.divider-hex::before, .divider-hex::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--border-strong)); }
.divider-hex::after { background: linear-gradient(90deg, var(--border-strong), transparent); }

.tabs { display: flex; gap: var(--space-xs); border-bottom: 1px solid var(--border); }
.tab { padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab.is-active { color: var(--gold-text); border-bottom-color: var(--gold-mid); }

.hex-avatar { width: 36px; height: 36px; flex-shrink: 0; position: relative; }
.hex-avatar svg.frame { width: 100%; height: 100%; }
.hex-avatar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-on-ink); font-family: var(--font-sans); }

.progress-track { height: 4px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold-mid); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-out); }

/* dotted price leader — the spa-menu price list */
.menu-row { display: flex; align-items: baseline; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
.menu-row .name { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); color: var(--text); white-space: nowrap; }
.menu-row .leader { flex: 1; border-bottom: 1px dotted var(--border-strong); position: relative; top: -5px; min-width: 20px; }
.menu-row .price { font-size: var(--text-sm); font-weight: 600; color: var(--text); white-space: nowrap; }
