:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --text: #172033;
  --text-soft: #667085;
  --text-faint: #98a2b3;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --brand: #1769e0;
  --brand-hover: #1258bf;
  --brand-soft: #eaf2ff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --violet: #6941c6;
  --violet-soft: #f4f3ff;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-md: 0 8px 24px rgb(16 24 40 / 10%);
  --radius: 10px;
  --sidebar-width: 244px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #131c2e;
  --surface-soft: #182338;
  --surface-raised: #1a2538;
  --sidebar: #080d18;
  --sidebar-soft: #182033;
  --text: #e8edf5;
  --text-soft: #9ba9bd;
  --text-faint: #77859a;
  --border: #26344b;
  --border-strong: #34435b;
  --brand: #5b9cff;
  --brand-hover: #7dafec;
  --brand-soft: #142d52;
  --success: #47cd89;
  --success-soft: #12392c;
  --warning: #fdb022;
  --warning-soft: #3b2a12;
  --danger: #f97066;
  --danger-soft: #451c1b;
  --violet: #b692f6;
  --violet-soft: #2b2246;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --shadow-md: 0 12px 30px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .92em; }
.hidden { display: none !important; }
.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; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 1000; padding: 10px 14px; background: var(--brand); color: #fff; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-width); display: flex; flex-direction: column; background: var(--sidebar); color: #d9e2ef; border-right: 1px solid rgb(255 255 255 / 6%); }
.brand { height: 68px; display: flex; align-items: center; gap: 11px; padding: 0 20px; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; color: #fff; background: linear-gradient(145deg, #2e7bea, #1254b5); border: 1px solid rgb(255 255 255 / 18%); border-radius: 9px; font-weight: 750; font-size: 17px; box-shadow: 0 5px 14px rgb(0 0 0 / 22%); }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 14px; letter-spacing: .01em; }
.brand small { color: #92a2b8; font-size: 11px; margin-top: 1px; }
.primary-nav { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 3px; padding: 18px 12px; overflow-y: auto; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; color: #aebdd0; border-radius: 7px; font-size: 13px; font-weight: 540; transition: background .16s, color .16s; }
.nav-link:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.nav-link.active { color: #fff; background: #1e3658; box-shadow: inset 3px 0 #5b9cff; }
.nav-link .icon { width: 18px; height: 18px; }
.sidebar-footer { padding: 15px 18px 18px; color: #78889f; border-top: 1px solid rgb(255 255 255 / 7%); }
.sidebar-footer > small { display: block; margin-top: 8px; font-size: 10px; }
.environment-chip { display: flex; align-items: center; gap: 8px; color: #b9c5d5; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.environment-chip span { width: 7px; height: 7px; background: #32d583; border-radius: 50%; box-shadow: 0 0 0 3px rgb(50 213 131 / 14%); }

.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: 68px; display: flex; align-items: center; gap: 20px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 96%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.global-search { width: min(560px, 48vw); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.global-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.global-search .icon { width: 17px; height: 17px; }
.global-search input { min-width: 0; flex: 1; color: var(--text); background: transparent; border: 0; outline: 0; }
.global-search input::placeholder { color: var(--text-faint); }
kbd { padding: 2px 6px; color: var(--text-faint); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; font: 10px "SFMono-Regular", Consolas, monospace; box-shadow: 0 1px 0 var(--border-strong); }
.topbar-actions { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.platform-state { display: flex; align-items: center; gap: 8px; margin-right: 6px; padding: 7px 9px; color: var(--text-soft); border-radius: 7px; font-size: 12px; white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s; }
.platform-state:hover { color: var(--text); background: var(--surface-soft); }
.platform-state:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.platform-state > span { width: 8px; height: 8px; border-radius: 50%; }
.state-success > span { background: #12b76a; box-shadow: 0 0 0 3px rgb(18 183 106 / 13%); }
.state-warning > span { background: #f79009; box-shadow: 0 0 0 3px rgb(247 144 9 / 13%); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-soft); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--surface-soft); border-color: var(--border); }
.mobile-menu { display: none; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 4px 7px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker, .action-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] summary, .user-menu summary:hover { background: var(--surface-soft); border-color: var(--border); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: #344054; border-radius: 50%; font-weight: 700; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--text-soft); font-size: 10px; }
.user-menu summary > .icon { width: 14px; height: 14px; }
.user-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; width: 230px; padding: 7px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-md); }
.user-menu-panel > div { padding: 9px 10px 11px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.user-menu-panel strong, .user-menu-panel small { display: block; }
.user-menu-panel small { margin-top: 2px; color: var(--text-soft); font-size: 11px; }
.user-menu-panel a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 12px; }
.user-menu-panel a:hover { background: var(--surface-soft); }

.content { width: min(1560px, 100%); margin: 0 auto; padding: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 3px 0 5px; font-size: 27px; line-height: 1.18; letter-spacing: -.025em; }
.page-header p { max-width: 720px; margin: 0; color: var(--text-soft); }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 650; cursor: pointer; transition: background .14s, border-color .14s, transform .08s; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button .icon { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.button-secondary:hover { background: var(--surface-soft); }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { filter: brightness(.92); }
.danger-text { color: var(--danger) !important; }
.text-link { color: var(--brand); font-size: 12px; font-weight: 620; }
.text-link:hover, .table-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 118px; display: flex; align-items: center; gap: 15px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.metric-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: 0 7px 22px rgb(16 24 40 / 7%); }
.metric-card-link { cursor: pointer; }
.metric-card-link:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.metric-card > div > span, .metric-card > div > small { display: block; }
.metric-card > div > span { color: var(--text-soft); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .035em; }
.metric-card strong { display: block; margin: 2px 0 1px; font-size: 25px; line-height: 1.25; }
.metric-card small { color: var(--text-soft); font-size: 11px; }
.metric-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 9px; flex: 0 0 auto; }
.metric-icon .icon { width: 21px; height: 21px; }
.metric-blue { color: var(--brand); background: var(--brand-soft); }
.metric-green { color: var(--success); background: var(--success-soft); }
.metric-violet { color: var(--violet); background: var(--violet-soft); }
.metric-amber { color: var(--warning); background: var(--warning-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(340px, .78fr) minmax(600px, 1.22fr); gap: 18px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 0 0 2px; font-size: 15px; }
.panel-header p { margin: 0; color: var(--text-soft); font-size: 11px; }
.health-list { padding: 5px 0; }
.health-row { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 9px 17px; border-bottom: 1px solid var(--border); }
.health-row:last-child { border-bottom: 0; }
.health-row:hover { background: var(--surface-soft); }
.tenant-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #175cd3; background: #eff8ff; border: 1px solid #d1e9ff; border-radius: 8px; font-size: 11px; font-weight: 750; }
html[data-theme="dark"] .tenant-avatar { color: #84adff; background: #142d52; border-color: #194185; }
.health-copy { min-width: 0; flex: 1; }
.health-copy strong, .health-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-copy strong { font-size: 12px; }
.health-copy small { color: var(--text-soft); font-size: 10px; margin-top: 2px; }
.empty-inline { padding: 18px; color: var(--text-soft); }

.badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-progress .badge-dot { width: 9px; height: 9px; border: 2px solid currentColor; border-right-color: transparent; background: transparent; animation: badge-progress-spin .75s linear infinite; }
@keyframes badge-progress-spin { to { transform: rotate(360deg); } }
.tenant-row-busy .row-actions { opacity: .55; pointer-events: none; }
.badge-success { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.badge-warning { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.badge-neutral { color: var(--text-soft); background: var(--surface-soft); border-color: var(--border); }

.table-panel { overflow: visible; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-spacing: 0; border-collapse: separate; text-align: left; }
.data-table th { height: 42px; padding: 0 15px; color: var(--text-soft); background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 58px; padding: 9px 15px; border-bottom: 1px solid var(--border); font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); }
.data-table small { display: block; margin-top: 2px; color: var(--text-soft); font-size: 9px; }
.table-compact th:nth-child(4), .table-compact th:nth-child(6), .table-compact td:nth-child(4), .table-compact td:nth-child(6) { display: none; }
.table-compact td { height: 54px; padding: 8px 12px; }
.table-toolbar, .operation-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 15px; border-bottom: 1px solid var(--border); }
.table-toolbar > div:first-child { display: flex; align-items: center; gap: 8px; }
.table-toolbar > div:first-child span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 99px; font-size: 10px; }
.table-filter { width: 230px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; }
.table-filter .icon { width: 15px; height: 15px; color: var(--text-soft); }
.table-filter input { min-width: 0; width: 100%; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 11px; }
.tenant-cell, .row-actions, .operation-main { display: flex; align-items: center; }
.tenant-cell { gap: 10px; min-width: 190px; }
.tenant-cell > div { min-width: 0; }
.tenant-name { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.table-link { color: var(--brand); font-weight: 620; }
.version-cell { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.last-operation { display: block; font-weight: 620; }
.row-actions { justify-content: flex-end; gap: 4px; }
.operation-main { gap: 9px; min-width: 200px; }
.operation-main > div { min-width: 0; }
.operation-main strong, .operation-main small { display: block; }
.operation-main small { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "SFMono-Regular", Consolas, monospace; }
.operation-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-soft); border-radius: 7px; }
.operation-icon .icon { width: 15px; height: 15px; }

.action-menu { position: relative; }
.action-menu-panel { position: fixed; z-index: 120; width: 190px; max-height: min(360px, calc(100vh - 16px)); overflow-y: auto; visibility: hidden; padding: 5px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); }
.action-menu-panel.is-positioned { visibility: visible; }
.menu-action { width: 100%; min-height: 34px; display: flex; align-items: center; padding: 7px 9px; color: var(--text); background: transparent; border: 0; border-radius: 5px; font-size: 11px; text-align: left; cursor: pointer; }
.menu-action:hover { background: var(--surface-soft); }
.menu-separator { display: block; height: 1px; margin: 5px 4px; background: var(--border); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.segmented button { min-height: 29px; padding: 4px 10px; color: var(--text-soft); background: transparent; border: 0; border-radius: 5px; font-size: 11px; cursor: pointer; }
.segmented button.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 650; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--text-soft); font-size: 11px; }
.breadcrumbs a { color: var(--brand); }
.tenant-hero { min-height: 138px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tenant-hero-main { display: flex; align-items: center; gap: 16px; }
.tenant-avatar-large { width: 62px; height: 62px; border-radius: 12px; font-size: 17px; }
.tenant-hero h1 { margin: 4px 0 2px; font-size: 23px; letter-spacing: -.02em; }
.tenant-hero p { margin: 0; color: var(--text-soft); font-size: 11px; }
.hero-status { display: flex; gap: 6px; }
.detail-grid { display: grid; grid-template-columns: minmax(480px, 1.15fr) minmax(300px, .85fr); gap: 18px; }
.panel-full { grid-column: 1 / -1; }
.service-grid { padding: 8px 17px; }
.service-card { min-height: 72px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); }
.service-card:last-child { border-bottom: 0; }
.service-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 7px; }
.service-icon .icon { width: 17px; height: 17px; }
.service-card h3 { margin: 0; font-size: 12px; }
.service-card p { margin: 2px 0 0; color: var(--text-soft); font-size: 10px; }
.form-separator { width: 100%; height: 1px; margin: 18px 0; border: 0; background: var(--border); }
.service-state { text-align: right; }
.service-state small { display: block; margin-top: 3px; color: var(--text-soft); font-size: 9px; }
.backup-summary { min-height: 118px; display: flex; align-items: center; gap: 15px; padding: 18px; }
.backup-summary span, .backup-summary small { display: block; color: var(--text-soft); font-size: 10px; }
.backup-summary strong { display: block; margin: 3px 0; font-size: 16px; }
.panel-actions { width: 100%; min-width: 0; justify-content: flex-start; padding: 14px 18px 16px; border-top: 1px solid var(--border); }
.panel-actions .button { max-width: 100%; white-space: normal; }
.tenant-usage-list { display: grid; gap: 0; padding: 7px 18px 12px; }
.tenant-usage-card { min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.tenant-usage-card:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.tenant-usage-card:last-child { border-bottom: 0; }
.tenant-usage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tenant-usage-head span, .tenant-usage-head strong, .tenant-usage-card > small { display: block; }
.tenant-usage-head span { color: var(--text-soft); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.tenant-usage-head strong { margin-top: 2px; font-size: 18px; }
.tenant-usage-card meter { width: 100%; height: 9px; margin: 8px 0 4px; accent-color: var(--brand); }
.tenant-usage-card > small { color: var(--text-soft); font-size: 9px; }
.tenant-resource-preview { min-height: 48px; margin-top: 7px; }
.tenant-resource-preview svg { display: block; width: 100%; height: 48px; }
.tenant-list-usage { display: grid; min-width: 150px; gap: 2px; color: var(--text-soft); font-size: 9px; }
.resource-history-button {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}
.resource-history-button svg { width: 14px; height: 14px; }
.modal-resource-history { width: min(1120px, calc(100vw - 28px)); }
.resource-dialog-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}
.resource-dialog-toolbar .field { width: 180px; margin: 0; }
.resource-dialog-toolbar > span { color: var(--text-soft); font-size: 11px; }
.resource-custom-range,
.resource-export-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.resource-custom-range .field { width: 205px; }
.resource-custom-range .button,
.resource-export-actions .button { white-space: nowrap; }
.resource-dialog-toolbar > span { margin-left: auto; }
@media (max-width: 980px) {
    .resource-dialog-toolbar { align-items: stretch; flex-wrap: wrap; }
    .resource-custom-range { flex: 1 1 100%; flex-wrap: wrap; }
    .resource-custom-range .field { flex: 1 1 210px; }
    .resource-dialog-toolbar > span { width: 100%; margin-left: 0; }
}
.resource-chart-grid { display: grid; gap: 14px; }
.resource-chart-grid article {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: var(--surface-soft);
}
.resource-chart-grid article.resource-chart-focus {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}
.resource-chart-grid article > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 7px;
}
.resource-chart-grid article > div:first-child span {
    color: var(--text-soft);
    font-size: 11px;
}
.resource-chart { min-height: 190px; }
.resource-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.resource-chart-grid-line { stroke: var(--border); stroke-width: 1; }
.resource-chart-axis { fill: var(--text-soft); font-size: 10px; }
.resource-chart-area { opacity: .10; stroke: none; }
.resource-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.resource-chart-empty {
    display: grid;
    min-height: 48px;
    place-items: center;
    color: var(--text-soft);
    font-size: 10px;
}
.billing-profile-history { margin: 0 18px 7px; padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.billing-profile-history span, .billing-profile-history strong, .billing-profile-history small { display: block; }
.billing-profile-history span { color: var(--text-soft); font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.billing-profile-history strong { margin: 3px 0 2px; font-size: 11px; }
.billing-profile-history small { color: var(--text-soft); font-size: 9px; }
.metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 7px 18px 15px; }
.metadata-grid > div { min-width: 0; padding: 11px 8px 11px 0; border-bottom: 1px solid var(--border); }
.metadata-grid dt { color: var(--text-soft); font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .045em; }
.metadata-grid dd { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 620; }

.health-banner { min-height: 90px; display: flex; align-items: center; gap: 15px; padding: 18px 20px; margin-bottom: 18px; border: 1px solid; border-radius: var(--radius); }
.health-banner > .icon { width: 28px; height: 28px; }
.health-banner h2 { margin: 0 0 3px; font-size: 15px; }
.health-banner p { margin: 0; font-size: 11px; }
.health-banner-success { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.health-banner-warning { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.health-banner-link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.health-banner-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.health-banner-link:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.health-banner-arrow { margin-left: auto; font-size: 20px; line-height: 1; }
.health-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.health-card { padding: 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.health-card-head, .health-card-head > div { display: flex; align-items: center; }
.health-card-head { justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.health-card-head > div { gap: 10px; }
.health-card-head a, .health-card-head small { display: block; }
.health-card-head a { font-weight: 650; }
.health-card-head small { color: var(--text-soft); font-size: 10px; }
.component-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; }
.component-status > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text-soft); font: 9px "SFMono-Regular", Consolas, monospace; }
.operational-metrics { margin-bottom: 18px; }
.alert-panel { margin-bottom: 18px; scroll-margin-top: 86px; }
.alert-panel:focus { outline: 0; border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.alert-list { padding: 2px 18px 10px; }
.alert-row { min-height: 62px; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: 0; }
.alert-row strong, .alert-row small { display: block; }
.alert-row strong { font-size: 11px; }
.alert-row small { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.alert-row time { color: var(--text-faint); font-size: 9px; }
.alert-severity { font: 700 9px "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; }
.alert-critical .alert-severity { color: var(--danger); }
.alert-warning .alert-severity { color: var(--warning); }
.compact-empty { padding: 22px 20px 26px; }
.health-card-targets { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-top: 13px; margin-top: 13px; color: var(--text-soft); border-top: 1px solid var(--border); font-size: 9px; }
.health-card-targets strong { color: var(--text); }
.operational-checks { margin-top: 18px; }
.operational-checks td strong, .operational-checks td small { display: block; }
.operational-checks td small { margin-top: 2px; color: var(--text-soft); font-size: 9px; }
.capacity-panel { margin-bottom: 18px; }
.pressure-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.pressure-card { min-width: 0; min-height: 172px; padding: 17px 18px 14px; border-right: 1px solid var(--border); }
.pressure-card:last-child { border-right: 0; }
.pressure-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pressure-head span, .pressure-head strong, .pressure-card > small { display: block; }
.pressure-head > div > span { color: var(--text-soft); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.pressure-head strong { margin-top: 2px; font-size: 22px; }
.pressure-card meter { width: 100%; height: 9px; margin: 11px 0 5px; accent-color: var(--brand); }
.pressure-card > small { min-height: 28px; color: var(--text-soft); font-size: 9px; }
.sparkline { width: 100%; height: 42px; margin-top: 7px; overflow: visible; }
.sparkline polyline { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline-empty { display: grid; place-items: center; height: 42px; margin-top: 7px; color: var(--text-faint); font-size: 9px; border-top: 1px dashed var(--border); }
.network-rate { min-height: 47px; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: var(--text-soft); font-size: 10px; }
.container-pressure { margin-bottom: 18px; }
.container-pressure td strong, .container-pressure td small { display: block; }
.container-pressure td small { margin-top: 2px; color: var(--text-soft); font-size: 9px; }
.panel-count { color: var(--text-soft); font-size: 10px; }
.cluster-detail-grid { display: grid; grid-template-columns: minmax(440px, .9fr) minmax(520px, 1.1fr); gap: 18px; margin-top: 18px; }
.enrollment-content { padding: 18px; }
.enrollment-content ol { padding-left: 20px; margin: 0 0 16px; color: var(--text-soft); font-size: 11px; }
.enrollment-content li + li { margin-top: 7px; }
.public-key { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; padding: 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.public-key > span { grid-column: 1 / -1; color: var(--text-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.public-key code { min-width: 0; padding: 7px 8px; overflow-x: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; white-space: nowrap; }
.security-note { margin: 13px 0 0; color: var(--text-soft); font-size: 10px; }
.cluster-stack { display: grid; gap: 14px; }
.stack-content { display: flex; align-items: center; gap: 15px; padding: 18px; }
.stack-content h3, .stack-content p { margin: 0; }
.stack-content p { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.stack-content small { display: block; margin-top: 7px; color: var(--text-soft); font-size: 9px; }
.stack-logo { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, #1769e0, #6941c6); border-radius: 12px; font-weight: 800; }
.cluster-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cluster-profile { min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cluster-profile-head { display: flex; align-items: center; gap: 10px; }
.cluster-profile-head h3 { margin: 0 0 3px; font-size: 11px; }
.cluster-profile-head .metric-icon { width: 34px; height: 34px; }
.cluster-profile p { min-height: 48px; margin: 12px 0; color: var(--text-soft); font-size: 10px; }
.cluster-profile dl { margin: 0; }
.cluster-profile dl > div { display: flex; justify-content: space-between; gap: 7px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 9px; }
.cluster-profile dt { color: var(--text-soft); }
.cluster-profile dd { margin: 0; font-weight: 700; }
.protection-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.protection-summary article { min-height: 106px; display: flex; align-items: center; gap: 15px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.protection-summary span, .protection-summary small, .protection-summary strong { display: block; }
.protection-summary article > div > span { color: var(--text-soft); font-size: 10px; }
.protection-summary strong { margin: 3px 0; font-size: 15px; }
.protection-summary small { color: var(--text-soft); font-size: 9px; }
.access-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 18px; }
.boundary-list { padding: 3px 18px; }
.boundary-row { min-height: 64px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); }
.boundary-row:last-child { border-bottom: 0; }
.boundary-row strong, .boundary-row small { display: block; }
.boundary-row strong { font-size: 11px; }
.boundary-row small { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.boundary-check { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 750; }
.boundary-ok { color: var(--success); background: var(--success-soft); }
.boundary-warning { color: var(--warning); background: var(--warning-soft); }
.identity-mfa-panel { padding-bottom: 18px; }
.identity-mfa-panel > .identity-description, .identity-mfa-panel > .page-actions { margin-right: 18px; margin-left: 18px; }
.identity-description { color: var(--text-soft); font-size: 10px; line-height: 1.55; }
.identity-warning { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; margin: 0 18px 12px; color: var(--warning); background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border)); border-radius: 7px; }
.identity-warning strong { font-size: 11px; }
.identity-warning span { font-size: 9px; }
.identity-users { margin-top: 18px; }
.identity-sessions, .security-events { margin-top: 18px; }
.identity-users td strong, .identity-users td small { display: block; }
.identity-users td small, .identity-sessions td small, .security-events td small { display: block; margin-top: 2px; color: var(--text-soft); }
.button-compact { min-height: 28px; padding: 5px 9px; font-size: 9px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; margin-bottom: 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; }
.check-field input { margin-top: 2px; accent-color: var(--brand); }
.check-field span, .check-field strong, .check-field small { display: block; }
.check-field strong { font-size: 10px; }
.check-field small { margin-top: 2px; color: var(--text-soft); font-size: 9px; line-height: 1.45; }
.setup-steps { padding-left: 20px; margin: 0 0 16px; color: var(--text-soft); font-size: 10px; line-height: 1.55; }
.setup-steps li + li { margin-top: 4px; }
.authenticator-lead { margin: 0 0 16px; color: var(--text-soft); font-size: 11px; line-height: 1.55; }
.authenticator-lead strong { color: var(--text); }
.totp-enrollment-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.totp-qr-panel { display: grid; justify-items: center; gap: 9px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 9px; }
.totp-qr-panel img { display: block; width: 210px; height: 210px; object-fit: contain; }
.totp-qr-panel small { color: #53627a; font-size: 9px; line-height: 1.45; text-align: center; }
.totp-manual { margin-top: 16px; padding: 12px 14px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.totp-manual summary { color: var(--brand); font-size: 10px; font-weight: 700; cursor: pointer; }
.totp-manual[open] summary { margin-bottom: 14px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-field input { min-width: 0; width: 100%; }
.copy-field code { min-width: 0; padding: 10px; overflow-x: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.recovery-codes code { padding: 9px 11px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-align: center; }
.button:disabled, .icon-button:disabled { opacity: .45; cursor: not-allowed; }
.empty-state { padding: 36px 20px; color: var(--text-soft); text-align: center; }
.empty-state h3 { margin: 8px 0 3px; color: var(--text); font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.empty-icon { width: 34px; height: 34px; display: grid; place-items: center; margin: auto; color: var(--success); background: var(--success-soft); border-radius: 50%; }
.not-found { min-height: 60vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.not-found > span { color: var(--brand); font-size: 68px; font-weight: 800; letter-spacing: -.06em; }
.not-found h1 { margin: -7px 0 5px; }
.not-found p { margin: 0 0 18px; color: var(--text-soft); }

.modal { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 30px); padding: 0; color: var(--text); background: transparent; border: 0; overflow: visible; }
.modal::backdrop { background: rgb(10 18 32 / 62%); backdrop-filter: blur(2px); }
.modal-card { max-height: calc(100vh - 30px); display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 28px 70px rgb(0 0 0 / 30%); overflow: hidden; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 20px 15px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 3px 0 0; font-size: 18px; }
.modal-close { font-size: 22px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-description { margin: 0 0 14px; color: var(--text-soft); }
.tenant-context { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; margin-bottom: 14px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.tenant-context span { color: var(--text-soft); font-size: 10px; text-transform: uppercase; }
.tenant-context strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; background: var(--surface-soft); border-top: 1px solid var(--border); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; padding: 0 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; outline: 0; }
.field input, .field select { height: 39px; }
.field textarea { min-height: 86px; padding-top: 9px; padding-bottom: 9px; resize: vertical; font: 10px "SFMono-Regular", Consolas, monospace; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.field small { display: block; margin-top: 4px; color: var(--text-soft); font-size: 9px; }
.billing-help { margin: 0 0 16px; color: var(--text-soft); background: color-mix(in srgb, var(--brand) 5%, var(--surface-soft)); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border)); border-radius: 7px; }
.billing-help summary { padding: 10px 12px; color: var(--text); font-size: 10px; font-weight: 700; cursor: pointer; user-select: none; }
.billing-help summary::marker { color: var(--brand); }
.billing-help[open] summary { border-bottom: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border)); }
.billing-help p, .billing-help dl { margin: 0; padding: 11px 12px 12px; font-size: 10px; line-height: 1.55; }
.billing-help dl { display: grid; gap: 9px; }
.billing-help dl div { display: grid; grid-template-columns: minmax(110px, .38fr) minmax(0, 1fr); gap: 10px; }
.billing-help dt { color: var(--text); font-weight: 700; }
.billing-help dd { margin: 0; }
.modal-wide { width: min(720px, calc(100vw - 28px)); }
.modal-provision { width: min(900px, calc(100vw - 28px)); }
.provision-config { display: grid; gap: 16px; }
.provision-intro {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}
.provision-intro span, .provision-section p {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}
.provision-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.provision-section h3 { margin: 3px 0 0; font-size: 15px; }
.provision-section p { margin: 5px 0 0; }
.provision-progress { display: grid; gap: 16px; }
.provision-progress-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.provision-progress-header h3 { margin: 3px 0 4px; font-size: 19px; }
.provision-progress-header p { margin: 0; color: var(--text-soft); }
.provision-progress-header > strong {
  color: var(--brand);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.provision-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.provision-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .25s ease;
}
.provision-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.provision-stepper.lifecycle-stepper {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.provision-stepper li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}
.provision-stepper li > span {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--text-soft);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}
.provision-stepper li div { display: grid; min-width: 0; }
.provision-stepper li strong { font-size: 11px; }
.provision-stepper li small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.provision-stepper li.complete { border-color: color-mix(in srgb, var(--success) 28%, transparent); background: var(--success-soft); }
.provision-stepper li.complete > span { color: var(--success); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.provision-stepper li.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgb(37 99 235 / 10%); }
.provision-stepper li.active > span { color: white; background: var(--brand); border-color: var(--brand); }
.provision-stepper li.failed { border-color: var(--danger); background: var(--danger-soft); }
.provision-readiness {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.provision-readiness article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
}
.provision-readiness article > span {
  color: var(--text-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.provision-readiness article strong { font-size: 13px; }
.provision-readiness article small { color: var(--text-soft); line-height: 1.35; }
.provision-readiness article[data-state="ready"] { border-color: color-mix(in srgb, var(--success) 28%, transparent); background: var(--success-soft); }
.provision-readiness article[data-state="failed"] { border-color: var(--danger); background: var(--danger-soft); }
.credential-handoff {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
  border-radius: 10px;
  background: var(--success-soft);
}
.credential-handoff h3 { margin: 3px 0; }
.credential-handoff p { margin: 0; color: var(--text-soft); }
.credential-handoff > .button { justify-self: start; }
.credential-result { display: grid; grid-template-columns: 1fr 1.5fr; gap: 0 12px; }
.credential-result .security-note { grid-column: 1 / -1; }
.provision-result-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-footer-note { margin-right: auto; color: var(--text-soft); font-size: 11px; }
.tenant-readiness { margin-bottom: 18px; }
.icon-button.disabled { opacity: .42; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.role-selector { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 11px 13px 13px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 7px; }
.role-selector legend { padding: 0 5px; color: var(--text-soft); font-size: 10px; font-weight: 650; }
.role-selector label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.role-selector input { accent-color: var(--brand); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; width: min(390px, calc(100vw - 40px)); display: flex; flex-direction: column; gap: 8px; }
.toast { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 13px 14px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
.toast-mark { width: 8px; height: 8px; margin-top: 4px; background: var(--brand); border-radius: 50%; }
.toast-success .toast-mark { background: var(--success); }
.toast-error .toast-mark { background: var(--danger); }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 11px; }
.toast small { margin-top: 2px; color: var(--text-soft); font-size: 10px; }
.toast button { padding: 0; color: var(--text-soft); background: transparent; border: 0; cursor: pointer; }
.toast-actions { display: flex; align-items: center; gap: 10px; }
.toast-actions .toast-dismiss { font-size: 18px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-scrim { display: none; }

.login-body { background: #0b1220; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(430px, .92fr); }
.login-brand-panel { position: relative; display: flex; align-items: center; min-height: 100vh; padding: 9vw; color: #fff; background: radial-gradient(circle at 20% 20%, #254c82 0, transparent 37%), linear-gradient(145deg, #152947 0%, #0c1729 58%, #09101c 100%); overflow: hidden; }
.login-brand-content { position: relative; z-index: 2; max-width: 600px; }
.brand-mark-large { width: 52px; height: 52px; margin-bottom: 34px; border-radius: 13px; font-size: 24px; }
.login-brand-panel .eyebrow { color: #84adff; }
.login-brand-panel h1 { max-width: 560px; margin: 12px 0 18px; font-size: clamp(34px, 4vw, 58px); line-height: 1.04; letter-spacing: -.045em; }
.login-brand-panel p { max-width: 560px; color: #aebdd0; font-size: 16px; }
.login-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.login-features span { padding: 7px 10px; color: #c7d4e5; background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 9%); border-radius: 6px; font-size: 11px; }
.login-grid-art { position: absolute; inset: auto -10% -40% 20%; height: 80%; opacity: .18; transform: perspective(700px) rotateX(60deg) rotateZ(-20deg); background-image: linear-gradient(rgb(91 156 255 / 35%) 1px, transparent 1px), linear-gradient(90deg, rgb(91 156 255 / 35%) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to top, #000, transparent); }
.login-form-panel { position: relative; display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 40px; background: #f8fafc; }
.login-theme-toggle { position: absolute; top: 24px; right: 24px; z-index: 3; color: #344054; background: rgb(255 255 255 / 82%); border-color: #d9dee7; box-shadow: 0 6px 18px rgb(16 24 40 / 8%); backdrop-filter: blur(10px); }
.login-theme-toggle:hover { color: #172033; background: #fff; }
.theme-icon { display: inline-grid; place-items: center; }
.theme-icon-sun { display: none; }
.login-card { width: min(400px, 100%); padding: 34px; color: #172033; background: #fff; border: 1px solid #e4e7ec; border-radius: 12px; box-shadow: 0 20px 60px rgb(16 24 40 / 14%); }
.login-card h2 { margin: 5px 0 5px; font-size: 23px; letter-spacing: -.025em; }
.login-card .subtle { margin: 0 0 22px; color: #667085; font-size: 12px; }
.login-card .field > span { color: #344054; }
.login-card .field input { color: #172033; background: #fff; border-color: #d0d5dd; }
.login-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: #667085; font-size: 10px; }
.login-step span { padding: 4px 8px; color: #175cd3; background: #eff8ff; border: 1px solid #d1e9ff; border-radius: 999px; font-weight: 700; }
.login-step strong { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.login-attempts { display: block; margin: -5px 0 12px; color: #667085; text-align: right; }
.login-back-link { display: block; margin-top: 13px; color: #175cd3; font-size: 11px; font-weight: 650; text-align: center; }
.login-back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-submit { width: 100%; min-height: 42px; margin-top: 3px; }
.login-alert { padding: 9px 11px; margin: 0 0 16px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 6px; font-size: 11px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 17px; color: #667085; font-size: 10px; }
.login-security .icon { width: 14px; height: 14px; color: #067647; }
.login-form-panel footer { margin-top: 18px; color: #98a2b3; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.login-mobile-brand { display: none; }

html[data-theme="dark"] .login-body { background: #070d18; }
html[data-theme="dark"] .login-brand-panel { background: radial-gradient(circle at 20% 20%, #1e416f 0, transparent 37%), linear-gradient(145deg, #11233e 0%, #0a1526 58%, #060b14 100%); }
html[data-theme="dark"] .login-form-panel { background: #070d18; }
html[data-theme="dark"] .login-theme-toggle { color: #c8d2e0; background: rgb(17 26 43 / 82%); border-color: #2b3950; box-shadow: 0 8px 24px rgb(0 0 0 / 24%); }
html[data-theme="dark"] .login-theme-toggle:hover { color: #fff; background: #182338; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: inline-grid; }
html[data-theme="dark"] .login-card { color: #e8edf5; background: #111a2b; border-color: #26344b; box-shadow: 0 22px 68px rgb(0 0 0 / 35%); }
html[data-theme="dark"] .login-card .subtle,
html[data-theme="dark"] .login-security,
html[data-theme="dark"] .login-step,
html[data-theme="dark"] .login-attempts { color: #9ba9bd; }
html[data-theme="dark"] .login-step span { color: #84adff; background: #142d52; border-color: #194185; }
html[data-theme="dark"] .login-back-link { color: #84adff; }
html[data-theme="dark"] .login-card .field > span { color: #c8d2e0; }
html[data-theme="dark"] .login-card .field input { color: #e8edf5; background: #0b1220; border-color: #34435b; }
html[data-theme="dark"] .login-card .field input:focus { border-color: var(--brand); }
html[data-theme="dark"] .login-alert { color: #fda29b; background: #391716; border-color: #7a271a; }
html[data-theme="dark"] .login-form-panel footer { color: #77859a; }
html[data-theme="dark"] .login-mobile-brand strong { color: #e8edf5; }

.project-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.project-summary article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.project-summary span { color: var(--text-soft); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.project-summary strong { font-size: 24px; }
.roadmap-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; margin-bottom: 18px; }
.roadmap-column { min-width: 0; padding: 12px; background: color-mix(in srgb, var(--surface-soft) 78%, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); }
.roadmap-column-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 3px 12px; }
.roadmap-column-head h2 { margin: 0; font-size: 14px; }
.roadmap-column-head > span, .panel-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 10px; font-weight: 700; }
.roadmap-card { padding: 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.roadmap-card:last-child { margin-bottom: 0; }
.roadmap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.roadmap-card-head > span:last-child { min-width: 0; color: var(--text-faint); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roadmap-card h3 { margin: 12px 0 5px; font-size: 13px; line-height: 1.35; }
.roadmap-card p { margin: 0; color: var(--text-soft); font-size: 11px; }
.project-lower-grid { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(420px, 1.15fr); align-items: start; gap: 18px; }
.project-idea-form { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(220px, 1.3fr); gap: 14px; padding: 18px; }
.project-idea-description { grid-column: 1 / -1; }
.project-idea-form .button { grid-column: 1 / -1; justify-self: start; }
.project-idea-form-panel .identity-warning { margin: 18px 18px 0; }
.project-ideas-list { display: grid; gap: 10px; padding: 14px; }
.project-idea-card { padding: 14px 15px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; }
.project-idea-meta, .project-idea-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-idea-meta > span:first-child { color: var(--text-soft); font-size: 10px; font-weight: 650; }
.project-idea-card h3 { margin: 10px 0 4px; font-size: 13px; }
.project-idea-card p { margin: 0 0 12px; color: var(--text-soft); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.project-idea-card footer { padding-top: 10px; color: var(--text-faint); border-top: 1px solid var(--border); font-size: 9px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .panel-full { grid-column: auto; }
  .access-grid { grid-template-columns: 1fr; }
  .pressure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pressure-card:nth-child(2) { border-right: 0; }
  .pressure-card:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .cluster-detail-grid { grid-template-columns: 1fr; }
  .roadmap-board { grid-template-columns: 1fr; }
  .project-lower-grid { grid-template-columns: 1fr; }
  .data-table th:nth-child(6), .data-table td:nth-child(6) { display: none; }
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .workspace { grid-column: 1; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .app-body.nav-open .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 45; background: rgb(10 18 32 / 50%); }
  .app-body.nav-open .mobile-scrim { display: block; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .platform-state, .user-copy, .user-menu summary > .icon { display: none; }
  .global-search { width: min(520px, 100%); }
  .content { padding: 20px 16px; }
  .page-header, .tenant-hero { align-items: flex-start; flex-direction: column; }
  .tenant-hero { padding: 18px; }
  .health-card-grid { grid-template-columns: 1fr; }
  .protection-summary { grid-template-columns: 1fr; }
  .cluster-profile-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; }
  .login-mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 25px; }
}

@media (max-width: 620px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .global-search kbd { display: none; }
  .topbar-actions > #theme-toggle { display: none; }
  .page-header h1 { font-size: 23px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .table-toolbar, .operation-toolbar { align-items: stretch; flex-direction: column; }
  .table-filter { width: 100%; }
  .metadata-grid { grid-template-columns: 1fr; }
  .component-status { grid-template-columns: 1fr; }
  .pressure-grid { grid-template-columns: 1fr; }
  .pressure-card { border-right: 0; border-bottom: 1px solid var(--border); }
  .pressure-card:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .totp-enrollment-grid { grid-template-columns: 1fr; }
  .totp-qr-panel { width: min(100%, 260px); margin: 0 auto; }
  .billing-help dl div { grid-template-columns: 1fr; gap: 2px; }
  .public-key { grid-template-columns: 1fr; }
  .login-form-panel { padding: 18px; }
  .login-card { padding: 25px 21px; }
  .project-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-idea-form { grid-template-columns: 1fr; }
  .project-idea-description, .project-idea-form .button { grid-column: auto; }
  .project-idea-form .button { width: 100%; }
  .provision-stepper, .provision-stepper.lifecycle-stepper, .provision-readiness { grid-template-columns: 1fr; }
  .credential-result { grid-template-columns: 1fr; }
  .credential-result .security-note { grid-column: auto; }
  .provision-progress-header { align-items: flex-start; }
  .modal-footer-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.governance-form { display: grid; gap: 14px; padding: 18px; }
.compact-governance-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  border-bottom: 1px solid var(--border);
}
.checkbox-field { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; }
.checkbox-field input { width: 16px; height: 16px; margin: 0; }
.dangerous-governance-form {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
  border-radius: 12px;
}
.retention-preview-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}
.retention-preview-summary small { color: var(--text-soft); }
.governance-row-actions { flex-wrap: wrap; min-width: 230px; }
.tenant-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

@media (max-width: 760px) {
  .compact-governance-form { grid-template-columns: 1fr; }
  .retention-preview-summary { flex-direction: column; }
  .governance-row-actions { min-width: 0; }
}

.organization-list { display: grid; gap: 16px; margin: 16px 0; }
.organization-table td:last-child,
.organization-table th:last-child { width: 54px; text-align: right; }
.organization-table td small { display: block; margin-top: 3px; color: var(--text-soft); }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.clickable-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.organization-detail-grid { margin-top: 18px; }
.organization-tenant-panel { grid-column: 1 / -1; }
#organization-edit-dialog .modal-card { overflow-y: auto; }
#organization-edit-dialog .modal-body { overflow: visible; }
.organization-password-form { border-top: 1px solid var(--border); }
.organization-password-form .modal-body { padding-top: 16px; padding-bottom: 4px; }
.organization-password-form .provision-section { margin: 0; }
.organization-card { overflow: visible; }
.organization-card .panel-header { align-items: flex-start; }
.organization-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 24px 18px;
}
.organization-policy > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
}
.organization-policy strong { color: var(--text); font-size: 14px; }
.organization-tenants {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}
.organization-tenant-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.organization-tenant-chip small {
  color: var(--text-soft);
  font-weight: 500;
}
.organization-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
}
.organization-assignment-grid .form-grid,
.organization-assignment-grid .organization-confirmation,
.organization-assignment-grid .page-actions { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .organization-assignment-grid { grid-template-columns: 1fr; }
  .organization-assignment-grid > * { grid-column: 1 !important; }
  .organization-card .panel-header { flex-direction: column; }
  .organization-card .page-actions { justify-content: flex-start; }
}
