/* ==========================================================================
   StratumEdge Backoffice — IBM Carbon Design System v11
   Pure CSS, Zero inline scripts/styles (strict CSP).
   Themes: Carbon g10 (Light) · Carbon g100 (Dark) · System auto.
   Cascade layers: tokens < base < layout < components < utilities < responsive
   ========================================================================== */

@layer tokens, base, layout, components, utilities, responsive;

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
}

/* Registered custom properties for Canvas reads in dashboard.js */
@property --gold-lt { syntax: "<color>"; inherits: true; initial-value: #4589ff; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: rgba(15, 98, 254, 0.16); }
@property --ok { syntax: "<color>"; inherits: true; initial-value: #42be65; }
@property --border { syntax: "<color>"; inherits: true; initial-value: #393939; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #c6c6c6; }

@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- 1. Carbon v11 Design Tokens --------------------------------- */
@layer tokens {
  :root {
    color-scheme: light dark;

    --cds-header-h: 48px;
    --cds-sidenav-w: 256px;

    --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Carbon spacing scale */
    --sp-02: 4px;
    --sp-03: 8px;
    --sp-04: 12px;
    --sp-05: 16px;
    --sp-06: 24px;
    --sp-07: 32px;
    --sp-08: 40px;
    --sp-09: 48px;

    /* Carbon motion */
    --cds-ease: cubic-bezier(0.2, 0, 0.38, 0.9);
    --cds-dur-fast: 110ms;
    --cds-dur-med: 150ms;

    /* Core Surface & Layer Tokens: light = Carbon g10 | dark = Carbon g100 */
    --cds-background:        light-dark(#f4f4f4, #161616);
    --cds-layer-01:          light-dark(#ffffff, #262626);
    --cds-layer-02:          light-dark(#f4f4f4, #393939);
    --cds-layer-03:          light-dark(#e0e0e0, #525252);
    --cds-layer-hover-01:    light-dark(#e8e8e8, #333333);
    --cds-layer-hover-02:    light-dark(#e0e0e0, #474747);
    --cds-layer-selected-01: light-dark(#e0e0e0, #393939);

    --cds-field-01:          light-dark(#ffffff, #262626);
    --cds-field-02:          light-dark(#f4f4f4, #393939);

    --cds-border-subtle-00:  light-dark(#e0e0e0, #393939);
    --cds-border-subtle-01:  light-dark(#e0e0e0, #393939);
    --cds-border-strong-01:  light-dark(#8d8d8d, #6f6f6f);
    --cds-border-interactive: light-dark(#0f62fe, #4589ff);

    --cds-text-primary:      light-dark(#161616, #f4f4f4);
    --cds-text-secondary:    light-dark(#525252, #c6c6c6);
    --cds-text-helper:       light-dark(#6f6f6f, #a8a8a8);
    --cds-text-placeholder:  light-dark(#a8a8a8, #6f6f6f);
    --cds-text-on-color:     #ffffff;

    --cds-link-primary:      light-dark(#0f62fe, #78a9ff);
    --cds-button-primary:    #0f62fe;
    --cds-button-primary-hover: #0353e9;
    --cds-button-primary-active: #002d9c;
    --cds-button-secondary:  #393939;
    --cds-button-secondary-hover: #4c4c4c;
    --cds-button-danger:     #da1e28;
    --cds-button-danger-hover: #b81922;

    --cds-focus:             light-dark(#0f62fe, #ffffff);
    --cds-focus-inset:       light-dark(#ffffff, #161616);

    --cds-support-error:     light-dark(#da1e28, #fa4d56);
    --cds-support-success:   light-dark(#24a148, #42be65);
    --cds-support-warning:   #f1c21b;
    --cds-support-info:      light-dark(#0043ce, #4589ff);
    --cds-notif-bg-err:      light-dark(#fff1f1, #262626);
    --cds-notif-bg-warn:     light-dark(#fcf4d6, #262626);
    --cds-notif-bg-ok:       light-dark(#defbe6, #262626);
    --cds-notif-bg-info:     light-dark(#edf5ff, #262626);

    /* Carbon Tag tokens */
    --tag-green-bg:   light-dark(#a7f0ba, #0e6027);
    --tag-green-fg:   light-dark(#0e6027, #a7f0ba);
    --tag-blue-bg:    light-dark(#d0e2ff, #0043ce);
    --tag-blue-fg:    light-dark(#0043ce, #d0e2ff);
    --tag-teal-bg:    light-dark(#9ef0f0, #005d5d);
    --tag-teal-fg:    light-dark(#005d5d, #9ef0f0);
    --tag-purple-bg:  light-dark(#e8daff, #6929c4);
    --tag-purple-fg:  light-dark(#6929c4, #e8daff);
    --tag-red-bg:     light-dark(#ffd7d9, #a2191f);
    --tag-red-fg:     light-dark(#a2191f, #ffd7d9);
    --tag-amber-bg:   light-dark(#fddc69, #755800);
    --tag-amber-fg:   light-dark(#4e3b00, #fddc69);
    --tag-gray-bg:    light-dark(#e0e0e0, #525252);
    --tag-gray-fg:    light-dark(#161616, #f4f4f4);

    /* Registered Chart / Canvas Compatibility Aliases */
    --gold-lt:     light-dark(#0f62fe, #4589ff);
    --accent-soft: light-dark(rgba(15, 98, 254, 0.14), rgba(69, 137, 255, 0.22));
    --ok:          light-dark(#24a148, #42be65);
    --border:      var(--cds-border-subtle-01);
    --muted:       var(--cds-text-secondary);
  }

  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"]  { color-scheme: dark; }
}

/* ---------- 2. Base ----------------------------------------------------- */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.42857;
    color: var(--cds-text-primary);
    background-color: var(--cds-background);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  a { color: var(--cds-link-primary); text-decoration: none; }
  a:hover { text-decoration: underline; }
  h1, h2, h3, p { margin: 0; }
  h1 { font-size: 28px; font-weight: 400; line-height: 1.285; letter-spacing: 0; }
  h2 { font-size: 20px; font-weight: 400; line-height: 1.4; }
  h3 { font-size: 16px; font-weight: 600; line-height: 1.375; }
  code, pre, .mono { font-family: var(--font-mono); }

  :focus-visible {
    outline: 2px solid var(--cds-focus);
    outline-offset: -2px;
  }

  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
  .ico {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: square;
    stroke-linejoin: miter;
  }
}

/* ---------- 3. Carbon UI Shell Layout ---------------------------------- */
@layer layout {
  .layout { min-height: 100vh; }

  /* Zoned Fixed g100 Carbon Header Bar (always #161616) */
  .cds-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cds-header-h);
    background: #161616;
    color: #f4f4f4;
    border-bottom: 1px solid #393939;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 400;
  }

  .cds-header-left {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 0;
  }

  .appbar-menu {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f4f4f4;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .appbar-menu:hover { background: #353535; }
  .appbar-menu .ico-close { display: none; }
  html.drawer-open .appbar-menu .ico-menu { display: none; }
  html.drawer-open .appbar-menu .ico-close { display: block; }

  .cds-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 24px 0 16px;
    color: #f4f4f4;
    font-size: 14px;
    letter-spacing: 0.16px;
    text-decoration: none;
    white-space: nowrap;
  }
  .cds-header-brand:hover { background: #262626; text-decoration: none; }
  .cds-brand-prefix { font-weight: 400; color: #c6c6c6; }
  .cds-brand-name { font-weight: 600; color: #ffffff; }
  .cds-brand-accent { color: #78a9ff; }

  .cds-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
    min-width: 0;
  }
  .cmdk-trigger-center {
    width: min(560px, 100%);
    max-width: 100%;
    justify-content: flex-start;
    gap: 10px;
    border: 1px solid #525252;
    background: #262626;
    height: 32px;
    padding: 0 12px;
    color: #c6c6c6;
  }
  .cmdk-trigger-center:hover { background: #353535; border-color: #6f6f6f; }
  .cmdk-trigger-center span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 900px) {
    .cmdk-trigger-center span { display: none; }
    .cmdk-trigger-center { width: auto; }
  }

  .new-menu-wrap { position: relative; }
  .new-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: #262626;
    border: 1px solid #393939;
    box-shadow: 0 8px 16px rgba(0,0,0,0.35);
    z-index: 900;
    padding: 4px 0;
  }
  .new-menu[hidden] { display: none !important; }
  .new-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #f4f4f4;
    text-decoration: none;
    font-size: 13px;
  }
  .new-menu-item:hover, .new-menu-item:focus { background: #353535; outline: none; }
  .new-menu-item .ico { width: 16px; height: 16px; }

  .new-menu-button {
    width: 100%;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
  }
  .profile-menu { min-width: 240px; }
  .profile-menu-head {
    padding: 12px 14px;
    border-bottom: 1px solid #393939;
    margin-bottom: 4px;
  }
  .profile-menu-name { font-size: 14px; font-weight: 600; color: #f4f4f4; }
  .profile-menu-role { margin-top: 2px; font-size: 12px; color: #c6c6c6; text-transform: capitalize; }
  .profile-menu-divider { height: 1px; background: #393939; margin: 4px 0; }
  .profile-logout-form { margin: 0; }

  .cds-header-actions {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .cds-header-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 16px;
    border: 0;
    border-left: 1px solid #262626;
    background: transparent;
    color: #f4f4f4;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
  }
  .cds-header-action:hover { background: #353535; text-decoration: none; }

  .cds-header-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 48px;
    border-left: 1px solid #262626;
    font-size: 13px;
    color: #c6c6c6;
  }
  .cds-header-user strong { color: #ffffff; font-weight: 500; }

  .logout-form { margin: 0; display: inline-flex; height: 100%; }

  /* Carbon SideNav */
  .sidebar {
    position: fixed;
    top: var(--cds-header-h);
    left: 0;
    bottom: 0;
    width: var(--cds-sidenav-w);
    background: var(--cds-layer-01);
    border-right: 1px solid var(--cds-border-subtle-01);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 300;
  }

  .sidenav-group-label {
    padding: 16px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.32px;
    text-transform: uppercase;
    color: var(--cds-text-helper);
  }

  .nav { list-style: none; margin: 0; padding: 8px 0; }
  .nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--cds-text-secondary);
    border-left: 3px solid transparent;
    transition: background var(--cds-dur-fast) var(--cds-ease), color var(--cds-dur-fast) var(--cds-ease);
  }
  .nav li a:hover {
    background: var(--cds-layer-hover-01);
    color: var(--cds-text-primary);
    text-decoration: none;
  }
  .nav li a.active,
  .nav li a[aria-current="page"] {
    background: var(--cds-layer-selected-01);
    color: var(--cds-text-primary);
    font-weight: 600;
    border-left-color: #0f62fe;
  }

  .nav-foot {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--cds-border-subtle-01);
    font-size: 12px;
    color: var(--cds-text-helper);
  }

  .scrim { display: none; }

  /* Theme toggle icon swap */
  .theme-toggle .ico { display: none; }
  :root[data-theme="light"] .theme-toggle .ico-sun { display: block; }
  :root[data-theme="dark"] .theme-toggle .ico-moon { display: block; }
  :root:not([data-theme]) .theme-toggle .ico-auto { display: block; }

  /* Main Work Area */
  .content {
    margin-left: var(--cds-sidenav-w);
    margin-top: var(--cds-header-h);
    padding: 24px 32px 48px;
    min-height: calc(100vh - var(--cds-header-h));
    display: flex;
    flex-direction: column;
  }

  .app-foot {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--cds-border-subtle-01);
    font-size: 12px;
    color: var(--cds-text-helper);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Page Header */
  .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    flex-wrap: wrap;
  }
  .page-head p {
    margin-top: 4px;
    font-size: 13px;
    color: var(--cds-text-secondary);
  }
  .head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
}

/* ---------- 4. Carbon v11 Components ------------------------------------ */
@layer components {
  /* Carbon Tile / Surface (replaces .glass cleanly) */
  .glass, .cds-tile {
    background: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle-01);
    border-radius: 0;
  }

  /* Buttons (Carbon Primary / Secondary / Ghost / Danger) */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    border-radius: 0;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--cds-dur-fast) var(--cds-ease), border-color var(--cds-dur-fast) var(--cds-ease);
  }
  .btn:hover { text-decoration: none; }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
  .btn-block { width: 100%; justify-content: flex-start; }

  .btn-accent {
    background: var(--cds-button-primary);
    color: var(--cds-text-on-color);
  }
  .btn-accent:hover:not(:disabled) { background: var(--cds-button-primary-hover); }
  .btn-accent:active:not(:disabled) { background: var(--cds-button-primary-active); }

  .btn-secondary {
    background: var(--cds-button-secondary);
    color: #ffffff;
  }
  .btn-secondary:hover:not(:disabled) { background: var(--cds-button-secondary-hover); }

  .btn-ghost {
    background: transparent;
    color: var(--cds-link-primary);
    border-color: var(--cds-border-subtle-01);
  }
  .btn-ghost:hover:not(:disabled) {
    background: var(--cds-layer-hover-01);
    border-color: var(--cds-border-interactive);
  }

  .btn-danger {
    background: var(--cds-button-danger);
    color: #ffffff;
  }
  .btn-danger:hover:not(:disabled) { background: var(--cds-button-danger-hover); }

  .btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

  /* Carbon Status Tags */
  .badge, .who-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    background: var(--tag-gray-bg);
    color: var(--tag-gray-fg);
    white-space: nowrap;
  }
  .coin-tag { background: var(--tag-blue-bg); color: var(--tag-blue-fg); }
  .agg-aggregated { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
  .mode-prepaid { background: var(--tag-teal-bg); color: var(--tag-teal-fg); }
  .mode-paygo { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
  .pool-main { background: var(--tag-blue-bg); color: var(--tag-blue-fg); }
  .pool-paygo { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
  .state-active { background: var(--tag-green-bg); color: var(--tag-green-fg); }
  .state-warning { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
  .state-offline { background: var(--tag-red-bg); color: var(--tag-red-fg); }

  /* Live Freshness & Process Status Pills */
  .live-badge, .pstat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    background: var(--cds-layer-02);
    border: 1px solid var(--cds-border-subtle-01);
  }
  .live-dot, .pstat-dot, .hs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--cds-text-helper);
  }
  .live-ok .live-dot, .pstat-running .pstat-dot, .hs-healthy .hs-dot { background: var(--cds-support-success); }
  .live-stale .live-dot, .pstat-restarting .pstat-dot, .hs-warning .hs-dot { background: var(--cds-support-warning); }
  .live-down .live-dot, .pstat-stopped .pstat-dot, .pstat-failed .pstat-dot, .hs-critical .hs-dot { background: var(--cds-support-error); }
  .updated-ago { font-size: 12px; color: var(--cds-text-secondary); }

  /* Carbon Inline Notification Strips */
  .health-strip, .insight-bar, .pcap-strip, .alert, .notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--cds-border-subtle-01);
    border-left-width: 3px;
    background: var(--cds-layer-01);
    flex-wrap: wrap;
  }
  .hs-healthy { border-left-color: var(--cds-support-success); }
  .hs-warning { border-left-color: var(--cds-support-warning); }
  .hs-critical, .alert { border-left-color: var(--cds-support-error); background: var(--cds-notif-bg-err); }
  .notice { border-left-color: var(--cds-support-warning); background: var(--cds-notif-bg-warn); }
  .pcap-strip { border-left-color: var(--cds-border-interactive); justify-content: space-between; }

  .hs-main { flex: 1 1 240px; min-width: 0; }
  .hs-label { font-size: 14px; font-weight: 600; }
  .hs-reason { font-size: 13px; color: var(--cds-text-secondary); margin-top: 2px; }
  .hs-meta { font-size: 12px; color: var(--cds-text-secondary); }
  .hs-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .hs-ctl-actions { display: flex; gap: 6px; flex-wrap: wrap; }

  .insight-bar { font-size: 13px; color: var(--cds-text-secondary); border-left-color: var(--cds-border-interactive); }
  .insight-bar.insight-flash { background: var(--cds-notif-bg-info); }

  /* Attention List */
  .attn-title { color: var(--cds-support-warning); }
  .attn-list { display: grid; gap: 8px; margin-bottom: 20px; }
  .attn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--cds-text-primary);
    border-left-width: 3px;
  }
  .attn-row:hover { background: var(--cds-layer-hover-01); text-decoration: none; }
  .attn-name { font-weight: 600; min-width: 140px; }
  .attn-reason { flex: 1; font-size: 13px; color: var(--cds-text-secondary); }

  /* KPI Stat Tiles Grid (Carbon 2x Grid cadence) */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
  }
  .stat {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 112px;
    border-left-width: 3px;
  }
  .stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .stat .label { font-size: 12px; font-weight: 600; letter-spacing: 0.16px; color: var(--cds-text-secondary); }
  .label-note { font-weight: 400; color: var(--cds-text-helper); }
  .stat-ico { color: var(--cds-text-secondary); }
  .stat .value { font-size: 24px; font-weight: 400; line-height: 1.2; letter-spacing: -0.2px; }
  .value-sub { font-size: 13px; color: var(--cds-text-secondary); font-weight: 400; margin-left: 4px; }
  .stat-sub { font-size: 12px; color: var(--cds-text-secondary); }
  .stat .bar { height: 2px; background: var(--cds-border-subtle-01); margin-top: auto; }
  canvas.spark { width: 100%; height: 36px; display: block; margin-top: auto; }

  .substat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--cds-border-subtle-01);
    margin-bottom: 16px;
  }
  .substat {
    background: var(--cds-layer-01);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .ss-label { font-size: 11px; color: var(--cds-text-helper); text-transform: uppercase; letter-spacing: 0.32px; }
  .ss-val { font-size: 14px; font-weight: 500; }

  /* Dual-Axis Chart Tile */
  .chart-card { padding: 16px; margin-bottom: 24px; }
  .chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
  .chart-title { font-size: 16px; font-weight: 600; }
  .chart-tabs, .filter-chips, .jump-nav, .cds-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    gap: 0;
  }
  .chart-tab, .filter-chip, .jump-chip, .cds-tab {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--cds-text-secondary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .chart-tab:hover, .filter-chip:hover, .jump-chip:hover, .cds-tab:hover {
    color: var(--cds-text-primary);
    background: var(--cds-layer-hover-01);
  }
  .chart-tab.is-active, .filter-chip.is-active, .cds-tab.is-active {
    color: var(--cds-text-primary);
    font-weight: 600;
    border-bottom-color: var(--cds-border-interactive);
  }
  .chart-canvas-wrap { position: relative; width: 100%; height: 220px; }
  .chart-canvas { width: 100%; height: 100%; display: block; }
  .chart-tooltip {
    position: absolute;
    padding: 6px 10px;
    background: #161616;
    color: #f4f4f4;
    border: 1px solid #525252;
    font-size: 12px;
    pointer-events: none;
    z-index: 20;
  }
  .chart-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--cds-text-secondary); }
  .chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
  .cl-dot { width: 10px; height: 10px; display: inline-block; }
  .cl-hr { background: var(--gold-lt); }
  .cl-conn { background: var(--ok); }

  /* Section Headers & Search Toolbar */
  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 12px;
    flex-wrap: wrap;
  }
  .section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
  }
  .filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .filter-search { width: 240px; height: 36px; }

  /* Tenant Cards */
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
  }
  .tenant-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left-width: 3px;
  }
  .tenant-card.f-hide { display: none; }
  .tenant-card.jump-flash { outline: 2px solid var(--cds-border-interactive); }
  .tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .tc-name { font-size: 16px; font-weight: 600; }
  .tc-addr { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--cds-text-secondary); }
  .tc-badges { display: flex; flex-wrap: wrap; gap: 4px; }
  .tc-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    height: 22px;
    border: 1px solid var(--cds-border-subtle-01);
    background: var(--cds-layer-02);
    color: var(--cds-text-secondary);
    font-size: 11px;
    cursor: pointer;
  }
  .tc-copy:hover { color: var(--cds-text-primary); border-color: var(--cds-border-interactive); }
  .tc-copy.copied { background: var(--tag-green-bg); color: var(--tag-green-fg); }

  .tc-insight {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--cds-layer-02);
    font-size: 12px;
    color: var(--cds-text-secondary);
  }
  .metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--cds-border-subtle-01);
  }
  .metric { background: var(--cds-layer-01); padding: 8px 10px; }
  .m-val { font-size: 15px; font-weight: 600; }
  .m-lab { font-size: 11px; color: var(--cds-text-helper); margin-top: 2px; }
  .tc-empty { padding: 12px; background: var(--cds-layer-02); font-size: 12px; color: var(--cds-text-secondary); }
  .tc-empty-title { font-weight: 600; color: var(--cds-text-primary); margin-bottom: 2px; }

  .tc-details summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--cds-link-primary);
    padding: 4px 0;
  }
  .tc-health { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; }
  .tc-groups { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid var(--cds-border-subtle-01); }
  .tg-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.32px; color: var(--cds-text-helper); margin-bottom: 4px; }
  .tc-pairs { display: grid; gap: 3px; }
  .pair { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
  .p-lab { color: var(--cds-text-secondary); }
  .tc-foot { padding-top: 8px; border-top: 1px solid var(--cds-border-subtle-01); display: flex; gap: 8px; justify-content: flex-end; }

  /* Carbon DataTables */
  .table-wrap { width: 100%; overflow-x: auto; margin-bottom: 24px; }
  table.grid { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
  table.grid thead th {
    background: var(--cds-layer-02);
    color: var(--cds-text-primary);
    font-weight: 600;
    font-size: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    white-space: nowrap;
  }
  table.grid tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    vertical-align: middle;
  }
  table.grid tbody tr:hover { background: var(--cds-layer-hover-01); }
  .row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

  /* Carbon Forms */
  .form-card { padding: 24px; margin-bottom: 24px; }
  .form-card--auth, .form-card--confirm { max-width: 480px; }
  .audit-filters { padding: 16px; margin-bottom: 16px; }
  .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field.full, .full-span { grid-column: 1 / -1; }
  .field label {
    font-size: 12px;
    font-weight: 400;
    color: var(--cds-text-secondary);
  }
  .field small { font-size: 12px; color: var(--cds-text-helper); }
  .field small.err, .field small.field-err, .field-err {
    color: var(--cds-support-error);
    font-size: 12px;
  }

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--cds-text-primary);
    background: var(--cds-field-02);
    border: 0;
    border-bottom: 1px solid var(--cds-border-strong-01);
    border-radius: 0;
  }
  textarea { min-height: 84px; resize: vertical; }
  input.invalid, select.invalid, textarea.invalid {
    outline: 2px solid var(--cds-support-error);
    outline-offset: -2px;
  }

  .fieldset {
    grid-column: 1 / -1;
    border: 1px solid var(--cds-border-subtle-01);
    padding: 16px;
    margin: 4px 0;
    background: var(--cds-layer-02);
  }
  .fieldset legend {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cds-text-primary);
  }

  .switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--cds-text-primary);
    cursor: pointer;
    padding: 4px 0;
  }
  .switch input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0f62fe;
    margin: 0;
    cursor: pointer;
  }

  .form-actions { display: flex; gap: 8px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

  /* Policies Port Limit Rows & PCAP Cards */
  .pcap-card { padding: 16px; margin-bottom: 16px; }
  .pcap-meta, .pcap-actions, .pcap-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .pcap-files { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--cds-border-subtle-01); }
  .pcap-file-row { justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--cds-border-subtle-01); }
  .pcap-tenant-input { width: 190px; height: 32px; }
  .port-limits-rows { display: grid; gap: 8px; margin: 8px 0; }
  .port-limit-row { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)) auto; gap: 8px; align-items: center; }

  /* Audit Detail & Pager */
  .audit-detail summary { cursor: pointer; color: var(--cds-link-primary); font-size: 12px; font-weight: 600; }
  .audit-pairs { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 12px; }
  .audit-pairs dt { color: var(--cds-text-helper); }
  .audit-pairs dd { margin: 0; overflow-wrap: anywhere; }
  .audit-pre { margin: 0; padding: 8px; background: var(--cds-layer-02); border: 1px solid var(--cds-border-subtle-01); white-space: pre-wrap; font-size: 11px; }
  .pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--cds-text-secondary); }

  /* Carbon Modals & Toasts */
  .modal {
    position: fixed;
    inset: 0;
    background: rgba(22, 22, 22, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 600;
  }
  .modal.open { display: flex; }
  .modal-card {
    width: 100%;
    max-width: 560px;
    padding: 24px;
    background: var(--cds-layer-01);
    border: 1px solid var(--cds-border-strong-01);
  }
  .modal-card h3 { margin-bottom: 12px; }
  .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

  .toast-wrap {
    position: fixed;
    top: 60px;
    right: 20px;
    display: grid;
    gap: 8px;
    z-index: 700;
    max-width: 380px;
  }
  .toast {
    padding: 12px 16px;
    background: #161616;
    color: #f4f4f4;
    border-left: 3px solid #4589ff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .toast.success { border-left-color: #42be65; }
  .toast.error   { border-left-color: #fa4d56; }
  .toast.info    { border-left-color: #4589ff; }

  /* Notification center (right drawer) */
  .notif-trigger { position: relative; }
  .notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 9px;
    background: #da1e28;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
  }
  .notif-badge[hidden] { display: none !important; }

  .notif-scrim {
    position: fixed;
    inset: 48px 0 0 0;
    background: rgba(0,0,0,0.32);
    z-index: 780;
  }
  .notif-scrim[hidden] { display: none; }

  .notif-panel {
    position: fixed;
    top: 48px;
    right: 0;
    bottom: 0;
    width: min(420px, calc(100vw - 24px));
    background: var(--cds-layer-01, #262626);
    border-left: 1px solid var(--cds-border-subtle-01, #393939);
    box-shadow: -8px 0 24px rgba(0,0,0,0.28);
    transform: translateX(100%);
    transition: transform 180ms cubic-bezier(0.2, 0, 0.38, 0.9);
    z-index: 790;
    display: flex;
    flex-direction: column;
    visibility: hidden;
  }
  .notif-panel.open {
    transform: translateX(0);
    visibility: visible;
  }
  .notif-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--cds-border-subtle-01, #393939);
    background: var(--cds-layer-01, #262626);
  }
  .notif-title { font-size: 16px; font-weight: 600; color: var(--cds-text-primary, #f4f4f4); }
  .notif-sub { margin-top: 4px; font-size: 12px; color: var(--cds-text-secondary, #c6c6c6); }
  .notif-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

  .notif-list {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
    min-height: 0;
  }
  .notif-list[hidden] { display: none !important; }
  .notif-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--cds-text-secondary, #c6c6c6);
  }
  .notif-empty[hidden] { display: none !important; }
  .notif-empty .empty-ico { display: inline-flex; margin-bottom: 8px; color: var(--cds-text-secondary, #c6c6c6); }
  .notif-empty .empty-ico .ico { width: 24px; height: 24px; }

  .notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cds-border-subtle-00, #2c2c2c);
  }
  .notif-item:hover { background: var(--cds-layer-hover-01, #333); }
  .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    background: #4589ff;
    flex-shrink: 0;
  }
  .notif-success .notif-dot { background: #42be65; }
  .notif-error .notif-dot { background: #fa4d56; }
  .notif-warning .notif-dot { background: #f1c21b; }
  .notif-info .notif-dot { background: #4589ff; }
  .notif-item.is-read .notif-dot { opacity: 0.35; }
  .notif-body { min-width: 0; flex: 1; }
  .notif-text { font-size: 13px; line-height: 1.45; color: var(--cds-text-primary, #f4f4f4); word-wrap: break-word; }
  .notif-meta { margin-top: 4px; font-size: 11px; color: var(--cds-text-secondary, #c6c6c6); }
  .notif-ack { margin-top: 6px; font-size: 11px; color: #42be65; }
  .notif-actions { margin-top: 8px; }
  .notif-item.is-read .notif-text { color: var(--cds-text-secondary, #c6c6c6); }

  @media (prefers-reduced-motion: reduce) {
    .notif-panel { transition: none; }
  }

  /* Empty States */
  .empty { padding: 32px; text-align: center; color: var(--cds-text-secondary); }
  .empty-title { font-size: 16px; font-weight: 600; color: var(--cds-text-primary); margin: 8px 0 4px; }
  .empty-cta { margin-top: 16px; }

  /* Billing, SSO & SecOps Carbon Helpers */
  .split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
  .panel-pad { padding: 16px; margin-bottom: 16px; }
  .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
  .alert-ok { border-left: 3px solid var(--cds-support-success); background: var(--cds-layer-01); color: var(--cds-text-primary); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
  .sso-divider { margin: 16px 0; border-top: 1px solid var(--cds-border-subtle-01); padding-top: 16px; }
  .btn-sso { width: 100%; justify-content: center; margin-bottom: 12px; }
  .badge.risk-high { background: rgba(218, 30, 40, 0.16); color: #fa4d56; }
  .badge.risk-med { background: rgba(241, 194, 27, 0.16); color: #f1c21b; }
  .badge.risk-low { background: rgba(36, 161, 72, 0.16); color: #42be65; }
  .badge.plan-paygo { background: rgba(138, 63, 252, 0.18); color: #be95ff; }
  .wallet-pill { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 48px; color: #f4f4f4; font-family: var(--cds-font-mono); font-size: 12px; text-decoration: none; border-left: 1px solid #393939; }
  .wallet-pill:hover { background: #353535; }
  .price-preview { padding: 12px; background: var(--cds-layer-02); border-left: 3px solid #0f62fe; font-family: var(--cds-font-mono); font-size: 13px; margin-top: 8px; }
  .mt-12 { margin-top: 12px; }
  .mb-16 { margin-bottom: 16px; }

  /* Animations */
  .val-flash { animation: cds-flash 450ms var(--cds-ease); }
  @keyframes cds-flash {
    from { color: var(--cds-link-primary); }
    to   { color: inherit; }
  }

  /* ---------- Miner Inventory & JSON-RPC Spec Drawer --------------------- */
  .inv-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    align-items: end;
  }
  .inv-active-field { display: flex; flex-direction: column; justify-content: flex-end; }
  .inv-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.55);
    z-index: 410;
  }
  .inv-drawer {
    position: fixed;
    top: var(--cds-header-h, 48px);
    right: 0;
    bottom: 0;
    width: min(680px, 100vw);
    background: var(--cds-layer-01);
    border-left: 1px solid var(--cds-border-subtle-01);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    z-index: 420;
    display: flex;
    flex-direction: column;
  }
  .inv-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
  }
  .inv-drawer-head h2 { margin: 0 0 4px 0; font-size: 16px; }
  .inv-drawer-head-actions { display: flex; gap: 8px; }
  .inv-tabs {
    display: flex;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    background: var(--cds-layer-02);
  }
  .inv-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--cds-text-secondary);
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
  }
  .inv-tab.active {
    color: var(--cds-text-primary);
    border-bottom-color: var(--cds-link-primary, #0f62fe);
  }
  .inv-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
  .inv-probe-banner {
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--cds-layer-02);
    border-left: 3px solid var(--cds-link-primary, #0f62fe);
    font-size: 13px;
  }
  .inv-spec-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 14px;
    margin: 0 0 18px 0;
    font-size: 13px;
  }
  .inv-spec-grid dt { color: var(--cds-text-secondary); }
  .inv-spec-grid dd { margin: 0; word-break: break-word; }
  .inv-subhead { font-size: 13px; margin: 12px 0 8px 0; color: var(--cds-text-secondary); }
  .inv-json-pre {
    background: var(--cds-layer-02);
    border: 1px solid var(--cds-border-subtle-01);
    padding: 10px;
    margin: 4px 0 0 0;
    font-size: 12px;
    overflow-x: auto;
    max-height: 240px;
  }
  .inv-rpc-filter-row { margin-bottom: 12px; }
  .inv-rpc-filter-row input { width: 100%; }
  .inv-rpc-list { display: flex; flex-direction: column; gap: 10px; }
  .inv-rpc-card {
    background: var(--cds-layer-02);
    border: 1px solid var(--cds-border-subtle-01);
    padding: 10px 12px;
  }
  .inv-rpc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
  .inv-rpc-meta { display: flex; align-items: center; gap: 8px; }
  .inv-rpc-right { font-size: 12px; color: var(--cds-text-secondary); }
  .inv-rpc-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cds-text-secondary); margin-top: 8px; }
  .inv-rpc-err { color: #fa4d56; margin-top: 6px; font-size: 12px; }

  /* ---------- Universal Ctrl+K IntelliSearch ------------------------------ */
  .cmdk-trigger { gap: 8px; }
  .cmdk-kbd {
    font-family: var(--cds-font-mono);
    font-size: 11px;
    padding: 1px 5px;
    border: 1px solid var(--cds-border-subtle-01);
    opacity: 0.85;
  }
  .cmdk-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(2px);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 72px 16px 24px;
  }
  .cmdk-dialog {
    width: min(760px, 100%);
    background: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle-01);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 78vh;
  }
  .cmdk-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
  }
  .cmdk-head input {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--cds-text-primary);
    font-size: 15px;
    outline: none;
  }
  .cmdk-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 14px;
    border-bottom: 1px solid var(--cds-border-subtle-01);
    background: var(--cds-layer-02);
  }
  .cmdk-pill {
    background: transparent;
    border: 1px solid var(--cds-border-subtle-01);
    color: var(--cds-text-secondary);
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
  }
  .cmdk-pill.active {
    background: var(--cds-link-primary, #0f62fe);
    border-color: var(--cds-link-primary, #0f62fe);
    color: #ffffff;
  }
  .cmdk-results { overflow-y: auto; padding: 8px 0; max-height: 52vh; }
  .cmdk-group { margin-bottom: 8px; }
  .cmdk-group-title {
    padding: 6px 14px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cds-text-secondary);
  }
  .cmdk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--cds-text-primary);
    border-left: 3px solid transparent;
  }
  .cmdk-item.selected, .cmdk-item:hover {
    background: var(--cds-layer-hover-01, var(--cds-layer-02));
    border-left-color: var(--cds-link-primary, #0f62fe);
  }
  .cmdk-item-title { font-size: 13px; font-weight: 600; }
  .cmdk-item-sub { font-size: 12px; color: var(--cds-text-secondary); margin-top: 2px; word-break: break-word; }
  .cmdk-item-meta { font-size: 11px; color: var(--cds-text-secondary); white-space: nowrap; }
  .cmdk-empty { padding: 24px 16px; text-align: center; color: var(--cds-text-secondary); font-size: 13px; }
  .cmdk-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--cds-border-subtle-01);
    background: var(--cds-layer-02);
    font-size: 11px;
    color: var(--cds-text-secondary);
  }
}

/* ---------- 5. Utilities ------------------------------------------------ */
@layer utilities {
  .u-hide, [hidden] { display: none !important; }
  .text-muted { color: var(--cds-text-secondary); }
  .brand-accent { color: var(--cds-link-primary); font-weight: 600; }
}

/* ---------- 6. Responsive (Carbon Grid Breakpoints) --------------------- */
@layer responsive {
  @media (max-width: 1055px) {
    .appbar-menu { display: inline-flex; }
    .sidebar {
      transform: translateX(-100%);
      transition: transform var(--cds-dur-med) var(--cds-ease);
    }
    html.drawer-open { overflow: hidden; }
    html.drawer-open .sidebar { transform: translateX(0); }
    html.drawer-open .scrim {
      display: block;
      position: fixed;
      inset: var(--cds-header-h) 0 0 0;
      background: rgba(22, 22, 22, 0.55);
      z-index: 250;
    }
    .content { margin-left: 0; padding: 20px 16px 40px; }
  }

  @media (max-width: 640px) {
    .metrics-row { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
    .port-limit-row { grid-template-columns: 1fr; }
    table.grid thead { display: none; }
    table.grid tbody tr {
      display: block;
      border-bottom: 2px solid var(--cds-border-subtle-01);
      padding: 8px 0;
    }
    table.grid tbody td {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 12px;
    }
    table.grid tbody td::before {
      content: attr(data-label);
      font-weight: 600;
      color: var(--cds-text-secondary);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  }
}
