/* ─────────────────────────────────────────────────────────────
   Beacon — design tokens mapped to client foundation library
   blue (main), red, orange, green, cyan, neutral scales
   ───────────────────────────────────────────────────────────── */
:root {
  /* Launchpad token aliases (1:1 with Hub Backoffice design system) */
  --primary-500: #1E54E7; --primary-600: #1546CB; --primary-50: #EDF1FD;
  --grey-0:#fff; --grey-25:#FAFBFE; --grey-50:#F4F6FB; --grey-100:#F0F2F8; --grey-150:#E8EAEE; --grey-300:#D0D6DC; --grey-400:#C4CBD3; --grey-500:#A0AFBE; --grey-600:#8A98A8; --grey-700:#68798D; --grey-800:#4E5B68; --grey-900:#2B323B;
  --bg-app:#F4F6FB; --bg-surface:#fff; --bg-hover:#F2F5FB; --bg-sunken:#EEF1F8; --bg-overlay:rgba(0,0,0,.32);
  --text-primary:#000; --text-secondary:#4E5B68; --text-tertiary:#68798D;
  --border-subtle:#E8EAEE; --border-default:#D0D6DC;
  --success-500:#1DA534; --success-600:#188B2C; --success-100:#DCF9E1;
  --warning-500:#F36E2B; --warning-100:#FEF2EC; --tint-amber:#FEF2EC;
  --elev-1:0 1px 2px rgba(20,28,56,.05),0 1px 3px rgba(20,28,56,.07);
  --elev-3:0 6px 12px -2px rgba(20,28,56,.08),0 16px 36px -8px rgba(20,28,56,.12);
  --elev-4:0 12px 28px -6px rgba(20,28,56,.10),0 32px 56px -12px rgba(20,28,56,.16);
  --sidebar-w:260px; --topbar-h:56px;

  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Main blue scale */
  --blue-100: #EDF1FD;
  --blue-200: #DAE3FB;
  --blue-300: #C8D5F9;
  --blue-400: #A3B9F5;
  --blue-500: #5980EE;
  --blue-600: #1E54E7;
  --blue-700: #1546CB;
  --blue-800: #1139A6;
  --blue-900: #0C266F;
  --blue-1000:#08194A;

  /* Red scale */
  --red-100: #FFF2F2;
  --red-200: #FFEBEB;
  --red-300: #FFD6D6;
  --red-400: #E00000;
  --red-500: #CC0000;
  --red-600: #A30000;
  --red-700: #7A0000;
  --red-800: #520000;
  --red-900: #290000;

  /* Orange scale */
  --orange-100: #FEF2EC;
  --orange-200: #FDE5D8;
  --orange-300: #FBCAB2;
  --orange-400: #F58851;
  --orange-500: #F36E2B;
  --orange-600: #F15A0E;
  --orange-700: #864901;
  --orange-800: #653701;
  --orange-900: #4E2B01;

  /* Green scale */
  --green-100: #EEFCF0;
  --green-200: #DCF9E1;
  --green-300: #BAF3C3;
  --green-400: #22BF3C;
  --green-500: #1DA534;
  --green-600: #188B2C;
  --green-700: #126821;
  --green-800: #0C4516;
  --green-900: #093410;

  /* Cyan scale */
  --cyan-100: #EDF9FD;
  --cyan-200: #C8EDF9;
  --cyan-300: #A3E1F5;
  --cyan-400: #6BCEEF;
  --cyan-500: #46C2EC;
  --cyan-600: #1EB5E7;
  --cyan-700: #169DCA;
  --cyan-800: #1181A6;
  --cyan-900: #0E6481;

  /* Neutral scale */
  --neutral-100: #FFFFFF;
  --neutral-200: #E8EAEE;
  --neutral-300: #D0D6DC;
  --neutral-400: #C4CBD3;
  --neutral-500: #A1ADBA;
  --neutral-600: #8A98A8;
  --neutral-700: #68798D;
  --neutral-800: #4E5B68;
  --neutral-900: #2B323B;
  --neutral-1000:#1A1E23;
  --neutral-1100:#090A0C;
  --neutral-1200:#000000;

  /* Semantic tokens (mapped to scales) */
  --primary:        var(--blue-600);
  --primary-dark:   var(--blue-700);
  --primary-light:  var(--blue-500);
  --primary-soft:   var(--blue-100);
  --on-primary:     #ffffff;

  --secondary:      var(--cyan-700);
  --secondary-soft: var(--cyan-100);

  --error:          var(--red-500);
  --error-soft:     var(--red-100);
  --warning:        var(--orange-600);
  --warning-soft:   var(--orange-100);
  --info:           var(--cyan-600);
  --info-soft:      var(--cyan-100);
  --success:        var(--green-500);
  --success-soft:   var(--green-100);

  /* Surfaces */
  --bg:        #f4f5fa;
  --surface:   #ffffff;
  --surface-1: #fafbfe;
  --surface-2: #f3f5fb;
  --surface-3: #eceef7;
  --divider:   #eef0f6;
  --divider-strong: #dfe3ee;

  /* Text */
  --text:        var(--neutral-1300, var(--neutral-1200));
  --text-2:      var(--neutral-900);
  --text-3:      var(--neutral-600);
  --text-on-primary: #ffffff;
  --text-disabled: rgba(106,106,108,.5);

  /* Brand */
  --brand-blue:   #0041ED;
  --brand-navy:   #0A003C;
  --brand-orange: #FF600F;
  --brand-green:  #00CD91;

  /* Elevation (Material) */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(31,41,76,.04), 0 1px 3px rgba(31,41,76,.03);
  --shadow-2: 0 2px 8px -2px rgba(31,41,76,.06), 0 1px 3px rgba(31,41,76,.04);
  --shadow-3: 0 8px 24px -8px rgba(31,41,76,.10), 0 2px 6px rgba(31,41,76,.04);
  --shadow-4: 0 12px 32px -10px rgba(31,41,76,.12), 0 4px 10px rgba(31,41,76,.05);
  --shadow-6: 0 12px 24px -6px rgba(15,23,55,.12), 0 4px 8px rgba(15,23,55,.06);
  --shadow-8: 0 16px 32px -8px rgba(15,23,55,.14), 0 6px 12px rgba(15,23,55,.06);
  --shadow-12:0 24px 48px -12px rgba(15,23,55,.18), 0 8px 16px rgba(15,23,55,.06);

  --primary-elev: 0 1px 2px rgba(17,57,166,.30), 0 6px 16px -6px rgba(30,84,231,.45);

  /* Shape (Material — 4/8 scale) */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Spacing (Material 4-pt base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Z-index */
  --z-appbar: 1100;
  --z-drawer: 1200;
  --z-modal: 1300;
  --z-snackbar: 1400;
  --z-tooltip: 1500;
}

/* ──────────────── MUI-style tooltip ──────────────── */
.mui-tip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--text);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  padding: 7px 11px;
  border-radius: 8px;
  max-width: 260px;
  text-align: left;
  text-wrap: pretty;
  pointer-events: none;
  box-shadow: var(--shadow-4);
  animation: mui-tip-in .11s cubic-bezier(.4, 0, .2, 1);
}
@keyframes mui-tip-in { from { opacity: 0; } to { opacity: 1; } }
.mui-tip[data-place="top"]    { transform: translate(-50%, calc(-100% - 8px)); }
.mui-tip[data-place="bottom"] { transform: translate(-50%, 8px); }
.mui-tip[data-place="left"]   { transform: translate(calc(-100% - 8px), -50%); }
.mui-tip[data-place="right"]  { transform: translate(8px, -50%); }
.mui-tip-arrow { position: absolute; width: 8px; height: 8px; background: var(--text); transform: rotate(45deg); }
.mui-tip[data-place="top"] .mui-tip-arrow    { bottom: -3px; left: 50%; margin-left: -4px; }
.mui-tip[data-place="bottom"] .mui-tip-arrow { top: -3px;    left: 50%; margin-left: -4px; }
.mui-tip[data-place="left"] .mui-tip-arrow   { right: -3px;  top: 50%;  margin-top: -4px; }
.mui-tip[data-place="right"] .mui-tip-arrow  { left: -3px;   top: 50%;  margin-top: -4px; }

/* ──────────────── Reset / base ──────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ──────────────── Typography scale (Material) ──────────────── */
.typo-display { font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.typo-h1      { font-size: 24px; line-height: 1.25;font-weight: 600; letter-spacing: -.02em; }
.typo-h2      { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
.typo-h3      { font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.01em; }
.typo-subtitle{ font-size: 14px; line-height: 1.5; font-weight: 600; }
.typo-body1   { font-size: 14px; line-height: 1.55;font-weight: 400; }
.typo-body2   { font-size: 13px; line-height: 1.55;font-weight: 400; color: var(--text-2); }
.typo-caption { font-size: 12px; line-height: 1.45;font-weight: 400; color: var(--text-2); }
.typo-overline{ font-size: 11px; line-height: 1.3; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.typo-mono    { font-family: var(--font-sans); font-feature-settings: "tnum"; }

/* ──────────────── App shell ──────────────── */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "rail topbar"
    "rail main";
  height: 100vh;
  min-height: 600px;
}

.rail {
  grid-area: rail;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  padding: 0 12px 12px;
  gap: 0;
  overflow-y: auto;
}

/* Product picker header — Launchpad spec */
.rail-product {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  margin: 16px 0 8px;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.rail-product:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}
.rail-product[data-open="true"] {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
  box-shadow: none;
}

/* Product switcher menu */
.product-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 10px;
  box-shadow: var(--shadow-4);
  padding: 6px;
  z-index: 40;
}
.product-menu .pm-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 10px 6px;
}
.product-menu .pm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  text-decoration: none; color: inherit;
}
.product-menu .pm-item:hover { background: var(--surface-2); }
.product-menu .pm-item.active { background: var(--blue-100); }
.product-menu .pm-item.active .pm-name { color: var(--text); }
.product-menu .pm-ic { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--text-2); }
.product-menu .pm-item.active .pm-ic { background: var(--blue-600); color: #fff; }
.product-menu .pm-text { flex: 1; min-width: 0; }
.product-menu .pm-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }
.product-menu .pm-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; line-height: 1.3; }
.product-menu .pm-sep { height: 1px; background: var(--divider); margin: 6px 0; }
.product-menu .pm-foot { font-size: 13px; color: var(--text-2); padding: 8px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 8px; }
.product-menu .pm-foot:hover { background: var(--surface-2); }
.rail-product .rp-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--blue-600);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.rail-product .rp-text { flex: 1; min-width: 0; line-height: 1.25; }
.rail-product .rp-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail-product .rp-sub {
  font-size: 12px; color: var(--text-tertiary);
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail-product .rp-chev { color: var(--text-3); flex-shrink: 0; }

/* WORKSPACE label */
.rail-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 8px 8px;
  margin-top: 8px;
}

/* Nav items */
.rail-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  height: 34px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}
.rail-nav-item:hover { background: var(--grey-50); color: var(--text-primary); }
.rail-nav-item[data-active="true"] {
  background: var(--grey-100);
  color: var(--text-primary);
  font-weight: 600;
}
.rail-nav-item[data-active="true"] .rn-icon { color: var(--text-primary); }
.rail-nav-item .rn-icon { color: var(--text-tertiary); flex-shrink: 0; }
.rail-nav-item .rn-label { flex: 1; }
.rail-nav-item .rn-count {
  font-size: 11px;
  padding: 0 7px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-100);
  color: var(--text-secondary);
  border-radius: var(--r-pill);
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rail-nav-item[data-active="true"] .rn-count {
  background: var(--grey-100);
  color: var(--text-secondary);
}
.rail-nav-item .rn-count.error {
  background: var(--red-100);
  color: var(--red-500);
}

.rail-divider {
  height: 1px; background: var(--divider);
  margin: 12px 8px;
}

.rail-spacer { flex: 1; }

/* Environment badge (reference footer) */
.rail-env {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-top: 10px;
  border-radius: 8px;
  background: var(--green-100);
}
.rail-env-dot {
  position: relative; width: 8px; height: 8px; flex: none;
  border-radius: 999px; background: var(--green-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--green-500) 25%, transparent);
}
.rail-env-text { flex: 1; min-width: 0; }
.rail-env-label { font-size: 12px; font-weight: 700; color: var(--green-600); line-height: 1.2; }
.rail-env-note { font-size: 10.5px; color: var(--text-3); line-height: 1.3; }
.rail-env-switch {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--divider-strong);
  border-radius: 6px; padding: 3px 8px; cursor: pointer; flex: none;
  font-family: var(--font-sans);
}
.rail-env-switch:hover { background: var(--surface-2); }

/* Browse products link at bottom of expanded picker */
.rail-browse {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border-top: 1px solid var(--divider);
  margin-top: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.rail-browse:hover { background: var(--surface-2); }

/* AppBar */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: var(--z-appbar);
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 13px;
}
.crumbs .sep { color: var(--text-3); }
.crumbs .here { color: var(--text); font-weight: 500; }
.crumbs code {
  font-family: var(--font-sans); font-size: 13px;
  background: var(--surface-2);
  padding: 2px 7px; border-radius: 6px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -.005em;
}

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--grey-50);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  width: 280px;
  color: var(--text-3);
  transition: border-color .15s, background .15s;
}
.search:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search input {
  background: transparent; border: 0; outline: 0;
  color: var(--text);
  flex: 1; min-width: 0; font-size: 13px;
}
.search input::placeholder { color: var(--text-tertiary); }
.search kbd {
  font-family: var(--font-sans); font-size: 11px;
  background: var(--bg-surface);
  padding: 2px 6px; border-radius: 5px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.topbar-bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0; background: transparent;
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.topbar-bell:hover { background: var(--surface-2); color: var(--text); }
.bell-badge {
  position: absolute; top: 0; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--red-500); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  font-variant-numeric: tabular-nums;
}
.topbar-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #bcd4ff;
  color: #1c47b3;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: .02em;
  margin-left: 4px;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px 0 4px;
  border: 1px solid var(--divider);
  border-radius: var(--r-pill);
  font-size: 13px;
  background: var(--surface);
}
.user-chip .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--orange-500);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* Hide legacy bars */
.opbar, .stagebar { display: none; }

.main {
  grid-area: main;
  overflow: auto;
  background: var(--bg);
}

/* ────────────────────────────────────────────────────────────
   ATOMS — Material-aligned primitives
   ──────────────────────────────────────────────────────────── */

/* === Button (MUI variants) === */
.MuiButton {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 38px; padding: 6px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .05s;
  user-select: none;
}
.MuiButton:active { transform: translateY(0.5px); }
.MuiButton[disabled], .MuiButton:disabled {
  background: var(--neutral-200) !important;
  color: var(--text-disabled) !important;
  border-color: var(--neutral-200) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  opacity: 1;
  pointer-events: none;
}

/* Variants */
.MuiButton.contained {
  background: var(--blue-600);
  color: #fff;
  box-shadow: var(--primary-elev);
  border-color: transparent;
}
.MuiButton.contained:hover { background: var(--blue-700); }
.MuiButton.contained:focus { background: var(--blue-600); outline: 3px solid var(--blue-200); outline-offset: 1px; }

.MuiButton.outlined {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
  color: var(--text-2);
}
.MuiButton.outlined:hover { background: var(--neutral-200); border-color: var(--neutral-400); }
.MuiButton.outlined:focus { background: var(--neutral-200); border-color: var(--neutral-500); }

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

/* Color modifiers (apply to contained) */
.MuiButton.contained.error  { background: var(--red-500); border-color: transparent; box-shadow: 0 1px 2px rgba(122,0,0,.20), 0 8px 18px -6px rgba(204,0,0,.35); }
.MuiButton.contained.error:hover { background: var(--red-600); }
.MuiButton.contained.error:focus { background: var(--red-500); outline: 3px solid var(--red-200); outline-offset: 1px; }

.MuiButton.contained.warning{ background: var(--orange-600); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(134,73,1,.20), 0 8px 18px -6px rgba(241,90,14,.35); }
.MuiButton.contained.warning:hover{ background: var(--orange-700); }
.MuiButton.contained.warning:focus{ background: var(--orange-600); outline: 3px solid var(--orange-200); outline-offset: 1px; }

.MuiButton.contained.success{ background: var(--green-500); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(12,69,22,.20), 0 8px 18px -6px rgba(29,165,52,.35); }

/* Outlined color variants */
.MuiButton.outlined.error    { color: var(--red-500); border-color: color-mix(in oklab, var(--red-500) 50%, var(--neutral-300)); }
.MuiButton.outlined.error:hover { background: var(--red-100); }
.MuiButton.outlined.warning  { color: var(--orange-600); border-color: color-mix(in oklab, var(--orange-600) 50%, var(--neutral-300)); }
.MuiButton.outlined.warning:hover { background: var(--orange-100); }
.MuiButton.outlined.primary  { color: var(--blue-600); border-color: color-mix(in oklab, var(--blue-600) 50%, var(--neutral-300)); }
.MuiButton.outlined.primary:hover { background: var(--blue-100); }

/* Sizes */
.MuiButton.small { height: 32px; padding: 4px 14px; font-size: 13px; border-radius: var(--r-pill); }
.MuiButton.large { height: 44px; padding: 8px 24px; font-size: 15px; border-radius: var(--r-pill); }

/* IconButton */
.MuiIconButton {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.MuiIconButton:hover { background: var(--surface-2); color: var(--text); }
.top-actions .MuiIconButton { width: 36px; height: 36px; }
.MuiIconButton.small { width: 28px; height: 28px; }
.MuiIconButton.primary { color: var(--primary); }
.MuiIconButton.primary:hover { background: var(--primary-soft); }

/* === Chip === */
.MuiChip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  border: 0;
  letter-spacing: 0;
  white-space: nowrap;
}
.MuiChip.small { height: 22px; padding: 0 8px; font-size: 11px; }
.MuiChip .chip-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  margin-left: -4px;
}
.MuiChip .chip-icon {
  width: auto; height: auto;
  margin-left: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.MuiChip .chip-icon svg { display: block; }
.MuiChip.small:has(.chip-icon) { padding: 0 10px; gap: 5px; }
.MuiChip .chip-delete {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  margin-right: -4px;
  font-size: 10px;
}
.MuiChip .chip-delete:hover { background: rgba(0,0,0,.32); }
.MuiChip.outlined {
  background: transparent;
  border: 0;
  background: var(--surface-2);
}
/* color variants — mapped to foundation tokens */
.MuiChip.primary  { background: var(--blue-100);   color: var(--blue-600); }
.MuiChip.primary.filled  { background: var(--blue-600); color: #fff; }
.MuiChip.success  { background: var(--green-100);  color: var(--green-600); }
.MuiChip.success.filled { background: var(--green-500); color: #fff; }
.MuiChip.warning  { background: var(--orange-100); color: var(--orange-700); }
.MuiChip.warning.filled { background: var(--orange-600); color: #fff; }
.MuiChip.error    { background: var(--red-100);    color: var(--red-600); }
.MuiChip.error.filled { background: var(--red-500); color: #fff; }
.MuiChip.info     { background: var(--cyan-100);   color: var(--cyan-700); }
.MuiChip.info.filled { background: var(--cyan-600); color: #fff; }
/* dark mode: muted filled chips (tinted bg + light text), consistent with warning */
.tesla[data-theme="dark"] .MuiChip.error.filled { background: color-mix(in srgb, var(--red-500) 20%, var(--surface)); color: #F08A8A; }
.tesla[data-theme="dark"] .MuiChip.success.filled { background: color-mix(in srgb, var(--green-500) 20%, var(--surface)); color: #6FD89B; }
.tesla[data-theme="dark"] .MuiChip.info.filled, .tesla[data-theme="dark"] .MuiChip.secondary.filled { background: color-mix(in srgb, var(--cyan-600) 22%, var(--surface)); color: #6FD0E8; }
.tesla[data-theme="dark"] .MuiChip.primary.filled { background: color-mix(in srgb, var(--blue-500) 24%, var(--surface)); color: #9CC0FF; }
.MuiChip.secondary{ background: var(--cyan-100);   color: var(--cyan-700); }

.MuiChip[data-clickable="true"] { cursor: pointer; transition: filter .12s; }
.MuiChip[data-clickable="true"]:hover { filter: brightness(.96); }
.MuiChip[data-selected="true"] { box-shadow: 0 0 0 2px var(--blue-800); }

/* ────────────────────────────────────────────────────────────
   MOLECULES
   ──────────────────────────────────────────────────────────── */

/* === Card === */
.MuiCard {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.MuiCard[data-elevation="2"] { box-shadow: var(--shadow-2); }
.MuiCard[data-elevation="3"] { box-shadow: var(--shadow-3); }
.MuiCard[data-elevation="4"] { box-shadow: var(--shadow-4); }

.MuiCardHeader {
  display: flex; align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--divider);
  gap: 14px;
}
.MuiCardHeader .ch-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue-600);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.MuiCardHeader .ch-content { flex: 1; min-width: 0; padding-top: 4px; }
.MuiCardHeader .ch-title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.4;
}
.MuiCardHeader .ch-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.45;
}
.MuiCardHeader .ch-action { margin-left: auto; padding-top: 4px; }

.MuiCardContent {
  padding: 20px;
}
.MuiCardContent.dense { padding: 16px 20px; }
.MuiCardContent.flush { padding: 8px 0; }
.MuiCardContent.flush .MuiTable tr:last-child td { border-bottom: 0; }
.card-link { font-size: 13px; font-weight: 600; color: var(--blue-600); cursor: pointer; text-decoration: none; }
.card-link:hover { color: var(--blue-700); text-decoration: underline; }

.MuiCardActions {
  display: flex; align-items: center;
  padding: 14px 22px;
  gap: 8px;
  border-top: 1px solid var(--divider);
  background: var(--surface-1);
}

/* === Alert (MUI) — for Verdict === */
.MuiAlert {
  display: flex; align-items: flex-start;
  gap: 16px;
  padding: 16px 24px 16px 16px;
  border-radius: 8px;
  border: 1px solid;
  position: relative;
}
.MuiAlert .alert-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.MuiAlert .alert-content { flex: 1; min-width: 0; padding-top: 2px; }
.MuiAlert .alert-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.5;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.MuiAlert .alert-message {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
.MuiAlert .alert-message b { color: var(--text); font-weight: 600; }
.MuiAlert .alert-actions {
  display: flex; gap: 8px; align-items: center;
  margin-left: auto; flex-shrink: 0;
  padding-top: 2px;
}

/* Verdict — MUI Alert body, proper inline typography */
.verdict-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.verdict-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  position: relative;
  padding-left: 18px;
}
.verdict-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red-500);
}
.verdict-list li b {
  font-weight: 600;
  color: var(--text);
}

.verdict-footer {
  font-size: 13px;
  color: var(--text-2);
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklab, var(--warning) 22%, var(--divider));
  display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 4px;
  line-height: 1.5;
}
.verdict-footer .vf-item { display: inline-flex; align-items: center; gap: 6px; }
.verdict-footer b { color: var(--text); font-weight: 600; }

/* Verdict actions row (inside Alert body, below message) */
.verdict-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 16px;
}
.verdict-meta .vs-sep { color: var(--text-3); }
.verdict-meta b { color: var(--text); font-weight: 600; }
/* severity */
.MuiAlert.error   { background: var(--red-100);    border-color: var(--red-300); }
.MuiAlert.error   .alert-icon { background: var(--red-500); color: #fff; }
.MuiAlert.error   .alert-title { color: var(--red-600); }

.MuiAlert.warning { background: var(--orange-100); border-color: var(--orange-300); }
.MuiAlert.warning .alert-icon { background: var(--orange-600); color: #fff; }
.MuiAlert.warning .alert-title { color: var(--orange-700); }

.MuiAlert.info    { background: var(--cyan-100);   border-color: var(--cyan-300); }
.MuiAlert.info    .alert-icon { background: var(--cyan-600); color: #fff; }
.MuiAlert.info    .alert-title { color: var(--cyan-800); }

.MuiAlert.success { background: var(--green-100);  border-color: var(--green-300); }
.MuiAlert.success .alert-icon { background: var(--green-500); color: #fff; }
.MuiAlert.success .alert-title { color: var(--green-600); }

/* === Stepper (Material — horizontal) === */
.MuiStepper {
  display: flex; align-items: center;
  width: 100%;
  gap: 0;
}
.MuiStep {
  display: flex; align-items: center; gap: 12px;
  flex: 0 0 auto;
  cursor: pointer;
}
.MuiStep + .MuiStep::before {
  content: "";
  width: 64px; height: 2px;
  background: var(--divider);
  border-radius: 1px;
  margin: 0 14px 0 0;
}
.MuiStep[data-state="done"] + .MuiStep::before {
  background: var(--success);
}
.MuiStepIcon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--divider-strong);
  color: var(--text-3);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all .15s;
}
.MuiStep[data-state="done"] .MuiStepIcon {
  background: var(--success); border-color: var(--success); color: #fff;
}
.MuiStep[data-state="active"] .MuiStepIcon {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.MuiStepLabel {
  display: flex; flex-direction: column;
}
.MuiStepLabel .label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.MuiStep[data-state="done"] .MuiStepLabel .label { color: var(--text); }
.MuiStep[data-state="active"] .MuiStepLabel .label { color: var(--primary); font-weight: 600; }
.MuiStepLabel .opt {
  font-size: 11px;
  color: var(--text-3);
}

/* Tabs (MUI — sliding indicator) */
.MuiTabs {
  display: flex;
  border-bottom: 1px solid var(--divider);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  /* subtle shadow when stuck */
  box-shadow: 0 1px 0 var(--divider);
}
.MuiTab {
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
  transition: color .15s;
  text-transform: none;
}
.MuiTab:hover { color: var(--text); }
.MuiTab[data-active="true"] {
  color: var(--primary);
  font-weight: 600;
}
.MuiTab[data-active="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 12px; right: 12px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}
.MuiTab .count {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--surface-3); color: var(--text-2);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 500;
}
.MuiTab[data-active="true"] .count {
  background: var(--primary-soft);
  color: var(--primary);
}
.MuiTab .count.error {
  background: var(--error-soft);
  color: var(--error);
}

/* ─────── Profile header ─────── */
.profile-header {
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  padding: 20px 28px 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.ph-top {
  display: flex; align-items: center; gap: 20px;
}

/* Avatar — MUI circular Avatar */
.ph-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--blue-600);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.ph-avatar.device {
  background: var(--cyan-700);
}

/* Identity area */
.ph-identity {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}

/* Title row — MUI h5: 24px, 600, -0.5px letter-spacing */
.ph-title {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.334;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0;
}
.ph-title .handle { color: var(--text); }

/* Badges row — between title and meta */
.ph-badges {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

/* Meta row — MUI body2: 14px / 1.43 */
.ph-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.43;
}
.ph-meta-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.43;
}

/* Actions */
.ph-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

/* Bottom context row (case meta) */
.ph-stepper {
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.ph-stepper b { color: var(--text); font-weight: 600; }
.ph-stepper-sep {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--neutral-400);
  flex-shrink: 0;
}
.ph-stepper-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 16px;
  font-size: 13px;
  color: var(--text-2);
}

.dash-header {
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 8;
  padding: 16px 24px;
  display: flex; align-items: center; gap: 24px;
}
.dash-header h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-1);
}
.kpi-card .kpi-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.kpi-card .kpi-ico.red   { background: var(--red-100);    color: var(--red-500); }
.kpi-card .kpi-ico.blue  { background: var(--blue-100);   color: var(--blue-600); }
.kpi-card .kpi-ico.green { background: var(--green-100);  color: var(--green-600); }
.kpi-card .kpi-ico.amber { background: var(--orange-100); color: var(--orange-600); }
/* dark mode: KPI icon tiles match the bright solid tone of the top alert tiles */
.tesla[data-theme="dark"] .kpi-card .kpi-ico.red   { background: var(--red-500);    color: #fff; }
.tesla[data-theme="dark"] .kpi-card .kpi-ico.blue  { background: var(--blue-600);   color: #fff; }
.tesla[data-theme="dark"] .kpi-card .kpi-ico.green { background: var(--green-500);  color: #fff; }
.tesla[data-theme="dark"] .kpi-card .kpi-ico.amber { background: #E0902A;           color: #fff; }
.kpi-card .kpi-body { flex: 1; min-width: 0; }
.kpi-card .kpi-lbl { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-card .kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; color: var(--text); line-height: 1.15; }

/* LIVE now-strip — what needs attention right now */
.now-strip {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
}
.now-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 9px;
  background: var(--green-100);
  color: var(--green-600);
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 0 rgba(29,165,52,.5);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29,165,52,.5); }
  70% { box-shadow: 0 0 0 7px rgba(29,165,52,0); }
  100% { box-shadow: 0 0 0 0 rgba(29,165,52,0); }
}
.now-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.now-time { margin-left: auto; font-size: 12px; color: var(--text-3); }
.now-alerts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .now-alerts { grid-template-columns: 1fr; } }
.now-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .12s, transform .12s;
  border: 1px solid;
}
.now-alert:hover { transform: translateY(-1px); }
.now-alert .na-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.now-alert .na-body { flex: 1; min-width: 0; }
.now-alert .na-ttl { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.now-alert .na-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.now-alert.crit { background: var(--red-100);    border-color: var(--red-300); }
.now-alert.crit .na-ico { background: var(--red-500); color: #fff; }
.now-alert.crit:hover { background: color-mix(in oklab, var(--red-500) 14%, white); }
.now-alert.warn { background: var(--orange-100); border-color: var(--orange-300); }
.now-alert.warn .na-ico { background: var(--orange-600); color: #fff; }
.now-alert.warn:hover { background: color-mix(in oklab, var(--orange-600) 12%, white); }
.now-alert.info { background: var(--blue-100);   border-color: var(--blue-300); }
.now-alert.info .na-ico { background: var(--blue-600); color: #fff; }
.now-alert.info:hover { background: color-mix(in oklab, var(--blue-600) 12%, white); }
.now-alert > svg:last-child { color: var(--text-3); flex-shrink: 0; }

/* Dashboard analytics grid */
.dash-2col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1200px) { .dash-2col { grid-template-columns: 1fr; } }
/* columns dissolve into the grid so rows align crosswise */
.dash-main, .dash-side { display: contents; }
.dash-main > .MuiCard:nth-child(1) { grid-column: 1 / -1; grid-row: 1; }
.dash-main > .MuiCard:nth-child(2) { grid-column: 1; grid-row: 2; }
.dash-main > .MuiCard:nth-child(3) { grid-column: 1; grid-row: 3; }
.dash-main > .MuiCard:nth-child(4) { grid-column: 1 / -1; grid-row: 5; }
.dash-side > .MuiCard:nth-child(1) { grid-column: 2; grid-row: 2; }
.dash-side > .MuiCard:nth-child(2) { grid-column: 2; grid-row: 3; }
.dash-side > .MuiCard:nth-child(3) { grid-column: 2; grid-row: 4; }
.dash-side > .MuiCard:nth-child(4) { grid-column: 1; grid-row: 4; }
.dash-2col > .dash-side > .lbf-card, .dash-side > .lbf-card, .dash-side > .lbf-fullrow { grid-column: 1 / -1 !important; }
@media (max-width: 1200px) {
  .dash-main, .dash-side { display: contents; }
  .dash-2col > .dash-main > .MuiCard, .dash-2col > .dash-side > .MuiCard { grid-column: 1 !important; grid-row: auto !important; }
}

/* Stacked horizontal bar */
.stacked-bar { width: 100%; }
.sb-track { display: flex; width: 100%; border-radius: 12px; overflow: hidden; gap: 3px; box-shadow: inset 0 0 0 1px rgba(15,23,55,.04); }
.sb-seg {
  display: grid; place-items: center;
  transition: width .8s cubic-bezier(.4,0,.2,1); min-width: 3px;
  position: relative;
}
.sb-seg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0));
  pointer-events: none;
}
.sb-val { color: #fff; font-size: 14px; font-weight: 700; position: relative; z-index: 1; text-shadow: 0 1px 1px rgba(0,0,0,.12); }
.sb-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.sb-leg-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.sb-leg-dot { width: 10px; height: 10px; border-radius: 3px; }
.src-breakdown { margin-top: 18px; display: flex; flex-direction: column; }
.src-row { display: grid; grid-template-columns: 14px 1fr auto auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 13px; }
.src-dot { width: 10px; height: 10px; border-radius: 3px; }
.src-name { font-weight: 600; color: var(--text); }
/* Verification volume — compact rows with per-source bars */
.srcb-row { padding: 10px 0; border-top: 1px solid var(--divider); }
.srcb-row:first-child { border-top: 0; }
.srcb-head { display: grid; grid-template-columns: 14px 1fr auto auto auto; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 7px; }
.srcb-n { color: var(--text-2); font-variant-numeric: tabular-nums; }
.srcb-pct { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.srcb-pass { color: var(--green-600); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 74px; text-align: right; }
.srcb-track { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.srcb-fill { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }
/* Active threat patterns — full-width table redesign */
/* Live block feed */
.lbf-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green-600); }
.lbf-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d36b; box-shadow: 0 0 0 0 rgba(52,211,107,.7); animation: ai-dot-pulse 1.8s ease-out infinite; }
.lbf-list { display: flex; flex-direction: column; }
.lbf-summary { display: flex; gap: 8px; padding: 12px 0 14px; margin-bottom: 6px; border-bottom: 1px solid var(--divider); }
.lbf-table { width: 100%; border-collapse: collapse; border: 1px solid var(--divider-strong); border-radius: 14px; overflow: hidden; }
.lbf-table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 11px 14px; background: var(--surface-1); border-bottom: 1px solid var(--divider); }
.lbf-table td { height: 52px; padding: 0 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; font-size: 13.5px; }
.lbf-table { width: 100%; border-collapse: collapse; border: 1px solid var(--divider-strong); border-radius: 14px; overflow: hidden; }
.lbf-table th, .lbf-table td { white-space: nowrap; }
.lbf-table th:first-child, .lbf-table td:first-child { width: 16%; }
.lbf-bar { width: 96px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.lbf-table tr:last-child td { border-bottom: 0; }
.lbf-tr:hover { background: var(--surface-2); }
.lbf-dev { display: flex; align-items: center; gap: 10px; }
.lbf-dev .lbf-id { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.lbf-dev .lbf-plat { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-3); }
.lbf-table th:first-child, .lbf-table td:first-child { width: 22%; }
.lbf-reason { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.lbf-table td:nth-child(2) { white-space: normal; }
.lbf-dim { color: var(--text-3); font-size: 12.5px; }
.lbf-ago { white-space: nowrap; }
.lbf-actcell { width: 64px; padding-left: 0; }
.lbf-acts { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; justify-content: flex-end; }
.lbf-tr:hover .lbf-acts { opacity: 1; }
.lbf-sum-c .v { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.lbf-spike { display: flex; align-items: center; gap: 9px; padding: 8px 11px; margin-bottom: 8px; border-radius: 10px; background: color-mix(in srgb, var(--red-500) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--red-500) 24%, transparent); font-size: 12.5px; color: var(--text-2); }
.lbf-spike > svg { color: var(--red-600); flex-shrink: 0; }
.lbf-spike span { flex: 1; } .lbf-spike b { color: var(--red-700); }
.lbf-spike button { border: 0; background: var(--red-600); color: #fff; font-family: inherit; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; cursor: pointer; flex-shrink: 0; }
.lbf-pausebtn { border: 0; background: transparent; cursor: pointer; padding: 0; }
.lbf-ring { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.tesla[data-theme="dark"] .lbf-ring { color: var(--text); }
.lbf-ring svg { color: var(--text-2); }
.lbf-sum-c { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lbf-sum-c .v { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.lbf-sum-c .v .u { font-size: 10px; font-weight: 700; color: var(--text-3); }
.lbf-sum-c .v.txt { font-size: 13px; }
.lbf-sum-c .k { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.lbf-acts { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.lbf-row:hover .lbf-acts { opacity: 1; }
.lbf-acts button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--divider-strong); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.lbf-acts button:hover { background: var(--bg-hover); color: var(--blue-600); border-color: var(--blue-300); }
.lbf-row { display: grid; grid-template-columns: 34px minmax(220px, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 10px; margin: 0 -10px; border-top: 1px solid var(--divider); transition: background .12s; border-radius: 10px; }
.lbf-row:first-child { border-top: 0; }
.lbf-row + .lbf-row { border-top: 1px solid var(--divider); }
.lbf-row:hover { background: var(--surface-2); border-color: transparent; }
.lbf-icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lbf-main { min-width: 0; }
.lbf-top { display: flex; align-items: center; gap: 8px; }
.lbf-id { font-size: 13.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.lbf-plat { font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.lbf-new { font-size: 9.5px; font-weight: 700; color: var(--red-500); background: var(--red-100); padding: 1px 6px; border-radius: 999px; letter-spacing: .04em; }
.lbf-reason { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.lbf-sev { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.lbf-right { text-align: right; }
.lbf-checks { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.lbf-bar > div { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.lbf-checks b { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.lbf-ago { font-size: 11px; color: var(--text-3); display: block; margin-top: 3px; }
.threat-row { display: grid; grid-template-columns: 4px 1fr auto auto auto; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--divider); }
.threat-row:first-child { border-top: 0; }
.threat-sev { width: 4px; height: 32px; border-radius: 2px; }
.threat-info { min-width: 0; }
.threat-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.threat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.threat-spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 80px; }
.threat-spark span { flex: 1; border-radius: 2px 2px 1px 1px; opacity: .85; }
.threat-accts { text-align: right; }
.threat-accts b { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.threat-accts span { display: block; font-size: 10.5px; color: var(--text-3); }
.threat-trend { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; min-width: 52px; text-align: center; }
.threat-trend.up { background: var(--red-100); color: var(--red-500); }
.threat-trend.down { background: var(--green-100); color: var(--green-600); }
.src-n { color: var(--text-2); font-variant-numeric: tabular-nums; }
.src-pct { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.src-pass { color: var(--green-600); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }

/* Diverging bars */
.div-bars { display: flex; flex-direction: column; gap: 14px; }
.db-row { display: grid; grid-template-columns: 56px 1fr 48px; gap: 12px; align-items: center; }
.db-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.db-track { display: flex; height: 20px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.db-pass { background: var(--green-500); transition: width .8s ease; border-radius: 6px 0 0 6px; }
.db-fail { background: var(--red-500); transition: width .8s ease; }
.db-total { font-size: 12.5px; color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.db-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--text-2); }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; }
.db-dot { width: 9px; height: 9px; border-radius: 50%; }
.db-dot.pass { background: var(--green-500); }
.db-dot.fail { background: var(--red-500); }
/* Pass / fail by platform */
.pf-overall { text-align: right; line-height: 1.1; }
.pf-overall b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--green-600); font-variant-numeric: tabular-nums; }
.pf-overall span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.pf-list { display: flex; flex-direction: column; gap: 20px; }
.pf-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.pf-name { font-weight: 600; color: var(--text); min-width: 56px; }
.pf-vol { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-rate { margin-left: auto; color: var(--green-600); font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-fail { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.pf-track { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.pf-pass { background: var(--green-500); transition: width .8s ease; }
.pf-failbar { background: var(--red-500); transition: width .8s ease; }
.pf-foot { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-2); }
.pf-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.pf-foot-dot { width: 8px; height: 8px; border-radius: 50%; }
.pf-foot-dot.pass { background: var(--green-500); }
.pf-foot-dot.fail { background: var(--red-500); }
.pf-foot-note { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pf-content { display: flex; flex-direction: column; height: 100%; }
.pf-content .pf-list { flex: 1; justify-content: space-between; }
.pf-content .pf-foot { margin-top: 0; }

/* Top flagged users — enriched */
.tfu-user { display: flex; align-items: center; gap: 10px; }
.tfu-avatar { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.tfu-risk { display: flex; align-items: flex-end; gap: 9px; }
.tfu-score { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; flex-shrink: 0; line-height: 16px; }
.tfu-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; width: 48px; flex-shrink: 0; }
.tfu-spark span { flex: 1; border-radius: 2px; opacity: .8; }
.tfu-trend { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; flex-shrink: 0; line-height: 16px; }
.tfu-trend.up { color: var(--red-500); line-height: 1; }
/* dark mode: re-tint light icon tiles (white-mix backgrounds) from each tile's own hue */
.tesla[data-theme="dark"] .tfu-avatar,
.tesla[data-theme="dark"] .lbf-icon,
.tesla[data-theme="dark"] .acct-device .di,
.tesla[data-theme="dark"] .ct-device .di,
.tesla[data-theme="dark"] .dc-top .di,
.tesla[data-theme="dark"] .device-row .dr-icon { background: color-mix(in srgb, currentColor 22%, var(--surface)) !important; }
.tfu-trend.down { color: var(--green-600); }

/* Compact table (sidebar) */
.compact-table th, .compact-table td { padding: 11px 20px; }

/* legacy dash-grid kept for any remaining refs */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.dash-grid > .MuiCard { display: flex; flex-direction: column; }
.dash-grid > .MuiCard > .MuiCardContent { flex: 1; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .MuiCard { grid-column: 1 / -1 !important; } }

/* Donut */
.donut-layout { display: flex; align-items: center; gap: 20px; }
.donut-wrap { flex-shrink: 0; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.dl-row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 12px; font-size: 13px; }
.dl-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dl-label { color: var(--text-2); }
.dl-n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.dl-val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

/* Heatmap */
.heatmap { width: 100%; height: 100%; display: flex; flex-direction: column; }
.hm-grid { display: grid; gap: 4px; flex: 1; min-height: 0; }
.hm-col-label, .hm-row-label { font-size: 11px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; }
.hm-col-label { justify-content: center; }
.hm-cell { aspect-ratio: auto; border-radius: 4px; cursor: pointer; transition: transform .1s; min-height: 30px; height: 100%; }
.hm-cell:hover { transform: scale(1.08); outline: 2px solid var(--blue-600); }
.hm-legend { display: flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 11px; color: var(--text-3); justify-content: flex-end; }
.hm-legend.hm-legend-top { margin-top: 0; }
/* Heatmap analytical footer */
.hm-foot { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--divider); }
.hm-takeaway { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--blue-50, color-mix(in oklab, #1E54E7 7%, white)); border-radius: 10px; font-size: 13px; color: var(--text); line-height: 1.5; }
.hm-takeaway > svg { color: var(--blue-600); flex-shrink: 0; }
.hm-takeaway b { font-weight: 700; }
.hm-insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hm-ins { display: flex; flex-direction: column; gap: 2px; }
.hm-ins-k { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.hm-ins-v { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.hm-ins-s { font-size: 11px; color: var(--text-2); }
.hm-legend .hm-sw { width: 16px; height: 12px; border-radius: 3px; }

/* Hero protection metric */
.hero-metric { display: flex; align-items: center; gap: 24px; margin-bottom: 4px; }
.hero-metric .hm-big { font-size: 40px; font-weight: 700; letter-spacing: -.04em; color: var(--green-600); line-height: 1; display: flex; align-items: baseline; }
.hero-metric .hm-unit { font-size: 22px; font-weight: 700; margin-left: 2px; }
.hero-metric .hm-side { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hero-metric .hm-side .MuiChip { align-self: flex-start; }
.hero-metric .hm-note { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

/* Protection rate — redesigned scorecard */
.prot-hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; margin-bottom: 20px; }
.prot-left { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.prot-big { font-size: 38px; font-weight: 700; letter-spacing: -.03em; color: var(--green-600); line-height: 1; display: flex; align-items: baseline; }
.prot-unit { font-size: 20px; font-weight: 700; margin-left: 2px; }
.prot-right { min-width: 0; }
.prot-rail-row { display: flex; font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.prot-rail { position: relative; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.prot-rail-fill { height: 100%; background: linear-gradient(90deg, var(--green-400), var(--green-500)); border-radius: 999px; transition: width .9s cubic-bezier(.4,0,.2,1); }
.prot-rail-sla { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--neutral-700); }
.prot-rail-sla span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--neutral-700); }
.prot-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.prot-stat .ps-v { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.prot-stat .ps-l { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.prot-trend { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 20px; }
.prot-trend .pt-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.prot-trend .pt-bar { width: 100%; background: color-mix(in oklab, var(--green-500) 55%, white); border-radius: 5px 5px 3px 3px; transition: height .7s cubic-bezier(.4,0,.2,1); }
.prot-trend .pt-col:last-child .pt-bar { background: var(--green-500); }

/* Protection rate — flagship 3-part scorecard */
.prot3 { display: grid; grid-template-columns: auto 1fr 1.1fr; gap: 28px; align-items: center; }
.prot3-gauge { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.prot3-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.p3-stat .p3-v { font-size: 22px; font-weight: 700; letter-spacing: -.025em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.p3-stat .p3-l { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.prot3-clients { border-left: 1px solid var(--divider); padding-left: 28px; }
.p3c-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.p3c-row { display: grid; grid-template-columns: 110px 1fr 42px; align-items: center; gap: 12px; padding: 5px 0; font-size: 12.5px; }
.p3c-name { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p3c-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.p3c-fill { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.p3c-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.prot3-trend { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--divider); }
.p3t-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.p3t-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.p3t-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.p3t-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.p3t-dot.ok { background: var(--green-500); }
.p3t-dot.sla { background: var(--neutral-500); border-radius: 2px; width: 12px; height: 3px; }
@media (max-width: 1280px) { .prot3 { grid-template-columns: auto 1fr; } .prot3-clients { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--divider); padding-left: 0; padding-top: 16px; margin-top: 4px; } }

/* Protection rate — gauge scorecard */
.prot2 { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.prot2-gauge { flex-shrink: 0; }
.prot2-stats { display: flex; flex-direction: column; }
.p2-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--divider); font-size: 13.5px; }
.p2-row:first-child { border-top: 0; }
.p2-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-400); }
.p2-dot.ok { background: var(--green-500); }
.p2-dot.warn { background: var(--orange-500); }
.p2-l { color: var(--text-2); }
.p2-v { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Chart insight banner */
.chart-insight {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  background: var(--blue-100);
  border-radius: 10px;
  font-size: 13px; line-height: 1.5; color: var(--text-2);
}
.chart-insight b { color: var(--text); font-weight: 600; }
.chart-insight .ci-ico {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: var(--blue-600); color: #fff; display: grid; place-items: center;
}

/* Chart legend + axis */
.chart-legend { display: flex; gap: 20px; margin-bottom: 8px; }

/* Widget entrance + chart animations */
@keyframes ac-draw { to { stroke-dashoffset: 0; } }
@keyframes ac-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hm-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.ac-line { animation: ac-draw 1.4s cubic-bezier(.4,0,.2,1) forwards; }
.ac-area { opacity: 0; animation: ac-fade 1s ease .5s forwards; }
.ac-peak { opacity: 0; animation: ac-fade .5s ease 1.3s forwards; }
.hm-cell { animation: hm-pop .4s cubic-bezier(.34,1.56,.64,1) both; }
/* heatmap cells pop in sequentially when the card scrolls into view */
.main .reveal .hm-cell { animation: none; opacity: 0; transform: scale(.4); }
.main .reveal.in .hm-cell { animation: hm-pop .6s cubic-bezier(.34,1.56,.64,1) both; }
/* entrance animations removed — were resetting to opacity:0 under re-render; cards stay visible */
.kpi-card, .ring-card { animation: none !important; }
/* Scroll reveal */
.main .reveal { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.22,1,.36,1); }
.main .reveal.in { opacity: 1; transform: none; }
.dash-2col .MuiCard { display: flex; flex-direction: column; }
.dash-2col .MuiCard, .dash-main .MuiCard, .dash-side .MuiCard, .now-strip, .tab-content .MuiCard, .tab-content .MuiAlert { animation: none !important; }
.chart-legend .cl-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.chart-legend .cl-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-xaxis { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Area chart interactive hover tooltip */
.ac-yaxis {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 10px; color: var(--text-3); text-align: left;
  padding: 14px 0 38px; font-variant-numeric: tabular-nums;
}
  transform: translate(-50%, calc(-100% - 14px));
  background: var(--neutral-1000);
  border-radius: 10px;
  padding: 9px 12px;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.4);
  pointer-events: none;
  z-index: 6;
  min-width: 130px;
}
.ac-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--neutral-1000);
}
.ac-tip-x { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.6); margin-bottom: 6px; }
.ac-tip-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ac-tip-row + .ac-tip-row { margin-top: 3px; }
.ac-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ac-tip-name { color: rgba(255,255,255,.75); flex: 1; }
.ac-tip-val { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Dashboard hero strip */
.dash-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 1200px) { .dash-hero-grid { grid-template-columns: 1fr; } }

.dash-hero {
  background: linear-gradient(135deg, color-mix(in oklab, var(--red-500) 6%, white), var(--surface));
  border: 1px solid color-mix(in oklab, var(--red-500) 22%, var(--divider));
  border-radius: var(--r-md);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-1);
}
.dash-hero .dh-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--red-600);
}
.dash-hero .dh-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--red-500); color: #fff;
  display: grid; place-items: center;
}
.dash-hero .dh-value {
  font-size: 44px; font-weight: 700; letter-spacing: -.035em;
  color: var(--text); line-height: 1; display: flex; align-items: baseline; gap: 12px;
}
.dash-hero .dh-trend {
  font-size: 13px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.dash-hero .dh-trend.up { background: var(--red-100); color: var(--red-500); }
.dash-hero .dh-sub { font-size: 13px; color: var(--text-2); }
.dash-hero .dh-spark { height: 48px; margin: 4px 0; }
.dash-hero .MuiButton { align-self: flex-start; }

.dash-kpi-col { display: flex; flex-direction: column; gap: 12px; }
.dash-kpi {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-1);
  flex: 1;
}
.dash-kpi .dk-info { flex: 1; min-width: 0; }
.dash-kpi .dk-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.dash-kpi .dk-value {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  color: var(--text); margin-top: 2px; display: flex; align-items: baseline; gap: 8px;
}
.dash-kpi .dk-trend { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.dash-kpi .dk-trend.up { background: var(--red-100); color: var(--red-500); }
.dash-kpi .dk-trend.down { background: var(--green-100); color: var(--green-600); }
.dash-kpi .dk-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.dash-kpi .dk-spark { width: 120px; flex-shrink: 0; }

.risk-dist { display: flex; flex-direction: column; gap: 16px; }
.rank-list { display: flex; flex-direction: column; gap: 16px; }
.rk-row { display: flex; flex-direction: column; gap: 7px; }
.rk-head { display: flex; align-items: baseline; gap: 8px; }
.rk-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rk-meta { font-size: 11.5px; color: var(--text-3); }
.rk-val { margin-left: auto; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.rk-fill { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.region-bars { display: flex; flex-direction: column; gap: 14px; }
.rb-row {
  display: grid; grid-template-columns: 110px 1fr 150px;
  gap: 16px; align-items: center;
}
.rb-label { font-size: 13px; font-weight: 600; color: var(--text); }
.rb-track {
  position: relative;
  height: 28px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  display: flex; align-items: center;
}
.rb-fill { height: 100%; border-radius: 6px 0 0 6px; transition: width .3s ease; }
.rb-val {
  position: absolute; left: 12px;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rb-meta { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.rb-total { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rb-trend { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--neutral-200); color: var(--text-3); }
.rb-trend.up { background: var(--red-100); color: var(--red-500); }
.rb-trend.down { background: var(--green-100); color: var(--green-600); }

/* Card hover — only for clickable cards */
.MuiCard[onClick],
.MuiCard[data-clickable="true"] { cursor: pointer; }
.MuiCard[onClick]:hover,
.MuiCard[data-clickable="true"]:hover { box-shadow: var(--shadow-3); transform: translateY(-1px); }

/* Segmented tabs — Launchpad Calendar/Table style */
.seg-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--grey-100);
  border-radius: 10px;
  padding: 3px;
}
.seg-tabs button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.seg-tabs button:hover { color: var(--text-primary); }
.seg-tabs button[data-active="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(20,28,56,.12);
}

/* Tab content */
.tab-content {
  padding: 24px 28px 64px;
  min-height: calc(100vh - 56px - 180px);
}

/* 3-column workspace (Overview) */
.workspace-3col {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1440px) {
  .workspace-3col { grid-template-columns: 300px 1fr 340px; gap: 20px; }
}
@media (max-width: 1200px) {
  .workspace-3col { grid-template-columns: 1fr; gap: 20px; }
}
.ws-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Workspace list rows (inside cards) */
.ws-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background .12s;
}
.ws-row:last-child { border-bottom: 0; }
.ws-row:hover { background: var(--surface-1); }
.ws-row.focused {
  background: var(--blue-100);
  box-shadow: inset 3px 0 0 var(--blue-600);
}
.ws-row > svg:first-child {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-row-ttl {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.4;
}
.ws-row-sub {
  font-size: 12px; color: var(--text-3);
  margin-top: 3px;
  font-weight: 400;
}
.ws-row-meta {
  display: flex; flex-direction: column;
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}

/* Device rows (Devices card) */
.device-row.blocked { background: color-mix(in srgb, var(--red-500) 5%, transparent); }
.device-row.blocked:hover { background: color-mix(in srgb, var(--red-500) 9%, transparent); }
.device-row .dr-blocked { display: inline-flex; align-items: center; gap: 3px; margin-left: 7px; font-family: var(--font-sans); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--red-600); background: color-mix(in srgb, var(--red-500) 13%, transparent); padding: 1px 6px 1px 4px; border-radius: 5px; vertical-align: middle; }
.device-row.blocked .dr-sub { color: var(--red-600); }
.device-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background .12s;
}
.device-row:last-child { border-bottom: 0; }
.device-row:hover { background: var(--surface-1); }
.device-row .dr-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.device-row .dr-info { min-width: 0; }
.device-row .dr-ttl {
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: -.005em; line-height: 1.35;
}
.device-row .dr-sub {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
}

/* Section header */
.section-h {
  display: flex; align-items: baseline; gap: 14px;
  margin: 28px 0 16px;
}
.section-h h2 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; margin: 0; color: var(--text); }
.section-h .sub { font-size: 13px; color: var(--text-2); }
.section-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ──────────────── Stat cards ──────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex; flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow-3); }
.stat-card .sc-h {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.stat-card .sc-icon {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.stat-card .sc-icon.success { background: var(--success-soft); color: var(--success); }
.stat-card .sc-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-card .sc-icon.error   { background: var(--error-soft);   color: var(--error); }
.stat-card .sc-icon.secondary {background: var(--secondary-soft); color: var(--secondary); }

.stat-card .sc-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 8px;
}
.stat-card .sc-value .unit { font-size: 14px; color: var(--text-2); font-weight: 500; }
.stat-card .sc-sub { font-size: 12px; color: var(--text-3); }
.stat-card .sc-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  letter-spacing: -.005em;
}
.stat-card .sc-trend.up    { background: var(--error-soft);   color: var(--error); }
.stat-card .sc-trend.down  { background: var(--success-soft); color: var(--success); }
.stat-card .sc-spark { height: 40px; margin-top: 4px; }
.stat-card.compact { padding: 14px 16px; gap: 4px; }
.stat-card.compact .sc-value { font-size: 22px; }

.stat-card .sc-list {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 6px 12px;
  font-size: 12.5px;
  margin-top: 4px;
}
.stat-card .sc-list .swatch { width: 8px; height: 8px; border-radius: 50%; align-self: center; margin-top: 2px; }
.stat-card .sc-list .name { color: var(--text); font-weight: 500; }
.stat-card .sc-list .pct { font-family: var(--font-sans); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Bar chart (Material polish) */
.bar-chart {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 22px 26px 16px;
  box-shadow: var(--shadow-1);
}
.bar-chart-area {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  height: 280px;
}
.bar-yaxis {
  display: flex; flex-direction: column-reverse;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 4px;
  height: 100%;
}
.bar-canvas {
  position: relative;
  display: flex; align-items: flex-end;
  gap: 8px;
  padding: 0 4px 0 8px;
}
.bar-canvas .gridline {
  position: absolute; left: 0; right: 0;
  border-top: 1px dashed var(--divider);
  pointer-events: none;
}
.bar-col {
  flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative;
  cursor: pointer;
  min-width: 8px;
  transition: filter .12s;
}
.bar-col:hover { filter: brightness(1.05); }
.bar-col:hover .bar-tip { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.bar-col .seg-pass {
  background: var(--blue-600);
  border-radius: 7px 7px 4px 4px;
  box-shadow: 0 2px 4px -2px rgba(30,99,255,.4);
}
.bar-col .seg-fail {
  background: var(--red-500);
  border-radius: 7px 7px 0 0;
  box-shadow: 0 2px 4px -2px rgba(211,47,47,.4);
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}
.bar-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  font-size: 11.5px;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 5;
  line-height: 1.4;
  box-shadow: var(--shadow-4);
}
.bar-tip::after {
  content: "";
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.bar-xaxis {
  display: flex; gap: 8px;
  padding: 8px 4px 0 46px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.bar-xaxis .xtick { flex: 1; text-align: center; min-width: 8px; }
.bar-chart-legend {
  display: flex; gap: 18px;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 12px;
  align-items: center;
}
.bar-chart-legend .li { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.bar-chart-legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* Map+sidepanel layout */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.map-layout > .map-area { position: relative; min-height: 480px; }
.map-layout > .map-side {
  border-left: 1px solid var(--divider);
  display: flex; flex-direction: column;
  max-height: 560px;
}
.map-side-h {
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
}
.map-side-h .side-tabs { display: flex; gap: 4px; flex: 1; }
.map-side-h .side-tab {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  border: 0;
  color: var(--text-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.map-side-h .side-tab:hover { background: var(--surface-2); color: var(--text); }
.map-side-h .side-tab[data-active="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.map-side-h .side-tab .count {
  font-size: 11px; padding: 1px 6px;
  background: var(--surface-3); border-radius: var(--r-pill);
  color: var(--text-2);
}
.map-side-h .side-tab[data-active="true"] .count {
  background: #fff; color: var(--primary);
}

.map-side-body { flex: 1; overflow: auto; }
.tx-row {
  display: grid; grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  font-size: 12.5px;
  cursor: pointer;
  align-items: flex-start;
}
.tx-row:hover { background: var(--surface-2); }
.tx-row[data-focused="true"] { background: var(--primary-soft); }
.tx-row .tx-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-top: 1px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.tx-row .tx-marker.pass { background: var(--success); }
.tx-row .tx-marker.fail { background: var(--error); }
.tx-row .tx-marker.crit { background: var(--secondary); }
.tx-row .tx-id {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text);
  font-size: 12px;
}
.tx-row dl {
  margin: 6px 0 0;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 3px 12px;
  font-size: 11.5px;
}
.tx-row dl dt { color: var(--text-3); }
.tx-row dl dd { margin: 0; font-family: var(--font-sans); color: var(--text); }
.tx-row .blockmsg {
  margin-top: 8px; padding: 8px 10px;
  background: var(--error-soft);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--error);
  font-weight: 500;
}

/* Switch (Material) */
.switch {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer;
}
.switch input { display: none; }
.switch .track {
  width: 32px; height: 18px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  position: relative;
  transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-2);
  transition: left .15s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { left: 16px; }

/* Antifraud grid */
.af-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* Risk panel */
.risk-stack {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-1);
}
.risk-stack-h {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}
.risk-stack-h .big {
  font-size: 52px; font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.risk-stack-h .meta { font-size: 13px; color: var(--text-2); }
.risk-stack-h .meta .level { font-size: 15px; font-weight: 600; margin-bottom: 2px; }

.risk-bars { display: flex; flex-direction: column; gap: 10px; }
.risk-bar {
  display: grid; grid-template-columns: 130px 1fr 36px;
  align-items: center; gap: 14px;
  font-size: 12.5px;
}
.risk-bar .name { color: var(--text); display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.risk-bar .name .bl { font-size: 11px; color: var(--text-3); font-family: var(--font-sans); font-weight: 500; }
.risk-bar .track {
  height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden;
}
.risk-bar .fill { height: 100%; border-radius: 3px; }
.risk-bar .val { text-align: right; font-family: var(--font-sans); color: var(--text); font-weight: 500; }

/* ────────────────────────────────────────────────────────────
   AI Drawer
   ──────────────────────────────────────────────────────────── */
.ai-rail-btn {
  position: fixed; right: 24px; bottom: 24px;
  z-index: var(--z-drawer);
  height: 48px; padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--blue-600);
  color: #fff;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer;
  box-shadow: 0 16px 32px -10px rgba(30,84,231,.50), 0 4px 8px rgba(17,57,166,.20), inset 0 1px 0 rgba(255,255,255,.18);
  font-size: 14px; font-weight: 600;
  letter-spacing: -.005em; line-height: 1;
  transition: transform .15s, box-shadow .15s;
}
.ai-rail-btn > svg { flex-shrink: 0; display: block; }
.ai-rail-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d36b; flex-shrink: 0; box-shadow: 0 0 0 0 rgba(52,211,107,.7); animation: ai-dot-pulse 1.8s ease-out infinite; }
@keyframes ai-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,107,.7); }
  70% { box-shadow: 0 0 0 7px rgba(52,211,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,107,0); }
}
.ai-rail-btn > span { line-height: 1; display: inline-flex; align-items: center; }
.ai-rail-btn:hover { transform: translateY(-2px); box-shadow: 0 24px 40px -10px rgba(30,99,255,.6), 0 6px 12px rgba(28,71,179,.24), inset 0 1px 0 rgba(255,255,255,.2); }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255,216,100,.7); }
  70% { box-shadow: 0 0 0 8px rgba(255,216,100,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,216,100,0); }
}

.ai-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--divider);
  z-index: var(--z-drawer);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-12);
  transform: translateX(100%);
  transition: transform .25s ease;
}
.ai-panel[data-open="true"] { transform: none; }

.ai-h {
  padding: 16px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; gap: 12px;
}
.ai-h .ai-badge {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  box-shadow: var(--primary-elev);
}
.ai-h .ai-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ai-h .ai-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }

.ai-scopebar {
  display: flex; gap: 4px;
  padding: 10px 12px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--divider);
}
.ai-scope {
  flex: 1;
  padding: 8px 6px;
  font-size: 11.5px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.ai-scope:hover { background: var(--surface); color: var(--text); }
.ai-scope[data-active="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-1);
  font-weight: 600;
}

.ai-tabs {
  display: flex; padding: 0 12px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.ai-tab {
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent; border: 0;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: -1px;
  transition: color .15s;
}
.ai-tab:hover { color: var(--text); }
.ai-tab[data-active="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.ai-tab .badge-mini {
  font-size: 10px; padding: 1px 6px;
  background: var(--error); color: #fff;
  border-radius: var(--r-pill);
}

.ai-body { flex: 1; overflow: auto; padding: 16px; }
.ai-block {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.55;
}
.ai-block .ai-block-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-3);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.ai-block b { color: var(--text); font-weight: 600; }
.ai-rec {
  background: var(--blue-100);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--divider));
}
.ai-rec .rec-action {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklab, var(--primary) 15%, var(--divider));
}
.ai-match {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--surface);
}
.ai-match:hover { background: var(--surface-1); }
.ai-match .pct {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}
.ai-match .info { flex: 1; min-width: 0; }
.ai-match .info .ttl { font-weight: 500; font-size: 13px; }
.ai-match .info .sub { font-size: 11.5px; color: var(--text-2); font-family: var(--font-sans); margin-top: 1px; }

.ai-chat-row { display: flex; gap: 8px; padding: 8px 0; }
.ai-chat-row.user { justify-content: flex-end; }
.ai-chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 13px;
  line-height: 1.5;
}
.ai-chat-row.user .ai-chat-bubble { background: var(--primary); color: #fff; }
.ai-chat-row.assistant .ai-chat-bubble {
  background: var(--surface-2);
  color: var(--text);
}
.ai-chat-bubble .typing { display: inline-flex; gap: 4px; }
.ai-chat-bubble .typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
  animation: typing 1.2s infinite;
}
.ai-chat-bubble .typing i:nth-child(2) { animation-delay: .15s; }
.ai-chat-bubble .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.ai-input {
  padding: 12px;
  border-top: 1px solid var(--divider);
  background: var(--surface-1);
  display: flex; gap: 10px; align-items: flex-end;
}
.ai-input textarea {
  flex: 1;
  resize: none;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  min-height: 40px; max-height: 120px;
  color: var(--text);
}
.ai-input textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.ai-input .send {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff; border: 0;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--primary-elev);
}
.ai-input .send:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; box-shadow: none; }

.suggested-q {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  margin: 2px 4px 2px 0;
  font-weight: 500;
}
.suggested-q:hover { background: var(--surface-2); border-color: var(--divider-strong); }

/* Modal (MUI Dialog) */
.scrim {
  position: fixed; inset: 0;
  background: rgba(15,19,55,.4);
  z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-12);
  overflow: hidden;
}
.modal.lg { max-width: 760px; }
.modal-h {
  padding: 18px 24px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--divider);
}
.modal-h .title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modal-h .close { margin-left: auto; }
.modal-b { padding: 22px 24px; }
.modal-f {
  padding: 14px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--divider-strong);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { min-height: 96px; resize: vertical; font-family: var(--font-sans); }

/* Toasts (Snackbar) */
.toast-host {
  position: fixed; right: 24px; bottom: 24px;
  z-index: var(--z-snackbar);
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  min-width: 280px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-8);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Tables */
.MuiTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.MuiTable th {
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 20px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-1);
  position: sticky; top: 0;
}
.MuiTable td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.MuiTable tr:hover td { background: var(--surface-1); }
.MuiTable .mono { font-family: var(--font-sans); font-size: 12px; }
.MuiTable .dim { color: var(--text-3); }

/* utilities */
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.mono { font-family: var(--font-sans); }
.small { font-size: 12px; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--divider-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b5bbcc; }
::-webkit-scrollbar-track { background: transparent; }

.ico { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ico-sm { width: 14px; height: 14px; }

/* kv grid (for fingerprint, meta) */
.kv-grid { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 13px; }
.kv-grid .k { color: var(--text-3); }
.kv-grid .v { color: var(--text); font-family: var(--font-sans); font-size: 12px; word-break: break-all; }

/* Operator dropdown menu */
.op-dropdown {
  position: relative;
}
.op-select {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--divider-strong);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -.005em;
}
.op-select:hover { background: var(--surface-1); }
.op-select .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.op-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-8);
  padding: 6px;
  min-width: 280px;
  z-index: 30;
  display: none;
}
.op-dropdown[data-open="true"] .op-dropdown-menu { display: block; }
.op-dropdown-menu .item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.op-dropdown-menu .item:hover { background: var(--surface-2); }
.op-dropdown-menu .item .code { font-family: var(--font-sans); font-weight: 500; flex: 1; }
.op-dropdown-menu .item .meta-text { color: var(--text-3); font-size: 11.5px; }
.op-dropdown-menu .sep { height: 1px; background: var(--divider); margin: 6px 4px; }
.op-dropdown-menu .check { color: var(--primary); }
.op-dropdown-menu .ph { width: 14px; }

/* Compare layout */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--divider);
  min-height: 100%;
}
.compare > .col-c {
  background: var(--bg);
  padding: 20px;
}
.compare .opheader {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}

/* Subtle entry animation for cards — opacity only, no translate jump */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.tab-content .MuiCard,
.tab-content .MuiAlert {
  animation: fade-in .2s ease both;
}
.tab-content .MuiCard:nth-child(2) { animation-delay: .03s; }
.tab-content .MuiCard:nth-child(3) { animation-delay: .06s; }
.workspace-3col .ws-col:nth-child(2) .MuiCard,
.workspace-3col .ws-col:nth-child(2) .MuiAlert { animation-delay: .03s; }
.workspace-3col .ws-col:nth-child(3) .MuiCard { animation-delay: .06s; }

/* Session row density */
.ws-row { padding: 10px 16px; }
.ws-row-ttl { font-size: 12.5px; gap: 6px; }
.ws-row-sub { font-size: 11px; margin-top: 2px; }

/* Empty state */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}
.empty-state .ico-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--text-3);
}
.empty-state b { color: var(--text-2); font-weight: 600; }

/* Skeleton loading shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skel-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.skel-line { height: 12px; }
.skel-line.w40 { width: 40%; }
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-block { height: 120px; border-radius: 10px; }

/* Cluster preview chips for Block modal */
.cluster-preview {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}
.cluster-preview .cp-card {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.cluster-preview .cp-card .cp-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  margin-bottom: 4px;
}
.cluster-preview .cp-card .cp-name { font-weight: 600; color: var(--text); }
.cluster-preview .cp-card .cp-meta { font-size: 11px; color: var(--text-3); font-family: var(--font-sans); }
.cluster-preview .cp-card .cp-link { font-size: 11px; color: var(--error); }

/* Notes — grid: head + time on row 1, body on row 2 */
.note {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head time"
    "body body";
  gap: 4px 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
  line-height: 1.55;
}
.note:last-child { border-bottom: 0; }
.note .head {
  grid-area: head;
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--text-2);
}
.note .time {
  grid-area: time;
  font-size: 12px; color: var(--text-3);
  white-space: nowrap;
}
.note .author { color: var(--text); font-weight: 600; }
.note .body { grid-area: body; color: var(--text); margin-top: 2px; }

/* Connections graph — User → Devices → Users */
.graph-host {
  position: relative;
  height: 660px;
  background: var(--surface-2);
  background-image: radial-gradient(circle, var(--neutral-300) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
  border-radius: var(--r-md);
}
.graph-host.compact { height: 440px; }
.conn-svg { width: 100%; height: 100%; display: block; }
.conn-node { transition: opacity .15s; }

/* Legend toggle pill */
.graph-legend-toggle {
  position: absolute; top: 14px; left: 14px; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 999px;
  cursor: pointer;
  font-family: Inter; font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  box-shadow: var(--shadow-1);
}
.graph-legend-toggle:hover { background: var(--surface-2); color: var(--text); }
.graph-host.compact .graph-legend-toggle { padding: 5px 10px; font-size: 11.5px; }

.graph-legend-panel {
  position: absolute; top: 54px; left: 14px; z-index: 4;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-3);
  font-family: Inter;
}
.graph-legend-panel .gl-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 12px; line-height: 1.45;
}
.graph-legend-panel .gl-section {
  display: flex; flex-direction: column; gap: 8px;
}
.graph-legend-panel .gl-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-2);
}
.graph-legend-panel .gl-node {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid #fff; background: #fff;
}
.graph-legend-panel .gl-node.target { background: var(--blue-600); box-shadow: 0 0 0 1.5px var(--blue-600); }
.graph-legend-panel .gl-node.user   { border-color: var(--neutral-500); }
.graph-legend-panel .gl-node.device { border-color: var(--cyan-700); border-radius: 4px; }
.graph-legend-panel .gl-dot-red {
  width: 11px; height: 11px; flex-shrink: 0;
  background: var(--red-500); border: 2px solid #fff;
  border-radius: 50%; box-shadow: 0 0 0 1px var(--red-500);
}

/* Hover tooltip */
.graph-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 18px));
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 190px;
  box-shadow: var(--shadow-4);
  font-family: Inter;
  pointer-events: none;
  z-index: 5;
}
.graph-tooltip .gt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.graph-tooltip .gt-type {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: var(--neutral-200); color: var(--text-2);
}
.graph-tooltip .gt-type.device { background: var(--cyan-100); color: var(--cyan-700); }
.graph-tooltip .gt-flagged {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: var(--red-100); color: var(--red-500);
}
.graph-tooltip .gt-name { font-size: 14px; font-weight: 600; color: var(--text); }
.graph-tooltip .gt-id { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.graph-tooltip .gt-cta { margin-top: 8px; font-size: 11px; color: var(--blue-600); font-weight: 600; }

/* Detail drawer */
.graph-drawer {
  position: absolute; top: 14px; right: 14px; bottom: 14px; z-index: 4;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
  padding: 16px 18px;
  font-family: Inter;
  display: flex; flex-direction: column;
}
.graph-host.compact .graph-drawer { width: 252px; }
.graph-drawer .gd-h {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.graph-drawer .gd-name { font-size: 16px; font-weight: 600; color: var(--text); }
.graph-drawer .gd-id { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.graph-drawer .gd-close {
  margin-left: auto; background: transparent; border: 0;
  padding: 4px; cursor: pointer; color: var(--text-3); border-radius: 6px;
}
.graph-drawer .gd-close:hover { background: var(--surface-2); color: var(--text); }
.graph-drawer .gd-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.graph-drawer .gd-row { display: flex; justify-content: space-between; font-size: 13px; }
.graph-drawer .gd-row .k { color: var(--text-3); }
.graph-drawer .gd-row .v { color: var(--text); font-weight: 500; }
.graph-drawer .gd-flag {
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: var(--red-100); color: var(--red-500);
}
.graph-drawer .gd-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.graph-drawer .gd-btn {
  padding: 10px 14px; border-radius: 8px;
  background: var(--neutral-100); border: 1px solid var(--divider);
  color: var(--text-2); font-family: Inter; font-size: 13px; font-weight: 500; cursor: pointer;
}
.graph-drawer .gd-btn:hover { background: var(--neutral-200); color: var(--text); }
.graph-drawer .gd-btn.primary { background: var(--blue-600); color: #fff; border-color: var(--blue-700); }
.graph-drawer .gd-btn.primary:hover { background: var(--blue-700); }

/* Helpers */
.h2 { font-size: 16px; font-weight: 600; }
.h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tiny { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.toggle-group { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.toggle-group button {
  background: transparent; border: 0; padding: 5px 12px;
  font-size: 12px; color: var(--text-2); border-radius: 7px; cursor: pointer;
  font-weight: 500;
}
.toggle-group button[data-active="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Keyboard help */
.kbd-help {
  position: fixed; inset: 0;
  background: rgba(15,19,55,.45);
  z-index: var(--z-modal);
  display: grid; place-items: center;
}
.kbd-help .panel {
  width: 480px; max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-12);
}
.kbd-help h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.kbd-help .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; font-size: 13px; }
.kbd-help .grid .lbl { color: var(--text-2); }
.kbd-help .grid .keys { display: flex; gap: 4px; justify-content: flex-end; }
.kbd-help .grid kbd {
  font-family: var(--font-sans); font-size: 11px;
  background: var(--surface-2); padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--divider);
}

.action-bar { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--divider); background: var(--surface-1); }

/* Date range picker */
.range-picker { position: relative; }
.range-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 10px;
  box-shadow: var(--shadow-4);
  padding: 6px; min-width: 180px; z-index: 30;
}
.range-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text-2);
}
.range-item:hover { background: var(--surface-2); color: var(--text); }
.range-item[data-active="true"] { color: var(--primary); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--divider); font-size: 12px; }
.panel-h .title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.panel-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 16px 18px; }
.panel-b.flush { padding: 0; }

/* ── Card base guard (last-wins, ensures rendering) ── */
.MuiCard {
  background: #ffffff;
  border: 1px solid var(--divider);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31,41,76,.04), 0 1px 3px rgba(31,41,76,.03);
  overflow: hidden;
}
.MuiCardHeader { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-bottom: 1px solid var(--divider); }
.MuiCardHeader .ch-content { flex: 1; min-width: 0; }
.MuiCardHeader .ch-action { margin-left: auto; }
.MuiCardContent { padding: 20px; }
.MuiCardContent.flush { padding: 0 0; }

/* ── Layout guards (last-wins) ── */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.kpi-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--divider); border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(31,41,76,.04); }
.kpi-card .kpi-body { flex: 1; min-width: 0; }

.dash-2col { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: stretch; }
@media (max-width: 1200px) { .dash-2col { grid-template-columns: 1fr; } }
.dash-main, .dash-side { display: contents; }

.now-strip { background: #fff; border: 1px solid var(--divider); border-radius: 16px; padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(31,41,76,.04); }
.now-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.now-alerts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .now-alerts { grid-template-columns: 1fr; } }
.now-alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--divider); cursor: pointer; }
.now-alert .na-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.now-alert .na-body { flex: 1; min-width: 0; }
.now-alert > svg:last-child { color: var(--text-3); flex-shrink: 0; }

.workspace-3col { display: grid; grid-template-columns: 320px 1fr 360px; gap: 24px; align-items: flex-start; }
@media (max-width: 1440px) { .workspace-3col { grid-template-columns: 300px 1fr 340px; gap: 20px; } }
@media (max-width: 1200px) { .workspace-3col { grid-template-columns: 1fr; } }
.ws-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.tab-content { padding: 24px 28px; }
.dash-header { display: flex; align-items: center; gap: 24px; padding: 16px 24px; background: var(--bg); border-bottom: 1px solid var(--divider); }
.profile-header { padding: 20px 28px 0; background: #fff; border-bottom: 1px solid var(--divider); }
