/* WebLuxe Aircon System — demo design system
   Brand from the WebLuxe logo: cobalt -> cyan gradient frame, ink letters. */

:root {
  --brand: #0b5cff;
  --brand-2: #00b8f0;
  --brand-ink: #0846c4;
  --brand-soft: #e8f0ff;
  --grad: linear-gradient(135deg, #1a5bff 0%, #00c6ff 100%);

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --line: #e2e7f0;
  --line-2: #eef1f7;
  --ink: #0b1533;
  --text: #1f2a44;
  --muted: #56627e;
  --dim: #6b7690;

  --ok: #0f7a55;      --ok-bg: #e4f6ee;
  --warn: #9a5b00;    --warn-bg: #fff3dc;
  --bad: #c22b2b;     --bad-bg: #fde8e8;
  --info: #0b5cff;    --info-bg: #e8f0ff;
  --vio: #6a3fd1;     --vio-bg: #efe9fd;
  --neutral-bg: #eef1f6;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 21, 51, .06), 0 4px 16px rgba(11, 21, 51, .05);
  --shadow-lg: 0 12px 48px rgba(11, 21, 51, .18);
  --side-w: 248px;
  --top-h: 60px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #3d7dff;
  --brand-ink: #7aa7ff;
  --brand-soft: #14244d;
  --bg: #070c1c;
  --surface: #0d152c;
  --surface-2: #101a34;
  --line: #1e2a4a;
  --line-2: #18223f;
  --ink: #eef2fb;
  --text: #d7deef;
  --muted: #9aa6c4;
  --dim: #8592b2;
  --ok: #3fcf98;      --ok-bg: #0f2e25;
  --warn: #f2b14c;    --warn-bg: #33250c;
  --bad: #ff7676;     --bad-bg: #3a1418;
  --info: #7aa7ff;    --info-bg: #14244d;
  --vio: #b49bff;     --vio-bg: #251b47;
  --neutral-bg: #18223f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 8px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; color: var(--ink); }
.hide { display: none !important; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }

svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Demo presenter bar ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 14px; background: #0b1533; color: #cfd8ee; font-size: 12.5px;
}
.demo-bar .tag {
  font-weight: 800; letter-spacing: .08em; font-size: 11px; color: #0b1533;
  background: var(--grad); padding: 3px 8px; border-radius: 99px;
}
.demo-bar label { display: inline-flex; align-items: center; gap: 6px; }
.demo-bar select, .demo-bar button {
  font: inherit; color: #fff; background: #17244a; border: 1px solid #2a3a68;
  border-radius: 7px; padding: 4px 8px; cursor: pointer;
}
.demo-bar button:hover, .demo-bar select:hover { border-color: #6b7690; }
.demo-bar .sp { flex: 1; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: calc(100vh - 38px); }
.side {
  position: sticky; top: 38px; height: calc(100vh - 38px); overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px 10px;
}
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side .logo img { height: 42px; width: auto; }
.side .logo .prod { font-size: 11px; line-height: 1.25; color: var(--muted); font-weight: 600; }
.side .logo .prod b { display: block; color: var(--ink); font-size: 13px; }
.nav-group { margin-top: 10px; }
.nav-group > .lbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); padding: 6px 10px 4px;
}
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0;
  border-radius: 9px; color: var(--text); font-weight: 600; font-size: 13.5px; position: relative;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--neutral-bg); color: var(--ink); }

.nav a .cnt {
  margin-left: auto; font-size: 11px; font-weight: 800; color: #fff; background: var(--bad);
  border-radius: 99px; padding: 1px 7px;
}
.nav a.locked { color: var(--dim); }
.nav a.locked .lock { margin-left: auto; font-size: 10px; font-weight: 800; color: var(--dim);
  border: 1px solid var(--line); border-radius: 99px; padding: 1px 6px; }
.side .foot { margin-top: auto; padding: 10px 8px 2px; font-size: 11.5px; color: var(--dim); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 38px; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .menu-btn { display: none; }
.top .m-logo { display: none; }
.top .search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px;
  color: var(--dim);
}
.top .search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); width: 100%; }
.top .sp { flex: 1; }
.branch-sel {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; color: var(--ink);
}
.branch-sel select { border: 0; background: transparent; font: inherit; color: inherit; outline: 0; cursor: pointer; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--dim); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }
.me { display: flex; align-items: center; gap: 9px; padding: 3px 4px 3px 3px; border-radius: 99px; cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 12.5px; color: #fff; background: var(--grad);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.me .nm { font-weight: 700; color: var(--ink); font-size: 13px; line-height: 1.15; }
.me .rl { font-size: 11.5px; color: var(--muted); }

.content { padding: 22px 26px 60px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.crumb a { color: var(--dim); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--dim); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
:root[data-theme="dark"] .btn.primary:hover { background: #2a66e6; }
.btn.grad { background: var(--grad); border: 0; color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 16px 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h .acts { margin-left: auto; display: flex; gap: 6px; }
.card-b { padding: 14px 18px; }
.grid { display: grid; gap: 14px; }
.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)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow); overflow: hidden;
}

.kpi .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { font-size: 25px; font-weight: 800; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--dim); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 750; white-space: nowrap; background: var(--neutral-bg); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.vio { background: var(--vio-bg); color: var(--vio); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 12.5px; cursor: pointer; color: var(--text);
}
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
:root[data-theme="dark"] .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 700; color: var(--muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer;
  background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; font-size: 13.5px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { font-size: 11px; font-weight: 800; background: var(--neutral-bg); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.tab.on .n { background: var(--ink); color: var(--surface); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.inp-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--dim);
}
.inp-search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); width: 100%; }

/* ---------- Tables (become cards on phone) ---------- */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl .t2 { display: block; font-size: 12px; color: var(--dim); }
.tbl tfoot td { font-weight: 800; color: var(--ink); background: var(--surface-2); border-top: 1px solid var(--line); }
.empty { padding: 38px 16px; text-align: center; color: var(--dim); }
.empty svg.i { width: 30px; height: 30px; display: block; margin: 0 auto 8px; opacity: .6; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl-sm { font-size: 12px; font-weight: 750; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--dim); }
input.in, select.in, textarea.in {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: 0;
}
textarea.in { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--dim); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
input.in.sm, select.in.sm { height: 34px; font-size: 13px; padding: 0 9px; }
.in.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.seg { display: inline-flex; background: var(--neutral-bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 13px; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Line items editor ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); text-align: left; padding: 6px 6px; font-weight: 800; }
.lines td { padding: 4px 6px; vertical-align: middle; }
.lines td.num { text-align: right; }
.lines .x { color: var(--dim); background: none; border: 0; cursor: pointer; padding: 4px; }
.lines .x:hover { color: var(--bad); }
.totals { margin-left: auto; width: min(340px, 100%); }
.totals .row { display: flex; justify-content: space-between; padding: 5px 0; gap: 10px; }
.totals .row.grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; font-size: 17px; font-weight: 800; color: var(--ink); }

/* ---------- Detail / key-value ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; }
.sec-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 18px 0 8px; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.tl li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl .when { font-size: 11.5px; color: var(--dim); }

/* ---------- Flow steps (shows the connected system) ---------- */
.flow { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.flow .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 99px; background: var(--neutral-bg); color: var(--dim); }
.flow .st.done { background: var(--ok-bg); color: var(--ok); }
.flow .st.now { background: var(--brand); color: #fff; }
.flow .ar { color: var(--dim); font-size: 11px; }

/* ---------- Modal / sheet ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(7, 12, 28, .5); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 24px; animation: fade .15s ease;
}
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.lg { width: min(980px, 100%); }
.modal.xl { width: min(1180px, 100%); }
.modal.sm { width: min(440px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--surface); padding: 11px 16px;
  border-radius: 11px; box-shadow: var(--shadow-lg); font-weight: 650; font-size: 13.5px; animation: pop .2s ease; max-width: 380px;
}
.toast.ok svg { color: #3fcf98; }

/* ---------- Upsell (locked module) ---------- */
.upsell { max-width: 620px; margin: 30px auto; text-align: center; padding: 34px 28px; }
.upsell .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--grad); color: #fff; }
.upsell .ic svg.i { width: 30px; height: 30px; }
.upsell ul { text-align: left; display: inline-block; margin: 10px auto 18px; color: var(--muted); }

/* ---------- Plan cards ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); position: relative; }
.plan.cur { border: 2px solid var(--ink); }
.plan .pr { font-size: 24px; font-weight: 800; color: var(--ink); }
.plan ul { padding-left: 18px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Bars (simple charts) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--brand); }
.bars .b.today i { background: var(--grad); }
.bars .b span { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: 13px; margin: 7px 0; }
.hbar .track { height: 9px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- Mobile list items ---------- */
.mlist .it {
  display: flex; gap: 12px; align-items: center; padding: 13px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer;
}
.mlist .it .grow { flex: 1; min-width: 0; }
.mlist .it .t { font-weight: 750; color: var(--ink); }
.mlist .it .s { font-size: 12.5px; color: var(--muted); }

/* ---------- Login ---------- */
.login { min-height: calc(100vh - 38px); display: grid; grid-template-columns: 1.05fr 1fr; }
.login .art {
  background: #0b1533; color: #cdd7ef; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}

.login .art > * { position: relative; z-index: 1; }
.login .art h1 { color: #fff; font-size: 38px; line-height: 1.08; letter-spacing: -.02em; max-width: 520px; }
.login .art .flowline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; max-width: 520px; }
.login .art .flowline span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #17244a; color: #cfe0ff; }
.login .form { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.role-card {
  display: flex; gap: 10px; align-items: center; text-align: left; padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
}
.role-card:hover { border-color: var(--dim); }
.role-card .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.role-card b { display: block; color: var(--ink); font-size: 13.5px; }
.role-card span { font-size: 12px; color: var(--muted); }

/* ---------- Collapsible sidebar (desktop: icon rail, remembered per browser) ---------- */
.side-h { display: flex; align-items: flex-start; gap: 4px; }
.side-h .logo { flex: 1; min-width: 0; }
.side-tg {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 9px;
  border: 0; border-radius: 9px; background: transparent; color: var(--dim); cursor: pointer;
}
.side-tg:hover { background: var(--surface-2); color: var(--ink); }
.nav a svg.i { flex: none; }
.app { transition: grid-template-columns .22s ease; }
@media screen and (min-width: 901px) {
  .app.mini { grid-template-columns: 72px 1fr; }
  .app.mini .side { padding: 12px 10px 10px; overflow-x: hidden; scrollbar-width: none; }
  .app.mini .side-h { flex-direction: column; align-items: center; gap: 6px; padding-bottom: 6px; }
  .app.mini .side .logo { padding: 2px 0; justify-content: center; }
  .app.mini .side .logo img { height: auto; width: 44px; }
  .app.mini .side-tg { margin-top: 0; }
  .app.mini .side .logo .prod, .app.mini .nav-group > .lbl, .app.mini .nav a .nl, .app.mini .nav a .lock, .app.mini .side .foot { display: none; }
  .app.mini .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); }
  .app.mini .nav a { justify-content: center; padding: 10px 0; }
  .app.mini .nav a .cnt { position: absolute; top: 2px; right: 4px; margin: 0; padding: 0 5px; font-size: 9.5px; line-height: 15px; }
  /* label pops out to the right on hover (fixed + static position escapes the rail's scroll clip) */
  .app.mini .nav a:hover::after {
    content: attr(data-tip); position: fixed; left: 76px; margin-top: -2px; z-index: 95; white-space: nowrap; pointer-events: none;
    padding: 6px 10px; border-radius: 8px; background: #0b1533; color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-lg);
  }
}

/* ---------- Bottom tabs (phone) ---------- */
.btabs { display: none; }
.fab { display: none; }
.drawer-bg { display: none; }

/* ---------- Phone ---------- */
@media screen and (max-width: 900px) {
  body { font-size: 14.5px; }
  .demo-bar { padding: 6px 10px; gap: 6px; font-size: 12px; }
  .demo-bar .hide-m { display: none; }
  .app { display: block; }
  .side {
    position: fixed; z-index: 90; top: 0; left: 0; bottom: 0; height: 100vh; width: 284px;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.drawer .side { transform: none; }
  body.drawer .drawer-bg { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(7, 12, 28, .45); }
  .top { padding: 0 12px; gap: 8px; height: 56px; }
  .top .menu-btn { display: inline-grid; border: 0; background: transparent; }
  .top .m-logo { display: block; height: 30px; }
  .top .search, .top .branch-sel, .me .txt, .top .hide-m { display: none; }
  .content { padding: 16px 14px 96px; }
  h1 { font-size: 20px; }
  .page-head { margin-bottom: 12px; }
  .page-head .acts { margin-left: 0; width: 100%; }
  .page-head .acts .btn { flex: 1; }
  .g2, .g3, .g4, .g-main { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .val { font-size: 20px; }
  .form-grid, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .inp-search { min-width: 0; flex: 1; }
  .kv { grid-template-columns: 110px 1fr; }

  /* tables turn into cards */
  .tbl-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tfoot { display: block; }
  .tbl tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; padding: 8px 12px; box-shadow: var(--shadow); }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--dim); text-align: left; flex: none; }
  .tbl td:first-child { text-align: left; font-size: 15px; }
  .tbl td:first-child::before { display: none; }
  .tbl td.num { text-align: right; }
  .tbl td[data-label=""]::before { display: none; }

  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .lines td { padding: 0; }
  .lines td.item { grid-column: 1 / -1; }

  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.lg, .modal.xl, .modal.sm { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-f .btn { flex: 1; }

  .btabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .btabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--dim); padding: 4px 0; position: relative; }
  .btabs a svg.i { width: 22px; height: 22px; }
  .btabs a.on { color: var(--ink); }
  .btabs a.on::before { content: ""; position: absolute; top: -7px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
  .btabs a .cnt { position: absolute; top: 0; left: 55%; font-size: 10px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 5px; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 71; right: 16px; bottom: 78px; width: 54px; height: 54px; border-radius: 17px;
    background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(11, 92, 255, .4); border: 0; }
  .fab svg.i { width: 24px; height: 24px; }
  .toasts { left: 12px; right: 12px; bottom: 84px; }
  .login { grid-template-columns: 1fr; }
  .login .art { padding: 28px 22px; min-height: 0; }
  .login .art h1 { font-size: 26px; }
  .login .form { padding: 24px 18px 40px; }
  .hbar { grid-template-columns: 90px 1fr auto; }
}

/* ---------- Print ---------- */
@media print {
  .demo-bar, .side, .top, .btabs, .fab, .page-head, .no-print, .bulk-bar, .tbl td.sel, .tbl th.sel { display: none !important; }
  .card { box-shadow: none; }
  .app { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ---------- multi-select tables ---------- */
.tbl th.sel, .tbl td.sel { width: 38px; padding-right: 0; }
.tbl td.sel input, .tbl th.sel input { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
.bulk-bar { display: none; align-items: center; gap: 8px; padding: 9px 14px; background: var(--ink); color: var(--surface); font-weight: 700; font-size: 13px; }
.bulk-bar .bulk-n { margin-right: auto; }
.bulk-bar .btn { background: transparent; color: var(--surface); border-color: rgba(255,255,255,.25); }
.bulk-bar .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.tbl-wrap.selecting .bulk-bar { display: flex; }
@media screen and (max-width: 900px) {
  .tbl-wrap.has-sel .tbl tbody tr { position: relative; padding-right: 40px; }
  .tbl td.sel { position: absolute; top: 10px; right: 6px; width: auto; display: block; }
  .tbl td.sel::before { display: none; }
  .bulk-bar { position: sticky; top: 94px; z-index: 30; border-radius: 12px; margin-bottom: 8px; }
}

/* ---------- search-to-select dropdown (select-search.js) ---------- */
.ss-pop { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: 340px; overflow: hidden; animation: pop .14s ease; color: var(--text); font-family: var(--font); }
.ss-search { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.ss-search svg { width: 16px; height: 16px; flex: none; stroke: var(--dim); fill: none; stroke-width: 2; stroke-linecap: round; }
.ss-q { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); width: 100%; height: 26px; }
.ss-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.ss-opt { position: relative; padding: 8px 30px 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; line-height: 1.3; }
.ss-opt.hi { background: var(--neutral-bg); }
.ss-opt.cur { font-weight: 750; color: var(--ink); }
.ss-opt.off { opacity: .45; cursor: not-allowed; }
.ss-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ss-ck { position: absolute; right: 10px; top: 8px; color: var(--ok); font-weight: 800; }
.ss-grp { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ss-empty { padding: 14px 10px; font-size: 13px; color: var(--dim); text-align: center; }
.ss-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
.ss-head b { color: var(--ink); font-size: 15px; }
.ss-x { border: 0; background: var(--neutral-bg); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; color: var(--ink); }
.ss-bg { position: fixed; inset: 0; z-index: 399; background: rgba(7, 12, 28, .45); }
.ss-pop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.ss-pop.sheet .ss-search { margin: 6px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ss-pop.sheet .ss-opt { padding: 12px 34px 12px 12px; font-size: 15px; }

/* ---------- Phone polish: slim demo bar, sticky app header, cleaner list cards ---------- */
@media screen and (max-width: 900px) {
  /* demo bar = one slim row that scrolls away; the app header sticks to the very top */
  .demo-bar { position: relative; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding: 6px 10px; }
  .demo-bar::-webkit-scrollbar { display: none; }
  .demo-bar > * { flex: none; }
  .demo-bar select { max-width: 170px; padding: 3px 6px; }
  .app { min-height: 100vh; }
  .top { top: 0; height: 58px; padding: 0 10px 0 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
  .top .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .top .m-logo { height: 32px; }
  .bulk-bar { top: 66px; }

  /* page head: bigger title, buttons sit side by side */
  .page-head h1 { font-size: 23px; letter-spacing: -.02em; }
  .page-head .sub { font-size: 13px; }
  .page-head .acts .btn { height: 44px; border-radius: 12px; }

  /* tabs: swipeable pills instead of a clipped underline row */
  .tabs { gap: 6px; border-bottom: 0; margin: 0 -14px 12px; padding: 2px 14px 4px; }
  .tab { padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); margin: 0; font-size: 13px; }
  .tab.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
  .tab.on .n { background: rgba(255,255,255,.2); color: #fff; }

  /* KPIs: tighter, the label never wraps into three lines */
  .kpi { border-radius: 16px; }
  .kpi .lbl { font-size: 10.5px; letter-spacing: .04em; line-height: 1.3; }
  .kpi .val { font-size: 21px; }

  /* list cards: the first column is the card title, the rest are tidy label / value rows */
  .tbl tbody tr { position: relative; padding: 13px 14px 8px; border-radius: 16px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(11, 21, 51, .05); }
  .tbl tbody tr.click:active { transform: scale(.99); }
  .tbl tbody tr.click:hover td { background: transparent; }
  .tbl td { display: grid; grid-template-columns: minmax(88px, 36%) minmax(0, 1fr); align-items: baseline; column-gap: 12px; row-gap: 0; padding: 7px 0; border-top: 1px dashed var(--line-2); font-size: 13.5px; }
  .tbl td::before { grid-column: 1; grid-row: 1 / span 6; font-size: 12px; font-weight: 650; color: var(--dim); }
  .tbl td > * { grid-column: 2; justify-self: end; text-align: right; max-width: 100%; }
  .tbl td .t2 { font-size: 11.5px; margin-top: 1px; }
  .tbl td[data-label=""] { display: block; }
  .tbl td:first-child:not(.sel), .tbl td.sel + td {
    display: block; text-align: left; border-top: 0; padding: 0 30px 9px 0; font-size: 15px; font-weight: 700; color: var(--ink);
  }
  .tbl td:first-child:not(.sel)::before, .tbl td.sel + td::before { display: none; }
  .tbl td:first-child:not(.sel) > *, .tbl td.sel + td > * { justify-self: start; text-align: left; }
  .tbl td.sel + td + td, .tbl td:first-child:not(.sel) + td { border-top: 1px solid var(--line-2); }
  .tbl td.sel { top: 11px; right: 10px; border-top: 0; }
  .tbl tfoot tr { display: block; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
  .tbl tfoot td { display: block; border: 0; background: transparent; padding: 2px 0; }
  .tbl tfoot td::before { display: none; }

  /* card headers with several buttons wrap instead of running off the screen */
  .card-h { flex-wrap: wrap; row-gap: 8px; }
  .card-h .acts { flex-wrap: wrap; justify-content: flex-end; }

  /* floating + button: a bit smaller so it covers less of the list */
  .fab { width: 50px; height: 50px; border-radius: 16px; right: 14px; bottom: 80px; }
}
