@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --navy-950: #0b1120;
  --navy-900: #10172a;
  --navy-850: #151e35;
  --ink: #182034;
  --ink-soft: #47536b;
  --muted: #78839a;
  --line: #e4e8f0;
  --line-strong: #d6dce8;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --canvas: #f3f5f9;
  --violet: #6857db;
  --violet-dark: #5140c2;
  --violet-soft: #f0edff;
  --cyan: #2fb7c7;
  --green: #16a77a;
  --green-soft: #eaf9f4;
  --amber: #c88425;
  --amber-soft: #fff5e6;
  --red: #c94d62;
  --red-soft: #fff0f3;
  --blue: #3578d3;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .035);
  --shadow-md: 0 18px 50px rgba(18, 28, 55, .12);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; }
.hidden { display: none !important; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -60px; padding: 10px 14px; border-radius: 7px; color: #fff; background: var(--violet); text-decoration: none; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 256px; display: flex; flex-direction: column; overflow-y: auto; color: #b9c2d8; background: radial-gradient(circle at 10% 4%, #263768 0, transparent 32%), linear-gradient(180deg, var(--navy-850), var(--navy-950)); box-shadow: 8px 0 34px rgba(8, 15, 32, .08); }
.brand { height: 84px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand strong, .brand span { display: block; }
.brand strong { color: #fff; font: 800 18px "Manrope", sans-serif; letter-spacing: -.02em; }
.brand span { margin-top: 3px; color: #7483a5; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { position: relative; width: 33px; height: 42px; flex: 0 0 33px; }
.brand-mark i { position: absolute; left: 8px; width: 17px; height: 17px; transform: rotate(45deg); border-radius: 4px; }
.brand-mark i:nth-child(1) { top: 1px; background: #8172f4; box-shadow: 0 5px 18px rgba(129, 114, 244, .45); }
.brand-mark i:nth-child(2) { top: 13px; left: 11px; width: 12px; height: 12px; background: #42d4bb; }
.brand-mark i:nth-child(3) { top: 23px; background: #6253c9; }
.environment-card { display: flex; align-items: center; gap: 10px; margin: 18px 16px 8px; padding: 11px 12px; border: 1px solid rgba(132, 148, 188, .16); border-radius: 10px; background: rgba(255,255,255,.025); }
.environment-card strong, .environment-card small { display: block; }
.environment-card strong { color: #d8deec; font-size: 11px; font-weight: 600; }
.environment-card small { margin-top: 2px; color: #72809f; font-size: 9px; }
.environment-tag { margin-left: auto; padding: 3px 5px; border-radius: 4px; color: #7fefcf; background: rgba(43, 212, 172, .1); font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #35d1a5; box-shadow: 0 0 0 5px rgba(53, 209, 165, .1); }
.live-dot.offline { background: #dd6578; box-shadow: 0 0 0 5px rgba(221, 101, 120, .1); }
.live-dot.waiting { background: #e0a541; box-shadow: 0 0 0 5px rgba(224, 165, 65, .1); }
.primary-nav { padding: 7px 13px 20px; }
.primary-nav p { margin: 20px 11px 8px; color: #5d6b8d; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { height: 43px; display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 0 12px; border-radius: 8px; color: #929fba; font-size: 12px; font-weight: 600; text-decoration: none; transition: .16s ease; }
.nav-item svg { width: 17px; height: 17px; color: #6f7d9e; }
.nav-item b { min-width: 24px; margin-left: auto; padding: 2px 6px; border-radius: 10px; color: #7482a2; background: rgba(255,255,255,.04); font-size: 8px; font-weight: 700; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.045); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(108, 91, 221, .46), rgba(89, 75, 190, .18)); box-shadow: inset 3px 0 #8778f5; }
.nav-item.active svg { color: #9489f5; }
.nav-item.active b { color: #cbc5ff; background: rgba(129, 112, 244, .16); }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.06); }
.service-status { display: flex; gap: 10px; align-items: center; padding: 8px; }
.service-status strong, .service-status small { display: block; }
.service-status strong { color: #bdc7dc; font-size: 10px; }
.service-status small { margin-top: 2px; color: #677696; font-size: 8px; }
.sidebar-footer > a { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 11px; border-radius: 7px; color: #8491ad; font-size: 10px; text-decoration: none; }
.sidebar-footer > a:hover { color: #fff; background: rgba(255,255,255,.04); }

.app-frame { min-height: 100vh; margin-left: 256px; }
.topbar { position: sticky; z-index: 20; top: 0; height: 72px; display: flex; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.menu-button { display: none !important; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }
.search-box { width: min(430px, 43vw); height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 9px; color: #9aa4b7; background: var(--surface-soft); transition: .16s ease; }
.search-box:focus-within { border-color: #a9a0eb; background: #fff; box-shadow: 0 0 0 3px rgba(104, 87, 219, .08); }
.search-box svg { width: 16px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #9aa4b7; }
.search-box kbd { padding: 2px 6px; border: 1px solid #dce1e9; border-radius: 5px; color: #9da6b5; background: #fff; font: 9px "DM Sans"; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.quiet-button { height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; color: #657087; background: transparent; cursor: pointer; font-size: 10px; font-weight: 600; }
.quiet-button:hover { color: var(--ink); background: var(--surface-soft); }
.quiet-button svg { width: 15px; }
.identity-chip { display: flex; align-items: center; gap: 10px; margin-left: 5px; padding-left: 13px; border-left: 1px solid var(--line); }
.identity-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #7969e7, #4b3fb2); box-shadow: 0 6px 14px rgba(74, 61, 176, .25); font: 800 12px "Manrope"; }
.identity-chip strong, .identity-chip small { display: block; }
.identity-chip strong { font-size: 10px; }
.identity-chip small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.connection-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 34px; color: #744826; border-bottom: 1px solid #eed5b6; background: #fff7ea; }
.connection-banner strong, .connection-banner span { display: block; }
.connection-banner strong { font-size: 11px; }
.connection-banner span { margin-top: 2px; color: #9a714f; font-size: 9px; }

#workspace { min-height: calc(100vh - 72px); padding: 30px 34px 54px; outline: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; margin-bottom: 24px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--violet); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head .eyebrow::before { content: ""; width: 17px; height: 2px; background: var(--violet); }
.page-head h1 { margin: 0; color: #171f32; font: 750 clamp(25px, 3vw, 34px) "Manrope", sans-serif; letter-spacing: -.035em; }
.page-head p { max-width: 690px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.page-actions { display: flex; gap: 9px; flex: none; padding-top: 9px; }
.button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: .16s ease; }
.button svg { width: 14px; height: 14px; }
.button.primary { color: #fff; background: linear-gradient(135deg, #7565e3, #5d4cca); box-shadow: 0 7px 17px rgba(86, 70, 194, .18); }
.button.primary:hover { background: linear-gradient(135deg, #6656d5, #4f3dbb); transform: translateY(-1px); }
.button.secondary { color: #536077; border-color: var(--line-strong); background: #fff; }
.button.secondary:hover { color: var(--violet); border-color: #bdb5ee; }
.button.danger-text { color: var(--red); background: transparent; }
.button.danger { color: #fff; background: var(--red); }
.button:disabled { opacity: .55; pointer-events: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 130px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; right: -23px; bottom: -33px; width: 96px; height: 96px; border-radius: 50%; background: var(--violet-soft); opacity: .6; }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-top > span:first-child { color: #778197; font-size: 10px; font-weight: 600; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: var(--violet); background: var(--violet-soft); }
.metric-icon svg { width: 15px; }
.metric-card strong { display: block; margin-top: 15px; font: 750 28px "Manrope"; letter-spacing: -.04em; }
.metric-card > small { display: block; margin-top: 5px; color: #939caf; font-size: 9px; }
.metric-card > small b { color: var(--green); }
.metric-card.green .metric-icon, .metric-card.green::after { color: var(--green); background: var(--green-soft); }
.metric-card.blue .metric-icon, .metric-card.blue::after { color: var(--blue); background: #edf4fd; }
.metric-card.amber .metric-icon, .metric-card.amber::after { color: var(--amber); background: var(--amber-soft); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-head { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font: 700 13px "Manrope"; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.panel-link { color: var(--violet); font-size: 9px; font-weight: 700; text-decoration: none; }
.activity-list { padding: 4px 18px 8px; }
.activity-item { display: grid; grid-template-columns: 35px 1fr auto; gap: 12px; align-items: center; min-height: 62px; border-bottom: 1px solid #edf0f5; }
.activity-item:last-child { border: 0; }
.activity-glyph { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: var(--violet); background: var(--violet-soft); font-size: 10px; font-weight: 800; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { color: #313b50; font-size: 10px; }
.activity-item small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.activity-item time { color: #9099ab; font-size: 8px; }
.quick-actions { display: grid; gap: 8px; padding: 15px; }
.quick-action { display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; min-height: 58px; padding: 9px 12px; border: 1px solid #edf0f5; border-radius: 9px; color: inherit; background: #fff; cursor: pointer; text-align: left; }
.quick-action:hover { border-color: #d5cff8; background: #fbfaff; }
.quick-action > i { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px; color: var(--violet); background: var(--violet-soft); font-style: normal; }
.quick-action svg { width: 15px; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 10px; }
.quick-action small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.quick-action > span:last-child { color: #a8b0c0; }
.posture-card { position: relative; margin-top: 16px; padding: 22px; overflow: hidden; color: #fff; border-radius: 12px; background: radial-gradient(circle at 85% 30%, rgba(66, 218, 190, .2), transparent 28%), linear-gradient(125deg, #172443, #27376b); box-shadow: var(--shadow-sm); }
.posture-card h3 { margin: 0; font: 700 13px "Manrope"; }
.posture-card p { max-width: 610px; margin: 7px 0 16px; color: #aebbd2; font-size: 10px; line-height: 1.6; }
.posture-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.posture-tags span { padding: 5px 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 5px; color: #c7d0e1; background: rgba(255,255,255,.04); font-size: 8px; font-weight: 700; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .filter-pills { display: flex; gap: 5px; }
.filter-pill { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; cursor: pointer; font-size: 9px; font-weight: 600; }
.filter-pill:hover, .filter-pill.active { color: var(--violet); border-color: #cbc4f2; background: var(--violet-soft); }
.record-count { margin-left: auto; color: var(--muted); font-size: 9px; }
.data-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 42px; padding: 0 16px; color: #7d879a; background: #f8f9fb; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-height: 64px; padding: 14px 16px; border-top: 1px solid #edf0f4; color: #536078; font-size: 10px; vertical-align: middle; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #fcfcfe; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.entity-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; color: #5c4cc6; background: var(--violet-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.entity-avatar.application { color: #2772b2; background: #eaf4fc; }
.entity-avatar.group { color: #17876b; background: var(--green-soft); }
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell strong { color: #263047; font-size: 10px; font-weight: 700; }
.entity-cell small { max-width: 280px; margin-top: 3px; overflow: hidden; color: #8b95a8; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mono { color: #5d687e; font: 9px "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 12px; color: #59657b; background: #f0f2f6; font-size: 8px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #98a2b4; }
.badge.active, .badge.success, .badge.allow { color: #137f60; background: var(--green-soft); }
.badge.active::before, .badge.success::before, .badge.allow::before { background: #1dae80; }
.badge.suspended, .badge.warning { color: #9b651c; background: var(--amber-soft); }
.badge.suspended::before, .badge.warning::before { background: #dc9a37; }
.badge.disabled, .badge.failed, .badge.deny { color: #a33d51; background: var(--red-soft); }
.badge.disabled::before, .badge.failed::before, .badge.deny::before { background: #d35368; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.chip { padding: 3px 6px; border-radius: 4px; color: #6658b9; background: #f2f0fc; font-size: 8px; white-space: nowrap; }
.chip.neutral { color: #657087; background: #f0f2f6; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.row-action { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 6px; color: #8993a6; background: transparent; cursor: pointer; }
.row-action:hover { color: var(--violet); background: var(--violet-soft); }
.row-action.danger:hover { color: var(--red); background: var(--red-soft); }
.row-action svg { width: 14px; height: 14px; }
.empty-state { padding: 66px 20px; text-align: center; }
.empty-state > i { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; color: var(--violet); background: var(--violet-soft); font-style: normal; }
.empty-state h3 { margin: 0; font: 700 14px "Manrope"; }
.empty-state p { max-width: 420px; margin: 7px auto 17px; color: var(--muted); font-size: 10px; line-height: 1.6; }

.auth-grid, .policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.entity-card { padding: 18px; }
.entity-card-head { display: flex; justify-content: space-between; gap: 15px; }
.entity-card-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: var(--violet-soft); }
.entity-card-icon svg { width: 18px; }
.entity-card h3 { margin: 15px 0 4px; font: 700 13px "Manrope"; }
.entity-card > p { height: 32px; margin: 0 0 15px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.6; }
.entity-card-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 12px 0; border-top: 1px solid var(--line); }
.entity-card-meta span { color: #8b95a8; font-size: 8px; }
.entity-card-meta strong { display: block; margin-top: 3px; color: #455066; font-size: 9px; }
.entity-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.entity-card-footer small { color: var(--muted); font-size: 8px; }

.audit-item { display: grid; grid-template-columns: 38px 1fr 135px 95px; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid #edf0f4; }
.audit-item:first-child { border-top: 0; }
.audit-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; color: var(--violet); background: var(--violet-soft); font-size: 9px; font-weight: 800; }
.audit-main strong, .audit-main small { display: block; }
.audit-main strong { color: #313b50; font-size: 10px; }
.audit-main small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.audit-resource { overflow: hidden; color: #626e84; font: 8px "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.audit-time { color: #8791a5; font-size: 8px; text-align: right; }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-nav { position: sticky; top: 92px; padding: 9px; }
.docs-nav button { width: 100%; padding: 9px 10px; border-radius: 6px; color: #6f7990; background: transparent; cursor: pointer; font-size: 9px; text-align: left; }
.docs-nav button:hover, .docs-nav button.active { color: var(--violet); background: var(--violet-soft); font-weight: 700; }
.docs-content { padding: 28px 32px; }
.docs-section { display: none; }
.docs-section.active { display: block; }
.docs-content .kicker { color: var(--violet); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.docs-content h2 { margin: 8px 0 10px; font: 750 24px "Manrope"; letter-spacing: -.03em; }
.docs-content h3 { margin: 25px 0 9px; font: 700 13px "Manrope"; }
.docs-content p, .docs-content li { color: #657188; font-size: 10px; line-height: 1.75; }
.docs-content ul, .docs-content ol { padding-left: 20px; }
.docs-content code { padding: 2px 5px; border-radius: 4px; color: #5849bd; background: var(--violet-soft); font: 9px "Cascadia Code", Consolas, monospace; }
.docs-content pre { margin: 12px 0; padding: 17px; overflow-x: auto; border: 1px solid #263250; border-radius: 9px; color: #cbd5e8; background: #141d32; font: 9px/1.7 "Cascadia Code", Consolas, monospace; white-space: pre; }
.docs-note { margin: 16px 0; padding: 13px 15px; border-left: 3px solid var(--violet); color: #5d687d; background: #f7f5ff; font-size: 10px; line-height: 1.65; }
.architecture-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; margin: 18px 0; }
.architecture-flow div { min-height: 100px; display: grid; place-items: center; align-content: center; padding: 13px; border: 1px solid var(--line); border-top: 3px solid var(--violet); border-radius: 9px; background: #fff; text-align: center; }
.architecture-flow strong, .architecture-flow small { display: block; }
.architecture-flow strong { font-size: 10px; }
.architecture-flow small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.architecture-flow > span { color: #a2aabb; }
.doc-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.doc-table th { padding: 9px; color: #727e94; background: #f6f7fa; font-size: 8px; text-align: left; }
.doc-table td { padding: 10px 9px; border-top: 1px solid var(--line); color: #606c82; font-size: 9px; vertical-align: top; }

.modal { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 38px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(10, 18, 38, .28); }
.modal::backdrop { background: rgba(10, 16, 31, .6); backdrop-filter: blur(3px); }
.small-modal { width: min(540px, calc(100vw - 30px)); }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 38px); }
.modal header { display: flex; justify-content: space-between; gap: 20px; padding: 23px 25px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 5px 0 0; font: 750 18px "Manrope"; letter-spacing: -.025em; }
.modal header p { max-width: 520px; margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.modal-kicker { color: var(--violet); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.modal header .icon-button { font-size: 22px; }
.modal-body { padding: 21px 25px 25px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 25px; border-top: 1px solid var(--line); background: #fafbfc; }
.modal footer .danger-text { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #49546a; font-size: 9px; font-weight: 700; }
.field > span em { color: var(--red); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; color: #344057; background: #fff; font-size: 10px; transition: .15s ease; }
.field input, .field select { height: 38px; padding: 0 11px; }
.field textarea { min-height: 80px; padding: 10px 11px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #9e92e9; box-shadow: 0 0 0 3px rgba(104,87,219,.08); }
.field input:disabled { color: #8d96a7; background: #f4f5f8; }
.field small { color: #929bad; font-size: 8px; line-height: 1.45; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 165px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 7px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px; border-radius: 6px; cursor: pointer; }
.checkbox-row:hover { background: var(--surface-soft); }
.checkbox-row input { width: 14px; height: 14px; margin: 0; accent-color: var(--violet); }
.checkbox-row strong, .checkbox-row small { display: block; }
.checkbox-row strong { font-size: 9px; }
.checkbox-row small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.form-error { margin: 0 0 16px; padding: 10px 12px; border-radius: 7px; color: #9d394c; background: var(--red-soft); font-size: 9px; line-height: 1.55; }
.auth-stack { display: grid; gap: 16px; }
.auth-stack .form-error { margin: 0; }
.advanced-access { padding-top: 2px; border-top: 1px solid var(--line); }
.advanced-access summary { padding-top: 14px; color: #68748a; font-size: 9px; font-weight: 700; cursor: pointer; }
.advanced-access[open] summary { margin-bottom: 13px; }
.confirm-copy { color: #657188; font-size: 11px; line-height: 1.65; }
.confirm-copy strong { color: var(--ink); }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 280px; max-width: 390px; display: grid; grid-template-columns: 27px 1fr; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); animation: toast-in .22s ease both; }
.toast > i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-style: normal; }
.toast.error > i { background: var(--red); }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 10px; }
.toast small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.view-loading { padding-top: 8px; }
.skeleton { border-radius: 6px; background: linear-gradient(90deg, #e8ebf1, #f5f6f9, #e8ebf1); background-size: 200% 100%; animation: shimmer 1.25s infinite; }
.skeleton.title { width: 260px; height: 34px; }
.skeleton.copy { width: 480px; max-width: 90%; height: 12px; margin-top: 13px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; }
.skeleton-grid i { height: 130px; border-radius: 12px; background: linear-gradient(90deg, #e8ebf1, #f5f6f9, #e8ebf1); background-size: 200% 100%; animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-grid, .policy-grid { grid-template-columns: repeat(2, 1fr); }
  .identity-chip div, .quiet-button span { display: none; }
  .architecture-flow { grid-template-columns: 1fr; }
  .architecture-flow > span { transform: rotate(90deg); text-align: center; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-103%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .app-frame { margin-left: 0; }
  .menu-button { display: grid !important; }
  .mobile-scrim { position: fixed; z-index: 25; inset: 0; display: none; background: rgba(9,15,29,.52); }
  .mobile-scrim.open { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; }
  .docs-nav button { width: auto; }
}

@media (max-width: 620px) {
  .topbar { height: 64px; padding: 0 13px; gap: 8px; }
  .search-box { width: 100%; }
  .search-box kbd, .identity-chip, #refreshButton { display: none; }
  #accessButton { width: 36px; padding: 0; justify-content: center; }
  #workspace { min-height: calc(100vh - 64px); padding: 23px 15px 42px; }
  .page-head { display: block; }
  .page-actions { padding-top: 16px; }
  .page-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr; }
  .auth-grid, .policy-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; }
  .filter-pills { max-width: 100%; overflow-x: auto; }
  .record-count { display: none; }
  .data-table th:nth-child(n+4), .data-table td:nth-child(n+4):not(:last-child) { display: none; }
  .audit-item { grid-template-columns: 34px 1fr; }
  .audit-resource, .audit-time { display: none; }
  .docs-content { padding: 22px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .connection-banner { align-items: flex-start; padding: 12px 15px; }
  .connection-banner span { display: none; }
  .modal header, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal footer { padding: 12px 18px; }
}

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