/* =====================================================================
   TekdotPMS design system
   All brand colors live in the :root tokens below — change them to re-theme the entire app.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --brand: #1D4ED8;
  --brand-600: #1E40AF;
  --brand-50: #EFF4FF;
  --brand-100: #DBE6FE;
  --accent: #14B8A6;
  --accent-50: #E6FAF7;

  /* Sidebar */
  --side-bg: #0B1B36;
  --side-bg-2: #102546;
  --side-text: #A9B8D4;
  --side-text-strong: #FFFFFF;
  --side-active: rgba(255,255,255,.08);

  /* Surfaces */
  --bg: #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --border: #E3E8F1;
  --border-strong: #CDD5E3;
  --text: #0F1B2D;
  --text-2: #4A5A73;
  --muted: #7B8AA3;

  /* Status */
  --success: #16A34A; --success-50: #E9F8EF;
  --warning: #D97706; --warning-50: #FEF5E6;
  --danger:  #DC2626; --danger-50:  #FDECEC;
  --info:    #0284C7; --info-50:    #E6F4FB;
  --purple:  #7C3AED; --purple-50:  #F1EBFE;

  /* Room status */
  --st-clean: #16A34A; --st-dirty: #DC2626; --st-inspected: #0284C7; --st-cleaning: #D97706; --st-ooo: #475569; --st-occupied: #1D4ED8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 4px 16px rgba(15,27,45,.05);
  --shadow-lg: 0 20px 60px rgba(15,27,45,.22);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4F7DF3; --brand-600: #3B6AE8; --brand-50: #16213A; --brand-100: #1C2B4B;
    --accent-50: #0F2A2A;
    --side-bg: #070F1F; --side-bg-2: #0C1830;
    --bg: #0B1220; --surface: #111A2C; --surface-2: #0E1626; --border: #1F2B41; --border-strong: #2A3854;
    --text: #E6ECF7; --text-2: #B3BFD4; --muted: #7F8DA8;
    --success-50: #0F2A1B; --warning-50: #2E2210; --danger-50: #2E1414; --info-50: #0E2230; --purple-50: #221838;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4F7DF3; --brand-600: #3B6AE8; --brand-50: #16213A; --brand-100: #1C2B4B;
  --accent-50: #0F2A2A;
  --side-bg: #070F1F; --side-bg-2: #0C1830;
  --bg: #0B1220; --surface: #111A2C; --surface-2: #0E1626; --border: #1F2B41; --border-strong: #2A3854;
  --text: #E6ECF7; --text-2: #B3BFD4; --muted: #7F8DA8;
  --success-50: #0F2A1B; --warning-50: #2E2210; --danger-50: #2E1414; --info-50: #0E2230; --purple-50: #221838;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.card-h h3 svg.i { width: 17px; height: 17px; color: var(--brand); }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bold { font-weight: 600; } .strong { font-weight: 700; }
.pos { color: var(--success); } .neg { color: var(--danger); }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; } .flex.wrap { flex-wrap: wrap; } .flex.between { justify-content: space-between; } .flex.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-s { margin-top: 8px; }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2)); color: var(--side-text); display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.sidebar .brand { min-height: var(--topbar-h); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 14px 18px 12px; color: var(--side-text-strong); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 6px 16px rgba(29,78,216,.35); flex: none; }
.brand-logo { display: block; width: 176px; max-width: 100%; height: auto; }
.sidebar .brand b { font-size: 16px; letter-spacing: -.01em; } .sidebar .brand small { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-text); font-weight: 500; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(169,184,212,.6); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; font-size: 13.5px; text-decoration: none; margin: 1px 0; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--side-active); color: var(--side-text-strong); }
.nav a.active { background: linear-gradient(90deg, rgba(79,125,243,.28), rgba(79,125,243,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a .count { margin-left: auto; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: rgba(169,184,212,.7); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.topbar .menu-btn { display: none; }
.search-box { position: relative; flex: 1; max-width: 460px; }
.search-box input { width: 100%; padding-left: 36px; background: var(--surface-2); }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; z-index: 50; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--brand-50); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.brand { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.topbar .spacer { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 10px; color: var(--text); font: inherit; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .who { text-align: left; line-height: 1.2; } .user-btn .who b { font-size: 13px; display: block; } .user-btn .who small { color: var(--muted); font-size: 11.5px; }
.content { padding: 22px 24px 40px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h3 { display: flex; align-items: center; gap: 8px; }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .ico svg { width: 21px; height: 21px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ico.blue { background: var(--brand-50); color: var(--brand); } .ico.teal { background: var(--accent-50); color: var(--accent); }
.ico.green { background: var(--success-50); color: var(--success); } .ico.amber { background: var(--warning-50); color: var(--warning); }
.ico.red { background: var(--danger-50); color: var(--danger); } .ico.purple { background: var(--purple-50); color: var(--purple); } .ico.sky { background: var(--info-50); color: var(--info); }

.stat-row { display: flex; gap: 0; border-top: 1px solid var(--border); }
.stat-row > div { flex: 1; padding: 10px 14px; border-right: 1px solid var(--border); }
.stat-row > div:last-child { border-right: 0; }
.stat-row b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 11.5px; color: var(--muted); }

.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; }

/* ---------------------------------------------------------------- Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(29,78,216,.25); }
.btn.primary:hover { background: var(--brand-600); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.on { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); z-index: 1; }

input, select, textarea { font: 400 13.5px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 36px; padding: 0 11px; width: 100%; min-width: 0; }
textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); padding: 0; }
input[type=color] { padding: 3px; width: 56px; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.req::after { content: ' *'; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .form-grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.input-group { display: flex; } .input-group > * { border-radius: 0; } .input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .input-group > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .search { min-width: 220px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0; }
legend { font-size: 12px; font-weight: 700; color: var(--text-2); padding: 0 6px; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.t th.sortable { cursor: pointer; user-select: none; } .t th.sortable:hover { color: var(--text); }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--brand-50) 55%, transparent); }
.t tr.click { cursor: pointer; }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); }
.t tr.voided td { color: var(--muted); text-decoration: line-through; }
.t.compact td, .t.compact th { padding: 7px 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); line-height: 1.3; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.green { background: var(--success-50); color: var(--success); border-color: transparent; }
.badge.red { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.badge.amber { background: var(--warning-50); color: var(--warning); border-color: transparent; }
.badge.blue { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.badge.sky { background: var(--info-50); color: var(--info); border-color: transparent; }
.badge.purple { background: var(--purple-50); color: var(--purple); border-color: transparent; }
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge.dark { background: #334155; color: #fff; border-color: transparent; }
.vip { display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; color: #7A5200; background: linear-gradient(135deg, #FDE68A, #F59E0B); border-radius: 4px; padding: 1px 5px; letter-spacing: .03em; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: 600 13px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; font-size: 11px; color: var(--text-2); }
.tabs .on .count { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }

/* ---------------------------------------------------------------- Modal, drawer, toast, menu */
.overlay { position: fixed; inset: 0; background: rgba(8,15,30,.5); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .18s ease-out; display: flex; flex-direction: column; max-height: 90vh; }
.modal.lg { max-width: 860px; } .modal.xl { max-width: 1140px; } .modal.sm { max-width: 420px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-h h2 { font-size: 17px; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.x-btn { background: none; border: 0; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.x-btn:hover { background: var(--surface-2); color: var(--text); }
.x-btn svg { width: 18px; height: 18px; }
.drawer-ov { position: fixed; inset: 0; background: rgba(8,15,30,.4); z-index: 90; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-h { padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 380px; display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; }
.toast.ok { background: #065F46; color: #fff; } .toast.err { background: #991B1B; color: #fff; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 150; animation: pop .12s; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; font: 500 13px var(--font); color: var(--text); border-radius: 6px; cursor: pointer; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { margin: 6px 0; }
.menu .danger { color: var(--danger); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.info { background: var(--info-50); color: var(--info); } .alert.success { background: var(--success-50); color: var(--success); }
.alert.warning { background: var(--warning-50); color: var(--warning); } .alert.danger { background: var(--danger-50); color: var(--danger); }
.alert a { font-weight: 600; }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { to { background-position: -200% 0 } }
.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------------------------------------------------------------- Charts */
.chart { width: 100%; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar-list > div { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.bar-list .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-list .track i { display: block; height: 100%; border-radius: 99px; }
.chart-tip { position: fixed; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 12px; z-index: 300; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------------- Room rack / housekeeping tiles */
.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.room-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; position: relative; transition: transform .1s, box-shadow .1s; border-top: 4px solid var(--st-clean); min-height: 104px; display: flex; flex-direction: column; gap: 3px; }
.room-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.room-tile .no { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.room-tile .type { font-size: 11px; color: var(--muted); font-weight: 600; }
.room-tile .guest { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-tile .meta { margin-top: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.room-tile.sel { outline: 3px solid var(--brand); }
.room-tile.hk-clean { border-top-color: var(--st-clean); } .room-tile.hk-dirty { border-top-color: var(--st-dirty); }
.room-tile.hk-inspected { border-top-color: var(--st-inspected); } .room-tile.hk-cleaning { border-top-color: var(--st-cleaning); }
.room-tile.hk-ooo, .room-tile.hk-oos { border-top-color: var(--st-ooo); background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.room-tile.occ { background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%); }
.floor-label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.legend-bar { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend-bar span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- Tape chart */
.tape-wrap { overflow: auto; max-height: calc(100vh - 230px); border-top: 1px solid var(--border); }
.tape { display: grid; position: relative; min-width: max-content; font-size: 12px; }
.tape .hd { position: sticky; top: 0; z-index: 5; background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; padding: 6px 2px; font-weight: 600; color: var(--text-2); }
.tape .hd small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.tape .hd.today { background: var(--brand-50); color: var(--brand); }
.tape .hd.we { background: color-mix(in srgb, var(--warning-50) 60%, var(--surface-2)); }
.tape .corner { position: sticky; left: 0; top: 0; z-index: 7; background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px 10px; font-weight: 700; }
.tape .rl { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0 10px; display: flex; align-items: center; gap: 8px; white-space: nowrap; height: 38px; }
.tape .rl b { font-size: 13px; } .tape .rl small { color: var(--muted); }
.tape .grp { position: sticky; left: 0; z-index: 4; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 5px 10px; font-weight: 700; font-size: 11.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.tape .grp-cell { background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-size: 11px; padding: 5px 0; color: var(--muted); font-weight: 600; }
.tape .grp-cell.low { color: var(--danger); }
.tape .c { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: 38px; cursor: pointer; }
.tape .c:hover { background: var(--brand-50); }
.tape .c.today { background: color-mix(in srgb, var(--brand-50) 50%, transparent); }
.tape .c.drop { background: var(--accent-50); outline: 2px dashed var(--accent); outline-offset: -2px; }
.tape .bar { position: relative; height: 28px; min-width: 0; border-radius: 7px; color: #fff; font-size: 11.5px; font-weight: 600; padding: 0 8px; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; cursor: pointer; z-index: 3; box-shadow: 0 1px 3px rgba(0,0,0,.2); border-left: 4px solid rgba(0,0,0,.25); }
.tape .bar:hover { filter: brightness(1.08); z-index: 6; }
.tape .bar.confirmed { background: #2563EB; } .tape .bar.tentative { background: repeating-linear-gradient(135deg, #7C3AED, #7C3AED 6px, #8B5CF6 6px, #8B5CF6 12px); }
.tape .bar.checked_in { background: #16A34A; } .tape .bar.checked_out { background: #94A3B8; }
.tape .bar.unassigned { background: #D97706; }
.tape .bar.dragging { opacity: .5; }

/* ---------------------------------------------------------------- POS */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; height: calc(100vh - var(--topbar-h) - 190px); min-height: 540px; }
.pos-menu { display: flex; flex-direction: column; min-height: 0; }
.pos-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-cats button { border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 99px; font: 600 12.5px var(--font); color: var(--text-2); cursor: pointer; }
.pos-cats button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pos-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; overflow-y: auto; padding-bottom: 8px; align-content: start; }
.pos-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; text-align: left; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 6px; min-height: 92px; transition: transform .08s, border-color .1s; border-left: 4px solid var(--brand); }
.pos-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.pos-item:active { transform: scale(.98); }
.pos-item b { font-size: 13px; line-height: 1.25; }
.pos-item span { margin-top: auto; font-weight: 700; color: var(--brand); }
.pos-cart { display: flex; flex-direction: column; min-height: 0; }
.pos-cart .lines { flex: 1; overflow-y: auto; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.pos-line .q { display: flex; align-items: center; gap: 6px; }
.pos-line .q button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--text); }
.pos-line.sent { background: var(--surface-2); }
.pos-totals { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.pos-totals > div { display: flex; justify-content: space-between; padding: 2px 0; }
.pos-totals .grand { font-size: 20px; font-weight: 800; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--border-strong); }
.pos-actions { padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--border); }
.open-checks { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.open-checks button { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: 600 12px var(--font); color: var(--text); text-align: left; }
.open-checks button.on { border-color: var(--brand); background: var(--brand-50); }
.open-checks small { display: block; color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------- ARI grid */
.ari { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: max-content; }
.ari th, .ari td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: center; white-space: nowrap; }
.ari th { background: var(--surface-2); position: sticky; top: 0; z-index: 2; font-weight: 600; color: var(--text-2); }
.ari .rh { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; font-weight: 600; min-width: 170px; }
.ari td.editable { cursor: pointer; } .ari td.editable:hover { background: var(--brand-50); }
.ari td.stop { background: var(--danger-50); color: var(--danger); font-weight: 700; }
.ari td.ovr { color: var(--brand); font-weight: 700; }
.ari td.zero { color: var(--danger); font-weight: 700; }
.ari tr.sub td { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- Auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, rgba(79,125,243,.35), transparent), radial-gradient(900px 500px at 110% 110%, rgba(20,184,166,.3), transparent), var(--side-bg); }
.auth-shell { width: 100%; max-width: 1000px; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.auth-hero { background: linear-gradient(150deg, #0B1B36 0%, #13306A 55%, #0F766E 130%); color: #fff; padding: 44px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -120px; bottom: -140px; background: radial-gradient(circle, rgba(20,184,166,.45), transparent 70%); }
.auth-hero h1 { font-size: 30px; line-height: 1.15; margin: 36px 0 12px; letter-spacing: -.02em; }
.auth-hero p { color: rgba(255,255,255,.75); margin: 0; max-width: 380px; }
.auth-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); font-size: 13.5px; }
.auth-hero li svg { width: 18px; height: 18px; color: #5EEAD4; flex: none; }
.auth-card { background: var(--surface); padding: 44px 40px; width: 100%; }
.auth-body > .auth-card { border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.brand-lg { display: flex; align-items: center; gap: 12px; }
.brand-lg .brand-mark { width: 42px; height: 42px; font-size: 20px; }
.brand-lg b { font-size: 20px; display: block; letter-spacing: -.02em; } .brand-lg small { color: var(--muted); font-size: 12px; }
.auth-hero .brand-lg small { color: rgba(255,255,255,.65); }
.auth-card h2 { font-size: 22px; margin: 28px 0 6px; }
.auth-card .stack { margin-top: 22px; }
.demo-creds { margin-top: 18px; font-size: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; color: var(--text-2); }
.demo-creds button { background: none; border: 0; color: var(--brand); cursor: pointer; font: 600 12px var(--font); padding: 2px 4px; }

/* ---------------------------------------------------------------- Folio */
.folio-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.balance-box { text-align: right; }
.balance-box .amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline > div { position: relative; padding: 0 0 12px; font-size: 12.5px; }
.timeline > div::before { content: ''; position: absolute; left: -17px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }

/* ---------------------------------------------------------------- Wizard / availability */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.steps span.on { background: var(--brand); }
.avail-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; cursor: pointer; transition: border-color .1s, background .1s; }
.avail-card:hover { border-color: var(--brand); }
.avail-card.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.avail-card.none { opacity: .55; cursor: not-allowed; }
.avail-card .price { font-size: 18px; font-weight: 800; text-align: right; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .pos-grid { grid-template-columns: 1fr 330px; } }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .g3, .g2 { grid-template-columns: minmax(0,1fr); }
  .span2, .span3 { grid-column: auto; }
  .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .pos-grid { grid-template-columns: 1fr; height: auto; }
  .pos-cart { min-height: 480px; }
  .user-btn .who, .hide-sm { display: none !important; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .g4 { grid-template-columns: minmax(0,1fr); }
  .form-grid, .form-grid.c3, .form-grid.c4 { grid-template-columns: minmax(0,1fr); }
  .dl { grid-template-columns: 110px 1fr; }
  .auth-card { padding: 32px 22px; }
  .modal-b { padding: 16px; }
  .kpi .val { font-size: 21px; }
  .toolbar .search { min-width: 0; flex: 1; }
  .bar-list > div { grid-template-columns: 90px 1fr 60px; }
}

/* ---------------------------------------------------------------- Print */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .page-actions, .no-print, #toasts { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .print-only { display: block; }
}
