/* Venorix Tech admin — Tally-style, keyboard-first professional theme.
   Legacy class names (.card .btn .badge .field .modal .drawer .stats …) are kept so older pages keep working. */
:root {
  --navy: #0f1b33;
  --navy-2: #182a4d;
  --accent: #f26522;
  --accent-soft: #fff1e8;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #111827;
  --muted: #5b6474;
  --faint: #8a93a3;
  --rule: #d8dde5;
  --rule-strong: #b9c1cd;
  --focus-row: #fff4c2;
  --focus-ring: #2563eb;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --info: #1d4ed8;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 50px rgba(15, 27, 51, .25);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  /* legacy aliases */
  --primary: var(--navy); --primary-dark: #0a1325; --card: var(--surface); --border: var(--rule);
  --green: var(--ok); --red: var(--bad); --yellow: var(--warn);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, td.num, th.num, .tnum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
kbd, .kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--rule-strong); border-bottom-width: 2px;
  border-radius: 4px; background: #fff; font: 600 11px/17px var(--mono); color: var(--navy); text-align: center;
}
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
u.ak { text-decoration: underline; text-underline-offset: 2px; }

/* ================= Login ================= */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 10%, #22345c 0, var(--navy) 45%, #070d1a 100%); }
.login-card { background: #fff; border-radius: 10px; padding: 34px 32px 26px; width: 100%; max-width: 390px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 0 0 4px; color: var(--navy); font-size: 20px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-logo { display: block; max-width: 230px; height: auto; margin: 0 auto 14px; }
.login-foot { margin-top: 14px; font-size: 12px; color: var(--faint); text-align: center; }

/* ================= App shell ================= */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr) auto; grid-template-rows: 52px minmax(0, 1fr) 26px;
  grid-template-areas: "top top top" "side main keys" "status status status"; height: 100vh; }
.topbar-app { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px; background: var(--navy); color: #fff; z-index: 30; }
.topbar-app .tb-brand { display: flex; align-items: center; gap: 10px; min-width: 212px; }
.topbar-app .tb-brand img { height: 34px; background: #fff; border-radius: 5px; padding: 3px 7px; }
.topbar-app .tb-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-app .tb-goto { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #dfe6f3; border-radius: 6px; padding: 6px 10px; cursor: pointer; text-align: left; }
.topbar-app .tb-goto:hover { background: rgba(255,255,255,.16); }
.topbar-app .tb-goto kbd { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.topbar-app .tb-goto span { flex: 1; }
.topbar-app .tb-goto .tb-ic { font-size: 16px; line-height: 1; }
.topbar-app .tb-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.topbar-app .tb-date { font-size: 12px; color: #c9d3e6; text-align: right; line-height: 1.25; }
.topbar-app .tb-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.08); font-size: 13px; }
.topbar-app .tb-user small { color: #aab6cc; }
.topbar-app .tb-btn { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 5px 9px; }
.topbar-app .tb-btn:hover { background: rgba(255,255,255,.12); }
.sidebar-toggle { display: none; }

.sidebar { grid-area: side; background: #fff; border-right: 1px solid var(--rule); overflow-y: auto; padding: 8px 0 20px; }
.sidebar .brand { display: none; }
.nav-group { margin: 4px 0 8px; }
.nav-group > .ng-title { padding: 8px 16px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.sidebar nav a, .nav-group a { display: flex; align-items: center; gap: 9px; padding: 7px 16px; color: #253047; font-weight: 500; position: relative; text-decoration: none; }
.nav-group a:hover, .sidebar nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav-group a.active, .sidebar nav a.active { background: var(--accent-soft); color: var(--navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.nav-group a .nk { margin-left: auto; font: 600 10.5px var(--mono); color: var(--faint); }
.nav-group a .ni { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.nav-badge { display: inline-block; margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 999px; line-height: 18px; min-width: 20px; text-align: center; }
.nav-badge + .nk { margin-left: 6px; }
.sidebar .logout { display: block; margin: 16px 16px 0; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 6px; color: var(--bad); text-align: center; cursor: pointer; }

.main { grid-area: main; overflow-y: auto; padding: 16px 20px 40px; min-width: 0; }
.main > .topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.main > .topbar h2, .page-head h2 { margin: 0; font-size: 19px; color: var(--navy); }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head .ph-sub { color: var(--muted); font-size: 13px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-right input#global-search { width: 300px; max-width: 45vw; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--rule-strong); background: #fff; }
.user-pill { display: none; }

/* Right function-key bar (Tally button bar) */
.keybar { grid-area: keys; width: 150px; background: #f3f5f8; border-left: 1px solid var(--rule); overflow-y: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 3px; }
.keybar .kb-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; padding: 6px 6px 2px; }
.keybar button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; text-align: left; color: #253047; font-size: 12.5px; }
.keybar button:hover:not(:disabled) { background: #fff; border-color: var(--rule); }
.keybar button:disabled { opacity: .4; cursor: default; }
.keybar button kbd { min-width: 42px; }
.keybar hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 2px; }

.statusbar { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 12px; background: #e3e7ee; border-top: 1px solid var(--rule); font-size: 12px; color: #3b4556; white-space: nowrap; overflow: hidden; }
.statusbar b { color: var(--navy); }
.statusbar .sb-right { margin-left: auto; display: flex; gap: 14px; }

/* ================= Cards / panels ================= */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; color: var(--navy); }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: 10px 14px; margin: 0; border-bottom: 1px solid var(--rule); }
.section-title { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }

/* KPI tiles */
.stats, .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat, .kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 11px 13px; box-shadow: var(--shadow); position: relative; }
.kpi.link { cursor: pointer; } .kpi.link:hover { border-color: var(--rule-strong); }
.stat .label, .kpi .k-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value, .kpi .k-value { font-size: 21px; font-weight: 700; color: var(--navy); margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-top: 3px solid var(--accent); }
.kpi.alert .k-value, .stat.alert .value { color: var(--bad); }
.kpi.good .k-value, .stat.good .value { color: var(--ok); }

/* ================= Tables (dense register grid) ================= */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--rule); font-size: 13.5px; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
tr:hover td { background: #fafbfd; }
.grid-wrap { overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 250px); }
.grid-wrap.tall { max-height: none; }
table.grid td { cursor: default; }
table.grid tbody tr.sel td { background: var(--focus-row) !important; }
table.grid tbody tr.clickable td { cursor: pointer; }
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--navy); }
table.grid th .sort { font-size: 10px; margin-left: 3px; }
table.grid tfoot td { font-weight: 700; background: #f3f5f8; border-top: 2px solid var(--rule-strong); position: sticky; bottom: 0; }
table.grid td.empty { text-align: center; color: var(--muted); padding: 28px; }
table.grid tr.dim td { color: var(--faint); text-decoration: line-through; }
.grid-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.grid-tools input.gfilter { padding: 6px 10px; border: 1px solid var(--rule-strong); border-radius: 6px; min-width: 220px; background: #fff; }
.grid-tools .gcount { color: var(--muted); font-size: 12.5px; }

/* ================= Buttons ================= */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 6px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; line-height: 1.2; background: #fff; color: var(--text); white-space: nowrap; text-decoration: none !important; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn kbd { font-size: 10px; line-height: 15px; padding: 0 4px; min-width: 0; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-primary kbd, .btn-accent kbd, .btn-danger kbd { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #de5716; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-outline, .btn-ghost { background: #fff; color: var(--navy); border-color: var(--rule-strong); }
.btn-outline:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: #9aa4b4; }
.btn-link { background: none; border: 0; color: var(--info); padding: 2px 4px; font-weight: 600; }
.btn-sm { padding: 4px 8px; font-size: 12.5px; }
.btn-wa { background: #128c4a; color: #fff; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ================= Status chips (screen only) ================= */
.badge, .st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; text-transform: capitalize; }
.badge.new, .st-new, .st-open, .st-draft { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.badge.contacted, .st-sent, .st-assigned { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.scheduled, .st-in_progress, .st-scheduled { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.badge.completed, .badge.paid, .st-paid, .st-approved, .st-completed, .st-converted, .st-invoiced, .st-received { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.badge.cancelled, .st-cancelled, .st-rejected, .st-expired { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge.unpaid, .badge.pending, .st-unpaid, .st-on_hold { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.st-active { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.st-partial { background: #fefce8; color: #854d0e; border-color: #fde047; }
.badge.failed { background: #fef2f2; color: #991b1b; } .badge.refunded { background: #eef2ff; color: #3730a3; } .badge.adjusted { background: #ecfdf5; color: #166534; }
.badge.admin, .badge.manager { background: #eef2ff; color: #3730a3; } .badge.staff, .badge.technician { background: #f1f5f9; color: #334155; }
.pri-urgent { color: var(--bad); font-weight: 800; } .pri-high { color: var(--warn); font-weight: 700; }

/* ================= Forms ================= */
.field { display: flex; flex-direction: column; margin-bottom: 10px; min-width: 0; }
.field label, .lbl { font-weight: 600; margin-bottom: 4px; font-size: 12.5px; color: #3b4556; }
.field input, .field select, .field textarea, .inp {
  padding: 7px 9px; border-radius: 5px; border: 1px solid var(--rule-strong); background: #fff; min-width: 0; max-width: 100%; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 2px rgba(37,99,235,.15); background: #fffdf2; }
.field .hint, .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.field.err input, .field.err select { border-color: var(--bad); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-row.four { grid-template-columns: repeat(4, 1fr); }
.form-row > .field { min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; }

/* ================= Toolbar / tabs ================= */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--rule-strong); background: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 12px; font-weight: 600; color: var(--muted); margin-bottom: -1px; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--accent); }
.tabs button .cnt { display: inline-block; margin-left: 5px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e8ecf2; font-size: 11px; color: #334155; }
.period { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period select, .period input { padding: 6px 8px; border: 1px solid var(--rule-strong); border-radius: 6px; background: #fff; }

/* ================= Modal / drawer / confirm / toast ================= */
.modal { position: fixed; inset: 0; background: rgba(12, 18, 32, .5); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px 16px; overflow-y: auto; }
.modal.open { display: flex; }
.modal-body { background: #fff; border-radius: 8px; padding: 18px 20px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); }
.modal-body.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 12px; }
.modal-head h3 { margin: 0; color: var(--navy); font-size: 16px; }
.modal-close { background: none; border: 0; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

.drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(12,18,32,.35); opacity: 0; transition: opacity .15s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100vh; width: 620px; max-width: 97vw; background: #fff; box-shadow: -18px 0 45px rgba(0,0,0,.18); overflow-y: auto; transform: translateX(100%); transition: transform .18s ease; padding: 16px 20px 40px; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.drawer-head h3 { margin: 0; color: var(--navy); font-size: 17px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.drawer-section { margin: 14px 0; }
.drawer-section h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv b, .kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

.confirm-box { max-width: 420px; text-align: center; padding: 20px 22px 16px; }
.confirm-box .cb-q { font-size: 15px; font-weight: 600; margin: 4px 0 16px; color: var(--navy); white-space: pre-line; }
.confirm-box .cb-yn { display: flex; justify-content: center; gap: 10px; }

.toasts { position: fixed; right: 16px; bottom: 36px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow-lg); font-size: 13.5px; border-left: 4px solid var(--accent); animation: tin .15s ease-out; }
.toast.ok { border-left-color: #22c55e; } .toast.err { border-left-color: #ef4444; background: #3b0d0d; } .toast.info { border-left-color: #60a5fa; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= Go To palette & help ================= */
.palette-bg { position: fixed; inset: 0; background: rgba(12,18,32,.45); z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(600px, 94vw); background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette .pl-head { background: var(--navy); color: #fff; padding: 8px 12px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; display: flex; justify-content: space-between; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 12px 14px; font-size: 16px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 4px 0; max-height: 52vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 7px 14px; cursor: pointer; }
.palette li.on { background: var(--focus-row); }
.palette li .pl-group { margin-left: auto; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.palette li kbd { margin-left: 8px; }
.palette .pl-empty { padding: 16px; color: var(--muted); text-align: center; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.help-grid .hk { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--rule); font-size: 13px; }

/* ================= Voucher (document entry screen) ================= */
.voucher { background: #fff; border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.voucher-head { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.voucher-head .vh-type { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.voucher-head .vh-no { font: 600 13px var(--mono); background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 4px; }
.voucher-head .vh-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.voucher-head input { background: #fff; color: var(--text); border: 0; border-radius: 4px; padding: 4px 7px; }
.voucher-body { padding: 12px 14px; }
.voucher-party { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px 18px; }
.voucher-foot { display: grid; grid-template-columns: 1fr 330px; gap: 16px; padding: 12px 14px; border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.voucher-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.voucher-actions .left { margin-right: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.party-card { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.party-card b { color: var(--text); }
.totals-ladder { width: 100%; border-collapse: collapse; }
.totals-ladder td { padding: 3px 0; border: 0; font-size: 13.5px; background: none !important; }
.totals-ladder td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.totals-ladder tr.grand td { font-size: 17px; font-weight: 800; color: var(--navy); border-top: 2px solid var(--navy); padding-top: 6px; }
.totals-ladder tr.sub td { color: var(--muted); }
.totals-ladder input { width: 110px; text-align: right; padding: 3px 6px; border: 1px solid var(--rule-strong); border-radius: 4px; }

/* Item grid */
.igrid-wrap { overflow-x: auto; border: 1px solid var(--rule-strong); border-radius: 4px; }
table.igrid { min-width: 860px; }
table.igrid th { padding: 6px 6px; font-size: 11px; }
table.igrid td { padding: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: #fff; }
table.igrid td:last-child { border-right: 0; }
table.igrid td.sr { width: 34px; text-align: center; color: var(--faint); font-size: 12px; padding: 0 4px; }
table.igrid td input, table.igrid td select { width: 100%; border: 0; padding: 7px 6px; background: transparent; border-radius: 0; min-width: 0; }
table.igrid td input:focus, table.igrid td select:focus { outline: none; background: var(--focus-row); box-shadow: inset 0 0 0 1px #e5b700; }
table.igrid td.amt { text-align: right; padding: 0 8px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; min-width: 100px; }
table.igrid td.x { width: 30px; text-align: center; }
table.igrid td.x button { border: 0; background: none; color: var(--faint); font-size: 16px; padding: 4px; }
table.igrid td.x button:hover { color: var(--bad); }
table.igrid tr.src-extra td.desc input { background: #fffbeb; }
table.igrid .src-tag { font-size: 10px; font-weight: 700; color: var(--warn); padding: 0 6px; }
.ac-pop { position: fixed; z-index: 400; background: #fff; border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; min-width: 320px; }
.ac-pop .ac-item { padding: 6px 10px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid #f1f3f6; }
.ac-pop .ac-item.on { background: var(--focus-row); }
.ac-pop .ac-item .ac-main { flex: 1; min-width: 0; }
.ac-pop .ac-item .ac-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ac-pop .ac-item.create { color: var(--info); font-weight: 600; }
.ac-pop .ac-empty { padding: 10px; color: var(--muted); }

/* Detail view */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.doc-summary .ds-no { font: 700 18px var(--mono); color: var(--navy); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--rule); }
.timeline li { margin-bottom: 10px; position: relative; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 3px #fff; }
.timeline li.kind-status::before { background: var(--accent); }
.timeline li.kind-bill::before, .timeline li.kind-invoice::before { background: var(--ok); }
.timeline-meta { color: var(--muted); font-size: 11.5px; }
.sig-pad { width: 100%; height: 170px; border: 1px dashed var(--rule-strong); border-radius: 6px; background: #fff; touch-action: none; display: block; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); }
.note-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.warn-box { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.ok-box { background: #ecfdf5; border: 1px solid #bbf7d0; color: #14532d; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.empty-state { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty-state b { color: var(--navy); display: block; font-size: 15px; margin-bottom: 4px; }

/* Charts (inline SVG) */
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.bar-row .bar { height: 10px; background: #e8ecf2; border-radius: 5px; overflow: hidden; }
.bar-row .bar > span { display: block; height: 100%; background: var(--navy); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.dash-grid.three { grid-template-columns: repeat(3, 1fr); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; text-align: left; }
.quick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick button b { color: var(--navy); } .quick button span { font-size: 12px; color: var(--muted); }

/* Legacy dashboard bits */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; }
.chart-card h4 { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bars .bar { flex: 1; background: var(--navy); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.bars .bar .bar-unpaid { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); opacity: .75; }
.bars-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.bars-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.bars-legend .leg-paid::before { background: var(--navy); } .bars-legend .leg-unpaid::before { background: var(--accent); }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.top-list li:last-child { border-bottom: 0; }
.top-list .count { font-weight: 700; color: var(--navy); }
.funnel { display: flex; flex-direction: column; gap: 5px; }
.funnel-row { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 5px; font-size: 13px; color: #fff; font-weight: 600; background: var(--navy); }
.bulk-bar { display: flex; gap: 10px; align-items: center; padding: 7px 10px; background: var(--accent-soft); border: 1px solid #fdc9a8; border-radius: 6px; margin-bottom: 10px; }
.bulk-bar.empty { display: none; }
.row-check { width: 28px; } .row-check input { transform: scale(1.15); cursor: pointer; }
.items-wrap { overflow-x: auto; }
.items-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.items-table th, .items-table td { padding: 5px 4px; }
.items-table input, .items-table select { padding: 5px 7px; font-size: 13px; width: 100%; border: 1px solid var(--rule-strong); border-radius: 4px; }
.items-table .num { text-align: right; }

/* Global search results */
.search-results { position: fixed; top: 56px; right: 170px; width: 480px; max-width: calc(100vw - 24px); max-height: 72vh; overflow-y: auto; background: #fff; border: 1px solid var(--rule-strong); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 60; padding: 6px; }
.search-results .search-group { padding: 6px 4px; }
.search-results h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results li a { display: block; padding: 6px 8px; border-radius: 5px; color: var(--text); font-size: 13.5px; }
.search-results li a:hover { background: var(--surface-2); text-decoration: none; }
.search-results .search-empty { padding: 14px; text-align: center; color: var(--muted); }

/* Technician mobile app */
.tech-app { max-width: 720px; margin: 0 auto; }
.tech-card { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tech-card.tap { cursor: pointer; } .tech-card.tap:active { background: var(--surface-2); }
.tech-card h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.tech-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.tech-actions .btn { justify-content: center; padding: 11px 10px; font-size: 14px; }
.big-btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

/* ================= Responsive ================= */
@media (max-width: 1280px) { .keybar { width: 128px; } .keybar button { font-size: 12px; } }
@media (max-width: 1100px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "top top" "side main" "status status"; }
  .keybar { display: none; }
  .detail-grid, .dash-grid { grid-template-columns: 1fr; }
  .voucher-foot { grid-template-columns: 1fr; }
  .search-results { right: 12px; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "top" "main" "status"; grid-template-rows: 52px minmax(0,1fr) 0; }
  .statusbar { display: none; }
  .sidebar { position: fixed; top: 52px; left: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; z-index: 80; box-shadow: 6px 0 24px rgba(0,0,0,.18); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.35); z-index: 79; display: none; }
  .sidebar-backdrop.open { display: block; }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font-size: 18px; }
  .topbar-app .tb-brand { min-width: 0; }
  .topbar-app .tb-brand img { height: 28px; }
  .topbar-app .tb-goto span, .topbar-app .tb-goto kbd, .topbar-app .tb-date, .topbar-app .tb-user small { display: none; }
  .topbar-app .tb-goto { flex: 0 0 auto; margin-left: auto; }
  .topbar-app .tb-title { display: none; }
  .main { padding: 12px 12px 60px; }
  .form-row, .form-row.three, .form-row.four, .voucher-party, .dash-grid.three, .help-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .grid-wrap { max-height: none; }
  .modal { padding: 10px; }
  .drawer-panel { width: 100vw; padding: 14px; }
  .topbar-right input#global-search { width: 100%; max-width: none; }
  .main > .topbar { flex-wrap: wrap; }
  .page-head .ph-actions { margin-left: 0; }
}
@media (min-width: 801px) { .sidebar-backdrop { display: none !important; } .shell-new .main > .topbar { display: none; } }

@media print {
  .sidebar, .topbar-app, .keybar, .statusbar, .drawer, .modal, .no-print, .toasts, .grid-tools, .tabs, .page-head .ph-actions { display: none !important; }
  .app { display: block !important; height: auto; }
  .main { padding: 0 !important; overflow: visible; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #000; }
  .grid-wrap { max-height: none; overflow: visible; border-color: #000; }
  th { background: #fff !important; color: #000; border-bottom: 1px solid #000; }
  td { border-bottom: 1px solid #999; }
  .st, .badge { border: 0; background: none !important; color: #000 !important; padding: 0; }
}

/* =====================================================================================
   TALLY PRIME LOOK - overrides the base theme above (keep this block last in the file).
   ===================================================================================== */
:root {
  --tp-top: #1f3a52; --tp-top-2: #2a4d6b; --tp-title: #cadced; --tp-head: #3a6a8c; --tp-head-2: #dbe7f0;
  --tp-bg: #eef2f6; --tp-line: #a9bdcd; --tp-line-soft: #d3dfe8; --tp-sel: #ffd86b; --tp-sel-2: #fff1c2;
  --tp-key: #b4301f; --tp-ink: #0f2233; --tp-blue: #1f4e79;
  --navy: #1f3a52; --accent: #d9822b; --accent-soft: #fff4d6; --focus-row: var(--tp-sel); --rule: var(--tp-line-soft); --rule-strong: var(--tp-line);
  --radius: 2px; --shadow: none; --font: "Segoe UI", Tahoma, Arial, sans-serif;
}
body { background: var(--tp-bg); color: var(--tp-ink); font-size: 13.5px; }
.app { grid-template-columns: minmax(0, 1fr) 160px; grid-template-rows: 34px 30px minmax(0, 1fr) 24px;
  grid-template-areas: "top top" "title title" "main keys" "status status"; }

/* top menu bar */
.tp-top { grid-area: top; display: flex; align-items: stretch; gap: 6px; background: var(--tp-top); color: #e6eef5; padding: 0 8px; z-index: 40; }
.tp-burger { background: transparent; border: 0; color: #fff; font-size: 17px; padding: 0 8px; }
.tp-burger:hover { background: var(--tp-top-2); }
.tp-brand { display: flex; align-items: center; padding: 0 8px 0 2px; }
.tp-brand img { height: 24px; background: #fff; border-radius: 2px; padding: 1px 5px; display: block; }
.tp-menu { display: flex; align-items: stretch; margin-left: auto; }
.tp-mi { background: transparent; border: 0; color: #e6eef5; padding: 0 11px; font-size: 13px; white-space: nowrap; }
.tp-mi b { color: #ffd86b; font-weight: 700; }
.tp-mi:hover { background: var(--tp-top-2); }
.tp-sep { width: 1px; background: rgba(255,255,255,.18); margin: 7px 6px; }
.tp-user { display: flex; align-items: center; gap: 8px; margin-left: 10px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); font-size: 12.5px; white-space: nowrap; }
.tp-user small { color: #9fb6ca; }
.tp-user button { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 2px; }
.tp-user button:hover { background: var(--tp-top-2); }

/* screen title bar */
.tp-titlebar { grid-area: title; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--tp-title); color: var(--tp-ink); border-bottom: 1px solid var(--tp-line); z-index: 30; }
.tp-titlebar b { font-size: 14.5px; }
.tp-crumb { font-size: 12.5px; color: #3c566c; }
.tp-crumb a { color: #1f4e79; }
.tp-co { margin-left: auto; font-weight: 700; color: #274a66; }
.tp-close { background: #fff; border: 1px solid var(--tp-line); color: var(--tp-ink); font-size: 12px; padding: 2px 8px; border-radius: 2px; }
.tp-close:hover { background: var(--tp-sel-2); }
.tp-back { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #7f9db5; color: var(--tp-ink); font-size: 13px; font-weight: 700; padding: 2px 10px 2px 8px; border-radius: 2px; cursor: pointer; }
.tp-back span { font-size: 15px; line-height: 1; }
.tp-back small { font-weight: 400; color: #56708a; font-size: 11px; }
.tp-back:hover { background: var(--tp-sel); border-color: #5f7f99; }
.tp-back[hidden] { display: none; }

/* slide-out menu (no permanent sidebar, like Tally) */
.sidebar { position: fixed; top: 64px; left: 0; bottom: 24px; width: 270px; transform: translateX(-102%); transition: transform .16s ease; z-index: 85; border-right: 1px solid var(--tp-line); box-shadow: 8px 0 24px rgba(0,0,0,.15); padding-top: 0; }
.sidebar.open { transform: none; }
.sidebar .sb-head { background: var(--tp-head); color: #fff; padding: 7px 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.sidebar .sb-head small { font-weight: 400; color: #d6e4ef; }
.sidebar-backdrop { position: fixed; inset: 64px 0 24px 0; background: rgba(15,34,51,.25); z-index: 84; display: none; }
.sidebar-backdrop.open { display: block !important; }
.nav-group a.active, .sidebar nav a.active { background: var(--tp-sel); box-shadow: none; }
.nav-group > .ng-title { color: #56708a; }

.main { padding: 12px 14px 30px; background: var(--tp-bg); }
.shell-new .main > .topbar { display: none; }
.main > .topbar h2 { font-size: 16px; }

/* right function-key button bar */
.keybar { width: 160px; background: #dde6ee; border-left: 1px solid var(--tp-line); padding: 0; gap: 0; }
.keybar button { border: 0; border-bottom: 1px solid #c2d1dd; border-radius: 0; padding: 6px 9px; font-size: 12.5px; color: var(--tp-ink); background: transparent; gap: 4px; }
.keybar button b { color: var(--tp-blue); font-weight: 700; white-space: nowrap; }
.keybar button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keybar button:hover:not(:disabled) { background: var(--tp-sel-2); border-color: #c2d1dd; }
.keybar .kb-gap { height: 10px; border-bottom: 1px solid #c2d1dd; background: #d3dde6; }

.statusbar { background: #d5e0ea; color: #203a52; border-top: 1px solid var(--tp-line); font-size: 12px; gap: 22px; }
.statusbar b { color: var(--tp-ink); }

/* panels */
.card { border: 1px solid var(--tp-line); border-radius: 0; padding: 10px 12px; }
.card-head { margin: -10px -12px 10px; padding: 6px 12px; background: var(--tp-head-2); border-bottom: 1px solid var(--tp-line); }
.card-head h3 { font-size: 13.5px; color: var(--tp-ink); }
.card.flush > .card-head { margin: 0; }
.kpi, .stat { border: 1px solid var(--tp-line); border-radius: 0; box-shadow: none; }
.kpi.accent { border-top: 3px solid var(--tp-head); }
.kpi .k-label { color: #3c566c; }
.kpi .k-value { color: var(--tp-ink); font-size: 19px; }
.section-title { color: #3c566c; }
.page-head { margin-bottom: 8px; }

/* registers */
.grid-wrap { border: 1px solid var(--tp-line); border-radius: 0; }
th { background: var(--tp-head-2); color: var(--tp-ink); font-size: 12px; text-transform: none; letter-spacing: 0; border-bottom: 1px solid #7f9db5; padding: 6px 8px; }
td { border-bottom: 1px solid #e3eaf0; padding: 5px 8px; font-size: 13px; }
tr:hover td { background: #f5f9fc; }
table.grid tbody tr.sel td { background: var(--tp-sel) !important; }
table.grid tfoot td { background: #eef3f7; border-top: 1px solid #5f7f99; border-bottom: 2px double #5f7f99; }
.grid-tools input.gfilter { border-radius: 2px; border: 1px solid var(--tp-line); }
.tabs { border-bottom: 1px solid var(--tp-line); }
.tabs button { padding: 5px 11px; font-size: 13px; color: #3c566c; border-bottom-width: 3px; }
.tabs button.on { color: var(--tp-ink); border-bottom-color: var(--tp-head); background: #fff; }

/* buttons */
.btn { border-radius: 2px; padding: 5px 11px; font-size: 13px; }
.btn-primary { background: var(--tp-blue); }
.btn-primary:hover:not(:disabled) { background: #173d5f; }
.btn-outline, .btn-ghost { border-color: #8aa5bb; color: var(--tp-ink); }
.btn-accent { background: #c96f1f; }

/* fields: no boxes, yellow when active */
.field label, .lbl { font-weight: 500; color: #33475b; font-size: 12.5px; }
.field input, .field select, .inp, .voucher input, .voucher select {
  border: 0; border-bottom: 1px solid #9fb2c3; border-radius: 0; background: transparent; padding: 5px 4px; }
.field textarea, .voucher textarea { border: 1px solid #c3d1dd; border-radius: 0; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus, .voucher input:focus, .voucher select:focus, .voucher textarea:focus {
  background: var(--tp-sel-2); box-shadow: none; border-bottom-color: var(--tp-blue); outline: none; }
.field input[readonly] { color: #56708a; }
.check input:focus { outline: 2px solid var(--tp-sel); }

/* modal / drawer / confirm */
.modal { background: rgba(15,34,51,.35); }
.modal-body { border-radius: 0; padding: 0 16px 14px; border: 1px solid #5f7f99; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.modal-head { margin: 0 -16px 12px; padding: 7px 14px; background: var(--tp-head); }
.modal-head h3 { color: #fff; font-size: 14px; }
.modal-close { color: #fff; }
.modal-foot { border-top-color: var(--tp-line-soft); }
.drawer-panel { padding: 0 16px 30px; border-left: 1px solid #5f7f99; }
.drawer-head { margin: 0 -16px 10px; padding: 8px 14px; background: var(--tp-head); border-bottom: 0; }
.drawer-head h3 { color: #fff; font-size: 15px; }
.drawer-head .modal-close { color: #fff; }
.confirm-box { max-width: 260px; padding: 0 0 12px; text-align: center; }
.confirm-box .cb-q { margin: 0 0 12px; padding: 7px 12px; background: var(--tp-head); color: #fff; font-size: 14px; }
.confirm-box .cb-yn .btn { min-width: 70px; justify-content: center; }
#zt-confirm { align-items: flex-end; justify-content: flex-end; padding: 0 180px 60px 0; background: rgba(15,34,51,.15); }

/* voucher entry */
.voucher { border: 1px solid #5f7f99; border-radius: 0; }
.voucher-head { background: var(--tp-top); border-radius: 0; padding: 6px 12px; }
.voucher-head .vh-type { background: #fff; color: var(--tp-ink); padding: 2px 10px; }
.voucher-head input { border: 0; border-radius: 0; background: #fff; color: var(--tp-ink); padding: 3px 6px; }
.voucher-head input:focus { background: var(--tp-sel); }
.voucher-head .vh-no { color: #fff; }
.voucher-foot { background: #f5f8fb; border-radius: 0; }
.igrid-wrap { border: 1px solid var(--tp-line); border-radius: 0; }
table.igrid th { background: var(--tp-head-2); border-bottom: 1px solid #7f9db5; }
table.igrid td { border-right: 0; border-bottom: 1px solid #edf2f6; }
table.igrid td input, table.igrid td select { border: 0; background: transparent; }
table.igrid td input:focus, table.igrid td select:focus { background: var(--tp-sel); box-shadow: none; }
.totals-ladder tr.grand td { border-top: 1px solid var(--tp-ink); border-bottom: 2px double var(--tp-ink); color: var(--tp-ink); }
.party-card { color: #3c566c; }
.ac-pop { border-radius: 0; border-color: #5f7f99; }
.ac-pop .ac-item.on { background: var(--tp-sel); }

/* Go To box */
.palette { border-radius: 0; border: 1px solid #5f7f99; }
.palette .pl-head { background: var(--tp-head); }
.palette li.on { background: var(--tp-sel); }

/* Gateway (home) */
.gw { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; padding-top: 6px; }
.gw-info { background: #fff; border: 1px solid var(--tp-line); }
.gw-info .gi-row { padding: 8px 12px; border-bottom: 1px solid var(--tp-line-soft); }
.gw-info .gi-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #56708a; text-transform: uppercase; }
.gw-info .gi-val { font-weight: 700; margin-top: 2px; }
.gw-info table td { border: 0; padding: 3px 0; font-size: 13px; }
.gw-menu { background: #fff; border: 1px solid #5f7f99; box-shadow: 0 6px 18px rgba(15,34,51,.12); }
.gw-menu .gm-head { background: var(--tp-head); color: #fff; font-weight: 700; text-align: center; padding: 7px; letter-spacing: .02em; }
.gw-menu .gm-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #6b8296; padding: 10px 0 3px; text-align: center; text-transform: uppercase; }
.gw-menu .gm-item { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 4px 12px; cursor: pointer; font-size: 14px; color: var(--tp-ink); text-decoration: none; position: relative; }
.gw-menu .gm-item u { color: var(--tp-key); text-decoration: none; font-weight: 800; }
.gw-menu .gm-item .gm-k { position: absolute; right: 12px; font-size: 11px; color: #7b91a4; }
.gw-menu .gm-item.on, .gw-menu .gm-item:hover { background: var(--tp-sel); text-decoration: none; }
.gw-menu .gm-foot { border-top: 1px solid var(--tp-line-soft); margin-top: 8px; padding: 6px 0 8px; }
.gw-side { display: flex; flex-direction: column; gap: 10px; }
.gw-side .card { margin: 0; }
.gw-mini td { padding: 4px 6px; }

@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "title" "main" "status"; }
  .keybar { display: none; }
  .tp-menu .tp-mi:not([data-combo="Alt+G"]) { display: none; }
  .tp-sep { display: none; }
  .gw { grid-template-columns: 1fr; }
  .gw-menu { order: -1; }
}
@media (max-width: 800px) {
  .app { grid-template-rows: 44px 30px minmax(0, 1fr) 0; }
  .tp-top { padding: 0 4px; }
  .tp-user span, .tp-user small { display: none; }
  .tp-co { display: none; }
  .sidebar { top: 74px; bottom: 0; }
  .sidebar-backdrop { inset: 74px 0 0 0; }
  #zt-confirm { align-items: center; justify-content: center; padding: 20px; }
}
/* Panels and forms open below the menu + title bars so the Back button stays clickable. */
.drawer { inset: 64px 0 0 0; }
.drawer-panel { height: 100%; }
.modal.ui-modal, #zt-modal { inset: 64px 0 0 0; padding-top: 4vh; }
@media (max-width: 800px) { .drawer, .modal.ui-modal, #zt-modal { inset: 74px 0 0 0; } }
@media print { .tp-top, .tp-titlebar { display: none !important; } }
