:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --surface-raised: #ffffff;
  --text: #151923;
  --text-soft: #50596b;
  --muted: #7c8494;
  --line: #e5e8f0;
  --line-strong: #d7dce7;
  --accent: #6d5dfc;
  --accent-strong: #5444e8;
  --accent-soft: #eeecff;
  --blue: #4d8dff;
  --green: #20b486;
  --amber: #e79a28;
  --red: #e15a69;
  --violet: #9b7cff;
  --sidebar: #0b0d12;
  --sidebar-soft: #121620;
  --sidebar-text: #f3f5fa;
  --sidebar-muted: #8c93a5;
  --shadow: 0 18px 50px rgba(28, 36, 61, .07);
  --shadow-soft: 0 9px 28px rgba(28, 36, 61, .05);
  --radius: 22px;
  --radius-small: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090b10;
    --surface: #11141c;
    --surface-soft: #0e1118;
    --surface-raised: #171b25;
    --text: #f3f5fa;
    --text-soft: #b4bbca;
    --muted: #858d9e;
    --line: #252b37;
    --line-strong: #343b4a;
    --accent: #9186ff;
    --accent-strong: #aa9fff;
    --accent-soft: #25213f;
    --shadow: 0 24px 70px rgba(0, 0, 0, .25);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, .18);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b10;
  --surface: #11141c;
  --surface-soft: #0e1118;
  --surface-raised: #171b25;
  --text: #f3f5fa;
  --text-soft: #b4bbca;
  --muted: #858d9e;
  --line: #252b37;
  --line-strong: #343b4a;
  --accent: #9186ff;
  --accent-strong: #aa9fff;
  --accent-soft: #25213f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .18);
}

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

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body, button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { border: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: 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; }
.hidden { display: none !important; }

.ambient { position: fixed; z-index: -1; width: 420px; height: 420px; border-radius: 50%; opacity: .24; pointer-events: none; filter: blur(2px); }
.ambient-one { top: -180px; right: 8%; background: radial-gradient(circle, rgba(109, 93, 252, .24), transparent 68%); }
.ambient-two { bottom: -240px; left: 28%; background: radial-gradient(circle, rgba(77, 141, 255, .16), transparent 68%); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 252px; flex-direction: column; padding: 28px 18px 20px; background: var(--sidebar); color: var(--sidebar-text); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid rgba(255, 255, 255, .15); border-radius: 11px; background: linear-gradient(145deg, #8579ff, #4d8dff); box-shadow: 0 8px 22px rgba(109, 93, 252, .36); color: #fff; }
.brand-mark svg { width: 19px; height: 19px; stroke-width: 1.7; }
.brand-word { white-space: nowrap; color: var(--sidebar-text); font-size: 15px; font-weight: 620; letter-spacing: -.025em; }
.brand-word strong { font-weight: 780; }
.sidebar-label { margin: 53px 12px 12px; color: var(--sidebar-muted); font-size: 10px; font-weight: 760; letter-spacing: .17em; }
.sidebar-nav { display: grid; gap: 6px; }
.nav-item { position: relative; display: flex; min-height: 47px; align-items: center; gap: 13px; padding: 0 13px; border-radius: 13px; color: var(--sidebar-muted); font-size: 14px; font-weight: 560; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.7; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--sidebar-text); transform: translateX(2px); }
.nav-item.active { background: linear-gradient(100deg, rgba(109, 93, 252, .24), rgba(109, 93, 252, .08)); color: #fff; }
.nav-item.active::before { position: absolute; top: 10px; bottom: 10px; left: -18px; width: 3px; border-radius: 0 3px 3px 0; background: #8b80ff; content: ""; }
.nav-indicator { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #8b80ff; opacity: 0; }
.nav-item.active .nav-indicator { opacity: 1; }
.sidebar-spacer { flex: 1; }
.sidebar-footer { display: grid; gap: 14px; }
.secure-status { display: inline-flex; align-items: center; gap: 8px; color: var(--sidebar-muted); font-size: 11px; }
.secure-status-tag { margin-left: auto; color: #6ecca9; font-size: 9px; font-weight: 760; letter-spacing: .12em; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(32, 180, 134, .12); }
.account-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 15px; background: var(--sidebar-soft); }
.account-avatar { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #6d5dfc, #4d8dff); color: white; font-size: 13px; font-weight: 750; }
.account-copy { display: grid; min-width: 0; gap: 1px; flex: 1; }
.account-copy strong { overflow: hidden; color: var(--sidebar-text); font-size: 12px; text-overflow: ellipsis; }
.account-copy span { color: var(--sidebar-muted); font-size: 10px; }
.icon-button { display: inline-grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { border-color: var(--line); background: var(--surface-soft); color: var(--text); transform: translateY(-1px); }
.sidebar .icon-button { color: var(--sidebar-muted); }
.sidebar .icon-button:hover { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); color: #fff; }
.mobile-only, .mobile-topbar { display: none; }
.sidebar-scrim { display: none; }
.app-main { min-width: 0; margin-left: 252px; }
.container { width: min(1440px, 100%); margin: 0 auto; padding: 43px 52px 76px; }

.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-soft); transition: color .18s ease, transform .18s ease, border-color .18s ease; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
.desktop-theme-toggle { position: fixed; top: 27px; right: 32px; z-index: 10; }

.page { animation: page-in .22s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-header h1 { margin: 7px 0 8px; color: var(--text); font-size: clamp(30px, 3.4vw, 45px); font-weight: 760; letter-spacing: -.055em; line-height: 1.05; }
.eyebrow, .panel-kicker { color: var(--accent); font-size: 10px; font-weight: 780; letter-spacing: .17em; }
.eyebrow span { padding: 0 6px; color: var(--muted); }
.page-subtitle { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.last-updated { display: inline-flex; align-items: center; gap: 9px; margin-right: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 680; line-height: 1; transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }
.button svg { width: 16px; height: 16px; stroke-width: 1.9; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.primary { background: linear-gradient(135deg, var(--accent), #897eff); color: #fff; box-shadow: 0 10px 22px rgba(109, 93, 252, .2); }
.primary:hover { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); box-shadow: 0 13px 28px rgba(109, 93, 252, .28); }
.secondary { border-color: var(--line); background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow-soft); }
.secondary:hover { border-color: var(--accent); color: var(--accent); }
.danger { background: color-mix(in srgb, var(--red) 11%, var(--surface)); color: var(--red); }
.danger:hover { background: color-mix(in srgb, var(--red) 18%, var(--surface)); }
.full { width: 100%; }

.dashboard-hero { position: relative; display: flex; min-height: 205px; align-items: center; justify-content: space-between; overflow: hidden; margin-bottom: 18px; padding: 34px 40px; border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); background: radial-gradient(circle at 81% 20%, rgba(109, 93, 252, .33), transparent 32%), linear-gradient(120deg, #10131c 0%, #151a2a 55%, #1a2033 100%); color: #f8f9ff; box-shadow: 0 22px 60px rgba(14, 18, 31, .16); }
.hero-copy { position: relative; z-index: 2; }
.hero-eyebrow { color: #9f96ff; }
.dashboard-hero h2 { margin: 9px 0 7px; font-size: clamp(23px, 3vw, 31px); letter-spacing: -.04em; }
.dashboard-hero p { margin: 0; color: #aab2c5; font-size: 13px; }
.hero-chips { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.hero-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 99px; background: rgba(255, 255, 255, .055); color: #c8cede; font-size: 10px; }
.hero-chips i { width: 5px; height: 5px; border-radius: 50%; background: #74d6b6; box-shadow: 0 0 8px rgba(116, 214, 182, .75); }
.hero-status { position: relative; z-index: 2; display: grid; min-width: 150px; justify-items: center; gap: 7px; }
.hero-status-ring { display: grid; width: 67px; height: 67px; place-items: center; border: 1px solid rgba(145, 134, 255, .47); border-radius: 50%; background: rgba(109, 93, 252, .15); box-shadow: 0 0 0 9px rgba(109, 93, 252, .06), 0 0 38px rgba(109, 93, 252, .2); color: #b8b0ff; }
.hero-status-ring svg { width: 27px; height: 27px; }
.hero-status strong { color: #b8b0ff; font-size: 10px; letter-spacing: .17em; }
.hero-status small { max-width: 150px; overflow: hidden; color: #858ea4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; }
.hero-orbit { position: absolute; border: 1px solid rgba(150, 141, 255, .11); border-radius: 50%; transform: rotate(-18deg); }
.hero-orbit-one { top: -95px; right: 7%; width: 370px; height: 230px; }
.hero-orbit-two { right: 12%; bottom: -145px; width: 330px; height: 230px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 154px; padding: 19px 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.metric-card::after { position: absolute; right: -33px; bottom: -44px; width: 120px; height: 120px; border: 1px solid currentColor; border-radius: 50%; opacity: .08; content: ""; }
.metric-blue { color: var(--blue); }
.metric-green { color: var(--green); }
.metric-amber { color: var(--amber); }
.metric-violet { color: var(--violet); }
.metric-head { display: flex; align-items: center; gap: 9px; color: var(--text-soft); }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: color-mix(in srgb, currentColor 12%, var(--surface)); color: currentColor; }
.metric-icon svg { width: 16px; height: 16px; }
.metric-label { color: var(--text-soft); font-size: 12px; font-weight: 610; }
.metric-menu { margin-left: auto; color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.metric-value { display: block; margin: 17px 0 12px; color: var(--text); font-size: 31px; font-weight: 760; letter-spacing: -.055em; line-height: 1; }
.metric-foot { display: flex; min-height: 19px; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.metric-foot a { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 650; }
.metric-foot a svg { width: 13px; height: 13px; }
.metric-trend { padding: 4px 6px; border-radius: 6px; background: color-mix(in srgb, currentColor 10%, var(--surface)); font-size: 9px; font-weight: 760; letter-spacing: .08em; }
.metric-trend.positive { color: var(--green); }
.metric-trend.warning { color: var(--amber); }
.metric-trend.violet { color: var(--violet); }

.panel { min-width: 0; margin-bottom: 18px; padding: 25px 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 6px 0 4px; color: var(--text); font-size: 18px; font-weight: 720; letter-spacing: -.035em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.panel-heading-inline { align-items: center; }
.panel-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; font-weight: 740; letter-spacing: .08em; white-space: nowrap; }
.dashboard-chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .9fr); gap: 18px; }
.dashboard-chart-grid .panel { margin-bottom: 0; }
.chart-panel, .feature-panel { min-height: 446px; }
.range-select select { min-width: 89px; padding: 8px 26px 8px 10px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; cursor: pointer; }
.chart-legend { display: flex; gap: 18px; margin: 28px 0 2px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-issued { background: var(--accent); }
.legend-activated { background: var(--blue); }
.legend-revoked { background: var(--red); }
.trend-chart-wrap { position: relative; min-height: 294px; margin: 14px -5px -8px; }
.trend-chart { display: block; width: 100%; height: 294px; overflow: visible; }
.trend-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.trend-axis-label { fill: var(--muted); font-size: 10px; }
.trend-area { fill: url(#trendAreaGradient); opacity: .55; }
.trend-line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.trend-line-issued { stroke: var(--accent); }
.trend-line-activated { stroke: var(--blue); }
.trend-line-revoked { stroke: var(--red); stroke-dasharray: 5 5; }
.trend-point { stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-point-issued { fill: var(--accent); }
.trend-point-activated { fill: var(--blue); }
.trend-point-revoked { fill: var(--red); }
.trend-label-bg { fill: var(--surface-raised); stroke: var(--line); }
.trend-tooltip-text { fill: var(--text); font-size: 10px; font-weight: 650; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.donut-wrap { position: relative; display: grid; width: 220px; height: 220px; margin: 21px auto 12px; place-items: center; }
.feature-chart { width: 220px; height: 220px; transform: rotate(-90deg); overflow: visible; }
.donut-track { fill: none; stroke: var(--line); stroke-width: 18; }
.donut-segment { fill: none; stroke-width: 18; stroke-linecap: butt; }
.donut-center { position: absolute; display: grid; place-items: center; gap: 1px; pointer-events: none; }
.donut-center strong { color: var(--text); font-size: 29px; font-weight: 760; letter-spacing: -.06em; }
.donut-center span { color: var(--muted); font-size: 10px; }
.feature-legend { display: grid; gap: 9px; }
.feature-legend-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px; background: var(--surface-soft); }
.feature-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.feature-color-0 { background: var(--accent); }
.feature-color-1 { background: var(--blue); }
.feature-color-2 { background: var(--green); }
.feature-legend-label { flex: 1; color: var(--text-soft); font-size: 11px; }
.feature-legend-value { color: var(--text); font-size: 12px; font-weight: 720; }

.audit-panel { margin-top: 18px; }
.audit-list { display: grid; margin-top: 19px; }
.audit-row { display: flex; min-height: 60px; align-items: center; gap: 13px; border-top: 1px solid var(--line); }
.audit-icon { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.audit-icon svg { width: 15px; height: 15px; }
.audit-main { display: grid; min-width: 0; flex: 1; gap: 1px; }
.audit-main strong { overflow: hidden; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 650; text-overflow: ellipsis; }
.audit-main span, .audit-row time, .audit-actor { color: var(--muted); font-size: 10px; }
.audit-row time { white-space: nowrap; }
.audit-actor { min-width: 50px; text-align: right; }
.empty-state { display: grid; min-height: 178px; place-items: center; align-content: center; gap: 5px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text-soft); font-size: 13px; }
.empty-state span:last-child { font-size: 11px; }
.empty-state.compact { min-height: 120px; }
.empty-icon { display: grid; width: 42px; height: 42px; margin-bottom: 5px; place-items: center; border-radius: 13px; background: var(--surface-soft); color: var(--muted); }
.empty-icon svg { width: 20px; height: 20px; }

.filter-panel { padding: 15px; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) 190px auto; gap: 10px; align-items: center; margin: 0; }
.search-field, .select-field { position: relative; display: flex; align-items: center; min-height: 43px; margin: 0; }
.field-prefix { display: grid; width: 42px; height: 100%; flex: 0 0 42px; place-items: center; color: var(--muted); }
.field-prefix svg { width: 16px; height: 16px; }
.search-field input, .select-field select { width: 100%; height: 43px; padding: 0 13px 0 0; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--surface-soft); color: var(--text); font-size: 12px; }
.search-field input { padding-left: 0; }
.select-field select { padding-left: 42px; appearance: auto; }
.search-field:focus-within input, .select-field:focus-within select { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; margin: 22px -4px 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 790px; font-size: 12px; }
.data-table th { padding: 0 12px 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .03em; text-align: left; white-space: nowrap; }
.data-table td { padding: 14px 12px; border-top: 1px solid var(--line); color: var(--text-soft); vertical-align: middle; }
.data-table tbody tr { transition: background .18s ease; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table code, code { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; }
.license-id { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 620; }
.license-id:hover code, .row-action:hover { color: var(--accent); }
.license-id small { display: block; margin: 3px 0 0 27px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; }
.license-key-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.license-key-icon svg { width: 13px; height: 13px; }
.status { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 680; white-space: nowrap; }
.status-active { background: color-mix(in srgb, var(--green) 13%, var(--surface)); color: var(--green); }
.status-issued { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.status-expired, .status-revoked { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.feature-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.feature-tags span { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--text-soft); font-size: 9px; white-space: nowrap; }
.muted-cell { color: var(--muted) !important; font-size: 11px; }
.row-action { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 11px; font-weight: 650; white-space: nowrap; }
.row-action svg { width: 13px; height: 13px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 0 8px; color: var(--muted); font-size: 10px; }

.issue-dialog { width: min(580px, calc(100% - 28px)); max-height: min(730px, calc(100vh - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0, 0, 0, .28); }
.issue-dialog::backdrop { background: rgba(9, 11, 16, .64); backdrop-filter: blur(5px); }
.dialog-shell { padding: 27px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.dialog-header h2 { margin: 7px 0 4px; font-size: 24px; letter-spacing: -.045em; }
.dialog-header p { margin: 0; color: var(--muted); font-size: 11px; }
.issue-form { display: grid; gap: 24px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-label { display: grid; gap: 8px; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.field-label input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--surface-soft); color: var(--text); }
.field-label input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.field-label small { margin-top: -4px; color: var(--muted); font-size: 10px; font-weight: 450; }
.permission-fieldset { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.permission-fieldset legend { margin-bottom: 1px; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.permission-option { display: flex; min-height: 57px; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.permission-option:hover { border-color: var(--accent); }
.permission-option > input { position: absolute; opacity: 0; pointer-events: none; }
.permission-check { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: transparent; }
.permission-check svg { width: 13px; height: 13px; stroke-width: 2.5; }
.permission-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.permission-option:has(input:checked) .permission-check { border-color: var(--accent); background: var(--accent); color: white; }
.permission-option span:last-child { display: grid; gap: 1px; }
.permission-option strong { color: var(--text); font-size: 12px; }
.permission-option small { color: var(--muted); font-size: 10px; font-weight: 450; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 2px; }
.issued-keys { display: grid; gap: 8px; margin-top: 20px; padding: 17px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 14px; background: var(--accent-soft); }
.issued-keys strong { color: var(--text); font-size: 12px; }
.issued-key-row { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 9px; background: var(--surface); }
.issued-key-row code { flex: 1; overflow-wrap: anywhere; color: var(--accent); font-size: 11px; }
.copy-key { display: inline-grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.copy-key svg { width: 14px; height: 14px; }
.issued-keys p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.copy-fallback { position: fixed; top: -100px; left: -100px; width: 1px; height: 1px; opacity: 0; }

.detail-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.detail-status-card, .detail-summary-card { display: flex; min-height: 134px; align-items: center; gap: 16px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.detail-status-card { position: relative; overflow: hidden; }
.detail-status-card::after { position: absolute; right: -38px; bottom: -70px; width: 180px; height: 180px; border: 1px solid currentColor; border-radius: 50%; opacity: .12; content: ""; }
.detail-status-card.status-active { color: var(--green); }
.detail-status-card.status-issued { color: var(--accent); }
.detail-status-card.status-expired, .detail-status-card.status-revoked { color: var(--red); }
.detail-status-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 15px; background: color-mix(in srgb, currentColor 12%, var(--surface)); color: currentColor; }
.detail-status-icon svg { width: 22px; height: 22px; }
.detail-status-card > div { position: relative; z-index: 1; display: grid; gap: 2px; }
.detail-status-card strong { color: var(--text); font-size: 19px; }
.detail-status-card > div > span:last-child { color: var(--muted); font-size: 11px; }
.detail-summary-card { display: grid; align-content: center; gap: 11px; }
.detail-summary-card small { color: var(--muted); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.detail-grid .panel { margin-bottom: 0; }
.key-values { display: grid; gap: 0; margin: 24px 0 0; }
.key-values div { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 46px; border-top: 1px solid var(--line); }
.key-values dt { color: var(--muted); font-size: 11px; }
.key-values dd { max-width: 68%; color: var(--text-soft); font-size: 11px; text-align: right; overflow-wrap: anywhere; }
.action-panel { display: grid; align-content: start; gap: 12px; }
.action-panel .panel-heading { margin-bottom: 4px; }
.action-button { min-height: 45px; justify-content: flex-start; padding-left: 14px; }
.action-button svg { width: 17px; height: 17px; }
.timeline-panel { margin-top: 18px; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }
.timeline-item { position: relative; display: flex; align-items: flex-start; gap: 10px; color: var(--muted); }
.timeline-item:not(:last-child)::after { position: absolute; top: 14px; left: 29px; width: calc(100% + 20px); height: 1px; background: var(--line-strong); content: ""; }
.timeline-marker { position: relative; z-index: 1; display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted); }
.timeline-marker svg { width: 13px; height: 13px; }
.timeline-item.complete { color: var(--text); }
.timeline-item.complete .timeline-marker { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); }
.timeline-item.danger-line.complete .timeline-marker { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.timeline-item > div { display: grid; gap: 2px; }
.timeline-item strong { color: inherit; font-size: 11px; }
.timeline-item > div span { color: var(--muted); font-size: 10px; }
.boolean-chip { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--green) 11%, var(--surface)); color: var(--green); font-size: 10px; }

.audit-summary-panel { display: flex; align-items: center; gap: 13px; padding: 17px 20px; }
.audit-summary-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.audit-summary-icon svg { width: 19px; height: 19px; }
.audit-summary-panel > div:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.audit-summary-panel strong { color: var(--text); font-size: 12px; }
.audit-summary-panel span { color: var(--muted); font-size: 10px; }
.compact-status { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); }
.audit-table td { vertical-align: top; }
.actor-chip { display: inline-grid; width: 24px; height: 24px; margin-right: 7px; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 750; vertical-align: middle; }
.action-code { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: var(--surface-soft); color: var(--accent); font-family: ui-monospace, monospace; font-size: 10px; }
.sub-code { color: var(--muted); font-size: 10px; }
.audit-details summary { color: var(--accent); font-size: 10px; cursor: pointer; }
.json-cell { display: block; max-width: 260px; margin-top: 8px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

.auth-page { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: 35px; background: #0b0d12; color: #f5f7fb; }
.auth-page::before { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(109, 93, 252, .08), transparent 42%, rgba(77, 141, 255, .06)); content: ""; pointer-events: none; }
.auth-glow { position: absolute; width: 450px; height: 450px; border-radius: 50%; filter: blur(16px); pointer-events: none; }
.auth-glow-one { top: -260px; left: -120px; background: radial-gradient(circle, rgba(109, 93, 252, .27), transparent 67%); }
.auth-glow-two { right: -190px; bottom: -260px; background: radial-gradient(circle, rgba(77, 141, 255, .22), transparent 67%); }
.auth-layout { position: relative; z-index: 1; display: grid; width: min(1050px, 100%); grid-template-columns: minmax(0, 1fr) 410px; align-items: center; gap: clamp(50px, 9vw, 125px); }
.auth-intro { display: grid; min-height: 520px; align-content: space-between; padding: 10px 0; }
.auth-brand .brand-word { color: #fff; font-size: 16px; }
.auth-intro-copy { max-width: 540px; }
.auth-intro-copy .eyebrow { color: #9e95ff; }
.auth-intro-copy h1 { margin: 17px 0 18px; color: #f8f9ff; font-size: clamp(38px, 5vw, 65px); font-weight: 760; letter-spacing: -.07em; line-height: 1.06; }
.auth-intro-copy h1 em { color: #a9a1ff; font-style: normal; }
.auth-intro-copy p { max-width: 440px; margin: 0; color: #939bad; font-size: 14px; line-height: 1.8; }
.auth-highlights { display: flex; gap: 30px; }
.auth-highlights > div { display: grid; grid-template-columns: 31px auto; grid-template-rows: auto auto; column-gap: 9px; align-items: center; }
.highlight-icon { display: grid; grid-row: span 2; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; background: rgba(255, 255, 255, .055); color: #a9a1ff; }
.highlight-icon svg { width: 15px; height: 15px; }
.auth-highlights strong { color: #e4e7f0; font-size: 11px; }
.auth-highlights small { color: #777f92; font-size: 10px; }
.login-card { padding: 34px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; background: rgba(19, 22, 31, .93); box-shadow: 0 30px 90px rgba(0, 0, 0, .3); }
.login-card-head { display: flex; align-items: center; justify-content: space-between; }
.login-kicker { color: #8f86ff; font-size: 10px; font-weight: 780; letter-spacing: .17em; }
.login-lock { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(143, 134, 255, .25); border-radius: 10px; background: rgba(109, 93, 252, .12); color: #a59eff; }
.login-lock svg { width: 16px; height: 16px; }
.login-card h2 { margin: 21px 0 5px; color: #f5f6fb; font-size: 28px; letter-spacing: -.05em; }
.login-subtitle { margin: 0; color: #858da0; font-size: 12px; }
.login-form { display: grid; gap: 17px; margin-top: 28px; }
.auth-page .field-label { color: #a1a9b9; }
.auth-page .field-wrap { display: flex; height: 46px; align-items: center; border: 1px solid #2c3240; border-radius: 12px; background: #10131a; transition: border-color .18s ease, box-shadow .18s ease; }
.auth-page .field-wrap:focus-within { border-color: #8278ff; box-shadow: 0 0 0 3px rgba(109, 93, 252, .15); }
.auth-page .field-wrap .field-prefix { width: 40px; height: 100%; color: #737c90; }
.auth-page .field-wrap input { width: 100%; height: 100%; padding: 0 12px 0 0; border: 0; outline: 0; background: transparent; color: #f2f4fa; font-size: 13px; }
.auth-page input::placeholder { color: #5c6474; }
.auth-page .field-prefix svg { width: 16px; height: 16px; }
.login-submit { width: 100%; height: 47px; margin-top: 5px; justify-content: space-between; padding: 0 15px 0 18px; border-radius: 12px; }
.login-submit svg { width: 17px; height: 17px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; color: #687184; font-size: 10px; }
.login-security .status-dot { width: 5px; height: 5px; flex-basis: 5px; box-shadow: none; }
.alert { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 10px 11px; border: 1px solid rgba(225, 90, 105, .23); border-radius: 10px; background: rgba(225, 90, 105, .1); color: #f095a1; font-size: 11px; }
.alert-mark { display: grid; width: 17px; height: 17px; flex: 0 0 17px; place-items: center; border-radius: 50%; background: rgba(225, 90, 105, .3); color: #ffbac2; font-size: 11px; font-weight: 750; }

.toast { position: fixed; right: 25px; bottom: 25px; z-index: 60; display: flex; max-width: min(370px, calc(100vw - 40px)); align-items: center; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); color: var(--red); }

@media (max-width: 1180px) {
  .container { padding-right: 34px; padding-left: 34px; }
  .dashboard-chart-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); }
  .auth-layout { gap: 60px; }
}

@media (max-width: 960px) {
  .sidebar { width: 228px; }
  .app-main { margin-left: 228px; }
  .desktop-theme-toggle { right: 25px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-chart-grid, .detail-grid { grid-template-columns: 1fr; }
  .chart-panel, .feature-panel { min-height: auto; }
  .auth-layout { grid-template-columns: 1fr 380px; gap: 40px; }
  .auth-intro-copy h1 { font-size: 47px; }
}

@media (max-width: 720px) {
  .sidebar { left: -252px; width: 252px; transition: left .22s ease; }
  body.sidebar-open .sidebar { left: 0; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 20; display: block; visibility: hidden; padding: 0; background: rgba(9, 11, 16, .56); opacity: 0; transition: visibility .22s ease, opacity .22s ease; }
  body.sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .app-main { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .mobile-topbar { position: sticky; top: 0; z-index: 15; display: flex; height: 62px; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); }
  .mobile-brand { flex: 1; color: var(--text); font-size: 14px; font-weight: 650; }
  .mobile-brand strong { font-weight: 800; }
  .desktop-theme-toggle { display: none; }
  .container { padding: 29px 18px 55px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 23px; }
  .page-header h1 { font-size: 34px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .last-updated { margin-right: auto; }
  .dashboard-hero { min-height: 235px; align-items: flex-start; padding: 28px 25px; }
  .hero-status { position: absolute; right: 21px; bottom: 20px; min-width: auto; transform: scale(.82); transform-origin: bottom right; }
  .hero-chips { max-width: 270px; }
  .metrics-grid { gap: 10px; }
  .metric-card { min-height: 145px; padding: 16px; }
  .metric-value { font-size: 28px; }
  .metric-foot { display: grid; gap: 4px; }
  .metric-trend { justify-self: start; }
  .panel { padding: 21px 18px; border-radius: 18px; }
  .panel-heading-inline { align-items: flex-start; }
  .trend-chart-wrap { min-height: 245px; }
  .trend-chart { height: 245px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .button { width: 100%; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .detail-overview { grid-template-columns: 1fr; }
  .detail-status-card, .detail-summary-card { min-height: 118px; padding: 20px; }
  .timeline { grid-template-columns: 1fr; gap: 14px; }
  .timeline-item:not(:last-child)::after { top: 29px; bottom: -14px; left: 14px; width: 1px; height: auto; }
  .audit-summary-panel { align-items: flex-start; flex-wrap: wrap; }
  .audit-summary-panel .panel-badge { margin-left: 52px; }
  .audit-row { gap: 8px; }
  .audit-row time { display: none; }
  .audit-actor { min-width: auto; }
  .issue-dialog { width: calc(100% - 20px); border-radius: 19px; }
  .dialog-shell { padding: 22px 18px; }
  .auth-page { padding: 20px; }
  .auth-layout { display: block; width: min(440px, 100%); }
  .auth-intro { display: block; min-height: auto; padding: 0; }
  .auth-intro-copy { margin: 68px 0 29px; }
  .auth-intro-copy h1 { margin-top: 13px; font-size: 38px; }
  .auth-intro-copy p { font-size: 12px; }
  .auth-highlights { display: none; }
  .login-card { padding: 25px 21px; }
}

@media (max-width: 430px) {
  .page-actions .button { flex: 1; min-width: 0; padding: 0 11px; }
  .page-actions .button span { white-space: nowrap; }
  .dashboard-header .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dashboard-header .last-updated { grid-column: 1 / -1; }
  .dashboard-header .button { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 136px; padding: 14px; }
  .metric-label { font-size: 11px; }
  .metric-icon { width: 27px; height: 27px; }
  .metric-value { margin-top: 15px; font-size: 25px; }
  .metric-menu { display: none; }
  .form-grid-two { grid-template-columns: 1fr; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions .button { padding: 0 8px; }
}

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