:root {
  --bg: #0B0E13; --nav: #11151C; --card: #161B23; --card2: #1B212B; --card3: #232A35; --inset: #0E1217;
  --text: #F2F4F7; --muted: #9AA3B2; --soft: #B7BFCC;
  --amber: #F5B544; --amber-d: #A7741A; --amber-text: #1A1206;
  --green: #34D399; --green-d: #1B8A60; --green-text: #04170E; --green-soft: #6EE7A8;
  --red: #FF7A7F; --red-d: #A8333A; --red-text: #2A0A0B;
  --blue: #3B82F6;
  --edge: #0A0D12;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--amber); }
h1, h2, h3, p { margin: 0; }
.ico { display: inline-flex; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidenav {
  width: 92px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0;
  background: var(--nav); box-shadow: inset -1px 0 0 rgba(255,255,255,.05), 8px 0 30px rgba(0,0,0,.35);
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.pole {
  width: 44px; height: 64px; border-radius: 22px; margin-bottom: 14px;
  background: repeating-linear-gradient(135deg, #E5484D 0 9px, #F2F4F7 9px 18px, #3B82F6 18px 27px, #F2F4F7 27px 36px);
  box-shadow: inset -10px 0 14px rgba(0,0,0,.45), inset 8px 0 10px rgba(255,255,255,.35), 0 12px 20px rgba(0,0,0,.55);
}
.navlink {
  width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; border: 0;
  color: var(--muted); background: #1A1F28; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 0 #07090C;
}
.navlink .lbl { display: none; }
.navlink.active { color: var(--amber-text); background: var(--amber); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 5px 0 var(--amber-d), 0 12px 20px rgba(245,181,68,.25); }
.nav-spacer { flex: 1; }
.main { flex: 1; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 899px) {
  .app { flex-direction: column; }
  .sidenav {
    order: 2; position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: auto; height: auto; flex-direction: row; justify-content: space-around;
    gap: 0; padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 -10px 30px rgba(0,0,0,.45); z-index: 20;
  }
  .pole, .nav-spacer { display: none; }
  .navlink { width: auto; flex: 1; height: 56px; flex-direction: column; gap: 3px; background: transparent; box-shadow: none; border-radius: 14px; font-size: 11px; font-weight: 600; margin: 0 2px; }
  .navlink .lbl { display: block; }
  .navlink.active { background: transparent; color: var(--amber); box-shadow: none; }
  .navlink.active .ico { background: var(--amber); color: var(--amber-text); border-radius: 12px; padding: 4px 14px; box-shadow: 0 3px 0 var(--amber-d); }
  .main { padding: calc(18px + env(safe-area-inset-top)) 16px 110px; }
}

/* ---------- header ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { font-size: 13px; color: var(--muted); font-weight: 500; display: block; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; }
.pill-short { display: none; }
@media (max-width: 899px) {
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 24px; }
  .page-head .grow { flex: 1 1 150px; min-width: 150px; }
  .pill.role { display: none; }
  .pill-full { display: none; }
  .pill-short { display: inline; }
  .pill { padding: 8px 12px; }
}
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 0; background: #161B23; }
.pill.ok { background: #121A16; color: var(--green-soft); box-shadow: 0 0 0 1px rgba(110,231,168,.18); }
.pill.warn { background: rgba(245,181,68,.14); color: #FFC56B; box-shadow: 0 0 0 1px rgba(245,181,68,.35); }
.pill.role { padding: 5px 14px 5px 5px; }
.pill.role b { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--amber); color: var(--amber-text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.icon-btn { width: 46px; height: 46px; border-radius: 15px; border: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: #1A1F28; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 0 #07090C; text-decoration: none; flex-shrink: 0; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 24px 50px -22px rgba(0,0,0,.85), 0 2px 6px rgba(0,0,0,.5); }
.card.flat { background: #141920; }
.card h2 { font-size: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--card2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 0 var(--edge); text-decoration: none; color: var(--text); }
.item .grow > b { display: block; font-size: 15px; }
.item .grow > span { font-size: 13px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: #0B0E13; box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.35); }
.avatar.round { border-radius: 50%; }
.avatar.lg { width: 84px; height: 84px; border-radius: 28px; font-size: 36px; }
.avatar.photo { object-fit: cover; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; }
.tag.free { color: var(--green-soft); background: rgba(52,211,153,.14); }
.tag.busy { color: #FFC56B; background: rgba(245,181,68,.14); }
.tag.off { color: var(--soft); background: rgba(154,163,178,.14); }
.tag.time { color: var(--amber); background: rgba(245,181,68,.12); border-radius: 10px; padding: 6px 10px; }
.grid { display: grid; gap: 14px; }
.cols2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 899px) { .split, .split.even, .cols2 { grid-template-columns: minmax(0, 1fr); } .card { padding: 16px; border-radius: 22px; } }
.barbers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.bcard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 20px; background: #161B23; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 5px 0 var(--edge), 0 14px 22px rgba(0,0,0,.45); }
.bcard b { font-size: 15px; }

/* ---------- buttons ---------- */
.btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 16px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); background: var(--card3); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 0 var(--edge); text-decoration: none; }
.btn:active { transform: translateY(2px); }
.btn.primary { color: var(--amber-text); background: var(--amber); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 5px 0 var(--amber-d), 0 14px 24px rgba(245,181,68,.22); }
.btn.green { color: var(--green-text); background: var(--green); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 0 var(--green-d), 0 16px 28px rgba(52,211,153,.25); }
.btn.red { color: var(--red-text); background: var(--red); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 var(--red-d); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn.lg { min-height: 60px; font-size: 18px; border-radius: 20px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip { min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; font-size: 14px; font-weight: 600; background: var(--card3); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 0 var(--edge); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chip.on { color: var(--amber-text); background: var(--amber); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 0 var(--amber-d); }
.chip.on.present, .chip.on.green { color: var(--green-text); background: var(--green); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 var(--green-d); }
.chip.on.absent { color: var(--red-text); background: var(--red); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 var(--red-d); }
.chip.on.off { color: #0B0E13; background: #C9CED6; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 #8A919C; }
.chip.dim { opacity: .6; }
.chip.cash.on { color: #0B0E13; background: #F2F4F7; box-shadow: inset 0 -4px 0 #B8BFCA; }
.chip.gcash.on { color: #fff; background: #0A6FE0; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 0 #06489A; }
.chip.maya.on { color: #fff; background: #00995A; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 0 #006B3E; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 6px; padding: 6px; border-radius: 18px; background: #141920; box-shadow: inset 0 3px 8px rgba(0,0,0,.6); }
.seg button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 13px; font-size: 14px; font-weight: 700; background: transparent; color: var(--soft); }
.seg button.on { color: var(--amber-text); background: var(--amber); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 0 var(--amber-d); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; font: inherit; font-size: 16px; color: var(--text);
  background: #141920; box-shadow: inset 0 3px 8px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.07);
}
textarea { padding: 12px 14px; min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
input[type=checkbox] { width: 22px; min-height: 22px; accent-color: var(--amber); }
input[type=file] { display: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #D5DAE2; }

/* ---------- queue / sale ---------- */
.big-total { font-size: 38px; font-weight: 700; letter-spacing: -.03em; color: var(--amber); }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line.total { font-size: 20px; font-weight: 700; padding-top: 6px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 38px; height: 38px; border-radius: 12px; border: 0; font-size: 20px; font-weight: 700; background: var(--card3); box-shadow: 0 3px 0 var(--edge); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.svc { min-height: 64px; border: 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; background: #1C222C; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 5px 0 var(--edge); }
.svc span { font-size: 13px; color: var(--soft); font-weight: 500; }
.again { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 0; border-radius: 22px; text-align: left; width: 100%; background: #1F2733; box-shadow: inset 0 0 0 2px var(--amber), inset 0 1px 0 rgba(255,255,255,.1), 0 6px 0 var(--edge); }
.again .ic { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: var(--amber-text); background: var(--amber); box-shadow: inset 0 -4px 0 var(--amber-d); flex-shrink: 0; }
.again b { font-size: 17px; display: block; }
.again span.s { font-size: 13px; color: var(--soft); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 22px; background: #141920; text-align: center; }
.qr-img { width: min(260px, 100%); aspect-ratio: 1; object-fit: contain; border-radius: 16px; background: #fff; padding: 8px; }
.qr-empty { width: min(260px, 100%); aspect-ratio: 1; border-radius: 16px; display: flex; align-items: center; justify-content: center; padding: 20px; font-size: 14px; color: var(--muted); background: #1D232D; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
.receipt { background: #fff; color: #111; border-radius: 12px; padding: 22px; max-width: 380px; width: 100%; margin: 0 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.receipt .line { gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #999; width: 100%; margin: 4px 0; }
.receipt h2 { text-align: center; font-size: 18px; }
.receipt .c { text-align: center; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.login-card h1 { font-size: 32px; letter-spacing: -.02em; text-align: center; }
.dots { display: flex; gap: 18px; margin: 4px 0; }
.dots i { width: 20px; height: 20px; border-radius: 50%; background: #141920; box-shadow: inset 0 3px 6px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.08); }
.dots i.on { background: var(--amber); box-shadow: 0 0 12px rgba(245,181,68,.6), inset 0 -3px 0 var(--amber-d); }
.dots.bad i { background: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(340px, 100%); }
.key { height: 70px; border: 0; border-radius: 22px; font-size: 26px; font-weight: 600; background: #1C222C; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 0 #07090C, 0 14px 22px rgba(0,0,0,.45); }
.key:active { transform: translateY(3px); }
.key.alt { background: #141920; font-size: 20px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; text-align: center; }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { padding: 16px; border-radius: 22px; background: #1A1F28; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 0 var(--edge); }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.hero .v { color: var(--amber); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .nm { width: 64px; font-size: 14px; font-weight: 600; }
.bar-track { flex: 1; height: 20px; border-radius: 10px; background: var(--inset); box-shadow: inset 0 2px 5px rgba(0,0,0,.6); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; box-shadow: inset 0 4px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.2); }
.splitbar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; }
.table td { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.06); }
.table td.r, .table th.r { text-align: right; }
.good { color: var(--green-soft); }
.bad { color: var(--red); }
.notice { padding: 12px 14px; border-radius: 14px; font-size: 14px; color: #FFD9A0; background: rgba(245,181,68,.1); box-shadow: inset 0 0 0 1px rgba(245,181,68,.25); }
.notice.danger { color: #FFB3B6; background: rgba(255,122,127,.1); box-shadow: inset 0 0 0 1px rgba(255,122,127,.3); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv > div { padding: 10px 12px; border-radius: 14px; background: #1D232D; }
.kv small { display: block; font-size: 12px; color: var(--muted); }
.kv b { font-size: 15px; }
.empty { padding: 22px; text-align: center; color: var(--muted); font-size: 14px; border-radius: 18px; background: #141920; }

/* ---------- dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.sheet { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--card); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 80px rgba(0,0,0,.7); }
.sheet h2 { font-size: 20px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 14px; background: #263041; color: var(--text); font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.5); max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 40px; } }
@media print { .sidenav, .page-head, .no-print { display: none !important; } body { background: #fff; } }
