:root {
  color-scheme: dark;
  --bg: #07100c;
  --surface: #0e1a15;
  --surface-2: #14241b;
  --line: #2a4336;
  --text: #f2f6f3;
  --muted: #a9b5ae;
  --accent: #78d23b;
  --accent-strong: #2f7d18;
  --accent-soft: rgba(120, 210, 59, .1);
  --info: #4da3ff;
  --warning: #f2b84b;
  --danger: #ef6a6a;
  --shadow: 0 28px 80px rgba(0, 0, 0, .32);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background:
  radial-gradient(circle at 12% 3%, rgba(120, 210, 59, .09), transparent 31%),
  radial-gradient(circle at 92% 87%, rgba(47, 125, 24, .12), transparent 35%),
  linear-gradient(180deg, #0a1510 0%, var(--bg) 46%); }
::selection { color: #041a11; background: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(77, 163, 255, .5); outline-offset: 2px; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(110px); opacity: .13; pointer-events: none; }
.ambient-one { width: 360px; height: 360px; background: var(--accent); top: -160px; left: -100px; }
.ambient-two { width: 420px; height: 420px; background: #24755a; right: -180px; bottom: -220px; }

.access-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.access-card { width: min(460px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: rgba(12, 29, 21, .94); box-shadow: var(--shadow); }
.access-logo { display: block; width: 96px; height: 96px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 22px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px 7px 17px 7px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #052116; font-weight: 900; letter-spacing: -.06em; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px 6px 13px 6px; }
.eyebrow { margin: 18px 0 5px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.035em; }
h2 { margin-bottom: 8px; font-size: 30px; letter-spacing: -.03em; }
h3 { margin-bottom: 0; font-size: 20px; }
.muted { color: var(--muted); }
label { display: grid; gap: 8px; color: #cfe0d7; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 13px; color: var(--text); background: #07160f; border: 1px solid #315343; border-radius: 10px; outline: none; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(119, 223, 189, .12); }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.primary-button, .secondary-button, .icon-button, .text-button, .danger-button { border: 0; border-radius: 10px; min-height: 42px; padding: 10px 16px; font-weight: 750; }
.primary-button { background: linear-gradient(135deg, #8cdd50, var(--accent)); color: #081006; box-shadow: 0 8px 24px rgba(120, 210, 59, .12); }
.primary-button:hover { background: linear-gradient(135deg, #9be366, #82d648); transform: translateY(-1px); }
.secondary-button, .icon-button { background: rgba(20, 42, 32, .78); color: var(--text); border: 1px solid #315343; }
.secondary-button:hover, .icon-button:hover { border-color: rgba(119, 223, 189, .55); background: #193326; }
.text-button { background: transparent; color: var(--accent); }
.danger-button { background: #7f2928; color: #fff4f2; border: 1px solid #bb5651; }
.danger-button:hover { background: #993330; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .55; cursor: wait; }
.access-card form { display: grid; gap: 14px; margin-top: 28px; }
.security-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.form-error { min-height: 18px; margin: -3px 0 0; color: var(--danger); font-size: 13px; }

.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid rgba(72, 119, 94, .42); background: rgba(6, 17, 12, .82); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(22px); box-shadow: 0 10px 35px rgba(0, 0, 0, .14); }
.brand-row, .top-actions, .intro-row, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand-row { justify-content: flex-start; }
.brand-row .eyebrow { margin: 0 0 2px; }
.brand-row h1 { margin: 0; font-size: 20px; }
.status-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; color: #cfe0d7; font-size: 12px; white-space: nowrap; background: rgba(85, 215, 155, .06); border: 1px solid rgba(85, 215, 155, .15); border-radius: 999px; }
.status-pill .status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #55d79b; box-shadow: 0 0 0 4px rgba(85, 215, 155, .12); }
.status-pill.offline { color: #ffd2cf; background: rgba(239, 106, 106, .08); border-color: rgba(239, 106, 106, .22); }
.status-pill.offline .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(239, 106, 106, .12); }
.current-admin { min-width: 0; max-width: 260px; overflow: hidden; color: var(--muted); font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 76px; }
.intro-row { align-items: flex-end; margin-bottom: 22px; padding: 24px 26px; border: 1px solid rgba(55, 96, 76, .48); border-radius: 20px; background: linear-gradient(125deg, rgba(17, 46, 32, .74), rgba(8, 25, 17, .58)); box-shadow: 0 18px 54px rgba(0, 0, 0, .13); }
.intro-row .eyebrow { margin-top: 0; }
.intro-row p { margin-bottom: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel { border: 1px solid rgba(52, 91, 72, .72); background: linear-gradient(145deg, rgba(17, 39, 29, .94), rgba(9, 25, 17, .94)); box-shadow: 0 18px 50px rgba(0, 0, 0, .15); }
.metric-card { position: relative; overflow: hidden; padding: 20px; border-radius: 17px; text-align: left; color: var(--text); }
.metric-card::after { content: ""; position: absolute; width: 72px; height: 72px; right: -30px; bottom: -38px; border-radius: 50%; background: var(--accent-soft); }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 7px; font-size: 30px; }
.metric-card small { display: block; min-height: 15px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.metric-action { cursor: pointer; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.metric-action:hover, .metric-action:focus-visible { border-color: var(--accent); background: linear-gradient(145deg, rgba(25, 57, 42, .96), rgba(12, 34, 23, .96)); transform: translateY(-2px); outline: none; }
.panel { border-radius: 20px; padding: 24px; margin-top: 18px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading > div:first-child { padding-left: 13px; border-left: 3px solid var(--accent); }
.panel-heading .eyebrow { margin-top: 0; }
.panel-heading p { margin-bottom: 0; }
.activation-form { display: grid; grid-template-columns: minmax(180px, 260px) auto; gap: 12px; align-items: end; }
.activation-result { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 17px; border: 1px solid rgba(119, 223, 189, .3); border-radius: 12px; background: rgba(119, 223, 189, .07); }
.activation-result span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.activation-result strong { display: block; margin-top: 5px; color: var(--accent); font-family: ui-monospace, "Cascadia Code", monospace; font-size: clamp(20px, 3vw, 28px); letter-spacing: .08em; }
.activation-result p { margin: 5px 0 0; font-size: 12px; }
.device-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.device-heading { align-items: flex-end; }
.device-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.device-table { min-width: 820px; }
.device-name { display: block; font-weight: 750; }
.device-hardware { display: block; margin-top: 4px; color: #d5e6dd; font-size: 12px; }
.device-software { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.device-technical { margin-top: 5px; }
.device-technical summary { color: var(--accent); cursor: pointer; font-size: 11px; }
.device-id { display: block; max-width: 280px; margin-top: 4px; color: var(--muted); font: 11px ui-monospace, "Cascadia Code", monospace; overflow: hidden; text-overflow: ellipsis; }
.user-form { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.critical-pin-panel { width: 100%; padding: 18px 22px; }
.critical-pin-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.critical-pin-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #0a1607; background: var(--accent); border-radius: 12px; font-size: 19px; font-weight: 900; box-shadow: 0 0 0 6px rgba(120, 210, 59, .08); }
.critical-pin-icon.pending { color: #2e2106; background: var(--warning); box-shadow: 0 0 0 6px rgba(242, 184, 75, .08); }
.critical-pin-copy { min-width: 0; }
.critical-pin-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 4px; }
.critical-pin-heading .eyebrow { margin: 0; }
.critical-pin-copy h3 { margin-bottom: 5px; }
.critical-pin-copy p { margin-bottom: 0; }
.critical-pin-updated { min-height: 15px; margin-top: 4px !important; font-size: 11px; }
#critical-pin-form input[inputmode="numeric"], #report-action-pin { letter-spacing: .18em; font-family: ui-monospace, "Cascadia Code", monospace; }
.catalog-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.catalog-panel { margin-top: 0; }
.catalog-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5, 18, 11, .34); }
.catalog-form > label:first-of-type, .catalog-form-actions, .switch-field { grid-column: 1 / -1; }
.switch-field { min-height: 42px; display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #07160f; }
.switch-field input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.catalog-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.catalog-table { min-width: 560px; }
.updates-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.release-status-panel, .publish-panel { margin-top: 0; }
.release-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 15px; color: var(--muted); text-align: center; }
.release-empty p { max-width: 440px; margin: 0; line-height: 1.55; }
.release-icon { width: 60px; height: 60px; display: grid; place-items: center; color: #0a1607; background: var(--accent); border-radius: 18px; font-weight: 900; box-shadow: 0 0 0 9px rgba(120, 210, 59, .08); }
.release-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.release-details > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 18, 11, .34); }
.release-details span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.release-hash, .release-notes { grid-column: 1 / -1; }
.release-hash code { display: block; overflow-wrap: anywhere; color: #cfe0d7; font-size: 11px; line-height: 1.45; }
.release-notes p { margin: 0; color: #dce9e2; line-height: 1.5; white-space: pre-wrap; }
.app-update-form { display: grid; gap: 14px; }
.update-version-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.apk-picker { padding: 15px; border: 1px dashed rgba(120, 210, 59, .35); border-radius: 13px; background: rgba(120, 210, 59, .035); }
.apk-picker input { padding: 9px; }
.apk-picker small { display: block; margin-top: 7px; color: var(--muted); font-weight: 500; }
.release-safety { display: grid; gap: 4px; padding: 13px 15px; color: #cfe0d7; background: rgba(77, 163, 255, .055); border-left: 3px solid var(--info); border-radius: 9px; font-size: 12px; line-height: 1.45; }
.filters-grid { display: grid; grid-template-columns: 2fr repeat(5, 1fr) auto; gap: 12px; align-items: end; }
.filter-submit { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(5, 18, 11, .35); }
table { width: 100%; min-width: 880px; border-collapse: collapse; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #a9c2b5; background: #091a11; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(119, 223, 189, .055); }
.report-id { display: block; max-width: 200px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--accent); background: rgba(119, 223, 189, .09); border: 1px solid rgba(119, 223, 189, .2); font-size: 11px; font-weight: 750; }
.badge.revoked { color: var(--danger); background: rgba(255, 154, 147, .08); border-color: rgba(255, 154, 147, .24); }
.badge.status-review { color: #f5cf78; background: rgba(245, 207, 120, .08); border-color: rgba(245, 207, 120, .24); }
.badge.status-approved { color: var(--accent); background: rgba(119, 223, 189, .09); border-color: rgba(119, 223, 189, .2); }
.badge.status-returned { color: var(--danger); background: rgba(255, 154, 147, .08); border-color: rgba(255, 154, 147, .24); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.loading-state::before { content: ""; display: block; width: 24px; height: 24px; margin: 0 auto 13px; border: 3px solid rgba(120, 210, 59, .15); border-top-color: var(--accent); border-radius: 50%; animation: loading-spin .8s linear infinite; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.detail-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.detail-panel { position: fixed; z-index: 21; inset: 0 0 0 auto; width: min(720px, 94vw); overflow-y: auto; padding: 28px; background: linear-gradient(180deg, #0a1e14, #07150e); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; position: sticky; top: 0; margin: -28px -28px 20px; padding: 28px; background: rgba(9, 26, 18, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(15px); z-index: 2; }
.detail-header .eyebrow { margin-top: 0; }
.detail-section { min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-section h3 { margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-field { padding: 12px; border-radius: 10px; background: var(--surface-2); }
.detail-field { min-width: 0; }
.detail-field > span:first-child { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.activity-card, .file-row { padding: 15px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: #0d2117; }
.activity-card p { margin: 7px 0 0; color: #cfe0d7; line-height: 1.45; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.file-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.review-section { margin-top: 18px; padding: 20px; border: 1px solid rgba(119, 223, 189, .3); border-radius: 16px; background: rgba(119, 223, 189, .035); }
.review-heading, .review-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-heading .eyebrow { margin: 0 0 5px; }
.review-safety { padding: 11px 13px; color: var(--muted); background: rgba(119, 223, 189, .05); border-left: 3px solid var(--accent); border-radius: 7px; font-size: 12px; }
.review-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; margin-top: 17px; }
.review-form label { min-width: 0; align-content: start; }
.review-form input, .review-form select, .review-form textarea { min-width: 0; }
.review-heading { flex-wrap: wrap; }
.file-row > div { min-width: 0; overflow-wrap: anywhere; }
.file-row button { flex-shrink: 0; }
.review-form label:nth-child(3), .review-form button { grid-column: 1 / -1; }
.review-history { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(6, 20, 13, .55); }
.review-item p { margin: 8px 0 0; }
.review-item-heading .muted { font-size: 11px; }
.review-transition { color: var(--muted); font-size: 11px; }
.danger-zone { border-color: rgba(255, 154, 147, .22); background: rgba(127, 41, 40, .045); }
.trash-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.trash-content { display: grid; gap: 12px; }
.trash-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.trash-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trash-card p { margin: 10px 0 0; }
.trash-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.trash-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.audit-panel { width: min(780px, 96vw); }
.audit-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(190px, 260px) auto; gap: 10px; align-items: end; margin: 20px 0 18px; }
.audit-content { display: grid; gap: 12px; }
.audit-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.audit-card p { margin: 11px 0 0; }
.audit-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.audit-card-heading .muted { font-size: 11px; text-align: right; }
.audit-summary { color: #e3eee8; font-size: 14px; line-height: 1.5; }
.audit-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.audit-facts div { min-width: 0; overflow-wrap: anywhere; }
.audit-facts dt { color: var(--muted); font-size: 11px; }
.audit-facts dd { margin: 4px 0 0; color: var(--text); font-size: 13px; line-height: 1.5; }
.audit-responsible { color: var(--muted); font-size: 12px; }
.audit-responsible span { display: block; margin-bottom: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.audit-responsible strong { color: #d7e7df; }
.audit-details { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.audit-details summary { color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.audit-details div { margin-top: 12px; }
.audit-details div > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.audit-details pre { max-height: 240px; overflow: auto; margin: 6px 0 0; padding: 12px; color: #cfe0d7; background: #07160f; border-radius: 9px; font: 11px/1.45 ui-monospace, "Cascadia Code", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-technical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.audit-technical-grid div { min-width: 0; margin: 0; padding: 9px; border-radius: 8px; background: #07160f; }
.audit-technical-grid dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.audit-technical-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #cfe0d7; font: 11px/1.4 ui-monospace, "Cascadia Code", monospace; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 30px)); padding: 14px 18px; border-radius: 14px; color: var(--text); background: #18271f; border: 1px solid #53665b; box-shadow: var(--shadow); }
.toast-success { background: #17351b; border-color: #4f8c44; }
.toast-info { background: #142b42; border-color: #426f9b; }
.toast-warning { color: #fff3d4; background: #3a2b10; border-color: #9b752d; }
.toast-error { color: #ffe8e6; background: #3b1918; border-color: #a24d49; }
* { scrollbar-width: thin; scrollbar-color: #315f49 #07150e; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .7); backdrop-filter: blur(5px); }
.modal-card { position: fixed; z-index: 41; top: 50%; left: 50%; width: min(520px, calc(100vw - 30px)); transform: translate(-50%, -50%); padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #0b1f16; box-shadow: var(--shadow); }
.modal-card .eyebrow { margin-top: 0; }
.modal-card form { display: grid; gap: 12px; margin-top: 18px; }
.device-selected { padding: 12px; border-radius: 10px; color: #dceae2; background: var(--surface-2); overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

@media (max-width: 1050px) {
  .filters-grid, .user-form { grid-template-columns: repeat(2, 1fr); }
  .search-field { grid-column: span 2; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-grid { grid-template-columns: 1fr; }
  .updates-grid { grid-template-columns: 1fr; }
}

/* Modular application shell */
.dashboard { min-height: 100vh; }
.app-sidebar { position: fixed; z-index: 14; inset: 0 auto 0 0; width: 270px; display: flex; flex-direction: column; padding: 22px 16px 18px; background: rgba(7, 16, 12, .97); border-right: 1px solid rgba(120, 210, 59, .16); box-shadow: 24px 0 70px rgba(0, 0, 0, .14); backdrop-filter: blur(22px); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 8px 20px; border-bottom: 1px solid var(--line); }
.sidebar-brand img { display: block; width: 52px; height: 52px; border-radius: 12px; }
.app-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-brand strong { display: block; color: var(--text); font-size: 24px; }
.app-brand small { color: var(--muted); font-size: 11px; }
.navigation-close, .navigation-trigger { display: none; }
.module-navigation { flex: 1; overflow-y: auto; padding: 18px 0; }
.nav-group-label { margin: 19px 12px 8px; color: #718078; font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.nav-group-label:first-child { margin-top: 0; }
.nav-item { width: 100%; min-height: 46px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 3px 0; padding: 9px 12px; color: #c7d1cb; background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: left; font-weight: 700; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.nav-item:hover { color: var(--text); background: rgba(120, 210, 59, .055); transform: translateX(2px); }
.nav-item.active { color: #e7ffd7; background: linear-gradient(90deg, rgba(120, 210, 59, .16), rgba(120, 210, 59, .045)); border-color: rgba(120, 210, 59, .2); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--accent); background: rgba(120, 210, 59, .08); border-radius: 8px; font-size: 16px; }
.nav-count { min-width: 24px; padding: 3px 7px; color: #dffdcc; background: rgba(120, 210, 59, .11); border-radius: 999px; font-size: 10px; text-align: center; }
.sidebar-footer { display: grid; gap: 4px; padding: 15px 10px 3px; color: #75837b; font-size: 10px; border-top: 1px solid var(--line); }
.sidebar-version { color: #9eaaa3; font-weight: 800; letter-spacing: .05em; }
.app-workspace { min-height: 100vh; margin-left: 270px; }
.topbar { min-height: 78px; padding: 13px 28px; }
.topbar-leading, .top-actions, .admin-identity { display: flex; align-items: center; gap: 12px; }
.top-actions { flex: 0 0 auto; min-width: 0; }
.topbar-leading .eyebrow { margin: 0 0 3px; font-size: 9px; }
.topbar-leading h1 { margin: 0; font-size: 21px; }
.admin-identity { min-width: 0; max-width: 290px; padding: 6px 11px 6px 7px; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 26, 21, .7); }
.admin-avatar { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; color: #0a1607; background: var(--accent); border-radius: 9px; font-size: 10px; font-weight: 900; }
.compact-button { min-height: 38px; padding: 8px 13px; }
.module-main { width: min(1320px, calc(100% - 52px)); padding: 34px 0 76px; }
.module-page { display: none; animation: module-enter .24s ease both; }
.module-page.active { display: block; }
.module-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; padding: 2px 2px 4px; }
.module-heading .eyebrow { margin-top: 0; }
.module-heading p { margin-bottom: 0; }
.hero-panel { position: relative; overflow: hidden; padding: 30px; background: linear-gradient(125deg, rgba(32, 62, 28, .78), rgba(10, 28, 17, .72)); }
.hero-panel::after { content: ""; position: absolute; width: 240px; height: 240px; right: -75px; top: -110px; border: 42px solid rgba(120, 210, 59, .055); border-radius: 50%; pointer-events: none; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { min-height: 230px; display: flex; flex-direction: column; align-items: flex-start; gap: 15px; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, rgba(18, 34, 26, .92), rgba(10, 23, 16, .92)); box-shadow: 0 18px 50px rgba(0, 0, 0, .12); transition: transform .2s ease, border-color .2s ease; }
.feature-card:hover { transform: translateY(-3px); border-color: rgba(120, 210, 59, .38); }
.feature-card > div { flex: 1; }
.feature-card p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.feature-card .eyebrow { margin: 0 0 5px; }
.feature-icon { width: 45px; height: 45px; display: grid; place-items: center; color: var(--accent); background: rgba(120, 210, 59, .09); border: 1px solid rgba(120, 210, 59, .16); border-radius: 13px; font-size: 21px; }
.feature-primary { background: linear-gradient(145deg, rgba(32, 66, 28, .72), rgba(12, 28, 18, .94)); }
.system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.system-card { display: flex; align-items: flex-start; gap: 15px; min-height: 156px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.system-card .eyebrow { margin: 0 0 5px; }
.system-card p:last-child { margin: 10px 0 0; line-height: 1.5; }
.system-indicator { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; }
.system-indicator.success { background: var(--accent); box-shadow: 0 0 0 6px rgba(120, 210, 59, .1); }
.system-indicator.neutral { background: var(--info); box-shadow: 0 0 0 6px rgba(77, 163, 255, .1); }
.system-indicator.danger { background: var(--danger); box-shadow: 0 0 0 6px rgba(239, 106, 106, .1); }
.brand-panel { width: 100%; display: flex; align-items: center; gap: 20px; min-height: 0; padding: 18px 22px; }
.brand-panel img { width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 20px; }
.brand-panel .eyebrow { margin-top: 0; }
.brand-panel h3 { font-size: 18px; }
.brand-panel .muted { margin: 4px 0 0; font-size: 13px; }
.navigation-backdrop { position: fixed; z-index: 13; inset: 0; background: rgba(0, 0, 0, .58); backdrop-filter: blur(3px); }

@keyframes module-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .home-grid, .system-grid { grid-template-columns: 1fr 1fr; }
  .top-actions .status-pill { display: none; }
}

@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .app-sidebar.open { transform: translateX(0); }
  .app-workspace { margin-left: 0; }
  .navigation-close, .navigation-trigger { display: inline-grid; place-items: center; }
  .module-main { width: min(100% - 32px, 1320px); }
}

@media (max-width: 720px) {
  .topbar { align-items: center; flex-direction: row; padding: 12px 16px; }
  .top-actions { width: auto; margin-left: auto; }
  .admin-identity { display: none; }
  .compact-button { padding: 8px 10px; }
  .metric-grid, .home-grid, .system-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 124px; }
  .critical-pin-summary { grid-template-columns: auto minmax(0, 1fr); }
  .critical-pin-summary > button { width: 100%; grid-column: 1 / -1; }
  .brand-panel { align-items: flex-start; flex-direction: column; }
  .brand-panel img { width: 80px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 650px) {
  .access-card { padding: 28px 22px; }
  .intro-row, .panel-heading { align-items: flex-start; }
  .intro-row { flex-direction: column; }
  .top-actions { justify-content: flex-end; flex-wrap: nowrap; }
  .current-admin { text-align: left; }
  main { width: min(100% - 24px, 1240px); padding-top: 24px; }
  .metric-grid, .filters-grid, .detail-grid, .device-toolbar, .review-form, .user-form, .catalog-form { grid-template-columns: 1fr; }
  .update-version-fields, .release-details { grid-template-columns: 1fr; }
  .activation-form { grid-template-columns: 1fr; }
  .activation-result { align-items: stretch; flex-direction: column; }
  .search-field { grid-column: auto; }
  .intro-row { padding: 20px; }
  .panel { padding: 17px; }
  .detail-panel { width: 100%; padding: 20px; }
  .detail-header { margin: -20px -20px 18px; padding: 20px; }
  .modal-actions { flex-direction: column-reverse; }
  .trash-search { grid-template-columns: 1fr; }
  .audit-toolbar { grid-template-columns: 1fr; }
  .sidebar-brand img { width: 48px; height: 48px; }
  .audit-facts { grid-template-columns: 1fr; }
  .file-row { align-items: flex-start; flex-direction: column; }
}
