/* House of Salon 2.0 — minimal UI
   One neutral palette, one accent, quiet borders instead of shadows.
   Loaded after Bootstrap so these rules win. */

:root {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #FAFAF9;
  --line: #E7E6E2;
  --line-strong: #D6D5D0;
  --text: #18181B;
  --muted: #6B6B70;
  --subtle: #A1A1A6;
  --ink: #18181B;          /* primary buttons / active nav */
  --accent: #A07A45;       /* salon gold, used sparingly */
  --accent-soft: #F5EFE6;
  --pos: #15803D;  --pos-soft: #ECF7EF;
  --neg: #C2410C;  --neg-soft: #FDF1EA;
  --warn: #A16207; --warn-soft: #FBF5E4;
  --info: #1D4ED8; --info-soft: #EEF3FD;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45;
  margin: 0; display: flex; height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4, h5 { letter-spacing: -0.01em; }
.num, .stat-val, .table td { font-variant-numeric: tabular-nums; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.brand img { height: 28px; width: auto; }
.brand-name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--muted); line-height: 1.25; margin-top: 1px; }
.brand-ver { font-size: 10px; color: var(--accent); font-weight: 650; letter-spacing: .04em; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--subtle); margin: 16px 10px 4px; text-transform: none; letter-spacing: .02em; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; color: #3F3F46; text-decoration: none;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; position: relative; transition: background .12s;
}
.nav-link i { width: 16px; text-align: center; color: var(--subtle); font-size: 13px; }
.nav-link:hover { background: #F2F2EF; color: var(--text); }
.nav-link.active { background: #EFEEEA; color: var(--text); font-weight: 600; }
.nav-link.active i { color: var(--text); }
.nav-link .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neg); margin-left: auto; }
.nav-link.danger { color: var(--neg); } .nav-link.danger i { color: var(--neg); }
.nav-link.gold, .nav-link.gold i { color: var(--accent); }
.nav-new { margin-left: auto; font-size: 9.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 99px; }

/* ── Main ────────────────────────────────────────────── */
.main { flex: 1; padding: 28px 32px 60px; overflow-y: auto; min-width: 0; }
.header-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 650; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Cards ───────────────────────────────────────────── */
.glass-card, .card-x {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: none;
}
.card-title { font-size: 14px; font-weight: 650; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card-title .muted { font-weight: 500; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; height: 100%; display: flex; flex-direction: column; justify-content: center; position: relative; box-shadow: none;
}
.stat-icon { position: absolute; top: 16px; right: 16px; font-size: 14px; color: var(--subtle) !important; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; text-transform: none; letter-spacing: 0; }
.stat-val { font-size: 24px; font-weight: 650; color: var(--text); letter-spacing: -0.02em; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.callout { border-radius: var(--radius); padding: 12px 16px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.callout i { margin-top: 2px; }
.callout.info { background: var(--info-soft); border-color: #D7E2FB; }
.callout.warn { background: var(--warn-soft); border-color: #F0E2B8; }
.callout.neg  { background: var(--neg-soft); border-color: #F6D6C4; }
.callout.pos  { background: var(--pos-soft); border-color: #CBE8D3; }

/* ── Tables ──────────────────────────────────────────── */
.table { margin: 0; color: var(--text); --bs-table-bg: transparent; }
.table th {
  border-bottom: 1px solid var(--line) !important; font-size: 11.5px; font-weight: 600; text-transform: none;
  color: var(--muted); padding: 10px 12px; background: transparent; white-space: nowrap;
}
.table td { border-bottom: 1px solid #F0EFEC; padding: 10px 12px; font-size: 13.5px; vertical-align: middle; }
.table tbody tr:hover td { background: #FBFBFA; }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot td { border-top: 1px solid var(--line); font-weight: 650; background: var(--surface-2); }
.table .r, .r { text-align: right; }
.table-wrap { overflow-x: auto; margin: -4px -8px; padding: 0 8px; }
.group-row td { background: var(--surface-2) !important; font-size: 11px; font-weight: 650; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; padding: 7px 12px; }

/* ── Badges ──────────────────────────────────────────── */
.status-badge { padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 4px; line-height: 1.6; white-space: nowrap; }
.bg-blue   { background: var(--info-soft) !important; color: var(--info) !important; }
.bg-green  { background: var(--pos-soft) !important;  color: var(--pos) !important; }
.bg-red    { background: var(--neg-soft) !important;  color: var(--neg) !important; }
.bg-orange { background: var(--warn-soft) !important; color: var(--warn) !important; }
.bg-gray   { background: #F1F1EE !important; color: #52525B !important; }
.bg-gold   { background: var(--accent-soft) !important; color: var(--accent) !important; }
.text-success { color: var(--pos) !important; } .text-danger { color: var(--neg) !important; }
.text-orange { color: var(--warn) !important; } .text-primary { color: var(--info) !important; }
.text-muted, .muted { color: var(--muted) !important; }
.small-muted { font-size: 12px; color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────── */
.btn-black, .btn-ink {
  background: var(--ink); color: #fff !important; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn-black:hover { background: #000; }
.btn-ghost, .btn-light {
  background: var(--surface) !important; color: var(--text) !important; padding: 8px 14px; border-radius: var(--radius-sm) !important; border: 1px solid var(--line-strong) !important;
  font-size: 13px; font-weight: 550; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn-ghost:hover, .btn-light:hover { background: #F4F4F2 !important; }
.btn-sm-x { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: #52525B; cursor: pointer; text-decoration: none; margin-right: 3px;
  font-size: 12.5px; transition: background .12s, border-color .12s; vertical-align: middle;
}
.btn-icon:hover { background: #F4F4F2; border-color: var(--line-strong); }
.actions { white-space: nowrap; }

/* ── Segmented filter ───────────────────────────────── */
.filter-group { display: inline-flex; gap: 2px; background: #EFEEEA; padding: 3px; border-radius: 9px; border: none; flex-wrap: wrap; }
.filter-btn { border: none; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 550; color: #52525B; cursor: pointer; text-decoration: none; line-height: 1.4; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ── Forms ───────────────────────────────────────────── */
.form-control, .form-select, select.form-control {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: 13.5px; background: var(--surface); color: var(--text); box-shadow: none; min-height: 36px;
}
.form-control:focus, .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.08); outline: none; }
.form-control.inline { margin: 0; width: auto; }
label.small, .lbl { font-size: 12px !important; font-weight: 550 !important; color: var(--muted) !important; margin-bottom: 4px; display: block; }
.field-row { display: flex; gap: 10px; } .field-row > * { flex: 1; min-width: 0; }

/* ── Modals ──────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(24,24,27,.38); z-index: 999; overflow-y: auto; padding: 40px 16px; }
.modal-box { background: var(--surface); width: 100%; max-width: 460px; margin: 0 auto; padding: 22px 22px 18px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.modal-box h3 { font-size: 17px; font-weight: 650; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; } .modal-actions > * { flex: 1; justify-content: center; }

/* ── Progress ────────────────────────────────────────── */
.bar { height: 6px; background: #EFEEEA; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar.pos > span { background: var(--pos); } .bar.gold > span { background: var(--accent); }

/* ── Key/value list ─────────────────────────────────── */
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #ECEBE7; font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); } .kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv.total { border-top: 1px solid var(--text); border-bottom: none; margin-top: 4px; padding-top: 9px; font-size: 15px; }
.kv.total .k { color: var(--text); font-weight: 650; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty i { font-size: 30px; color: var(--line-strong); display: block; margin-bottom: 12px; }
.empty h4 { font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: 4px; }

.row-highlight td { background: #FFFBEB !important; }
.mobile-header { display: none; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 860px) {
  body { flex-direction: column; overflow-y: auto; height: auto; min-height: 100vh; }
  .mobile-header {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100;
  }
  .mobile-header .brand-name { display: flex; align-items: center; gap: 8px; }
  .sidebar { width: 100%; max-height: 0; overflow: hidden; padding: 0 12px; border: none; transition: max-height .3s ease; }
  .sidebar.open { max-height: 1200px; padding: 12px; border-bottom: 1px solid var(--line); }
  .sidebar .brand { display: none; }
  .main { padding: 18px 16px 60px; overflow: visible; }
  .header-row { align-items: flex-start; }
  .glass-card { padding: 14px; }
  .glass-card:has(> .table), .glass-card.scroll-x { overflow-x: auto; }
  .stat-val { font-size: 20px; }
}

/* ── Print (daily closing, reports) ─────────────────── */
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; font-size: 12px; }
  .sidebar, .mobile-header, .no-print, .btn-black, .btn-ghost, .btn-icon, .filter-group, .toolbar form, .modal-overlay { display: none !important; }
  .main { padding: 0; overflow: visible; }
  .glass-card, .stat-card { border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  a { text-decoration: none; }
}
.print-only { display: none; }
