/* ============================================================
   CloudVenix — "Flight deck" design system
   One token set drives light + dark. Every page draws from this.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   TOKENS — Light (default)
   ============================================================ */
:root {
  /* type */
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* type scale */
  --fs-display: 30px;
  --fs-h1: 22px;
  --fs-h2: 18px;
  --fs-h3: 15px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-2xs: 11px;

  /* spacing scale (4pt) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 48px; --sp-10: 64px;

  /* radius */
  --r-xs: 5px; --r-sm: 7px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;

  /* layout */
  --sidebar-w: 244px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;

  /* ---- color: neutrals (cool graphite) ---- */
  --bg:           oklch(0.985 0.003 265);
  --bg-sunken:    oklch(0.965 0.004 265);
  --surface:      oklch(1 0 0);
  --surface-2:    oklch(0.978 0.003 265);
  --surface-3:    oklch(0.955 0.005 265);
  --border:       oklch(0.915 0.006 265);
  --border-strong:oklch(0.86 0.008 265);
  --line:         oklch(0.935 0.005 265);

  --text:         oklch(0.255 0.013 268);
  --text-2:       oklch(0.44 0.012 268);
  --text-3:       oklch(0.58 0.011 268);
  --text-faint:   oklch(0.70 0.009 268);
  --text-on-accent: oklch(0.99 0 0);

  /* ---- primary: iris ---- */
  --primary:      oklch(0.545 0.17 277);
  --primary-hover:oklch(0.50 0.175 277);
  --primary-press:oklch(0.46 0.175 277);
  --primary-soft: oklch(0.95 0.035 277);
  --primary-soft-border: oklch(0.89 0.06 277);
  --primary-text: oklch(0.46 0.17 277);

  /* ---- flow accent: teal (data movement) ---- */
  --flow:         oklch(0.66 0.12 195);
  --flow-soft:    oklch(0.95 0.035 195);
  --flow-text:    oklch(0.50 0.10 195);

  /* ---- semantics ---- */
  --ok:           oklch(0.62 0.14 156);
  --ok-soft:      oklch(0.95 0.04 156);
  --ok-text:      oklch(0.48 0.12 156);

  --warn:         oklch(0.74 0.13 76);
  --warn-soft:    oklch(0.955 0.05 86);
  --warn-text:    oklch(0.52 0.10 66);

  --error:        oklch(0.585 0.205 22);
  --error-soft:   oklch(0.955 0.035 22);
  --error-text:   oklch(0.52 0.19 22);

  --info:         oklch(0.60 0.14 244);
  --info-soft:    oklch(0.95 0.035 244);
  --info-text:    oklch(0.49 0.13 244);

  --neutral-soft: oklch(0.94 0.004 265);
  --neutral-text: oklch(0.46 0.012 268);

  /* shadows (cool-tinted) */
  --sh-xs: 0 1px 2px oklch(0.4 0.02 265 / 0.06);
  --sh-sm: 0 1px 2px oklch(0.4 0.02 265 / 0.06), 0 2px 6px oklch(0.4 0.02 265 / 0.06);
  --sh-md: 0 2px 4px oklch(0.4 0.02 265 / 0.05), 0 8px 20px oklch(0.4 0.02 265 / 0.10);
  --sh-lg: 0 8px 16px oklch(0.4 0.02 265 / 0.08), 0 24px 48px oklch(0.4 0.02 265 / 0.16);
  --ring: 0 0 0 3px oklch(0.545 0.17 277 / 0.28);

  --scrim: oklch(0.22 0.02 265 / 0.42);

  /* motion */
  --ease: cubic-bezier(0.32, 0.72, 0.22, 1);
  --t-fast: 120ms;
  --t: 170ms;
}

/* ============================================================
   TOKENS — Dark
   ============================================================ */
:root[data-theme="dark"] {
  --bg:           oklch(0.185 0.012 268);
  --bg-sunken:    oklch(0.155 0.011 268);
  --surface:      oklch(0.215 0.013 268);
  --surface-2:    oklch(0.235 0.014 268);
  --surface-3:    oklch(0.265 0.015 268);
  --border:       oklch(0.305 0.014 268);
  --border-strong:oklch(0.37 0.016 268);
  --line:         oklch(0.285 0.013 268);

  --text:         oklch(0.945 0.004 265);
  --text-2:       oklch(0.78 0.008 265);
  --text-3:       oklch(0.64 0.010 265);
  --text-faint:   oklch(0.52 0.011 265);
  --text-on-accent: oklch(0.99 0 0);

  --primary:      oklch(0.66 0.16 278);
  --primary-hover:oklch(0.71 0.16 278);
  --primary-press:oklch(0.62 0.16 278);
  --primary-soft: oklch(0.30 0.06 278);
  --primary-soft-border: oklch(0.40 0.09 278);
  --primary-text: oklch(0.80 0.13 278);

  --flow:         oklch(0.70 0.12 195);
  --flow-soft:    oklch(0.30 0.05 195);
  --flow-text:    oklch(0.78 0.10 195);

  --ok:           oklch(0.68 0.14 156);
  --ok-soft:      oklch(0.30 0.06 156);
  --ok-text:      oklch(0.78 0.12 156);

  --warn:         oklch(0.78 0.13 80);
  --warn-soft:    oklch(0.33 0.06 76);
  --warn-text:    oklch(0.83 0.11 84);

  --error:        oklch(0.66 0.19 24);
  --error-soft:   oklch(0.32 0.08 22);
  --error-text:   oklch(0.80 0.14 24);

  --info:         oklch(0.68 0.14 244);
  --info-soft:    oklch(0.31 0.06 244);
  --info-text:    oklch(0.80 0.12 244);

  --neutral-soft: oklch(0.29 0.012 268);
  --neutral-text: oklch(0.74 0.008 265);

  --sh-xs: 0 1px 2px oklch(0 0 0 / 0.30);
  --sh-sm: 0 1px 2px oklch(0 0 0 / 0.34), 0 2px 6px oklch(0 0 0 / 0.30);
  --sh-md: 0 2px 4px oklch(0 0 0 / 0.34), 0 8px 22px oklch(0 0 0 / 0.46);
  --sh-lg: 0 8px 18px oklch(0 0 0 / 0.42), 0 28px 56px oklch(0 0 0 / 0.58);
  --ring: 0 0 0 3px oklch(0.66 0.16 278 / 0.40);
  --scrim: oklch(0.10 0.01 265 / 0.62);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
#root { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--primary-soft); color: var(--primary-text); }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 36px; padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600;
  white-space: nowrap; user-select: none;
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-xs); border-radius: var(--r-xs); }
.btn.sm svg { width: 14px; height: 14px; }
.btn.lg { height: 42px; padding: 0 var(--sp-5); font-size: var(--fs-body); }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }

.btn-primary { background: var(--primary); color: var(--text-on-accent); box-shadow: var(--sh-xs); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-press); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-faint); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--error); color: var(--text-on-accent); }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-ghost { background: transparent; color: var(--error-text); }
.btn-danger-ghost:hover { background: var(--error-soft); }

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap; border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge svg { width: 12px; height: 12px; }
.badge-ok      { background: var(--ok-soft); color: var(--ok-text); }
.badge-warn    { background: var(--warn-soft); color: var(--warn-text); }
.badge-error   { background: var(--error-soft); color: var(--error-text); }
.badge-info    { background: var(--info-soft); color: var(--info-text); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-flow    { background: var(--flow-soft); color: var(--flow-text); }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral-text); }
.badge.outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }

/* role chips */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-xs);
  font-size: var(--fs-2xs); font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}

/* ============================================================
   CARDS / SURFACES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.card-pad { padding: var(--sp-5); }
.card-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; }
.card-head .sub { font-size: var(--fs-xs); color: var(--text-3); }

.section-label {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3);
}

/* ============================================================
   STAT TILES
   ============================================================ */
.tiles { display: grid; gap: var(--sp-4); }
.tile {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  box-shadow: var(--sh-xs);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.tile.click { cursor: pointer; }
.tile.click:hover { border-color: var(--border-strong); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.tile-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); letter-spacing: 0.01em; }
.tile-ico {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
}
.tile-ico svg { width: 16px; height: 16px; }
.tile-val { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.tile-val .unit { font-size: var(--fs-sm); color: var(--text-3); margin-left: 4px; }
.tile-delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2xs); font-weight: 600; margin-top: var(--sp-3); }
.tile-delta.up { color: var(--ok-text); }
.tile-delta.down { color: var(--error-text); }
.tile-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 34px; opacity: 0.7; }

/* ============================================================
   TABLES
   ============================================================ */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3);
  padding: 10px var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th.sortable:hover { color: var(--text); }
.tbl thead th .th-in { display: inline-flex; align-items: center; gap: 5px; }
.tbl thead th .sort-ico { width: 12px; height: 12px; opacity: 0.5; }
.tbl thead th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody td { padding: 11px var(--sp-4); border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.sel { background: var(--primary-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td .strong { color: var(--text); font-weight: 600; }
.tbl .col-check { width: 38px; padding-left: var(--sp-4); }
.tbl .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.tbl-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px var(--sp-4); border-top: 1px solid var(--line);
  font-size: var(--fs-xs); color: var(--text-3);
}

/* identity cell */
.identity { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.identity .meta { min-width: 0; }
.identity .name { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity .addr { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-on-accent);
  background: var(--primary); letter-spacing: 0.01em;
}
.avatar.sq { border-radius: var(--r-xs); }
.avatar.lg { width: 38px; height: 38px; font-size: var(--fs-sm); }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.field .hint { font-size: var(--fs-2xs); color: var(--text-3); }
.field .err { font-size: var(--fs-2xs); color: var(--error-text); font-weight: 600; }
.req { color: var(--error-text); }

.input, .select, textarea.input {
  height: 38px; width: 100%;
  padding: 0 var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
textarea.input { height: auto; padding: var(--sp-3); resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--text-faint); }
.input:hover, .select:hover { border-color: var(--text-faint); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.mono { font-family: var(--font-mono); font-size: var(--fs-xs); }
.input.invalid { border-color: var(--error); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .lead-ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.input-group .input { padding-left: 36px; }
.input-affix { position: absolute; right: 10px; font-size: var(--fs-2xs); color: var(--text-faint); font-family: var(--font-mono); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 34px; cursor: pointer;
}

/* checkbox + radio */
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; flex: none; transition: all var(--t-fast); cursor: pointer; }
.check svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(0.6); transition: all var(--t-fast); }
.check.on { background: var(--primary); border-color: var(--primary); }
.check.on svg { opacity: 1; transform: scale(1); }
.check.partial { background: var(--primary); border-color: var(--primary); }

/* toggle switch */
.switch { width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong); padding: 2px; cursor: pointer; transition: background var(--t); flex: none; }
.switch .knob { width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform var(--t) var(--ease); }
.switch.on { background: var(--primary); }
.switch.on .knob { transform: translateX(17px); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r-sm); gap: 2px; border: 1px solid var(--border); }
.seg button { height: 28px; padding: 0 12px; border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); transition: all var(--t-fast); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }

/* radio card group */
.radio-card { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-strong); border-radius: var(--r-sm); cursor: pointer; transition: all var(--t-fast); background: var(--surface); }
.radio-card:hover { border-color: var(--text-faint); }
.radio-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; margin-top: 1px; display: grid; place-items: center; transition: all var(--t-fast); }
.radio-card.on .radio-dot { border-color: var(--primary); }
.radio-card.on .radio-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.radio-card .rc-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.radio-card .rc-sub { font-size: var(--fs-2xs); color: var(--text-3); margin-top: 1px; }

/* ============================================================
   PROGRESS
   ============================================================ */
.bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width var(--t) var(--ease); }
.bar.tall { height: 10px; }
.bar .fill.ok { background: var(--ok); }
.bar .fill.warn { background: var(--warn); }
.bar .fill.error { background: var(--error); }
.bar .fill.flow { background: linear-gradient(90deg, var(--flow), var(--primary)); }
.bar .fill.striped { background-image: linear-gradient(45deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%); background-size: 16px 16px; animation: stripe 0.7s linear infinite; }
@keyframes stripe { from { background-position: 0 0; } to { background-position: 16px 0; } }

.ring-prog { transform: rotate(-90deg); }
.ring-prog circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-prog .track { stroke: var(--surface-3); }
.ring-prog .ind { stroke: var(--primary); transition: stroke-dashoffset var(--t) var(--ease); }

/* ============================================================
   MODAL
   ============================================================ */
.overlay { position: fixed; inset: 0; z-index: 200; background: var(--scrim); backdrop-filter: blur(2px); display: grid; place-items: center; padding: var(--sp-6); animation: fade var(--t) var(--ease); }
.modal { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-lg); max-height: calc(100vh - 80px); display: flex; flex-direction: column; animation: pop var(--t) var(--ease); overflow: hidden; }
.modal.sm { max-width: 440px; }
.modal.md { max-width: 600px; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
.modal-head { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.modal-head .mh-ico { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.modal-head .mh-ico svg { width: 19px; height: 19px; }
.modal-head h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.01em; }
.modal-head .mh-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: var(--sp-6); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

/* ============================================================
   TOAST
   ============================================================ */
.toasts { position: fixed; bottom: var(--sp-6); right: var(--sp-6); z-index: 300; display: flex; flex-direction: column; gap: var(--sp-3); width: 380px; max-width: calc(100vw - 32px); }
.toast { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-lg); animation: toastIn var(--t) var(--ease); position: relative; overflow: hidden; }
.toast .t-ico { width: 30px; height: 30px; border-radius: var(--r-xs); display: grid; place-items: center; flex: none; }
.toast .t-ico svg { width: 17px; height: 17px; }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-size: var(--fs-sm); font-weight: 700; }
.toast .t-msg { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.toast .t-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.toast.ok .t-ico { background: var(--ok-soft); color: var(--ok-text); } .toast.ok .t-accent { background: var(--ok); }
.toast.error .t-ico { background: var(--error-soft); color: var(--error-text); } .toast.error .t-accent { background: var(--error); }
.toast.warn .t-ico { background: var(--warn-soft); color: var(--warn-text); } .toast.warn .t-accent { background: var(--warn); }
.toast.info .t-ico { background: var(--info-soft); color: var(--info-text); } .toast.info .t-accent { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-10) var(--sp-6); gap: var(--sp-4); }
.empty .e-art { width: 72px; height: 72px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); border: 1px solid var(--primary-soft-border); }
.empty .e-art svg { width: 34px; height: 34px; }
.empty h3 { font-size: var(--fs-h2); font-weight: 700; }
.empty p { font-size: var(--fs-sm); color: var(--text-3); max-width: 380px; }
.empty .e-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }

/* skeleton / loading */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-xs); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   MISC / LAYOUT HELPERS
   ============================================================ */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row.tight { gap: var(--sp-2); }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); }
.vdiv { width: 1px; align-self: stretch; background: var(--line); }
.muted { color: var(--text-3); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.kbd { font-family: var(--font-mono); font-size: var(--fs-2xs); padding: 2px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-3); }

/* connection type glyph — real product marks on logo chips */
.type-glyph { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; padding: 5px; box-shadow: var(--sh-xs); }
.type-glyph.lg { width: 42px; height: 42px; padding: 7px; }
.type-glyph svg { width: 100%; height: 100%; }
.tg-m365   { background: #fff; border: 1px solid var(--border-strong); }
.tg-google { background: #fff; border: 1px solid var(--border-strong); }
.tg-imap   { background: linear-gradient(135deg, #FF8A4C, #EF5A1E); border: 1px solid transparent; }
.tg-onprem { background: linear-gradient(135deg, #3B6FB0, #1E3F73); border: 1px solid transparent; }
.tg-fileserver { background: linear-gradient(135deg, #5a6472, #2f3742); border: 1px solid transparent; }
:root[data-theme="dark"] .tg-m365, :root[data-theme="dark"] .tg-google { background: #fff; border-color: oklch(0.4 0.01 265); }

/* flow arrow source->dest */
.flowline { display: inline-flex; align-items: center; gap: 6px; color: var(--flow-text); }
.flowline svg { width: 15px; height: 15px; }

/* status dot */
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--surface); }
.sdot.ok { background: var(--ok); }
.sdot.warn { background: var(--warn); }
.sdot.error { background: var(--error); }
.sdot.info { background: var(--info); }
.sdot.idle { background: var(--text-faint); }
.sdot.pulse { animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--surface), 0 0 0 3px transparent; } 50% { box-shadow: 0 0 0 3px var(--surface), 0 0 0 7px color-mix(in oklch, var(--ok) 30%, transparent); } }

.hide-sm { }
@media (max-width: 900px) {
  .hide-sm { display: none !important; }
}
