:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --surface-3: #f0f0f3;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #06c;
  --accent-hover: #0077ed;
  --accent-soft: #eaf3ff;
  --danger: #d70015;
  --success: #248a3d;
  --warning: #a35b00;
  --shadow: 0 8px 28px rgba(0, 0, 0, .06);
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1c1c1e;
  --surface-2: #242427;
  --surface-3: #2c2c2f;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: #3a3a3e;
  --accent: #2997ff;
  --accent-hover: #5aaaff;
  --accent-soft: #142d47;
  --danger: #ff453a;
  --success: #30d158;
  --warning: #ff9f0a;
  --shadow: 0 8px 28px rgba(0, 0, 0, .22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111113;
    --surface: #1c1c1e;
    --surface-2: #242427;
    --surface-3: #2c2c2f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #3a3a3e;
    --accent: #2997ff;
    --accent-hover: #5aaaff;
    --accent-soft: #142d47;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
    --shadow: 0 8px 28px rgba(0, 0, 0, .22);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 16px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 30px; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: var(--text); color: var(--surface); font-size: 18px; font-weight: 700; letter-spacing: -.04em; }
.brand-title { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 10px; }
.nav-label { padding: 8px 12px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:active { transform: scale(.99); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { width: 17px; height: 17px; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; padding: 13px 10px 0; border-top: 1px solid var(--line); }
.sidebar-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.main-area { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(18px, 4vw, 48px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); }
.topbar-title { font-size: 13px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .text-button { border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; transition: background .16s ease, color .16s ease; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; font-size: 17px; }
.text-button { padding: 9px 12px; font-size: 12px; }
.icon-button:hover, .text-button:hover { background: var(--surface-3); color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 5px; padding-left: 15px; border-left: 1px solid var(--line); }
.avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 650; }
.user-chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.user-chip-role { margin-top: 2px; color: var(--muted); font-size: 10px; }
.mobile-nav-toggle { display: none; }
.page { width: min(100%, 1320px); margin: 0 auto; padding: clamp(24px, 4vw, 48px); animation: appear .25s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .02em; }
h1 { margin: 5px 0 0; font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.04em; line-height: 1.12; }
h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 14px; font-weight: 630; }
.page-description { max-width: 680px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 27px 0 13px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card { min-height: 132px; padding: 20px; transition: transform .18s ease, box-shadow .18s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, .08); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 17px; font-size: 32px; font-weight: 640; letter-spacing: -.055em; }
.metric-foot { margin-top: 3px; color: var(--muted); font-size: 11px; }
.two-column { grid-template-columns: minmax(0, 1.55fr) minmax(260px, .8fr); }
.list-card { overflow: hidden; }
.list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.list-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.application-list { display: grid; }
.application-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 74px; padding: 13px 22px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .16s ease; }
.application-row:last-child { border-bottom: 0; }
.application-row:hover { background: var(--surface-2); }
.app-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.app-row-meta { margin-top: 5px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 6px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-pending_review { background: #fff3d6; color: #885300; }
.status-needs_info { background: #fff0e6; color: #a34200; }
.status-approved, .status-completed { background: #e6f7ec; color: #176b32; }
.status-processing { background: #eaf3ff; color: #005ab5; }
.status-rejected { background: #ffeded; color: #bd2026; }
.status-cancelled { opacity: .7; }
:root[data-theme="dark"] .status-pending_review { background: #413516; color: #ffd166; }
:root[data-theme="dark"] .status-needs_info { background: #472916; color: #ffb26b; }
:root[data-theme="dark"] .status-approved, :root[data-theme="dark"] .status-completed { background: #173721; color: #83df9a; }
:root[data-theme="dark"] .status-processing { background: #132d47; color: #7dc1ff; }
:root[data-theme="dark"] .status-rejected { background: #421d20; color: #ff8d88; }
.empty-state { padding: 46px 24px; text-align: center; }
.empty-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 13px; border-radius: 16px; background: var(--surface-3); color: var(--muted); font-size: 22px; }
.empty-state p { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
.quick-card { padding: 22px; }
.quick-card p { color: var(--muted); line-height: 1.6; font-size: 12px; }
.quick-card .button { width: 100%; margin-top: 5px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 620; cursor: pointer; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.button:hover { background: var(--accent-hover); box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button.secondary:hover { background: var(--surface-2); box-shadow: none; }
.button.ghost { background: transparent; color: var(--accent); }
.button.ghost:hover { background: var(--accent-soft); box-shadow: none; }
.button.danger { background: var(--danger); }
.button.small { min-height: 32px; padding: 0 12px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 15px; }
.filters .input, .filters .select { max-width: 240px; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--surface); color: var(--text); transition: border-color .15s ease, box-shadow .15s ease; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.field-hint { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.required-mark { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { padding: 24px; margin-bottom: 14px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.section-number { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 650; }
.form-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.inline-check { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 12px; line-height: 1.5; cursor: pointer; }
.inline-check input { margin-top: 2px; accent-color: var(--accent); }
.callout { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 11px; line-height: 1.6; }
.callout.warning { border-color: color-mix(in srgb, var(--warning) 22%, var(--line)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.capability-list { display: grid; gap: 9px; }
.capability-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.capability-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 180px); align-items: center; gap: 12px; }
.capability-name { font-size: 12px; font-weight: 620; }
.capability-note { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.capability-details { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.details-panel { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.details-panel:last-child { border-bottom: 0; }
.details-panel h3 { margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.detail-item { min-width: 0; }
.detail-item dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.detail-item dd { margin: 0; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 13px; }
.timeline-item { position: relative; padding-left: 19px; }
.timeline-item::before { content: ""; position: absolute; left: 2px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline-item::after { content: ""; position: absolute; left: 5px; top: 16px; bottom: -11px; width: 1px; background: var(--line); }
.timeline-item:last-child::after { display: none; }
.timeline-title { font-size: 12px; font-weight: 600; }
.timeline-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.timeline-note { margin-top: 6px; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-list, .comment-list, .notification-list { display: grid; gap: 8px; }
.attachment-row, .comment-card, .notification-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attachment-name { overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; }
.attachment-meta, .comment-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.comment-body { margin: 9px 0 0; line-height: 1.55; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notification-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; cursor: pointer; }
.notification-card.unread { border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); background: var(--accent-soft); }
.notification-title { font-size: 12px; font-weight: 620; }
.notification-body { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.notification-time { margin-top: 5px; color: var(--muted); font-size: 10px; }
.member-table-wrap { overflow: auto; }
.member-table { width: 100%; border-collapse: collapse; min-width: 660px; }
.member-table th, .member-table td { padding: 13px 17px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.member-table th { color: var(--muted); font-weight: 600; }
.member-table td { vertical-align: middle; }
.member-name { font-size: 12px; font-weight: 620; }
.member-username { margin-top: 4px; color: var(--muted); font-size: 10px; }
.role-tag { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--surface-3); font-size: 10px; }
.role-admin { color: var(--accent); background: var(--accent-soft); }
.account-disabled { color: var(--danger); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.4); animation: fade .16s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(100%, 520px); max-height: min(86vh, 760px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 20px 80px rgba(0,0,0,.2); animation: appear .2s ease both; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.modal-header p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-form { display: grid; gap: 15px; }
.credential-box { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.credential-value { margin-top: 7px; padding: 10px; border-radius: 8px; background: var(--surface-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.form-errors { display: none; padding: 11px 13px; border-radius: 11px; background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); font-size: 11px; line-height: 1.55; }
.form-errors.visible { display: block; }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.loading { padding: 50px 24px; color: var(--muted); text-align: center; }
.skeleton { height: 14px; border-radius: 7px; background: var(--surface-3); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .48; } }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: var(--surface); }
.login-aside { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(32px, 7vw, 86px); background: var(--bg); }
.login-aside .brand { padding: 0; }
.login-copy { max-width: 530px; margin: auto 0; padding: 52px 0; }
.login-copy h1 { max-width: 430px; font-size: clamp(38px, 5vw, 58px); line-height: 1.04; }
.login-copy p { max-width: 430px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.login-aside-foot { color: var(--muted); font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(100%, 390px); }
.login-card h2 { margin-bottom: 8px; font-size: 25px; letter-spacing: -.035em; }
.login-card .muted { margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-form { display: grid; gap: 16px; }
.login-form .button { width: 100%; margin-top: 4px; min-height: 44px; }
.login-brand-mobile { display: none; }
.turnstile-slot { min-height: 0; }
.turnstile-slot:not(:empty) { min-height: 66px; }
.login-legal { margin-top: 23px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.setup-card { width: min(100%, 440px); }
.setup-card .field-hint { margin-bottom: 3px; }
.mobile-overlay { display: none; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; animation: appear .2s ease both; }
.toast.error { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.toast.success { border-color: color-mix(in srgb, var(--success) 30%, var(--line)); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0 !important; }
.mt-14 { margin-top: 14px; }
.hidden { display: none !important; }
.modal-open { overflow: hidden; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upload-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upload-control input[type="file"] { max-width: 100%; color: var(--muted); font-size: 11px; }
.mobile-only { display: none; }

.identity-gate { display: block; }
.identity-gate .sidebar, .identity-gate .mobile-nav-toggle { display: none; }
.identity-gate .main-area { min-height: 100vh; }
.identity-page { width: min(100%, 920px); margin: 0 auto; display: grid; gap: 16px; }
.identity-page .page-heading { margin-bottom: 0; }
.identity-notice-card, .identity-upload-card { padding: clamp(18px, 3vw, 28px); }
.identity-notice-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.identity-notice-heading h2, .identity-upload-card h2 { margin: 4px 0 10px; font-size: 20px; letter-spacing: -.025em; }
.identity-notice { max-height: min(42vh, 440px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.75; }
.identity-retention-callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 13px 15px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.identity-retention-callout > span { font-size: 18px; }
.identity-retention-callout strong { font-size: 12px; }
.identity-retention-callout p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.identity-upload-card > .muted { max-width: 690px; font-size: 12px; line-height: 1.6; }
.identity-form { display: grid; gap: 17px; margin-top: 18px; }
.identity-consents { display: grid; gap: 9px; }
.identity-consent { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); cursor: pointer; }
.identity-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.identity-consent strong, .identity-consent small { display: block; }
.identity-consent strong { font-size: 12px; line-height: 1.5; }
.identity-consent small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.identity-file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.identity-file-field { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.identity-file-field input[type="file"] { display: block; width: 100%; padding: 9px 0; color: var(--muted); font-size: 11px; }
.identity-form > .button { min-height: 46px; }
.identity-actions { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 12px; }
.identity-settings-card { margin-bottom: 12px; padding: 17px 20px; }
.identity-settings-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) auto; gap: 18px; align-items: center; }
.identity-settings-form strong { font-size: 12px; }
.identity-settings-form .field-hint { max-width: 620px; margin: 5px 0 0; line-height: 1.5; }
.identity-date-field { display: grid; gap: 7px; }
.identity-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--surface-3); font-size: 10px; white-space: nowrap; }
.identity-submitted, .identity-verified { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); }
.identity-rejected, .identity-expired { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.identity-admin-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 17px; }
.identity-admin-meta > div { display: grid; gap: 4px; padding: 11px; border-radius: 10px; background: var(--surface-2); }
.identity-admin-meta span, .identity-admin-images figcaption { color: var(--muted); font-size: 10px; }
.identity-admin-meta strong { font-size: 11px; overflow-wrap: anywhere; }
.identity-admin-images { display: grid; gap: 12px; }
.identity-admin-images figure { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.identity-admin-images img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.identity-admin-images figcaption { padding-top: 8px; }
.identity-empty-photo { display: grid; min-height: 90px; place-items: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; }
.identity-rights-section { margin-top: 20px; }
.identity-rights-section .section-heading { margin: 0 0 12px; }
.identity-rights-section h2 { margin: 4px 0; font-size: 18px; }
.identity-request-list { display: grid; gap: 9px; }
.identity-request-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.identity-request-main { min-width: 0; }
.identity-request-main > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.identity-request-main strong { font-size: 12px; }
.identity-request-main p { margin: 7px 0 5px; color: var(--text); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.identity-request-main small { color: var(--muted); font-size: 10px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr minmax(380px, .9fr); }
  .login-aside { padding: 44px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; width: 270px; height: 100dvh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay.open { position: fixed; inset: 0; z-index: 4; display: block; background: rgba(0,0,0,.28); }
  .mobile-nav-toggle { display: grid; }
  .topbar { min-height: 62px; padding: 0 15px; }
  .topbar-title { display: none; }
  .user-chip { margin-left: 0; padding-left: 8px; border-left: 0; }
  .user-chip-name { max-width: 100px; }
  .top-actions { gap: 1px; }
  .text-button { padding: 8px; }
  .page { padding: 23px 15px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 105px; padding: 15px; }
  .metric-value { margin-top: 12px; font-size: 28px; }
  .application-row { padding: 13px 14px; grid-template-columns: minmax(0,1fr); gap: 9px; }
  .application-row .status-badge { justify-self: start; }
  .list-header { padding: 16px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .form-section { padding: 18px 15px; border-radius: 18px; }
  .capability-top { grid-template-columns: minmax(0, 1fr) 125px; gap: 9px; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .login-page { display: block; min-height: 100vh; }
  .login-aside { display: none; }
  .login-panel { display: block; min-height: 100vh; padding: 0; }
  .login-brand-mobile { display: flex; padding: 34px 24px 15px; }
  .login-card { width: min(100%, 430px); margin: 0 auto; padding: 32px 24px 40px; }
  .login-card h2 { font-size: 23px; }
  .login-legal { margin-top: 21px; }
  .mobile-only { display: inline-flex; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .identity-file-grid, .identity-admin-meta { grid-template-columns: 1fr; }
  .identity-settings-form { grid-template-columns: 1fr; gap: 12px; }
  .identity-settings-form .button { width: 100%; }
  .identity-request-card { align-items: stretch; flex-direction: column; }
}
@media (max-width: 420px) {
  .user-chip-name { max-width: 72px; }
  .top-actions .text-button { font-size: 10px; }
  .metric-card { padding: 13px; }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 25px; }
  .capability-top { grid-template-columns: 1fr; }
  .capability-top .select { min-height: 38px; }
  .button-row { align-items: stretch; }
  .button-row .button { flex: 1; }
}

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