@charset "UTF-8";

:root {
  color-scheme: dark;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #0f0e17;
  --surface: #1b1a27;
  --raised: #24233a;
  --text: #f4f3fa;
  --muted: #a5a2c0;
  --cyan: #2de2e6;
  --magenta: #ff2e93;
  --line: #343246;
  --line-subtle: #292737;
  --good: #72e3b0;
  --warning: #f7c972;
  --bad: #ff91a2;
  --radius: 14px;
  --shadow: 0 16px 44px rgb(0 0 0 / 16%);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--ink); }
body { margin: 0; color: var(--text); background: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { color: inherit; }
input, select, textarea { color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--cyan); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .48; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--cyan); }
::selection { color: var(--ink); background: var(--cyan); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { margin-bottom: 6px; font-size: clamp(24px, 2.5vw, 32px); font-weight: 650; letter-spacing: -.035em; }
h2 { margin-bottom: 8px; font-size: 19px; font-weight: 620; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
p { margin-bottom: 16px; }
svg { display: block; flex-shrink: 0; }
[hidden], .page-section[hidden] { display: none !important; }
.muted, .section-copy, .panel-subtitle, .field-help { color: var(--muted); }
.eyebrow { margin-bottom: 10px; color: var(--cyan); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.mono { font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace; font-size: .92em; }
.numeric, .metric-value, .budget-value, .detail-value { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.visually-hidden, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Brand and sign in */
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; overflow: hidden; border-radius: 11px; background: linear-gradient(135deg, var(--cyan), #8b83ed 52%, var(--magenta)); color: var(--ink); font-weight: 850; font-size: 21px; line-height: 1; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -.055em; line-height: 1.2; }
.brand-copy strong { color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -.055em; line-height: 1.2; }
.brand-copy small, .brand-copy span { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.auth-screen { display: grid; min-height: 100vh; min-height: 100dvh; padding: 32px 20px; place-items: center; background-image: linear-gradient(rgb(165 162 192 / 3%) 1px, transparent 1px), linear-gradient(90deg, rgb(165 162 192 / 3%) 1px, transparent 1px); background-size: 56px 56px; }
.auth-card { width: min(100%, 460px); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 28px 100px rgb(0 0 0 / 30%); }
.auth-card .brand { margin-bottom: 40px; }
.auth-card h1 { font-size: 29px; }
.auth-card .field { margin-top: 22px; }
.auth-card .button.primary { width: 100%; margin-top: 24px; min-height: 46px; }
.auth-note { margin: 24px 0 0; padding-top: 22px; border-top: 1px solid var(--line-subtle); color: var(--muted); font-size: 12px; line-height: 1.7; }

/* Application frame */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 232px; flex-direction: column; padding: 30px 18px 20px; border-right: 1px solid var(--line-subtle); background: #13121d; }
.sidebar-brand { padding: 0 12px 34px; }
.nav-list { display: flex; margin: 0; padding: 0; list-style: none; flex-direction: column; gap: 7px; }
.nav-link { position: relative; display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 550; transition: background-color .16s, color .16s, border-color .16s; }
.nav-link:hover { background: #1e1d2b; color: var(--text); text-decoration: none; }
.nav-link[data-active="true"] { border-color: rgb(45 226 230 / 16%); background: rgb(45 226 230 / 8%); color: var(--cyan); }
.nav-link[data-active="true"]::before { position: absolute; inset: 11px auto 11px -19px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); content: ""; }
.nav-icon { display: grid; flex: 0 0 19px; width: 19px; height: 19px; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding: 22px 10px 0; border-top: 1px solid var(--line-subtle); }
.sidebar-footer .eyebrow { margin: 0; color: #7c7898; font-size: 9px; }
.sidebar-footer .button { justify-content: flex-start; }
.identity-email { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.main-area { min-width: 0; margin-left: 232px; }
.topbar { display: flex; min-height: 89px; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 36px; border-bottom: 1px solid var(--line-subtle); background: rgb(15 14 23 / 96%); }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.page-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; flex-shrink: 0; align-items: center; gap: 16px; }
.connection-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.connection-badge::before { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgb(114 227 176 / 6%); content: ""; }
.connection-badge:has(.status-dot)::before { display: none; }
.topbar-actions > .muted { font-size: 11px; }
.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px 36px 48px; }
.page-section { min-width: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.section-heading { min-width: 0; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-copy { max-width: 690px; margin: 8px 0 0; font-size: 13px; line-height: 1.65; }
.section-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.mobile-nav-toggle { display: none; }

/* Actions */
.button, .icon-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--text); text-decoration: none; font-size: 12px; font-weight: 600; line-height: 1.4; transition: background-color .16s, border-color .16s, box-shadow .16s, opacity .16s; }
.button:hover, .icon-button:hover { border-color: #53506a; background: #2e2c45; text-decoration: none; }
.button svg, .icon-button svg { width: 16px; height: 16px; }
.button.primary { border-color: transparent; background: linear-gradient(105deg, var(--cyan), #7cd8ec); color: #101722; box-shadow: 0 2px 10px rgb(45 226 230 / 8%); }
.button.primary:hover { background: linear-gradient(105deg, #72edf0, #a0e7f5); box-shadow: 0 3px 18px rgb(45 226 230 / 14%); }
.button.secondary { background: var(--surface); }
.button.secondary:hover { background: var(--raised); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--raised); color: var(--text); }
.button.danger { border-color: rgb(255 145 162 / 24%); background: rgb(255 145 162 / 8%); color: var(--bad); }
.button.danger:hover { border-color: rgb(255 145 162 / 50%); background: rgb(255 145 162 / 14%); }
.button.small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.icon-button { width: 36px; min-height: 36px; flex-shrink: 0; padding: 8px; background: transparent; }

/* Metrics and panels */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card { position: relative; min-width: 0; min-height: 148px; padding: 20px; overflow: hidden; border: 1px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface); }
.metric-label { min-height: 18px; margin-bottom: 17px; padding-right: 30px; color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-value { margin: 0 0 8px; font-size: clamp(25px, 2.5vw, 35px); font-weight: 600; letter-spacing: -.045em; line-height: 1.1; }
.metric-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.metric-icon { position: absolute; top: 19px; right: 18px; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid rgb(45 226 230 / 10%); border-radius: 8px; background: rgb(45 226 230 / 5%); color: var(--cyan); }
.metric-icon svg { width: 15px; height: 15px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(285px, 1fr); align-items: stretch; gap: 24px; margin-bottom: 24px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 24px; }
.dashboard-grid > .panel + .panel { margin-top: 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 23px 0; }
.panel-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel-subtitle { margin: 5px 0 0; font-size: 11px; line-height: 1.6; }
.panel-body { padding: 23px; }
.panel-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 23px; border-top: 1px solid var(--line-subtle); color: var(--muted); font-size: 11px; }
.panel-footer p { margin: 0; }
.chart-wrap { min-height: 240px; margin: 8px 0 0; }
.chart-svg { width: 100%; height: auto; min-height: 200px; overflow: visible; }
.chart-gridline { stroke: var(--line-subtle); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis-label { fill: var(--muted); font-family: inherit; font-size: 10px; }
.chart-area { fill: rgb(45 226 230 / 7%); }
.chart-line { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-line.matches { stroke: var(--magenta); }
.chart-point { fill: var(--cyan); stroke: var(--surface); stroke-width: 3; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--cyan); }
.legend-dot.matches { background: var(--magenta); }
.chart-table { margin-top: 16px; }
.chart-wrap > details { margin-top: 15px; }
.chart-wrap > details > summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1.6; }
.chart-wrap > details > summary:hover { color: var(--text); }
.chart-wrap > details[open] > summary { margin-bottom: 12px; }
.chart-wrap > details .table-shell { max-height: 280px; overflow-y: auto; }
.chart-table th, .chart-table td { padding: 10px 12px; }
.chart-table th { position: sticky; top: 0; background: var(--surface); font-size: 12px; }
.chart-table td { font-size: 14px; }

/* Quota and budget */
.budget-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--good); }
.status-dot.warn { background: var(--warning); }
.status-dot.bad { background: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: rgb(165 162 192 / 6%); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge.good { border-color: rgb(114 227 176 / 16%); background: rgb(114 227 176 / 8%); color: var(--good); }
.badge.warn { border-color: rgb(247 201 114 / 18%); background: rgb(247 201 114 / 8%); color: var(--warning); }
.badge.bad { border-color: rgb(255 145 162 / 18%); background: rgb(255 145 162 / 8%); color: var(--bad); }
.badge.neutral { border-color: var(--line); background: rgb(165 162 192 / 6%); color: var(--muted); }
.budget-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin: 13px 0 17px; }
.budget-value { font-size: 39px; font-weight: 600; line-height: 1.1; letter-spacing: -.05em; }
.budget-unit { color: var(--muted); font-size: 13px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 4px; background: #302e43; }
.progress-bar { display: block; width: 100%; max-width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: inherit; background: #302e43; color: var(--cyan); }
.progress-bar::-webkit-progress-bar { border-radius: 4px; background: #302e43; }
.progress-bar::-webkit-progress-value { border-radius: 4px; background: var(--cyan); }
.progress-bar::-moz-progress-bar { border-radius: 4px; background: var(--cyan); }
.progress-bar.warn { color: var(--warning); }
.progress-bar.warn::-webkit-progress-value { background: var(--warning); }
.progress-bar.warn::-moz-progress-bar { background: var(--warning); }
.progress-bar.danger, .progress-bar.bad { color: var(--bad); }
.progress-bar.danger::-webkit-progress-value, .progress-bar.bad::-webkit-progress-value { background: var(--bad); }
.progress-bar.danger::-moz-progress-bar, .progress-bar.bad::-moz-progress-bar { background: var(--bad); }
.budget-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 20px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-subtle); }
.detail-label { display: block; margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.detail-value { display: block; margin: 0; color: var(--text); font-size: 16px; font-weight: 550; }
.info-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; padding: 12px 14px; border: 1px solid rgb(45 226 230 / 13%); border-radius: 8px; background: rgb(45 226 230 / 4%); color: #b4d7dc; font-size: 11px; line-height: 1.7; }
.info-note svg { width: 15px; height: 15px; margin-top: 2px; }
.info-note p { margin: 0; }
.info-note.warn { border-color: rgb(247 201 114 / 17%); background: rgb(247 201 114 / 5%); color: var(--warning); }
.info-note.danger { border-color: rgb(255 145 162 / 20%); background: rgb(255 145 162 / 5%); color: var(--bad); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
fieldset.field { margin: 0 0 24px; padding: 0; border: 0; }
fieldset.field legend { margin-bottom: 9px; padding: 0; }
.field-label { display: block; color: #dedcea; font-size: 12px; font-weight: 550; }
.field-help { margin: 0; font-size: 11px; line-height: 1.65; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row .control { min-width: 0; flex: 1; }
.control, .search-input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #3b384e; border-radius: 8px; background: #15141f; color: var(--text); font-size: 12px; line-height: 1.5; transition: border-color .16s, box-shadow .16s; }
.control::placeholder, .search-input::placeholder { color: #79758f; opacity: 1; }
.control:hover, .search-input:hover { border-color: #555068; }
.control:focus, .search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgb(45 226 230 / 8%); }
.control[aria-invalid="true"], .search-input[aria-invalid="true"] { border-color: var(--bad); }
textarea.control { min-height: 108px; resize: vertical; }
select.control { padding-right: 28px; }
.segmented-control { display: inline-flex; width: fit-content; max-width: 100%; gap: 4px; padding: 4px; border: 1px solid var(--line-subtle); border-radius: 9px; background: #13121c; }
.segment-option { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; white-space: nowrap; }
.segment-option input { margin: 0; }
.segment-option:hover { background: var(--surface); color: var(--text); }
.segment-option[aria-pressed="true"], .segment-option[aria-selected="true"], .segment-option[data-active="true"], .segment-option:has(input:checked) { border-color: #45405e; background: var(--raised); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / 20%); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line-subtle); }
.form-actions .muted { margin: 0 auto 0 0; font-size: 11px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.checkbox-row input { width: 16px; height: 16px; flex-shrink: 0; margin: 2px 0 0; }

/* Tables and people */
.table-shell { position: relative; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #46415e var(--surface); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 15px 20px; border-bottom: 1px solid var(--line); background: rgb(15 14 23 / 22%); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
td { padding: 18px 20px; border-bottom: 1px solid var(--line-subtle); color: #d3d0e3; font-size: 14px; line-height: 1.5; vertical-align: middle; }
td[class] { display: table-cell; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(165 162 192 / 3%); }
td.numeric, th.numeric { text-align: right; }
.table-primary { display: block; color: var(--text); font-size: 14px; font-weight: 550; line-height: 1.5; }
.table-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.table-actions { text-align: right; }
td.table-actions { display: table-cell; vertical-align: middle; }
.table-action-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.table-action-group .button { min-height: 34px; font-size: 12px; white-space: nowrap; }
.users-table, .audit-table { table-layout: fixed; }
.users-table { min-width: 850px; }
.audit-table { min-width: 860px; }
.users-table th, .users-table td, .audit-table th, .audit-table td { padding-right: 16px; padding-left: 16px; }
.users-table th:first-child, .users-table td:first-child, .audit-table th:first-child, .audit-table td:first-child { padding-left: 22px; }
.users-table th:last-child, .users-table td:last-child, .audit-table th:last-child, .audit-table td:last-child { padding-right: 22px; }
.users-table th:nth-child(1) { width: 33%; }
.users-table th:nth-child(2) { width: 16%; }
.users-table th:nth-child(3) { width: 20%; }
.users-table th:nth-child(4) { width: 17%; }
.users-table th:nth-child(5) { width: 14%; }
.audit-table th:nth-child(1) { width: 26%; }
.audit-table th:nth-child(2) { width: 23%; }
.audit-table th:nth-child(3) { width: 33%; }
.audit-table th:nth-child(4) { width: 18%; }
.account-cell, .audit-event, .audit-actor, .audit-target { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
.account-cell .user-summary { gap: 12px; }
.account-cell .user-avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; }
.plan-cell .badge, .audit-table .badge, .modal-body .badge { max-width: 100%; padding: 4px 8px; font-size: 12px; line-height: 1.4; white-space: normal; }
.date-cell { font-variant-numeric: tabular-nums; }
.date-stack { display: block; white-space: nowrap; }
.date-stack .table-secondary { margin-top: 3px; }
.provider-pill { display: inline-block; max-width: 100%; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgb(165 162 192 / 4%); color: #dedbe9; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.table-help { margin: 0; padding: 15px 22px; border-bottom: 1px solid var(--line-subtle); background: rgb(15 14 23 / 12%); color: var(--muted); font-size: 12px; line-height: 1.65; }
.table-help p { margin: 0; }
.plan-help, .modal-body .plan-help { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.audit-event-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 9px; }
.audit-event-heading .table-primary { min-width: 0; }
.audit-event-heading .badge { flex-shrink: 0; }
.audit-diagnostic { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.technical-details { min-width: 0; margin-top: 10px; }
.technical-details > summary { width: fit-content; max-width: 100%; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1.5; }
.technical-details > summary:hover { color: var(--text); }
.technical-details[open] > summary { color: #d5d1e5; }
.technical-list { min-width: 0; margin: 10px 0 0; padding: 12px; border: 1px solid var(--line-subtle); border-radius: 7px; background: rgb(15 14 23 / 35%); }
.technical-list > div + div { margin-top: 10px; }
.technical-list dt { margin: 0 0 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.technical-list dd { min-width: 0; margin: 0; color: #d5d1e5; font-size: 12px; line-height: 1.6; }
.technical-list dd + dt { margin-top: 10px; }
.technical-list code, .technical-list .mono, .technical-list dd { white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.technical-list code, .technical-list .mono { font-size: 12px; }
.table-empty { padding: 44px 24px; color: var(--muted); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-top: 1px solid var(--line-subtle); }
.pagination-copy { margin: 0; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.search-form { display: flex; min-width: min(100%, 280px); max-width: 540px; flex: 1; align-items: center; gap: 9px; }
.toolbar.search-form { max-width: none; }
.search-input { min-width: 0; flex: 1; }
label.search-input { min-width: min(200px, 100%); padding: 0; border: 0; background: transparent; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-row .control { width: auto; min-width: 150px; }
.user-summary { display: flex; min-width: 0; align-items: center; gap: 14px; }
.user-summary h2 { margin-bottom: 3px; }
.user-summary p { margin: 0; overflow-wrap: anywhere; }
.user-avatar { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border: 1px solid #484259; border-radius: 12px; background: var(--raised); color: #c7c0eb; font-size: 16px; font-weight: 650; text-transform: uppercase; }
td .user-summary { gap: 10px; }
td .user-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.detail-grid > .panel + .panel { margin-top: 0; }
.definition-list { margin: 0; }
.definition-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-subtle); }
.definition-row:first-child { padding-top: 0; }
.definition-row:last-child { padding-bottom: 0; border-bottom: 0; }
.definition-row dt { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.definition-row dd { min-width: 0; margin: 0; color: var(--text); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.grant-form { display: flex; flex-direction: column; gap: 17px; }
.grant-form .form-actions { margin-top: 2px; }
.danger-zone { margin-top: 24px; padding: 20px 23px; border: 1px solid rgb(255 145 162 / 20%); border-radius: var(--radius); background: rgb(255 145 162 / 3%); }
.danger-zone h2, .danger-zone h3 { color: var(--bad); }
.danger-zone p { color: var(--muted); font-size: 12px; }

/* Empty, loading and feedback states */
.state-box { display: flex; min-height: 200px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 38px 24px; color: var(--muted); text-align: center; }
.state-box > svg { width: 30px; height: 30px; color: #77708f; }
.state-box h2, .state-box h3 { margin: 0; color: var(--text); }
.state-box p { max-width: 480px; margin: 0; font-size: 12px; line-height: 1.7; }
.state-box.error { color: var(--bad); }
.state-box.error > svg { color: var(--bad); }
.state-box.error p { color: var(--muted); }
.spinner { display: inline-block; width: 23px; height: 23px; border: 2px solid rgb(45 226 230 / 15%); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.button .spinner { width: 14px; height: 14px; border-width: 2px; }
.skeleton { display: block; min-height: 14px; border-radius: 5px; background: #302c42; animation: breathe 1.5s ease-in-out infinite alternate; }
.inline-error { margin: 9px 0 0; color: var(--bad); font-size: 12px; line-height: 1.6; }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; width: min(400px, calc(100vw - 32px)); flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border: 1px solid #4b465f; border-radius: 11px; background: #252235; color: var(--text); box-shadow: 0 12px 40px rgb(0 0 0 / 35%); font-size: 12px; line-height: 1.65; animation: toast-in .18s ease-out; }
.toast.success { border-left: 3px solid var(--good); }
.toast.error { border-left: 3px solid var(--bad); }
.toast svg { width: 17px; height: 17px; margin-top: 2px; }
.toast.success svg { color: var(--good); }
.toast.error svg { color: var(--bad); }
.toast p { margin: 0; }

/* Confirmation dialogs */
dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; overflow: auto; border: 1px solid #48435b; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgb(0 0 0 / 50%); }
dialog::backdrop { background: rgb(7 6 13 / 78%); backdrop-filter: blur(4px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 24px 18px; border-bottom: 1px solid var(--line-subtle); }
.modal-title { margin: 0; font-size: 19px; }
.modal-body { padding: 23px 24px; }
.modal-body p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body .field { margin-top: 19px; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line-subtle); background: rgb(15 14 23 / 20%); }
.modal-close { display: grid; width: 30px; height: 30px; flex-shrink: 0; padding: 5px; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.modal-close:hover { border-color: var(--line); background: var(--raised); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
#user-dialog { width: min(760px, calc(100vw - 32px)); }
#user-detail > .detail-grid, #user-detail > .panel, #user-detail > .grant-form { margin-top: 24px; }
.user-summary > div { min-width: 0; }
.table-primary, .table-secondary { overflow-wrap: anywhere; }
.modal-body .inline-error { color: var(--bad); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { from { opacity: .45; } to { opacity: .85; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 1600px) {
  .topbar { padding-right: max(36px, calc((100vw - 232px - 1328px) / 2)); padding-left: max(36px, calc((100vw - 232px - 1328px) / 2)); }
}

@media (max-width: 1180px) {
  .content { padding: 28px 25px 40px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .kpi-grid { gap: 12px; }
  .metric-card { min-height: 141px; padding: 18px 16px; }
  .metric-label { max-width: 145px; font-size: 11px; }
  .metric-icon { top: 17px; right: 14px; width: 25px; height: 25px; }
  .metric-value { font-size: 29px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr); gap: 18px; }
  .panel-header { padding: 20px 20px 0; }
  .panel-body { padding: 20px; }
  .section-head { gap: 16px; }
  .section-actions { max-width: 235px; }
}

@media (max-width: 1020px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 135px; }
  .metric-label { max-width: none; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-wrap { min-height: 215px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { flex-wrap: wrap; }
  .section-actions { max-width: none; justify-content: flex-start; padding-top: 0; }
  .form-grid { gap: 18px; }
  .topbar-actions { gap: 10px; }
}

@media (max-width: 759px) {
  .sidebar { position: relative; inset: auto; width: 100%; padding: 17px 20px 0; border-right: 0; border-bottom: 1px solid var(--line-subtle); }
  .sidebar-brand { order: 0; padding: 0 0 14px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .brand-copy, .brand-copy strong { font-size: 19px; }
  .brand-copy small, .brand-copy span { font-size: 9px; }
  .nav-list { order: 2; flex-direction: row; flex-wrap: wrap; gap: 3px; margin: 0 -7px; }
  .nav-list > li { min-width: 0; flex: 1; }
  .nav-link { width: auto; min-height: 45px; flex: 1 1 auto; justify-content: center; gap: 7px; padding: 11px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 7px 7px 0 0; font-size: 12px; white-space: nowrap; }
  .nav-link[data-active="true"] { border-bottom-color: var(--cyan); background: rgb(45 226 230 / 5%); }
  .nav-link[data-active="true"]::before { display: none; }
  .nav-icon, .nav-icon svg { width: 16px; height: 16px; }
  .nav-icon { flex-basis: 16px; }
  .sidebar-footer { position: static; order: 1; width: 100%; max-width: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; padding: 0; border: 0; }
  .sidebar-footer .connection-badge { display: none; }
  .sidebar-footer .eyebrow { display: none; }
  .sidebar-footer .identity-email { min-width: 0; max-width: none; flex: 1; font-size: 10px; }
  .sidebar-footer .button { min-height: 31px; padding: 6px 8px; font-size: 10px; }
  .main-area { margin-left: 0; }
  .topbar { min-height: 66px; gap: 16px; padding: 15px 21px; }
  .page-heading h1 { font-size: 16px; }
  .page-heading p { font-size: 10px; }
  .topbar-actions { gap: 8px; }
  .connection-badge { font-size: 10px; }
  .content { padding: 25px 20px 36px; }
  .section-head { gap: 17px; margin-bottom: 22px; }
  .section-copy { font-size: 12px; }
  .section-actions { gap: 8px; }
  .kpi-grid { margin-bottom: 18px; }
  .dashboard-grid { margin-bottom: 18px; }
  .panel + .panel { margin-top: 18px; }
  .dashboard-grid > .panel + .panel, .detail-grid > .panel + .panel { margin-top: 0; }
  .toolbar { gap: 12px; }
  .search-form { max-width: none; }
  .filter-row { width: 100%; }
  .filter-row .control { flex: 1; }
  .toast-stack { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 29px 23px; }
  .auth-card .brand { margin-bottom: 31px; }
  .auth-card h1 { font-size: 26px; }
  .sidebar { padding-right: 15px; padding-left: 15px; }
  .sidebar-footer { right: 15px; }
  .sidebar-footer .identity-email { display: block; }
  .nav-list { gap: 1px; }
  .nav-link { gap: 6px; padding-right: 9px; padding-left: 9px; font-size: 11px; }
  .topbar { padding-right: 16px; padding-left: 16px; }
  .topbar-actions .button { min-height: 33px; padding: 7px 9px; font-size: 10px; }
  .connection-badge { gap: 6px; font-size: 9px; }
  .content { padding: 23px 15px 30px; }
  .section-head h1 { font-size: 25px; }
  .section-actions { width: 100%; }
  .section-actions .button { flex: 1; }
  .kpi-grid { gap: 10px; }
  .metric-card { min-height: 128px; padding: 16px 13px; border-radius: 11px; }
  .metric-label { margin-bottom: 19px; font-size: 10px; }
  .metric-icon { top: 14px; right: 12px; width: 23px; height: 23px; }
  .metric-icon svg { width: 13px; height: 13px; }
  .metric-value { font-size: 28px; }
  .metric-foot { font-size: 9px; }
  .panel-header { gap: 10px; padding: 19px 17px 0; }
  .panel-title { font-size: 14px; }
  .panel-subtitle { font-size: 10px; }
  .panel-body { padding: 19px 17px; }
  .panel-footer { padding: 13px 17px; }
  .chart-wrap { min-height: 175px; }
  .chart-svg { min-height: 160px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { gap: 10px; }
  .form-actions > .button { flex: 1; }
  .form-actions .muted { width: 100%; }
  .segmented-control { width: 100%; }
  .segment-option { flex: 1; padding-right: 8px; padding-left: 8px; }
  .search-form { flex-wrap: wrap; }
  .search-form .button { padding-right: 11px; padding-left: 11px; }
  th, td { padding-right: 15px; padding-left: 15px; }
  .pagination { gap: 10px; padding: 14px 15px; }
  .pagination-copy { font-size: 12px; }
  .pagination .button { padding-right: 8px; padding-left: 8px; }
  .definition-row { gap: 12px; }
  .definition-row dt, .definition-row dd { font-size: 11px; }
  .modal-header { padding: 20px; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { border-right-color: var(--cyan); }
  .skeleton { opacity: .65; }
}
