/* Vionlabs trial portal - one stylesheet for login, shell, user pages and admin.
   Surfaces, borders and sizes come from the POC tools (Operations Lab / News Lab / Vertical Lab);
   the sidebar is the app.vionlabs.com portal sidebar; action blue, kickers and type follow
   Vionlabs Design System 2.0. No em dashes in copy. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: dark;
  /* surfaces (POC tools) */
  --bg: #0b1622;
  --bg-deep: #070d18;
  --panel: #0f1d2e;
  --panel-2: #13243a;
  --panel-3: #16293f;
  --panel-hover: #1a2c40;
  --line: #22384f;
  --line-soft: #1b3350;
  /* text */
  --text: #e7eef6;
  --text-2: #9fb2c6;
  --text-3: #64778c;
  /* accents */
  --blue: #0068e0;            /* DS 2.0: the only fill for actions */
  --blue-hover: #1a78e6;
  --sky: #4d9bff;             /* DS 2.0: kickers, links, focus */
  --ice: #8cc0ff;
  --side-blue: #3d8eff;       /* app.vionlabs.com active nav */
  --teal: #2dd4bf;            /* POC tools: active tab, progress, success-ish data */
  --teal-2: #3ccfb4;
  --teal-tint: rgba(45, 212, 191, .12);
  --violet: #c4b5fd;
  --amber: #f5b945;
  /* status (dataviz status palette, always with an icon + label) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  /* categorical series for tools (validated on --panel, dark) */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  /* sidebar (app.vionlabs.com) */
  --side-bg: #1f2c43;
  --side-text: #8c95a6;
  --side-strong: #dbdee4;
  --side-muted: #66748a;
  --side-hover: #26354f;
  /* shape */
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --font: Inter, -apple-system, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }

/* Themed scrollbars (match sidebar / panels; hide native OS chrome) */
* { scrollbar-width: thin; scrollbar-color: #4a6588 var(--panel-3); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--panel-3); border-radius: 8px; }
*::-webkit-scrollbar-thumb { background: #4a6588; border-radius: 8px; border: 2px solid var(--panel-3); }
*::-webkit-scrollbar-thumb:hover { background: var(--side-blue); }
*::-webkit-scrollbar-corner { background: transparent; }
a { color: var(--sky); text-decoration: none; }
a:hover { color: var(--ice); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--text-2);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.btn:hover { background: var(--panel-hover); color: var(--text); text-decoration: none; }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-teal { background: var(--teal-2); border-color: var(--teal-2); color: #06201c; }
.btn-teal:hover { background: var(--teal); color: #06201c; }
.btn-ghost { border-color: transparent; }
.btn-danger { color: #ffb4ab; border-color: rgba(255, 107, 94, .4); }
.btn-danger:hover { background: rgba(208, 59, 59, .15); color: #ffd2cc; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: var(--r); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); }
.icon-btn.btn-sm { width: 28px; height: 28px; }
.people-role { width: 148px; min-width: 148px; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12px; color: #ff9b91; }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--text); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(77, 155, 255, .18); }
.input.sm, .select.sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: var(--r-sm); }
.input.invalid { border-color: rgba(255, 107, 94, .7); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--teal-2); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: background .2s ease; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.switch input:checked + span { background: var(--teal-2); }
.switch input:checked + span::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); height: 26px; padding: 0 10px; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg.teal button.on { background: var(--teal-2); color: #06201c; box-shadow: none; }

/* ---------- chips, status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.teal { background: var(--teal-tint); color: #7de3d0; border-color: rgba(45, 212, 191, .35); }
.chip.blue { background: rgba(0, 104, 224, .16); color: var(--ice); border-color: rgba(77, 155, 255, .4); }
.chip.amber { background: rgba(250, 178, 25, .12); color: #fcd27a; border-color: rgba(250, 178, 25, .35); }
.chip.red { background: rgba(208, 59, 59, .14); color: #ffb0a8; border-color: rgba(255, 107, 94, .35); }
.chip.violet { background: rgba(196, 181, 253, .12); color: #d9cffe; border-color: rgba(196, 181, 253, .3); }
.chip.green { background: rgba(12, 163, 12, .14); color: #8fe08f; border-color: rgba(12, 163, 12, .4); }
.chip.ghost { background: transparent; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); }
.tool-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.tool-dot.olab { background: var(--series-1); }
.tool-dot.newslab { background: var(--series-2); }
.tool-dot.vertical { background: var(--series-3); }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.health svg { width: 14px; height: 14px; }
.health.healthy svg { color: var(--good); }
.health.needs_attention svg { color: var(--warning); }
.health.at_risk svg { color: var(--critical); }

/* ---------- cards, panels, tables ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card h3, .card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; border: 0; }

table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow: auto; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat .value { white-space: nowrap; font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; color: var(--text-3); font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.stat .delta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat .spark { margin-top: 10px; height: 28px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2a4a72, #1b3350); flex: none; border: 1px solid rgba(255, 255, 255, .12); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.co-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--panel-3); display: grid; place-items: center; overflow: hidden; flex: none;
  font-weight: 800; font-size: 13px; color: var(--text); letter-spacing: -.02em; border: 1px solid var(--line); }
.co-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.co-logo.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.page-co-logo { margin-bottom: 10px; }
.page-co-logo img { max-height: 40px; width: auto; display: block; object-fit: contain; }

.progress { height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--teal-2); border-radius: 6px; transition: width .3s ease; }
.progress.blue > i { background: var(--sky); }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .track { flex: 1; height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; min-width: 60px; }
.meter .fill { height: 100%; border-radius: 6px; }
.meter .val { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; min-width: 22px; text-align: right; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-2); }
.empty h4 { margin: 8px 0 4px; color: var(--text); font-size: 15px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid rgba(77, 155, 255, .3);
  background: rgba(0, 104, 224, .10); border-radius: var(--r); font-size: 13px; color: var(--text); }
.banner svg { color: var(--sky); }
.banner.warn { border-color: rgba(250, 178, 25, .35); background: rgba(250, 178, 25, .08); }
.banner.warn svg { color: var(--warning); }

/* ---------- toast, modal, drawer, tooltip ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 1000; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: rise .2s ease; }
.toast.ok svg { color: var(--teal); } .toast.err svg { color: var(--critical); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { position: fixed; inset: 0; background: rgba(3, 8, 15, .6); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 900; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow); }
.modal.wide { width: min(780px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: var(--shadow); z-index: 901; display: flex; flex-direction: column; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.tip { position: fixed; pointer-events: none; z-index: 1100; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 12px; box-shadow: var(--shadow); min-width: 120px; }
.tip b { display: block; font-size: 14px; color: var(--text); }
.tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }

/* ---------- prototype ribbon ---------- */
.proto-ribbon { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 950; display: flex; align-items: center; gap: 10px;
  background: rgba(15, 29, 46, .96); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px; font-size: 12px; color: var(--text-2); box-shadow: var(--shadow); }
.proto-ribbon b { color: var(--amber); font-weight: 700; }

.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.prod-dd { position: relative; display: inline-block; }
.prod-dd > summary { list-style: none; cursor: pointer; }
.prod-dd > summary::-webkit-details-marker { display: none; }
.prod-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 240px; max-height: 280px; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; box-shadow: var(--shadow); }
