/* OwnerView by GloryTech — glass UI. Teal → indigo brand, amber highlights, GloryTech navy logo. */

/* ---------- tokens ---------- */
:root {
  --bg: #eef2f8;
  --blob1: rgba(20, 184, 166, .28);
  --blob2: rgba(99, 102, 241, .22);
  --blob3: rgba(245, 158, 11, .14);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-hover: rgba(255, 255, 255, .85);
  --glass-border: rgba(255, 255, 255, .9);
  --glass-edge: rgba(255, 255, 255, .7);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(30, 41, 80, .18);
  --ink: #0f172a;
  --muted: #64708a;
  --line: rgba(15, 23, 42, .07);
  --track: rgba(15, 23, 42, .06);
  --logo: #1b2f4b;
  --brand: #0d9488;
  --brand-grad: linear-gradient(135deg, #0d9488 0%, #2563eb 55%, #6d28d9 100%);
  --brand-soft: rgba(13, 148, 136, .12);
  --b1: #0d9488;
  --b2: #f59e0b;
  --c3: #6366f1;
  --ok: #059669;
  --warn: #d9480f;
  --red: #e11d48;
  --amber: #f59e0b;
  --info: #6366f1;
  --good: #059669;
  --blur: blur(20px) saturate(180%);
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a14; --blob1: rgba(20, 184, 166, .18); --blob2: rgba(99, 102, 241, .24); --blob3: rgba(168, 85, 247, .14);
    --glass: rgba(20, 28, 48, .55); --glass-strong: rgba(13, 19, 35, .86); --glass-hover: rgba(32, 42, 68, .7);
    --glass-border: rgba(255, 255, 255, .08); --glass-edge: rgba(255, 255, 255, .06);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 14px 36px -14px rgba(0, 0, 0, .6);
    --ink: #e8edf7; --muted: #8e99b3; --line: rgba(255, 255, 255, .07); --track: rgba(255, 255, 255, .08); --logo: #e8edf7;
    --brand: #2dd4bf; --brand-grad: linear-gradient(135deg, #0f766e 0%, #1d4ed8 55%, #6d28d9 100%); --brand-soft: rgba(45, 212, 191, .14);
    --b1: #2dd4bf; --b2: #fbbf24; --c3: #818cf8;
    --ok: #34d399; --warn: #fb923c; --red: #fb7185; --amber: #fbbf24; --info: #818cf8; --good: #34d399;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060a14; --blob1: rgba(20, 184, 166, .18); --blob2: rgba(99, 102, 241, .24); --blob3: rgba(168, 85, 247, .14);
  --glass: rgba(20, 28, 48, .55); --glass-strong: rgba(13, 19, 35, .86); --glass-hover: rgba(32, 42, 68, .7);
  --glass-border: rgba(255, 255, 255, .08); --glass-edge: rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 14px 36px -14px rgba(0, 0, 0, .6);
  --ink: #e8edf7; --muted: #8e99b3; --line: rgba(255, 255, 255, .07); --track: rgba(255, 255, 255, .08); --logo: #e8edf7;
  --brand: #2dd4bf; --brand-grad: linear-gradient(135deg, #0f766e 0%, #1d4ed8 55%, #6d28d9 100%); --brand-soft: rgba(45, 212, 191, .14);
  --b1: #2dd4bf; --b2: #fbbf24; --c3: #818cf8;
  --ok: #34d399; --warn: #fb923c; --red: #fb7185; --amber: #fbbf24; --info: #818cf8; --good: #34d399;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  color: var(--ink); min-height: 100vh; background: var(--bg);
  font: 14.5px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gujarati", sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
/* fixed colour wash behind the glass (a layer, so long pages never band) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 640px at 0% -10%, var(--blob1), transparent 62%),
    radial-gradient(820px 600px at 100% 0%, var(--blob2), transparent 60%),
    radial-gradient(1000px 760px at 60% 115%, var(--blob3), transparent 60%);
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }
.kpi-v, .bs-v, .hb-v, .big2, .tbl td, .pnl-big span, .donut-v, .dl-r b { font-variant-numeric: tabular-nums; }

.top, .card, .kpi, .tabs, .chip, .btn, .search, .sheet, .banner, .bubble, .composer input, .seg, .icon-btn, .logo {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.card, .kpi {
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge);
}
.ic { width: 18px; height: 18px; }

/* ---------- logo ---------- */
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); color: var(--logo);
}
.gt-mark { width: 22px; height: 24px; color: var(--logo); }
.gt-mark.sm { width: 18px; height: 20px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--glass-strong); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand > div { min-width: 0; }
.co { font-weight: 750; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.asof { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo { background: var(--brand-soft); color: var(--brand); padding: 0 7px; border-radius: 6px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.seg { display: flex; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px -4px rgba(37, 99, 235, .55); }
.icon-btn { border: 1px solid var(--line); background: var(--glass); color: var(--ink); width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--glass-hover); }
.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner {
  margin: 10px 16px 0; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; text-align: center;
  background: color-mix(in srgb, var(--amber) 22%, var(--glass-strong)); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
}

main { padding: 16px 16px 20px; outline: none; display: flex; flex-direction: column; gap: 14px; }

/* ---------- greeting & cards ---------- */
.hello { padding: 4px 2px 0; }
.hello-g { font-size: 25px; font-weight: 800; letter-spacing: -.7px; }
.hello-d { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card { border-radius: var(--r); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card h2 { display: flex; align-items: center; gap: 10px; font-size: 14.5px; margin: 0; font-weight: 700; letter-spacing: -.15px; }
.h-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.h-ic .ic { width: 16px; height: 16px; }
.count { display: inline-block; min-width: 22px; padding: 2px 8px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; text-align: center; font-weight: 700; }
.count.soft { background: var(--track); color: var(--muted); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: var(--glass); padding: 8px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 650;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); transition: background .15s, transform .15s;
}
.btn:hover { background: var(--glass-hover); transform: translateY(-1px); }
.btn.wa { background: #22c55e; color: #052e16; border-color: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-row.sm { margin-top: 8px; }
.btn.more { margin-top: 10px; width: 100%; justify-content: center; color: var(--muted); }

/* ---------- KPI tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi {
  --tone: var(--b1); position: relative; overflow: hidden; text-align: left; border-radius: 18px; padding: 15px 16px; min-width: 0;
  color: var(--ink); display: flex; flex-direction: column; gap: 4px; transition: transform .15s ease, background .15s ease;
}
.kpi.t-blue { --tone: #3b82f6; } .kpi.t-violet { --tone: var(--c3); } .kpi.t-amber { --tone: var(--amber); }
.kpi.t-rose { --tone: var(--red); } .kpi.t-green { --tone: var(--ok); } .kpi.t-teal { --tone: var(--b1); }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone) 18%, transparent), transparent 70%); pointer-events: none; }
.kpi[data-goto]:hover { background: var(--glass-hover); transform: translateY(-2px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.kpi-ic .ic { width: 17px; height: 17px; }
.kpi-v { font-size: 24px; font-weight: 800; letter-spacing: -.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; min-height: 18px; }
.kpi-s { font-size: 12px; color: var(--muted); }
.kpi .spark { width: 72px; height: 26px; flex: none; }
.kpi.bad { --tone: var(--red); }
.kpi.bad .kpi-v { color: var(--red); }
.chg { font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.chg.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.chg.down { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 6px; flex-wrap: wrap; }

/* ---------- bars & progress ---------- */
.prog { height: 8px; background: var(--track); border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--b1), var(--c3)); border-radius: 6px; }
.prog-fill.bad { background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 70%, #f97316)); }
.prog-fill.amber { background: linear-gradient(90deg, var(--amber), color-mix(in srgb, var(--amber) 70%, #ef4444)); }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.hb-l { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-v { font-weight: 700; white-space: nowrap; }
.hb-track { height: 8px; background: var(--track); border-radius: 6px; overflow: hidden; }
.hb-fill { height: 100%; background: linear-gradient(90deg, var(--b1), color-mix(in srgb, var(--b1) 55%, var(--c3))); border-radius: 6px; }
.hb-fill.c2 { background: linear-gradient(90deg, var(--b2), color-mix(in srgb, var(--b2) 65%, #ef4444)); }
.hb-fill.c3 { background: linear-gradient(90deg, var(--c3), color-mix(in srgb, var(--c3) 60%, #a855f7)); }
.hb-fill.amber { background: linear-gradient(90deg, var(--amber), color-mix(in srgb, var(--amber) 65%, #ef4444)); }
.hb-fill.red { background: var(--red); }
.hb-s { font-size: 12px; color: var(--muted); margin-top: 5px; }
.hb.tap { cursor: pointer; }
.hb.tap:hover .hb-l { color: var(--brand); }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line); stroke-width: 1.5; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .ref { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; opacity: .7; }
.chart .ln { fill: none; stroke: var(--b1); stroke-width: 2.5; }
.chart .dot { fill: var(--glass-strong); stroke: var(--b1); stroke-width: 2; }
.chart .dot.bad { stroke: var(--red); fill: var(--red); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.b1 { background: var(--b1); }
.legend i.b2 { background: var(--b2); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.donut-track { fill: none; stroke: var(--track); stroke-width: 14; }
.donut-v { fill: var(--ink); font-size: 13px; font-weight: 800; font-family: inherit; }
.donut-l { fill: var(--muted); font-size: 8.5px; font-family: inherit; }
.dl { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 9px; }
.dl-r { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dl-r i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dl-r span { flex: 1; color: var(--muted); }
.pnl-big { display: flex; flex-direction: column; margin-bottom: 10px; }
.pnl-big span { font-size: 28px; font-weight: 800; letter-spacing: -.8px; }
.pnl-big small { color: var(--muted); font-size: 12.5px; }

/* ---------- alerts ---------- */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li + li { border-top: 1px solid var(--line); }
.al { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border: 0; background: none; text-align: left; font-size: 13.5px; border-radius: 10px; }
.al:hover { background: var(--glass-hover); }
.al-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--info); }
.al.red .al-dot { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.al.amber .al-dot { background: var(--amber); }
.al.good .al-dot { background: var(--good); }
.al-t { flex: 1; }
.chev { color: var(--muted); font-size: 18px; }

/* ---------- lists, avatars, tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list .r { text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.big2 { font-weight: 800; font-size: 15px; }
.tap { cursor: pointer; }
.list li.tap { align-items: center; }
.list li.tap:hover b, tr.tap:hover b { color: var(--brand); }
.link { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
.link:hover b { color: var(--brand); }
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.av {
  --h: 180; width: 32px; height: 32px; border-radius: 10px; flex: none; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 750; letter-spacing: .3px; color: hsl(var(--h) 70% 32%);
  background: linear-gradient(135deg, hsl(var(--h) 85% 90%), hsl(calc(var(--h) + 40) 80% 84%));
}
:root[data-theme="dark"] .av { color: hsl(var(--h) 90% 85%); background: linear-gradient(135deg, hsl(var(--h) 45% 26%), hsl(calc(var(--h) + 40) 45% 22%)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av { color: hsl(var(--h) 90% 85%); background: linear-gradient(135deg, hsl(var(--h) 45% 26%), hsl(calc(var(--h) + 40) 45% 22%)); } }
.hb-l .av { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--track); color: var(--muted); white-space: nowrap; }
.tag.red { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.tag.amber { background: color-mix(in srgb, var(--amber) 18%, transparent); color: color-mix(in srgb, var(--amber) 65%, var(--ink)); }
.tag.green { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.tag.violet { background: color-mix(in srgb, var(--c3) 14%, transparent); color: var(--c3); }
.tag.teal { background: color-mix(in srgb, var(--b1) 14%, transparent); color: var(--b1); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl td, .tbl th { padding: 8px 0; border-top: 1px solid var(--line); text-align: right; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.tbl tr:first-child td { border-top: 0; }
.tbl th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; border-top: 0; }
.tbl tr.sub td { color: var(--muted); font-size: 12.5px; padding: 4px 0; border-top: 0; }
.tbl.data th, .tbl.data td { padding: 10px 10px; text-align: left; }
.tbl.data th:last-child, .tbl.data td:last-child { text-align: right; }
.tbl.data thead th { background: var(--track); }
.tbl.data thead th:first-child { border-radius: 10px 0 0 10px; }
.tbl.data thead th:last-child { border-radius: 0 10px 10px 0; }
.tbl.data tbody tr:hover { background: var(--glass-hover); }
.tbl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tbl-tools .chips-row { margin: 0; }
.tbl-tools .search { margin: 0; flex: 1; min-width: 200px; }
@media (max-width: 639px) { .hide-sm { display: none; } }

/* ---------- chips & search ---------- */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--glass); padding: 7px 15px; border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.chip:hover { background: var(--glass-hover); }
.chip.on { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .6); }
.search { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font: inherit; outline: none; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- team & factory ---------- */
.team { display: flex; flex-direction: column; gap: 16px; }
.team .av { width: 28px; height: 28px; font-size: 10.5px; border-radius: 9px; }
.lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.ln-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--glass); display: flex; flex-direction: column; gap: 10px; }
.ln-card.bad { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: color-mix(in srgb, var(--red) 6%, var(--glass)); }
.ln-card.amber { border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.ln-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ring {
  --p: 0; --c: var(--b1); width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0);
}
.ring span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); font-size: 12px; font-weight: 800; }
.ln-card.bad .ring { --c: var(--red); }
.ln-card.amber .ring { --c: var(--amber); }
.ln-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 11.5px; color: var(--muted); }
.ln-stats span { display: flex; flex-direction: column; gap: 2px; }
.ln-stats b { color: var(--ink); font-size: 13px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 0; }

/* ---------- navigation: floating glass bar on phones ---------- */
.tabs {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100% - 20px); max-width: 540px;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 22px; box-shadow: var(--shadow);
}
.nav-brand, .nav-foot { display: none; }
.tabs button { border: 0; background: none; padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 16px; }
.tabs .ti svg { width: 20px; height: 20px; }
.tabs button.on { color: var(--brand); background: var(--brand-soft); }

.fab {
  position: fixed; z-index: 21; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom));
  border: 0; border-radius: 28px; padding: 12px 18px; background: var(--brand-grad); color: #fff; font-weight: 750; font-size: 14px;
  box-shadow: 0 14px 30px -8px rgba(79, 70, 229, .65);
}
.fab:hover { filter: brightness(1.08); }

/* ---------- sheets (Ask AI, customer drill-down) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--glass-strong); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
#detail { z-index: 55; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-title { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.sheet-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.detail-body { flex: 1; overflow-y: auto; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.detail-body > p { margin: 0; }
.detail-body .card { padding: 16px; }
.chat { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: 14.5px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.msg.me .bubble { background: var(--brand-grad); color: #fff; border-color: transparent; border-bottom-right-radius: 6px; }
.msg.bot .bubble { border-bottom-left-radius: 6px; }
.msg-act { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.msg-act button { border: 1px solid var(--line); background: var(--glass); border-radius: 9px; font-size: 12px; padding: 3px 10px; }
.sheet .chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 18px 8px; scrollbar-width: none; }
.composer { display: flex; gap: 8px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--glass); color: var(--ink); border-radius: 24px; padding: 11px 16px; font: inherit; outline: none; }
.composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mic, .send { border: 0; width: 44px; height: 44px; border-radius: 50%; flex: none; font-size: 17px; }
.mic { background: var(--track); }
.mic.live { background: var(--red); color: #fff; animation: pulse 1s infinite; }
.send { background: var(--brand-grad); color: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--red) 25%, transparent); } }
.mbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.mb { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.mb-v { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.mb-bar { height: 90px; width: 100%; display: flex; align-items: flex-end; background: var(--track); border-radius: 10px; overflow: hidden; }
.mb-bar div { width: 100%; background: linear-gradient(180deg, var(--c3), var(--b1)); border-radius: 10px 10px 0 0; }
.mb-l { font-size: 11.5px; color: var(--muted); }

/* ---------- Today's brief: the owner's 10-second view ---------- */
.brief2 {
  --b-soft: rgba(255, 255, 255, .78); --b-glass: rgba(255, 255, 255, .13); --b-line: rgba(255, 255, 255, .2); --b-spark: #ffffff;
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 20px;
  background: var(--brand-grad); box-shadow: 0 24px 48px -20px rgba(37, 99, 235, .65);
}
.brief2::before, .brief2::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.brief2::before { width: 360px; height: 360px; right: -110px; top: -170px; background: radial-gradient(circle, rgba(255, 255, 255, .24), transparent 70%); }
.brief2::after { width: 300px; height: 300px; left: -100px; bottom: -180px; background: radial-gradient(circle, rgba(45, 212, 191, .4), transparent 70%); }
.brief2 > * { position: relative; z-index: 1; }
.b-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.b-title { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--b-soft); }
.b-pill { font-size: 12px; font-weight: 750; padding: 4px 12px; border-radius: 20px; background: #f43f5e; color: #fff; box-shadow: 0 0 0 4px rgba(244, 63, 94, .25); }
.b-pill.ok { background: rgba(255, 255, 255, .2); box-shadow: none; }
.b-main { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.b-head { font-size: 21px; line-height: 1.3; font-weight: 800; letter-spacing: -.5px; margin-bottom: 14px; max-width: 780px; }
.brief2.good .b-head::before { content: "▲ "; color: #86efac; }
.brief2.warn .b-head::before, .brief2.bad .b-head::before { content: "▼ "; color: #fcd34d; }
.b-prog { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .18); margin-bottom: 7px; }
.b-prog-done { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #5eead4, #fde68a); box-shadow: 0 0 16px rgba(253, 230, 138, .5); }
.b-prog-proj { position: absolute; top: -4px; width: 3px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(-1px); }
.b-prog-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--b-soft); }
.b-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.bs {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0; color: inherit;
  background: var(--b-glass); border: 1px solid var(--b-line); border-radius: 16px; padding: 12px 14px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background .15s, transform .15s;
}
.bs:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.bs:last-child:nth-child(odd) { grid-column: 1 / -1; }
.bs-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 6px; }
.bs-l { font-size: 12px; color: var(--b-soft); }
.bs-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.bs-ic .ic { width: 15px; height: 15px; }
.bs-v { font-size: 23px; font-weight: 800; letter-spacing: -.6px; white-space: nowrap; }
.bs-s { font-size: 11.5px; color: var(--b-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bs-sp { position: absolute; right: 0; bottom: 0; width: 55%; height: 34px; opacity: .55; pointer-events: none; }
.bs-sp .spark { width: 100%; height: 100%; }
.bs.neg .bs-v { color: #fecdd3; }
.bs.pos .bs-v { color: #a7f3d0; }
.b-todo { background: rgba(2, 6, 23, .18); border: 1px solid var(--b-line); border-radius: 16px; padding: 8px 10px; }
.b-todo-h { font-size: 11.5px; font-weight: 700; color: var(--b-soft); text-transform: uppercase; letter-spacing: .6px; padding: 2px 2px 6px; }
.b-act { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; color: inherit; padding: 8px 2px; font-size: 13.5px; border-top: 1px solid var(--b-line); }
.b-act:first-of-type { border-top: 0; }
.b-ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.b-ic .ic { width: 16px; height: 16px; }
.b-act.red .b-ic { background: #f43f5e; }
.b-act.amber .b-ic { background: #f59e0b; }
.b-at { flex: 1; }
.b-act .chev { color: var(--b-soft); }
.b-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.b-btns .btn { background: rgba(255, 255, 255, .95); color: #1e1b4b; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.b-btns .btn.wa { background: #22c55e; color: #052e16; }

/* ---------- tablet: two-column cards ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .b-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bs:last-child:nth-child(odd) { grid-column: auto; }
  main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  main > .hello, main > .brief2, main > .grid, main > .chips-row, main > .foot, main > .w7, main > .w8, main > .w12 { grid-column: 1 / -1; }
}

/* ---------- desktop web: sidebar + floating header + bento grid ---------- */
@media (min-width: 1000px) {
  body {
    display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "nav top" "nav banner" "nav main"; padding: 0;
  }
  .tabs {
    grid-area: nav; position: sticky; top: 0; left: auto; bottom: auto; transform: none; width: auto; max-width: none; height: 100vh;
    display: flex !important; flex-direction: column; gap: 4px; padding: 22px 16px; border-radius: 0;
    border: 0; border-right: 1px solid var(--line); box-shadow: none;
  }
  .nav-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 26px; }
  .nav-brand b { display: block; font-size: 17px; letter-spacing: -.3px; }
  .nav-brand span { display: block; font-size: 11.5px; color: var(--muted); }
  .nav-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); color: var(--logo); }
  .nav-foot b { display: block; font-size: 12.5px; color: var(--logo); }
  .nav-foot span { display: block; font-size: 11px; color: var(--muted); }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; font-size: 14.5px; font-weight: 600; border-radius: 14px; }
  .tabs button:hover { background: var(--glass-hover); color: var(--ink); }
  .tabs button.on { background: var(--brand-grad); color: #fff; box-shadow: 0 12px 24px -12px rgba(37, 99, 235, .75); }
  .tabs .ti svg { width: 19px; height: 19px; }

  .top { grid-area: top; margin: 16px 28px 0; padding: 12px 18px; border-radius: 20px; top: 16px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
  .top .logo { display: none; }
  .co { font-size: 17px; }
  .banner { grid-area: banner; margin: 12px 28px 0; }

  main { grid-area: main; align-self: start; padding: 22px 28px 48px; max-width: 1600px; width: 100%; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
  main > * { grid-column: span 6; }
  main > .hello, main > .brief2, main > .grid, main > .chips-row, main > .foot, main > .w12 { grid-column: 1 / -1; }
  main > .w3 { grid-column: span 3; } main > .w4 { grid-column: span 4; } main > .w5 { grid-column: span 5; }
  main > .w7 { grid-column: span 7; } main > .w8 { grid-column: span 8; }
  .grid { gap: 18px; }
  .kpi { padding: 18px 20px; }
  .kpi-v { font-size: 28px; }
  .hello-g { font-size: 30px; }

  .brief2 { padding: 26px 28px; }
  .b-main { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 28px; }
  .b-left { flex: 1; min-width: 0; }
  .b-head { font-size: 26px; }
  .b-btns { flex: none; }
  .b-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .bs { padding: 14px 16px; }
  .bs-v { font-size: 25px; }
  .b-todo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: none; border: 0; padding: 0; }
  .b-todo-h { grid-column: 1 / -1; padding: 0 2px; }
  .b-act { border: 1px solid var(--b-line) !important; border-radius: 16px; padding: 12px 14px; background: rgba(2, 6, 23, .16); }
  .b-act:hover { background: rgba(2, 6, 23, .28); }

  .fab { right: 32px; bottom: 32px; padding: 14px 22px; font-size: 15px; }
  .sheet {
    left: auto; right: 16px; top: 16px; bottom: 16px; width: 480px; border-radius: 24px; border: 1px solid var(--glass-border);
    transform: translateX(calc(100% + 24px)); box-shadow: 0 32px 64px -20px rgba(15, 23, 42, .45);
  }
  .sheet.open { transform: none; }
  .sheet .grid { grid-template-columns: 1fr 1fr; }
  .sheet-head { padding: 18px 20px 14px; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  main > .w3, main > .w4, main > .w5 { grid-column: span 6; }
  main > .w7, main > .w8 { grid-column: 1 / -1; }
}

/* chart frame: svg stretches to the card, labels stay normal text */
.chart-box { width: 100%; }
.chart-box .chart { width: 100%; display: block; overflow: visible; }
.chart-box .grid-l, .chart-box .ref, .chart-box .base { vector-effect: non-scaling-stroke; }
.plot { position: relative; }
.pt { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--glass-strong); border: 2px solid var(--b1); }
.pt.bad { background: var(--red); border-color: var(--red); }
.xaxis { position: relative; height: 18px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.xaxis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
/* cards are flex columns so a bar chart can grow to fill a tall bento cell */
.card { display: flex; flex-direction: column; }
.card > .chart-box { flex: 1; display: flex; flex-direction: column; }
.card > .chart-box > .chart { flex: 1; height: var(--h); min-height: var(--h); }
/* never let a card push the page wider than the screen */
main > *, .brief2 > *, .b-main, .b-left { min-width: 0; }
.b-head { overflow-wrap: anywhere; }
html, body { overflow-x: clip; }
/* original GloryTech logo files: navy mark in light mode, white mark in dark mode */
.gt-logo { width: 24px; height: 26px; object-fit: contain; display: block; }
.gt-logo.on-dark { display: none; }
:root[data-theme="dark"] .gt-logo.on-light { display: none; }
:root[data-theme="dark"] .gt-logo.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gt-logo.on-light { display: none; }
  :root:not([data-theme="light"]) .gt-logo.on-dark { display: block; }
}
.gt-full { height: 34px; width: auto; display: block; }
:root[data-theme="dark"] .gt-full { filter: brightness(0) invert(.93); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-full { filter: brightness(0) invert(.93); } }
