
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #e7eef0;
  --bg-deep: #dbe6e9;
  --surface: #e9f0f2;
  --surface-raised: #eef4f5;
  --surface-soft: #e3ebee;
  --control: #e2eaed;
  --line: rgba(20, 52, 61, 0.18);
  --line-strong: rgba(20, 52, 61, 0.3);
  --control-border: #718990;
  --text: #14282f;
  --muted: #526a73;
  --muted-strong: #334d56;
  --placeholder: #667f87;
  --accent: #126972;
  --accent-strong: #0c555d;
  --accent-hover: #084b53;
  --accent-fill: #46adb9;
  --accent-fill-strong: #8ae2df;
  --accent-soft: rgba(18, 105, 114, 0.1);
  --on-accent: #031216;
  --focus: #126972;
  --blue: #2f67b2;
  --amber: #82570d;
  --danger: #a23f49;
  --good: #176b49;
  --shadow-dark: rgba(95, 112, 120, 0.28);
  --shadow-light: rgba(255, 255, 255, 0.88);
  --shadow-raised: 12px 12px 28px var(--shadow-dark), -7px -7px 22px var(--shadow-light);
  --shadow-soft: 7px 7px 18px var(--shadow-dark), -5px -5px 15px var(--shadow-light);
  --shadow-inset: inset 5px 5px 12px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #071118;
    --bg-deep: #040b10;
    --surface: #0b1922;
    --surface-raised: #0d1d27;
    --surface-soft: #10232e;
    --control: #081820;
    --line: rgba(148, 184, 204, 0.13);
    --line-strong: rgba(148, 184, 204, 0.22);
    --control-border: #58717e;
    --text: #edf5f7;
    --muted: #8197a3;
    --muted-strong: #aec0c8;
    --placeholder: #6c8792;
    --accent: #62c8d0;
    --accent-strong: #2f9eaa;
    --accent-hover: #91e1e5;
    --accent-fill: #46adb9;
    --accent-fill-strong: #8ae2df;
    --accent-soft: rgba(98, 200, 208, 0.12);
    --on-accent: #031216;
    --focus: #8ae2df;
    --blue: #69a7ff;
    --amber: #f1b45a;
    --danger: #ef7b7b;
    --good: #6ed0a0;
    --shadow-dark: rgba(0, 0, 0, 0.38);
    --shadow-light: rgba(25, 54, 68, 0.24);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { color: inherit; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }

.auth-page { overflow-x: hidden; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 9%, var(--bg)) 0, var(--bg) 43%, var(--bg-deep) 100%); }
.ambient { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(2px); opacity: .55; }
.ambient-one { width: 420px; height: 420px; left: -220px; top: 18%; background: radial-gradient(circle, rgba(54, 143, 156, .17), transparent 68%); }
.ambient-two { width: 500px; height: 500px; right: -270px; bottom: -170px; background: radial-gradient(circle, rgba(65, 105, 168, .13), transparent 68%); }
.auth-header { position: relative; z-index: 2; width: min(1180px, calc(100% - 40px)); min-height: 92px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--accent); background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow-soft); }
.brand-mark svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 3.1; stroke-linecap: round; stroke-linejoin: round; }
.brand span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 14px; letter-spacing: .09em; text-transform: uppercase; }
.brand small { color: var(--muted); font-size: 11px; }
.service-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; font-weight: 700; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-soft); }
.service-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px rgba(110, 208, 160, .75); }
.auth-stage { position: relative; z-index: 1; min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 52px 20px 72px; }
.auth-card { width: min(100%, 580px); padding: 54px 58px 48px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface-raised); box-shadow: var(--shadow-raised); }
.auth-card-head { text-align: center; margin-bottom: 26px; }
.auth-card-head > .brand-mark { width: 72px; height: 72px; margin: 0 auto 28px; border-radius: 22px; }
.auth-card-head > .brand-mark svg { width: 43px; height: 43px; }
.auth-card-head.compact > .brand-mark { margin-bottom: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; line-height: 1.2; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin-top: 0; letter-spacing: -.025em; }
.auth-card h1 { margin-bottom: 10px; font-size: clamp(29px, 5vw, 40px); }
.auth-card-head > p:last-child { max-width: 410px; margin: 0 auto; color: var(--muted); line-height: 1.65; font-size: 14px; }
.message { min-height: 22px; margin: 0 0 8px; color: var(--danger); font-size: 13px; line-height: 1.5; }
.message.success { color: var(--good); }
.message-centered { text-align: center; margin-bottom: 20px; }
.auth-form, .dashboard-form { display: grid; gap: 18px; }
.field { display: grid; gap: 9px; color: var(--muted-strong); font-size: 12px; font-weight: 750; }
.field > span:first-child:empty { display: none; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: -10px; color: var(--muted-strong); font-size: 12px; font-weight: 750; }
.field-row a { font-weight: 650; }
.input-shell { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 0 15px; border: 1px solid var(--control-border); border-radius: 13px; color: var(--accent); background: var(--control); box-shadow: var(--shadow-inset); transition: border-color .18s, box-shadow .18s; }
.input-shell:has(:focus-visible), .search-field:has(:focus-visible) { border-color: var(--focus); box-shadow: var(--shadow-inset), 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.input-shell input, .input-shell select { width: 100%; min-width: 0; padding: 14px 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.password-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 8px; color: var(--accent); background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.password-toggle > span { display: inline-flex; }
.password-toggle .password-hide-icon, .password-toggle[data-password-visible="true"] .password-show-icon { display: none; }
.password-toggle[data-password-visible="true"] .password-hide-icon { display: inline-flex; }
.password-toggle:hover:not(:disabled) { background: var(--accent-soft); }
.password-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.password-toggle:disabled { opacity: .5; cursor: default; }
.input-shell input::placeholder, .search-field input::placeholder { color: var(--placeholder); }
.input-shell.readonly { opacity: .72; }
.input-shell select { appearance: none; cursor: pointer; }
.field-note { margin: -7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.button { min-height: 50px; border: 1px solid transparent; border-radius: 13px; padding: 0 18px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; font-size: 13px; transition: transform .15s, filter .15s, box-shadow .15s; }
.button:hover:not(:disabled):not([aria-busy="true"]) { transform: translateY(-1px); color: inherit; filter: brightness(1.06); }
.button:active:not(:disabled), .icon-button:active, .table-button:active { transform: none; box-shadow: var(--shadow-inset); }
:where(a, button, input, select, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.input-shell :is(input, select):focus-visible, .search-field input:focus-visible { outline: 0; }
.button:disabled:not([aria-busy="true"]), .table-button:disabled:not([aria-busy="true"]) { opacity: .52; cursor: not-allowed; transform: none; }
.button[aria-busy="true"], .table-button[aria-busy="true"] { opacity: .78; cursor: progress; transform: none; filter: none; }
.button[aria-busy="true"]::after, .table-button[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; flex: 0 0 auto; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: busy-spin 700ms linear infinite; }
@keyframes busy-spin { to { transform: rotate(1turn); } }
.button-primary { margin-top: 4px; color: var(--on-accent); background: linear-gradient(115deg, var(--accent-fill-strong), var(--accent-fill)); box-shadow: var(--shadow-soft); }
.button-primary .icon { margin-left: auto; }
.button-secondary { width: 100%; color: var(--text); border-color: var(--line); background: linear-gradient(145deg, #10232d, #091720); box-shadow: var(--shadow-soft); }
.button-danger { color: #ffd9d9; border-color: rgba(239, 123, 123, .25); background: rgba(117, 43, 50, .35); box-shadow: var(--shadow-soft); }
.button-small { width: auto; min-height: 39px; padding: 0 14px; white-space: nowrap; }
.divider { margin: 24px 0; display: flex; align-items: center; gap: 12px; color: #59717c; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; text-align: center; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { margin: 26px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch a { font-weight: 800; }
.auth-footer { position: relative; z-index: 1; min-height: 58px; display: grid; place-items: center; padding: 14px 20px; color: #57707b; font-size: 11px; text-align: center; }
.auth-footer strong { color: var(--muted); }
.large-state { width: 54px; height: 54px; margin: -12px auto 20px; display: grid; place-items: center; border-radius: 50%; box-shadow: var(--shadow-soft); }
.large-state .icon { width: 25px; height: 25px; }
.state-warn { color: var(--amber); background: rgba(241, 180, 90, .09); }
.state-good { color: var(--good); background: rgba(110, 208, 160, .09); }
.code-input input { font-variant-numeric: tabular-nums; letter-spacing: .32em; font-size: 18px; font-weight: 750; }

.dashboard-page { background: var(--bg); }
.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--bg)); box-shadow: var(--shadow-soft); z-index: 5; }
.sidebar-brand { margin: 0 8px 42px; }
.side-nav { display: grid; gap: 8px; }
.side-nav a, .sidebar-action, .operator-link { min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; text-align: left; }
.side-nav a:hover, .sidebar-action:hover, .operator-link:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.side-nav a:first-child { color: var(--accent); border-color: var(--accent); background: var(--control); box-shadow: var(--shadow-inset); }
body:has(.dashboard-view:target) .side-nav a:first-child { color: var(--muted); border-color: transparent; background: transparent; box-shadow: none; }
body:has(#overview:target) .side-nav a[href="#overview"], body:has(#profile:target) .side-nav a[href="#profile"], body:has(#security:target) .side-nav a[href="#security"], body:has(#access:target) .side-nav a[href="#access"], body:has(#applications:target) .side-nav a[href="#applications"], body:has(#memberships:target) .side-nav a[href="#memberships"], body:has(#identities:target) .side-nav a[href="#identities"] { color: var(--accent); border-color: var(--accent); background: var(--control); box-shadow: var(--shadow-inset); }
.side-nav a b { min-width: 21px; height: 21px; margin-left: auto; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; color: #1c1103; background: var(--amber); font-size: 10px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.operator-link { color: var(--accent); border-color: var(--line); }
.operator-link .icon:last-child { width: 16px; margin-left: auto; }
.sidebar-action { width: 100%; cursor: pointer; }
.sidebar-action .icon { transform: rotate(180deg); }
.dashboard-main { width: 100%; min-width: 0; max-width: 1480px; margin: 0 auto; padding: 31px clamp(28px, 4.4vw, 72px) 72px; }
.dashboard-header { min-height: 67px; margin-bottom: 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dashboard-header h1 { margin: 0; font-size: 27px; }
.header-actions { display: flex; align-items: center; gap: 13px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--accent); background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow-soft); font-weight: 800; }
.dashboard-message { position: fixed; top: 25px; left: 50%; z-index: 20; min-height: 0; max-width: min(440px, calc(100vw - 40px)); margin: 0; padding: 11px 16px; border: 1px solid rgba(239, 123, 123, .24); border-radius: 11px; color: #ffd1d1; background: rgba(82, 29, 35, .96); box-shadow: var(--shadow-raised); opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: opacity .2s, transform .2s; }
.dashboard-message.visible { opacity: 1; transform: translate(-50%, 0); }
.dashboard-message.success { color: #c8f5dc; border-color: rgba(110, 208, 160, .25); background: rgba(18, 71, 49, .96); }
.dashboard-view { display: none; animation: view-in .22s ease; }
.dashboard-view.default-view { display: block; }
.dashboard-view:target { display: block; }
body:has(.dashboard-view:target) .dashboard-view.default-view:not(:target) { display: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.panel, .stat-card, .table-panel, .application-card { border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow-soft); }
.panel { border-radius: 19px; padding: 24px; }
.welcome-panel { min-height: 205px; padding: clamp(26px, 4vw, 45px); display: flex; align-items: center; justify-content: space-between; gap: 35px; overflow: hidden; position: relative; }
.welcome-panel::after { content: ""; position: absolute; width: 320px; height: 320px; right: -125px; top: -160px; border: 1px solid rgba(105, 167, 255, .12); border-radius: 50%; box-shadow: inset 0 0 55px rgba(105, 167, 255, .04); }
.welcome-panel h2 { max-width: 640px; margin-bottom: 12px; font-size: clamp(28px, 4vw, 44px); }
.welcome-panel p:not(.eyebrow) { max-width: 590px; margin: 0; color: var(--muted); line-height: 1.6; }
.security-score { min-width: 150px; padding: 23px 19px; display: grid; justify-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 18px; color: var(--good); background: var(--control); box-shadow: var(--shadow-inset); position: relative; z-index: 1; }
.security-score .icon { width: 30px; height: 30px; margin-bottom: 7px; }
.security-score strong { color: var(--text); }
.security-score small { color: var(--muted); }
.stat-grid { margin: 24px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat-card { min-height: 112px; padding: 19px; border-radius: 17px; display: flex; align-items: center; gap: 13px; }
.stat-icon, .panel-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: var(--accent-soft); box-shadow: none; flex: 0 0 auto; }
.stat-card > div { display: grid; gap: 3px; min-width: 0; }
.stat-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.stat-card strong { font-size: 20px; }
.stat-card > a, .stat-card > .status-badge { margin-left: auto; }
.status-badge { min-height: 27px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.status-badge .icon { width: 13px; height: 13px; }
.status-good { color: var(--good); background: rgba(110, 208, 160, .1); }
.status-warn { color: var(--amber); background: rgba(241, 180, 90, .1); }
.next-step { display: flex; align-items: center; gap: 17px; }
.next-step > span { color: var(--accent); }
.next-step h3 { margin: 0 0 5px; }
.next-step p { margin: 0; color: var(--muted); font-size: 13px; }
.next-step .button { margin-left: auto; }
.section-heading { min-height: 77px; margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.section-heading h2 { margin-bottom: 7px; font-size: 29px; }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 22px; }
.form-panel h3 { margin-bottom: 22px; }
.dashboard-form .button { justify-self: start; min-width: 170px; }
.info-panel { min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
.info-panel h3 { margin: 18px 0 9px; }
.info-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.panel-title { margin-bottom: 22px; display: flex; align-items: flex-start; gap: 14px; }
.panel-title h3 { margin: 3px 0 5px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.compact-form { margin-top: 21px; padding-top: 21px; border-top: 1px solid var(--line); }
.secret-output { margin-top: 20px; padding: 17px; border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-radius: 13px; color: var(--muted-strong); background: var(--control); box-shadow: var(--shadow-inset); }
.secret-output summary { margin-bottom: 12px; color: var(--amber); cursor: pointer; font-weight: 800; }
.secret-output strong { display: block; margin: 0 0 8px; color: var(--amber); font-size: 12px; }
.secret-output p { margin: 0 0 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.secret-output code, .secret-output pre { max-height: 160px; margin: 8px 0; padding: 10px; display: block; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 9px; color: #dbe9ed; background: rgba(0, 0, 0, .28); font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-button { margin: 2px 0 17px; padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.secret-value { transition: filter .18s, opacity .18s; }
.secret-value.concealed { filter: blur(7px); opacity: .48; user-select: none; }
.secret-actions { display: flex; gap: 18px; }
.configured-method { margin-bottom: 18px; padding: 17px; border: 1px solid rgba(110, 208, 160, .18); border-radius: 13px; background: rgba(110, 208, 160, .05); }
.configured-method p { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.check-field { display: flex; align-items: center; gap: 10px; color: var(--muted-strong); font-size: 12px; cursor: pointer; }
.check-field input { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.danger-panel { border-color: rgba(239, 123, 123, .14); }
.button-stack { display: flex; gap: 12px; }
.button-stack .button { width: auto; flex: 1; }
.card-list { display: grid; gap: 11px; }
.membership-card, .preview-card { padding: 17px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: none; }
.membership-card > span:first-child, .preview-card > span:first-child { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-weight: 850; }
.membership-card div, .preview-card div { min-width: 0; }
.membership-card strong, .preview-card strong { display: block; }
.membership-card small, .preview-card small { color: var(--muted); }
.membership-card .status-badge { margin-left: auto; }
.loading-state, .empty-state { min-height: 130px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.admin-stats { margin-top: 0; }
.admin-stats .stat-card { min-height: 125px; }
.admin-stats .stat-card strong { font-size: 28px; }
.skeleton { position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 18px; border-radius: 9px; background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.065), rgba(255,255,255,.02)); background-size: 200% 100%; animation: shine 1.3s infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 22px; }
.panel-heading { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.panel-heading h3 { margin: 0; }
.panel-heading > a { font-size: 12px; font-weight: 750; }
.activity-list { display: grid; gap: 4px; }
.activity-item { min-height: 51px; padding: 8px 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border: 0; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px rgba(110, 208, 160, .4); }
.activity-item > div { display: grid; gap: 3px; }
.activity-item strong { font-size: 12px; }
.activity-item small { color: var(--muted); font-size: 10px; }
.preview-card { padding: 13px; }
.preview-card .button { min-height: 32px; padding: 0 10px; margin-left: auto; font-size: 10px; }
.application-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; }
.application-card { min-height: 215px; padding: 23px; border-radius: 18px; }
.application-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-monogram { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: var(--accent-soft); box-shadow: none; font-weight: 900; font-size: 17px; }
.application-card h3 { margin: 19px 0 4px; }
.application-card > small { color: var(--muted); font-family: ui-monospace, monospace; }
.app-counts { margin-top: 23px; padding-top: 17px; display: flex; gap: 28px; border-top: 1px solid var(--line); }
.app-counts span { display: grid; gap: 3px; }
.app-counts strong { font-size: 18px; }
.app-counts small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.registration-note { margin-top: 22px; display: flex; align-items: flex-start; gap: 15px; }
.registration-note > span { color: var(--amber); }
.registration-note h3 { margin: 0 0 4px; font-size: 14px; }
.registration-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.registration-note code { color: var(--muted-strong); }
.select-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.select-field select { min-height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--control-border); border-radius: 11px; color: var(--text); background: var(--control); }
.search-field { min-width: 260px; min-height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--control-border); border-radius: 12px; color: var(--muted); background: var(--control); box-shadow: var(--shadow-inset); }
.search-form, .filter-form { display: flex; align-items: center; gap: 10px; }
.search-field .icon { width: 17px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.table-panel { overflow: hidden; border-radius: 18px; box-shadow: none; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 17px; color: var(--muted); background: rgba(0, 0, 0, .13); font-size: 9px; text-align: left; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 16px 17px; border-top: 1px solid var(--line); color: var(--muted-strong); font-size: 12px; vertical-align: middle; }
.data-table strong { color: var(--text); }
.data-table small { display: block; margin-top: 3px; color: var(--muted); }
.table-identity { display: flex; align-items: center; gap: 11px; }
.mini-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-weight: 850; }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; }
.table-button { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-strong); background: var(--surface-soft); cursor: pointer; font-size: 10px; font-weight: 800; }
.table-button:hover { color: var(--text); border-color: var(--line-strong); }
.table-button.danger { color: var(--danger); }
.security-flags { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-tag { padding: 4px 7px; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 9px; white-space: nowrap; }
.mini-tag.on { color: var(--good); background: rgba(110, 208, 160, .08); }

.modal { width: min(590px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 28px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 22px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-raised); }
.modal::backdrop { background: rgba(1, 7, 10, .78); backdrop-filter: blur(6px); }
.modal-head { display: flex; justify-content: space-between; gap: 20px; }
.modal h2 { margin-bottom: 6px; }
.modal > p { margin: 0 0 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; font-size: 22px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.inline-notice { margin: 0 0 16px; color: var(--danger); font-size: 12px; }
.inline-notice.success { color: var(--good); }
.registration-panel { margin-bottom: 22px; }
.registration-panel > summary { width: fit-content; list-style: none; }
.registration-panel > summary::-webkit-details-marker { display: none; }
.registration-panel[open] > summary { margin-bottom: 22px; box-shadow: var(--shadow-inset); }
.account-action { position: relative; }
.account-action > summary { display: inline-flex; align-items: center; list-style: none; }
.account-action > summary::-webkit-details-marker { display: none; }
.account-action[open] form { min-width: 260px; margin-top: 10px; padding: 14px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-raised); }
.account-action form p { margin: 0; color: var(--muted-strong); line-height: 1.5; }
.standalone-panel { width: min(680px, calc(100% - 32px)); margin: 8vh auto; }
.standalone-panel > .button { margin: 20px 10px 0 0; }
.button-small, .preview-card .button, .text-button, .check-field { min-height: 44px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal .secret-output { margin-bottom: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .button { width: auto; min-width: 120px; }
.confirm-modal { width: min(480px, calc(100% - 32px)); }

@media (max-width: 1160px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .application-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .sidebar-brand { margin-inline: auto; }
  .sidebar-brand > span:last-child, .side-nav a span, .sidebar-foot a span, .sidebar-action span, .side-nav a b { display: none; }
  .side-nav a, .sidebar-action, .operator-link { justify-content: center; padding: 0; }
  .operator-link .icon:last-child { display: none; }
  .overview-grid, .content-grid { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .data-table { min-width: 760px; }
  .table-panel { overflow-x: auto; }
}
@media (max-width: 650px) {
  .auth-header { width: calc(100% - 28px); min-height: 76px; }
  .auth-header .service-state { display: none; }
  .auth-stage { padding: 25px 14px 50px; place-items: start center; }
  .auth-card { padding: 38px 23px 32px; border-radius: 23px; }
  .auth-card-head > .brand-mark { width: 62px; height: 62px; margin-bottom: 21px; }
  .dashboard-shell { display: block; padding-bottom: 78px; }
  .sidebar { position: fixed; top: auto; bottom: 0; width: 100%; height: calc(70px + env(safe-area-inset-bottom)); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); display: block; border-top: 1px solid var(--line); border-right: 0; background: var(--surface); }
  .sidebar-brand, .sidebar-foot { display: none; }
  .side-nav { height: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .side-nav a { min-height: 52px; }
  .side-nav a span { display: block; font-size: 9px; }
  .side-nav a { flex-direction: column; gap: 3px; }
  .side-nav a .icon { width: 18px; height: 18px; }
  .dashboard-main { padding: 22px 15px 42px; }
  .dashboard-header { margin-bottom: 22px; }
  .dashboard-header .service-state { display: none; }
  .dashboard-header h1 { font-size: 23px; }
  .welcome-panel { align-items: flex-start; flex-direction: column; }
  .security-score { width: 100%; grid-template-columns: auto auto; justify-content: center; }
  .security-score .icon { margin: 0; }
  .security-score small { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { min-height: 91px; }
  .next-step { align-items: flex-start; flex-wrap: wrap; }
  .next-step .button { width: 100%; margin-left: 0; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading .button, .search-field { width: 100%; }
  .search-form, .filter-form { width: 100%; align-items: stretch; flex-direction: column; }
  .filter-form .select-field { justify-content: space-between; }
  .application-grid { grid-template-columns: 1fr; }
  .button-stack { flex-direction: column; }
  .form-columns { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}
@media (max-width: 480px) {
  .ambient, .welcome-panel::after { display: none; }
  .auth-stage { padding: 20px 0 32px; }
  .auth-card { width: 100%; padding: 28px 16px 32px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .dashboard-main { padding-inline: 12px; }
  .panel { padding: 18px 16px; }
  .membership-card, .preview-card { align-items: flex-start; flex-wrap: wrap; }
  .membership-card .status-badge { margin-left: 57px; }
}
@media (forced-colors: active) {
  .ambient, .welcome-panel::after, .skeleton::after { display: none; }
  .auth-card, .sidebar, .panel, .stat-card, .table-panel, .application-card, .membership-card, .preview-card, .brand-mark, .avatar { color: CanvasText; background: Canvas; border-color: CanvasText; box-shadow: none; }
  .input-shell, .search-field, .select-field select, .secret-output { color: FieldText; background: Field; border: 1px solid FieldText; box-shadow: none; }
  .button, .table-button, .icon-button, .sidebar-action, .operator-link { color: ButtonText; background: ButtonFace; border: 1px solid ButtonText; box-shadow: none; filter: none; }
  :where(a, button, input, select, summary):focus-visible { outline: 3px solid Highlight; outline-offset: 3px; }
  .status-badge { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.application-brand { display:flex; gap:1rem; align-items:center; padding:0 0 1.5rem; margin-bottom:1.5rem; border-bottom:1px solid var(--line); }
.application-brand img { flex:none; }
.application-brand strong { font-size:1.5rem; }
.application-brand p { color:var(--muted); margin:.35rem 0 0; }
.theme-pocketoffice { --accent:#9c4618; --accent-strong:#80350e; --accent-hover:#6a2c0b; --accent-fill:#e98339; --accent-fill-strong:#fcdbac; --accent-soft:rgba(233,131,57,.12); --focus:#9c4618; }
.theme-pocketoffice .auth-card-head > .brand-mark { display:none; }
@media (prefers-color-scheme: dark) {
 .theme-pocketoffice { --bg:#02080d; --bg-deep:#02080d; --surface:#061119; --surface-raised:#0a1b24; --text:#fff3e3; --muted:#c8b9a8; --accent:#f5c190; --accent-strong:#fcdbac; --accent-hover:#ffe6c7; --focus:#fcdbac; }
}
@media (max-width:360px) { .application-brand img { width:52px; height:52px; } .application-brand strong { font-size:1.2rem; } }
