:root {
  --nav: #0b1628;
  --nav-soft: #13223a;
  --primary: #075985;
  --primary-hover: #06496d;
  --primary-soft: #e0f2fe;
  --accent: #15803d;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warning: #a16207;
  --warning-soft: #fefce8;
  --surface: #ffffff;
  --background: #f4f7fb;
  --border: #dbe3ee;
  --text: #172033;
  --text-secondary: #526176;
  --text-muted: #718096;
  --shadow: 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 12px;
  --sidebar-width: 248px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(14, 165, 233, .3); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#i-grid path { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(circle at 50% 0, #173760 0, var(--nav) 42%, #07101e 100%); }
.auth-panel { width: min(100%, 460px); padding: 40px; border-radius: 18px; background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .32); }
.auth-panel > .brand-mark { margin-bottom: 22px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: #0ea5e9; }
.brand-mark.large { width: 52px; height: 52px; border-radius: 14px; }
.brand-mark.large svg { width: 28px; height: 28px; }
.eyebrow { margin: 0 0 5px; font-size: 11px; line-height: 1.4; font-weight: 700; letter-spacing: .14em; color: var(--primary); }
.auth-panel h1 { margin: 0; font-size: 27px; line-height: 1.25; letter-spacing: -.02em; }
.auth-description { margin: 8px 0 28px; color: var(--text-secondary); }
.auth-form { display: grid; gap: 17px; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.auth-foot svg { width: 16px; height: 16px; color: var(--accent); }
.notice { display: flex; gap: 10px; padding: 12px; border: 1px solid #bae6fd; border-radius: 9px; background: #f0f9ff; font-size: 13px; color: #0c4a6e; }
.notice svg { flex: 0 0 auto; width: 18px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
label > span, legend > span { margin-left: 3px; color: var(--danger); }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 11px; color: var(--text); background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, .12); outline: none; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
label small { min-height: 0; font-weight: 400; color: var(--text-muted); }
label small:empty { display: none; }
small[data-error]:not(:empty) { color: var(--danger); }
.form-alert { padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: 14px; transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.button svg { width: 18px; height: 18px; }
.button.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(7, 89, 133, .18); }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { border-color: #cbd5e1; background: #fff; color: #334155; }
.button.secondary:hover { border-color: #94a3b8; background: #f8fafc; }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover { background: #991b1b; }
.button.full { width: 100%; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 8px; color: inherit; background: transparent; transition: background .18s ease; }
.icon-button:hover { background: rgba(148, 163, 184, .14); }
.text-button { min-height: 38px; border: 0; padding: 7px 4px; background: transparent; color: var(--primary); font-weight: 650; }
.text-button svg { width: 15px; height: 15px; margin-right: 4px; vertical-align: -3px; }
.text-button:hover { color: var(--primary-hover); text-decoration: underline; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 20px 14px 14px; color: #dbeafe; background: var(--nav); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 15px; color: #fff; }
.sidebar-brand span { margin-top: 1px; font: 500 10px/1.4 Consolas, monospace; letter-spacing: .09em; color: #7f9ab9; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { position: relative; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 8px; padding: 9px 12px; text-align: left; color: #9eb2ca; background: transparent; transition: background .18s ease, color .18s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: #e5f2ff; background: rgba(255, 255, 255, .06); }
.nav-item.active { color: #fff; background: #164e73; }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 2px 2px 0; background: #38bdf8; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border-radius: 10px; color: #fde68a; background: rgba(161, 98, 7, .35); font-size: 11px; }
.sidebar-security { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px; border: 1px solid rgba(56, 189, 248, .12); border-radius: 9px; background: rgba(14, 165, 233, .06); }
.sidebar-security strong, .sidebar-security small { display: block; }
.sidebar-security strong { font-size: 12px; color: #cbeafe; }
.sidebar-security small { margin-top: 2px; font-size: 10px; color: #718ba8; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.status-dot.needs-attention { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, .12); }
.sidebar-user { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 9px; margin-top: 12px; padding: 13px 5px 2px; border-top: 1px solid rgba(148, 163, 184, .14); }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { overflow: hidden; color: #f8fafc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #718ba8; font-size: 10px; }
.sidebar-user .icon-button { width: 36px; height: 36px; color: #7f9ab9; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #1e3a5f; color: #e0f2fe; font-weight: 700; font-size: 13px; }

.content-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 30px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .95); }
.topbar p { margin: 0 0 2px; color: var(--text-muted); font-size: 11px; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.topbar-meta { display: flex; align-items: center; gap: 20px; font-size: 12px; color: var(--text-secondary); }
.topbar-meta span { display: flex; align-items: center; gap: 8px; }
.topbar-meta b { font-weight: 500; color: var(--text-muted); }
.main-content { max-width: 1520px; margin: 0 auto; padding: 28px 30px 48px; }
.page { display: none; }
.page.active { display: block; animation: page-in .18s ease-out; }
@keyframes page-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.hero-row, .section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.hero-row h2, .section-toolbar h2 { margin: 0; font-size: 25px; line-height: 1.3; letter-spacing: -.025em; }
.hero-row p:last-child, .section-toolbar p:last-child { margin: 5px 0 0; color: var(--text-secondary); font-size: 14px; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { min-height: 116px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-align: left; }
.metric:hover { border-color: var(--primary); }
.metric:active { background: var(--primary-soft); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.metric-head span:last-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.metric-head svg { width: 16px; height: 16px; }
.metric strong { display: block; margin-top: 10px; font: 700 27px/1.1 Consolas, "Segoe UI", sans-serif; letter-spacing: -.03em; }
.metric small { display: block; margin-top: 7px; color: var(--text-muted); }
.metric.warning .metric-head span:last-child { color: var(--warning); background: var(--warning-soft); }
.metric.warning strong { color: #854d0e; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 18px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-head { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 19px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 110px 88px; align-items: center; gap: 14px; min-height: 68px; padding: 12px 19px; border-bottom: 1px solid #edf1f6; font-size: 12px; }
.recent-row:last-child { border-bottom: 0; }
.recent-row strong, .recent-row small { display: block; }
.recent-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.recent-row small { margin-top: 2px; color: var(--text-muted); }
.security-list { display: grid; padding: 5px 18px; }
.security-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid #edf1f6; }
.security-item:last-child { border: 0; }
.security-item > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: #ecfdf5; }
.security-item.needs-attention > span { color: #92400e; background: #fffbeb; }
.security-item svg { width: 15px; height: 15px; }
.security-item strong, .security-item small { display: block; }
.security-item strong { font-size: 12px; }
.security-item small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }

.table-card { overflow: hidden; }
.table-tools { min-height: 65px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.table-tools > span:last-child { margin-left: auto; }
.search-box { position: relative; width: min(380px, 100%); display: block; }
.search-box svg { position: absolute; top: 12px; left: 11px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.search-box input { min-height: 42px; padding-left: 38px; font-size: 13px; }
.table-tools select { width: 132px; min-height: 42px; font-size: 13px; }
#license-software-filter { width: 220px; max-width: 100%; }
.license-count-link { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 42px; padding: 9px 16px; text-align: left; white-space: nowrap; color: var(--text-muted); background: #f8fafc; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 650; }
td { min-height: 60px; padding: 13px 16px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
td strong, td small { display: block; }
td strong { font-size: 13px; }
td small { margin-top: 3px; color: var(--text-muted); }
.code { font-family: Consolas, "SFMono-Regular", monospace; color: #334155; font-size: 12px; font-variant-numeric: tabular-nums; }
.action-column { width: 95px; text-align: right; }
td.action-column .text-button { min-height: 34px; padding: 5px 7px; font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 8px; border-radius: 12px; white-space: nowrap; font-size: 11px; font-weight: 650; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { color: #166534; background: #ecfdf5; }
.status.disabled, .status.revoked { color: #6b7280; background: #f1f5f9; }
.status.suspended, .status.expired { color: #991b1b; background: #fef2f2; }
.status.scheduled { color: #854d0e; background: #fefce8; }
.empty-state { padding: 56px 20px; text-align: center; color: var(--text-muted); }
.empty-state svg { width: 32px; height: 32px; margin-bottom: 8px; color: #94a3b8; }
.empty-state strong { display: block; color: var(--text-secondary); }
.empty-state p { margin: 5px 0 0; font-size: 13px; }
.integrity-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 8px; color: #166534; background: #ecfdf5; font-size: 12px; font-weight: 650; }
.integrity-badge.failed { color: #991b1b; background: #fef2f2; }
.audit-action { display: inline-block; padding: 3px 7px; border-radius: 5px; color: #334155; background: #f1f5f9; font: 600 11px/1.5 Consolas, monospace; }

.modal { width: min(600px, calc(100vw - 28px)); max-height: calc(100vh - 40px); border: 0; border-radius: 14px; padding: 0; color: var(--text); box-shadow: 0 28px 90px rgba(15, 23, 42, .28); }
.modal.wide { width: min(760px, calc(100vw - 28px)); }
.modal.small { width: min(480px, calc(100vw - 28px)); }
.status-form > label, .status-form > .form-grid { margin-top: 16px; }
.client-preview { margin-top: 16px; padding: 14px; border: 1px solid #fde68a; border-radius: 8px; background: var(--warning-soft); color: var(--warning); overflow-wrap: anywhere; }
.client-preview strong { font-size: 12px; }
.client-preview p { margin: 6px 0 0; white-space: pre-wrap; }
#license-table .client-note { max-width: 260px; min-width: 120px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--warning); }
#license-table .action-column { min-width: 112px; }
.danger-text { color: var(--danger); }
.modal::backdrop { background: rgba(7, 16, 30, .58); backdrop-filter: blur(2px); }
.modal form { padding: 0 24px 22px; }
.modal-head { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head .icon-button { margin-right: -8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid.compact { margin-top: 17px; }
.span-2 { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.step-note { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; margin-bottom: 13px; }
.step-note > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font: 700 12px Consolas, monospace; }
.step-note strong, .step-note small { display: block; }
.step-note strong { font-size: 13px; }
.step-note small { color: var(--text-muted); font-size: 11px; }
.divider { height: 1px; margin: 20px 0; background: var(--border); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
fieldset { min-width: 0; display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }
legend { margin-bottom: 8px; font-size: 13px; font-weight: 650; color: #334155; }
.choice { min-height: 58px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 10px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.choice:hover { border-color: #7dd3fc; background: #f8fcff; }
.choice:has(input:checked) { border-color: #0ea5e9; background: #f0f9ff; box-shadow: 0 0 0 1px #0ea5e9; }
.choice input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--primary); }
.choice strong, .choice small { display: block; }
.choice strong { color: var(--text); font-size: 12px; }
.choice small { margin-top: 1px; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.warning-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; padding: 11px 12px; border: 1px solid #fde68a; border-radius: 8px; color: #854d0e; background: var(--warning-soft); font-size: 12px; }
.warning-note svg { width: 18px; height: 18px; flex: 0 0 auto; }
.key-modal { padding: 30px; }
.key-success { text-align: center; }
.key-success > span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: var(--accent); background: #ecfdf5; }
.key-success > span svg { width: 25px; height: 25px; }
.key-success h2 { margin: 0; font-size: 21px; }
.key-success > p:last-child { margin: 7px 0 18px; color: var(--text-secondary); font-size: 13px; }
.key-box { padding: 16px; border: 1px solid #bae6fd; border-radius: 10px; background: #f0f9ff; }
.key-box small { display: block; margin-bottom: 8px; color: var(--text-muted); font: 600 11px Consolas, monospace; }
.key-box code { display: block; overflow-wrap: anywhere; color: #0c4a6e; font: 700 14px/1.65 Consolas, monospace; }
.key-box .button { width: 100%; margin-top: 13px; }
.key-box code + small { margin-top: 18px; }
#software-form > .form-grid + .form-grid { margin-top: 17px; }
.activation-fields { margin-bottom: 17px; }
.activation-fields > label, #software-form > .form-grid:first-of-type > label { align-content: start; }
.key-modal > .button { margin-top: 20px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 420px; display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #bbf7d0; border-radius: 9px; color: #166534; background: #f0fdf4; box-shadow: 0 14px 40px rgba(15, 23, 42, .15); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { border-color: #fecaca; color: #991b1b; background: #fef2f2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(7, 16, 30, .5); }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(4), .metric:nth-child(5) { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease-out; }
  .sidebar.open { transform: translateX(0); }
  .content-shell { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { height: 76px; justify-content: flex-start; padding: 12px 18px; }
  .topbar-meta { margin-left: auto; }
  .topbar-meta span { display: none; }
  .main-content { padding: 22px 18px 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 80px; }
  .recent-row > :nth-child(3) { display: none; }
}

@media (max-width: 560px) {
  .auth-panel { padding: 28px 22px; }
  .auth-panel h1 { font-size: 23px; }
  .topbar { padding: 10px 12px; }
  .topbar h1 { font-size: 18px; }
  .topbar-meta b { display: none; }
  .main-content { padding: 18px 12px 34px; }
  .hero-row, .section-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .hero-row .button, .section-toolbar .button { width: 100%; }
  .hero-row h2, .section-toolbar h2 { font-size: 22px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 105px; padding: 14px; }
  .metric strong { font-size: 23px; }
  .metric:last-child { grid-column: 1 / -1; }
  .card-head { padding: 14px; }
  .recent-row { grid-template-columns: 1fr 80px; padding: 12px 14px; }
  .recent-row > :nth-child(2), .recent-row > :nth-child(3) { display: none; }
  .table-tools { align-items: stretch; flex-wrap: wrap; padding: 12px; }
  .search-box { width: 100%; }
  .table-tools > span:last-child { margin-left: 0; align-self: center; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal { max-height: calc(100vh - 18px); }
  .modal form { padding: 0 18px 18px; }
  .modal-head { position: sticky; top: 0; z-index: 2; margin-bottom: 17px; background: #fff; }
  .modal-actions { position: sticky; bottom: 0; margin-left: -18px; margin-right: -18px; margin-bottom: -18px; padding: 14px 18px; background: #fff; }
  .modal-actions .button { flex: 1; }
  .key-modal { padding: 24px 18px; }
  .toast-region { inset: auto 12px 12px; }
  .toast { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Console account management uses the existing form and table visual language. */
.settings-card { max-width: 760px; padding: 28px; }
.settings-card label { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.form-help { color: var(--muted, #64748b); line-height: 1.7; font-size: 14px; }
.device-list { display: grid; gap: 16px; margin: 20px 0; }
.device-entry { border: 1px solid #dce5ef; border-radius: 10px; padding: 16px; overflow-wrap: anywhere; }
.device-entry small { display: block; margin-top: 8px; color: #64748b; }
.device-entry .modal-actions { justify-content: flex-start; flex-wrap: wrap; }
.sidebar nav { overflow-y: auto; min-height: 0; }
@media (max-width: 600px) { .settings-card { padding: 18px; } }
.device-dialog { padding: 24px; }
.offline-permit-note { color: #8a5200; }
.readiness-alert { margin-bottom: 18px; line-height: 1.7; }
.content-shell { display: flex; flex-direction: column; }
.main-content { flex: 1; width: 100%; }
.topbar { min-height: 88px; height: auto; }
.topbar > div:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.sidebar-brand > div:last-child, .sidebar-user > div { min-width: 0; }
.sidebar-brand strong { overflow-wrap: anywhere; }
.brand-mark, .avatar { flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-shell { position: relative; isolation: isolate; grid-template-rows: 1fr auto; gap: 24px; }
.auth-panel { position: relative; margin: auto 0; overflow-wrap: anywhere; }
.auth-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; pointer-events: none; }
.auth-background.fit-contain { object-fit: contain; }
.auth-shell.login-left .auth-panel { justify-self: start; margin-left: max(0px, calc((100vw - 1280px) / 2)); }
.auth-shell.login-right .auth-panel { justify-self: end; margin-right: max(0px, calc((100vw - 1280px) / 2)); }
.site-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 24px; padding: 18px 24px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; overflow-wrap: anywhere; }
.site-footer > span { white-space: pre-line; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 18px; }
.site-footer a { color: var(--primary); display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.auth-shell > .site-footer { position: relative; width: min(100%, 1100px); color: #fff; border-radius: 9px; background: rgba(7, 16, 30, .88); }
.auth-shell > .site-footer a { color: #bae6fd; }
.appearance-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .9fr); gap: 22px; align-items: start; }
.appearance-layout .settings-card { width: 100%; max-width: none; }
.appearance-preview-card { padding: 24px; position: sticky; top: 20px; min-width: 0; }
.appearance-preview-card h3, .settings-card h3 { margin: 0 0 12px; font-size: 17px; }
.field-title { font-weight: inherit; }
.field-title span { color: #b42318; }
#branding-form > h3:not(:first-child) { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.image-setting { display: flex; align-items: center; gap: 18px; }
.image-setting > div:last-child { flex: 1; min-width: 0; }
.image-setting .image-preview, .profile-avatar { width: 72px; height: 72px; font-size: 24px; }
.settings-card input[type="file"] { width: 100%; max-width: 100%; min-height: 44px; height: auto; padding: 8px; font-size: 12px; }
.settings-card input[type="file"]::file-selector-button { cursor: pointer; padding: 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); margin-right: 8px; }
.profile-details-card { margin-bottom: 22px; }
.settings-card .button, .danger-text { min-height: 44px; }
.settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.save-status { color: var(--primary); font-size: 13px; min-height: 22px; margin: 18px 0 0; }
.footer-link-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(130px, 1.3fr) auto; gap: 10px; align-items: end; padding: 10px 0; border-top: 1px solid var(--border); }
.footer-link-row label { margin: 0; }
.branding-preview { display: flex; justify-content: center; align-items: center; position: relative; isolation: isolate; min-height: 340px; border-radius: 10px; padding: 22px 16px; background: var(--nav); overflow: hidden; }
.branding-preview.login-left { justify-content: flex-start; }
.branding-preview.login-right { justify-content: flex-end; }
.preview-login { width: 230px; max-width: 100%; padding: 20px; border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.preview-login strong { display: block; margin-top: 14px; font-size: 15px; white-space: pre-line; }
.preview-login p { color: var(--text-secondary); font-size: 11px; white-space: pre-line; }
.preview-field { margin-top: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-secondary); }
.preview-submit { margin-top: 16px; background: var(--primary); color: white; padding: 9px; text-align: center; border-radius: 6px; font-size: 12px; }
.appearance-preview-card .site-footer { padding: 12px 0 0; }
.auth-description { white-space: pre-line; }
.danger-text { color: #b42318; }
.deleted-note { color: var(--text-secondary); }
.delete-confirm { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; line-height: 1.7; }
.delete-confirm input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; }
.deletion-reasons { padding-left: 22px; color: #92400e; line-height: 1.8; }
.user-identity { display: flex; gap: 10px; align-items: center; }
.user-identity .avatar { width: 32px; height: 32px; }
.profile-readout dt { font-size: 12px; color: var(--text-secondary); margin-top: 16px; }
.profile-readout dd { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .appearance-layout { grid-template-columns: 1fr; } .appearance-preview-card { position: static; } }
@media (max-width: 600px) {
  .auth-shell.login-left .auth-panel, .auth-shell.login-right .auth-panel { justify-self: center; margin-left: 0; margin-right: 0; }
  .topbar { min-height: 76px; }
  .footer-link-row { grid-template-columns: 1fr; }
  .footer-link-row .button { justify-self: end; }
  .settings-actions { flex-direction: column-reverse; }
  .settings-actions .button { width: 100%; }
  .image-setting { flex-wrap: wrap; }
  .image-setting > div:last-child { min-width: 190px; }
  .site-footer { padding: 14px 12px; text-align: center; }
  .appearance-preview-card { padding: 18px; }
}
#refresh-status { min-height: 44px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .page.active, .toast { transition: none; animation: none; }
}

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --background: #f5f7fb;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --radius: 14px;
  --sidebar-width: 232px;
}
.sidebar { padding: 16px 12px 12px; background: #0b1220; }
.sidebar-top { display: flex; align-items: center; gap: 4px; }
.sidebar-top .sidebar-brand { flex: 1; min-width: 0; padding: 0 6px 22px; }
#sidebar-collapse { width: 34px; height: 34px; margin-bottom: 22px; color: #8293aa; }
.nav-label { margin: 6px 12px 8px; color: #52647d; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-item { min-height: 42px; border-radius: 9px; }
.nav-item.active { background: #1d4ed8; }
.nav-item.active::before { display: none; }
.nav-group { margin-top: 12px; }
.nav-group-summary { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #9eb2ca; cursor: pointer; list-style: none; font-size: 14px; }
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary::after { content: "›"; margin-left: auto; font-size: 20px; transition: transform .16s ease; }
.nav-group[open] > .nav-group-summary::after { transform: rotate(90deg); }
.nav-group-summary:hover { color: #eff6ff; background: rgba(255,255,255,.05); }
.nav-group-summary svg { width: 19px; height: 19px; }
.nav-subitems { display: grid; gap: 3px; margin: 4px 0 0 12px; padding-left: 12px; border-left: 1px solid #24324a; }
.nav-subitems .nav-item { min-height: 38px; font-size: 13px; }
.sidebar-collapsed { --sidebar-width: 76px; }
.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .sidebar-top { flex-direction: column; gap: 8px; }
.sidebar-collapsed .sidebar-brand { padding: 0; }
.sidebar-collapsed .sidebar-brand > div:last-child,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-group-summary span,
.sidebar-collapsed .sidebar-security div,
.sidebar-collapsed .sidebar-user > div:not(.avatar),
.sidebar-collapsed #logout-button { display: none; }
.sidebar-collapsed #sidebar-collapse { margin: 0; }
.sidebar-collapsed .nav-item,
.sidebar-collapsed .nav-group-summary { justify-content: center; padding: 8px; }
.sidebar-collapsed .nav-group-summary::after { display: none; }
.sidebar-collapsed .nav-subitems { margin: 4px 0 0; padding: 0; border: 0; }
.sidebar-collapsed .sidebar-security { justify-content: center; padding: 12px 0; }
.sidebar-collapsed .sidebar-user { display: flex; justify-content: center; padding: 14px 0 0; }
.topbar { min-height: 72px; height: 72px; padding: 12px 28px; }
.topbar #breadcrumb { display: none; }
.topbar h1 { font-size: 21px; }
.main-content { padding: 24px 28px 42px; }
.hero-row, .section-toolbar { align-items: center; margin-bottom: 18px; }
.section-toolbar .eyebrow, .section-toolbar h2 { display: none; }
.section-toolbar p:last-child { margin: 0; font-size: 13px; }
.hero-row h2 { font-size: 22px; }
.metrics { gap: 12px; margin-bottom: 16px; }
.metric { min-height: 104px; border-radius: 12px; box-shadow: none; }
.metric small { display: none; }
.metric strong { margin-top: 14px; }
.card { box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.card-head { min-height: 68px; }
.table-tools { min-height: 58px; }
th { height: 40px; font-size: 11px; letter-spacing: .02em; }
td { padding-top: 12px; padding-bottom: 12px; }
td small { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.action-column { min-width: 108px; white-space: nowrap; }
td.action-column .action-icon { width: 32px; height: 32px; min-height: 32px; display: inline-grid; place-items: center; margin-left: 3px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--text-secondary); }
td.action-column .action-icon:hover { border-color: var(--border); background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.action-icon svg { width: 16px; height: 16px; margin: 0; }
.user-identity > span:last-child { min-width: 0; }
.user-identity strong, .user-identity small { display: block; }
.user-identity small { margin-top: 2px; }
.password-state { color: var(--text-secondary); font-size: 12px; }
.password-state.needs-change { color: var(--warning); }
.compact-details { margin-bottom: 16px; padding: 0; border: 0; background: transparent; }
.compact-details summary { width: fit-content; padding: 7px 0; color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 650; }
.compact-details p { max-width: 780px; margin: 0 0 10px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; line-height: 1.7; }
.settings-section { margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.settings-section > summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 12px 16px; cursor: pointer; list-style: none; color: var(--text); font-size: 15px; font-weight: 700; background: #f8fafc; }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary::after { content: "+"; color: var(--text-muted); font-size: 20px; font-weight: 400; }
.settings-section[open] > summary::after { content: "−"; }
.settings-section > :not(summary) { margin-left: 16px; margin-right: 16px; }
.settings-section > :last-child { margin-bottom: 16px; }
.settings-section .image-setting { padding-top: 16px; }
.form-section { margin: 18px 0; border: 1px solid var(--border); border-radius: 10px; }
.form-section > summary { padding: 11px 13px; cursor: pointer; color: var(--text-secondary); font-size: 13px; font-weight: 650; background: #f8fafc; }
.form-section > :not(summary) { margin: 14px 13px; }
#page-profile .settings-card, #page-security .settings-card { margin: 0; }
/* 个人资料/账号安全页：紧凑纵向节奏，避免大间隙 */
#page-profile .settings-card > h3, #page-security .settings-card > h3 { margin-bottom: 6px; }
#page-profile .settings-card > .form-help, #page-security .settings-card > .form-help { margin: 0 0 16px; }
#page-profile .form-grid, #page-security .form-grid { gap: 12px 17px; }
#page-profile .form-grid > label, #page-security .form-grid > label { margin: 0; }
#page-profile .settings-card > label, #page-security .settings-card > label { margin: 12px 0; }
#page-profile .settings-actions, #page-security .settings-actions { margin-top: 14px; }
#page-profile .save-status, #page-security .save-status { margin-top: 10px; }
.avatar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-controls > label { flex: 1; min-width: 220px; margin: 0; }
.avatar-controls .button { flex-shrink: 0; }
.avatar-hint { display: block; margin-top: 8px; color: var(--text-secondary); font-size: 12px; }
@media (max-width: 600px) { .avatar-controls > label { min-width: 100%; } }
@media (max-width: 820px) {
  #sidebar-collapse { display: none; }
  .sidebar-collapsed { --sidebar-width: 232px; }
  .sidebar-collapsed .sidebar-brand > div:last-child,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-item span,
  .sidebar-collapsed .nav-group-summary span,
  .sidebar-collapsed .sidebar-security div,
  .sidebar-collapsed .sidebar-user > div:not(.avatar),
  .sidebar-collapsed #logout-button { display: initial; }
  .sidebar-collapsed .nav-item, .sidebar-collapsed .nav-group-summary { justify-content: flex-start; }
  .topbar { height: 70px; min-height: 70px; }
  .main-content { padding: 20px 18px 36px; }
  .section-toolbar { flex-direction: row; align-items: center; }
}
@media (max-width: 560px) {
  .hero-row, .section-toolbar { align-items: stretch; }
  .section-toolbar { flex-direction: column; }
  .metric { min-height: 94px; }
  .metric strong { margin-top: 10px; }
  .action-column { min-width: 96px; }
  td small { max-width: 210px; }
}

.sidebar-brand { overflow: hidden; }
.sidebar-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(15,23,42,.28);
  overflow: auto;
}
.modal.wide { width: min(820px, calc(100vw - 32px)); }
.modal[open] { animation: modal-enter .2s cubic-bezier(.2,.8,.2,1); }
.modal::backdrop { background: rgba(15,23,42,.58); backdrop-filter: blur(5px); }
@keyframes modal-enter { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal form { padding: 0 28px 24px; }
.modal-head { position: sticky; top: 0; z-index: 4; min-height: 88px; margin: 0 0 22px; padding: 18px 0; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); }
.modal-head .eyebrow { display: none; }
.modal-head h2 { font-size: 24px; letter-spacing: -.025em; }
.modal-title { display: flex; align-items: center; gap: 14px; }
.modal-title h2 { margin: 0; }
.modal-title p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.modal-heading-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.modal-heading-icon svg { width: 23px; height: 23px; }
.modal .form-grid { gap: 18px; }
.modal label { font-size: 13px; }
.modal input, .modal select, .modal textarea { min-height: 46px; border-radius: 10px; background: #fbfdff; }
.modal input:focus, .modal select:focus, .modal textarea:focus { background: #fff; }
.modal-actions { position: sticky; bottom: 0; z-index: 3; margin: 24px -28px -24px; padding: 16px 28px; border-top: 1px solid var(--border); background: rgba(255,255,255,.97); }
.modal-actions .button { min-height: 44px; min-width: 96px; }
.form-section-block > h3 { margin: 0 0 16px; font-size: 14px; }
.table-create { margin-left: 8px; white-space: nowrap; }
.table-tools .table-create svg { width: 17px; height: 17px; }
.platform-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; margin-top: 7px; color: var(--text-secondary); font-size: 12px; }
.platform-badge svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--primary); }
.platform-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-settings { margin-top: 22px; }
.client-events-card { margin-top: 18px; }
.client-event-denied { background: #fef7f7; }
#client-event-alert { margin: 0 20px 12px; }
.platform-standard { margin: 0 20px; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; line-height: 1.8; }
#platform-type-list { display: grid; padding: 8px 20px 16px; }
.platform-type-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 66px; border-bottom: 1px solid #edf2f7; }
.platform-type-row:last-child { border-bottom: 0; }
.platform-type-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.platform-type-icon svg { width: 18px; height: 18px; }
.platform-type-row strong, .platform-type-row small { display: block; }
.platform-type-row small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.platform-type-actions { display: flex; }
.platform-type-actions .action-icon { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; }
.platform-type-actions svg { width: 16px; height: 16px; margin: 0; }
.avatar-button { padding: 0; border: 2px solid transparent; cursor: pointer; transition: border-color .16s ease, transform .16s ease; }
.avatar-button:hover, .avatar-button[aria-expanded="true"] { border-color: #60a5fa; transform: translateY(-1px); }
#user-avatar { width: 100%; height: 100%; display: grid; place-items: center; border-radius: inherit; overflow: hidden; }
#user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-menu { position: absolute; left: 0; bottom: 58px; z-index: 60; width: 248px; padding: 7px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.22); color: var(--text); }
.profile-menu button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 0; border-radius: 9px; color: var(--text-secondary); background: transparent; text-align: left; font-size: 13px; }
.profile-menu button:hover { color: var(--primary); background: var(--primary-soft); }
.profile-menu svg { width: 17px; height: 17px; }
@media (max-width: 560px) {
  .modal { width: calc(100vw - 18px); max-height: calc(100vh - 18px); border-radius: 16px; }
  .modal form { padding: 0 18px 18px; }
  .modal-head { min-height: 76px; }
  .modal-head h2 { font-size: 21px; }
  .modal-actions { margin: 20px -18px -18px; padding: 14px 18px; }
  .table-create { width: 100%; margin: 4px 0 0; }
  .platform-standard { margin: 0 14px; }
  #platform-type-list { padding-left: 14px; padding-right: 14px; }
  .profile-menu { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

.sidebar-user { position: relative; }
.profile-menu:not([hidden]) { display: block; }

.sidebar-collapsed .sidebar-user > .profile-menu:not([hidden]) { display: block; }

.model-code { font: 600 12px Consolas, monospace; color: var(--text-secondary); white-space: nowrap; }
#software-table td:first-child strong { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.activation-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.activation-badge.activated { color: #166534; background: #ecfdf5; }
.activation-badge.pending { color: #64748b; background: #f1f5f9; }

.customer-type { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 6px; color: #475569; background: #f1f5f9; font-size: 11px; }
.contact-lines span, .contact-lines small { display: block; }
.contact-lines small { margin-top: 4px; }
.relation-button { min-width: 64px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 9px; border: 1px solid transparent; border-radius: 9px; color: var(--text-secondary); background: transparent; }
.relation-button:hover { border-color: #dbeafe; color: var(--primary); background: #eff6ff; }
.relation-button svg { width: 16px; height: 16px; color: var(--primary); }
.relation-button strong { font-size: 14px; }
.relation-button span { color: var(--text-muted); font-size: 11px; }
.contract-number { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; font-size: 12px; }
.money-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.attachment-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 650; text-decoration: none; }
.attachment-link:hover { text-decoration: underline; }
.attachment-link svg { width: 16px; height: 16px; }
.muted-text { color: var(--text-muted); font-size: 12px; }
.contract-link { max-width: 175px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid transparent; border-radius: 9px; text-align: left; background: transparent; }
.contract-link > svg { width: 17px; height: 17px; flex: 0 0 auto; }
.contract-link span, .contract-link strong, .contract-link small { display: block; min-width: 0; }
.contract-link strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.contract-link small { margin-top: 2px; font-size: 10px; }
.contract-link.bound { color: #166534; }
.contract-link.bound:hover { border-color: #bbf7d0; background: #f0fdf4; }
.contract-link.unbound { color: #64748b; border-style: dashed; border-color: #cbd5e1; }
.contract-link.unbound:hover { color: var(--primary); border-color: #93c5fd; background: #eff6ff; }
.attachment-section { margin-top: 20px; }
.final-customer-list { display: grid; gap: 10px; max-height: 310px; overflow-y: auto; }
.final-customer-entry { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fbfdff; }
.record-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.record-icon svg { width: 18px; height: 18px; }
.final-customer-entry p { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; }
.final-customer-entry small { display: block; margin-top: 4px; color: var(--text-muted); }
.final-customer-entry .entry-note { padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-muted); white-space: pre-wrap; }
.final-customer-create { margin-bottom: 0; }
.inline-empty { min-height: 96px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px dashed #cbd5e1; border-radius: 12px; color: var(--text-muted); background: #f8fafc; }
.inline-empty svg { width: 20px; height: 20px; }
.record-dialog-body { padding: 0 28px 24px; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--border); border-radius: 12px; background: var(--border); overflow: hidden; }
.record-grid > div { min-width: 0; padding: 15px; background: #fbfdff; }
.record-grid small, .record-grid strong { display: block; }
.record-grid small { margin-bottom: 6px; color: var(--text-muted); font-size: 11px; }
.record-grid strong { overflow-wrap: anywhere; font-size: 13px; }
.record-note { margin-top: 16px; padding: 14px 16px; border-left: 3px solid #93c5fd; border-radius: 0 10px 10px 0; background: #f8fafc; }
.record-note strong { font-size: 12px; }
.record-note p { margin: 6px 0 0; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.record-section { margin-top: 20px; }
.record-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.record-section-head h3 { margin: 0; font-size: 14px; }
.record-section-head h3 span { color: var(--text-muted); font-weight: 500; }
.record-section-head .button { max-width: 75%; overflow-wrap: anywhere; font-size: 12px; }
.contract-license-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.contract-license-list > .muted-text { padding: 18px; }
.contract-license-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.contract-license-row:last-child { border-bottom: 0; }
.contract-license-row strong, .contract-license-row small { display: block; }
.contract-license-row small { margin-top: 4px; }
@media (max-width: 620px) {
  .record-dialog-body { padding: 0 18px 18px; }
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-section-head { align-items: flex-start; flex-direction: column; }
  .record-section-head .button { max-width: 100%; }
}

.modal label:not(.choice), .auth-form label:not(.choice) { display: block; }
.modal label > input, .modal label > select, .modal label > textarea,
.auth-form label > input { margin-top: 7px; }
.modal label > small, .auth-form label > small { display: block; margin-top: 6px; }
.modal label > span[aria-hidden="true"], .modal label > span:not(.record-icon) { display: inline; }
.modal .choice > span { display: block; margin-left: 0; }
.more-actions { position: relative; display: inline-block; vertical-align: middle; }
.more-actions > summary { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; list-style: none; white-space: nowrap; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions > summary svg { width: 14px; height: 14px; margin: 0; }
.more-actions-menu { position: absolute; z-index: 25; top: calc(100% + 3px); right: 0; min-width: 112px; display: grid; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 12px 32px rgba(15,23,42,.16); }
.more-actions-menu .text-button { display: block; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 6px; text-align: left; white-space: nowrap; }
.more-actions-menu .text-button:hover { background: var(--primary-soft); text-decoration: none; }
.more-actions-menu .danger-text:hover { background: #fef2f2; }
#license-table .action-column { min-width: 118px; }
#license-table td.action-column { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
#license-table .code { max-width: 185px; }
.audit-date { display: block; }
.audit-date input { width: 142px; min-height: 42px; font-size: 12px; }
.device-network { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding: 11px; border-radius: 9px; background: #f8fafc; }
.device-network span { color: var(--text-muted); font-size: 11px; }
.device-network strong { display: block; margin-top: 4px; color: var(--text-secondary); overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 720px) {
  .audit-date, .audit-date input { width: 100%; }
  .device-network { grid-template-columns: 1fr; }
}

.release-list { display: grid; gap: 16px; max-width: 1080px; }
.release-entry { padding: 22px 24px; }
.release-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.release-heading { display: flex; align-items: center; gap: 10px; }
.release-version { color: var(--primary); font: 700 20px/1.2 Consolas, monospace; }
.release-latest { padding: 3px 8px; border-radius: 10px; color: #166534; background: #ecfdf5; font-size: 11px; font-weight: 650; }
.release-head time { color: var(--text-muted); font-size: 12px; }
.release-entry > h3 { margin: 12px 0 10px; font-size: 17px; }
.release-items { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.release-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.release-details section { padding: 13px 15px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; }
.release-details strong { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.release-details strong svg { width: 16px; height: 16px; color: var(--primary); }
.release-details p { margin: 7px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.release-current { color: var(--text-secondary); font: 650 13px/1.4 Consolas, monospace; white-space: nowrap; }
@media (max-width: 640px) {
  .release-entry { padding: 18px; }
  .release-details { grid-template-columns: 1fr; }
  .release-current { display: none; }
}

.cockpit-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
#security-center-updated { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.security-center { position: relative; margin: 20px 0; padding: 20px; overflow: hidden; border: 1px solid #183b5c; border-radius: 16px; color: #dbeafe; background: radial-gradient(circle at 85% 0, rgba(14,165,233,.14), transparent 34%), linear-gradient(135deg, #081526, #0d2038 58%, #0b1a2d); box-shadow: 0 18px 40px rgba(8,21,38,.16); }
.security-center::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .13; background-image: linear-gradient(rgba(56,189,248,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(56,189,248,.15) 1px, transparent 1px); background-size: 36px 36px; }
.security-center > * { position: relative; }
.security-center-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.security-center-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; color: #f0f9ff; font-size: 16px; }
.security-center-head p { margin: 3px 0 0; color: #7f9ab9; font-size: 11px; }
.security-center .text-button { color: #67e8f9; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); animation: live-pulse 2.2s ease-in-out infinite; }
.has-high-risk .live-dot { background: #fb7185; box-shadow: 0 0 0 4px rgba(251,113,133,.14); }
@keyframes live-pulse { 50% { opacity: .55; box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
.security-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.security-metric { min-width: 0; display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid rgba(125,211,252,.12); border-radius: 11px; background: rgba(15,42,67,.7); transition: border-color .2s, transform .2s; }
.security-metric:hover { border-color: rgba(103,232,249,.45); transform: translateY(-2px); }
.security-metric > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #67e8f9; background: rgba(14,165,233,.12); }
.security-metric svg { width: 16px; height: 16px; }
.security-metric small, .security-metric strong, .security-metric p { display: block; }
.security-metric small { color: #8ea9c5; font-size: 10px; }
.security-metric strong { margin-top: 3px; color: #f0f9ff; font: 700 23px/1.2 Consolas, "Segoe UI", sans-serif; }
.security-metric p { margin: 4px 0 0; color: #718ba8; font-size: 10px; line-height: 1.45; }
.security-loading { grid-column: 1 / -1; padding: 20px; text-align: center; color: #8ea9c5; }
.cockpit-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.security-center .cockpit-panel { min-width: 0; padding: 16px; border-color: rgba(125,211,252,.12); border-radius: 11px; background: rgba(7,25,43,.8); box-shadow: none; }
.trend-panel { grid-column: span 8; }
.risk-panel { grid-column: span 4; }
.inactive-panel { grid-column: span 7; }
.live-panel { grid-column: span 5; }
.cockpit-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cockpit-panel-head h3 { margin: 0; color: #e0f2fe; font-size: 13px; }
.cockpit-panel-head p { margin: 3px 0 0; color: #718ba8; font-size: 10px; }
.chart-legend { display: flex; gap: 10px; color: #8ea9c5; font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 4px; }
.chart-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #22d3ee; }
.chart-legend .denied::before { background: #fb7185; }
.chart-legend .registration::before { border-radius: 50%; background: #fbbf24; }
.request-trend-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-grid { stroke: rgba(125,211,252,.09); stroke-width: 1; }
.chart-baseline { stroke: rgba(125,211,252,.25); }
.chart-axis { fill: #607c9b; font: 9px Consolas, monospace; }
.trend-bar { transform-box: fill-box; transform-origin: bottom; animation: bar-rise .55s ease-out both; }
.ok-bar { fill: #22d3ee; }
.denied-bar { fill: #fb7185; }
.registration-dot { fill: #fbbf24; filter: drop-shadow(0 0 4px rgba(251,191,36,.6)); }
@keyframes bar-rise { from { transform: scaleY(0); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
.risk-alerts, .inactive-devices, .live-requests { display: grid; gap: 9px; max-height: 390px; overflow-y: auto; scrollbar-width: thin; }
.risk-alert { padding: 11px 12px; border: 1px solid rgba(251,191,36,.18); border-left: 3px solid #fbbf24; border-radius: 8px; background: rgba(120,53,15,.12); animation: alert-in .35s ease-out both; }
.risk-alert.high { border-color: rgba(251,113,133,.25); border-left-color: #fb7185; background: rgba(159,18,57,.12); }
@keyframes alert-in { from { opacity: 0; transform: translateX(5px); } }
.risk-alert-head { display: flex; justify-content: space-between; gap: 8px; color: #fbbf24; font-size: 9px; }
.risk-alert.high .risk-alert-head { color: #fda4af; }
.risk-alert h4 { margin: 6px 0 3px; color: #f8fafc; font-size: 12px; }
.risk-alert p { margin: 3px 0; color: #a9bfd4; font-size: 10px; line-height: 1.55; }
.risk-alert details { margin-top: 7px; color: #8ea9c5; font-size: 10px; }
.risk-alert summary { cursor: pointer; color: #bae6fd; }
.risk-alert ul { margin: 7px 0; padding-left: 16px; }
.risk-actions { display: flex; gap: 12px; margin-top: 6px; }
.risk-actions .text-button { min-height: 30px; padding: 3px 0; font-size: 10px; text-decoration: none; }
.cockpit-empty { padding: 22px 12px; text-align: center; color: #718ba8; font-size: 11px; line-height: 1.7; }
.cockpit-empty.success { color: #6ee7b7; }
.inactive-device { padding: 9px 11px; border: 1px solid rgba(125,211,252,.1); border-radius: 8px; background: rgba(15,42,67,.45); }
.device-main { width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; padding: 0; color: inherit; text-align: left; background: transparent; }
.device-main strong, .device-main small { display: block; }
.device-main strong { color: #e0f2fe; font-size: 11px; }
.device-main small { margin-top: 2px; overflow: hidden; color: #718ba8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.device-activity { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.device-activity.inactive { background: #fb7185; }
.device-age { text-align: right; }
.device-age strong { color: #fde68a; font: 700 15px Consolas, monospace; }
.device-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 7px 0 0 18px; color: #607c9b; font-size: 9px; }
.live-request { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 8px 0; border-bottom: 1px solid rgba(125,211,252,.08); }
.live-request:last-child { border-bottom: 0; }
.request-state { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #34d399; }
.request-state.denied { background: #fb7185; }
.live-request strong, .live-request small { display: block; }
.live-request strong { color: #dbeafe; font-size: 10px; }
.live-request small { margin-top: 2px; color: #718ba8; font-size: 9px; }
.live-request p { margin: 3px 0 0; color: #8ea9c5; font-size: 9px; }
.live-request time { color: #607c9b; font-size: 8px; white-space: nowrap; }
.detection-rules { margin-top: 12px; border: 1px solid rgba(125,211,252,.1); border-radius: 9px; background: rgba(7,25,43,.55); }
.detection-rules > summary { padding: 10px 13px; cursor: pointer; color: #8ea9c5; font-size: 10px; }
#detection-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 13px 13px; }
#detection-rules article { padding: 9px 11px; border-radius: 7px; background: rgba(15,42,67,.5); }
#detection-rules strong { color: #bae6fd; font-size: 10px; }
#detection-rules p { margin: 4px 0 0; color: #718ba8; font-size: 9px; }
.registration-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.registration-summary article { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.registration-summary small, .registration-summary strong { display: block; }
.registration-summary small { color: var(--text-muted); font-size: 10px; }
.registration-summary strong { margin-top: 3px; font: 700 21px Consolas, monospace; }
.client-events-card table { min-width: 1120px; }
@media (max-width: 1240px) {
  .security-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trend-panel, .risk-panel { grid-column: span 12; }
  .inactive-panel, .live-panel { grid-column: span 6; }
}
@media (max-width: 760px) {
  .cockpit-actions { justify-content: flex-start; }
  #security-center-updated { width: 100%; white-space: normal; }
  .security-center { padding: 14px; }
  .security-metrics, .registration-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inactive-panel, .live-panel { grid-column: span 12; }
  #detection-rules { grid-template-columns: 1fr; }
  .security-center-head { align-items: flex-start; }
  .chart-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .trend-bar, .risk-alert { animation: none !important; }
  .security-metric { transition: none; }
  .security-metric:hover { transform: none; }
}

:root {
  --nav: #070d1a;
  --nav-soft: #111b30;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --surface: #ffffff;
  --background: #f3f6fc;
  --border: #dfe6f1;
  --text: #111c31;
  --text-secondary: #4e5d75;
  --text-muted: #718096;
  --radius: 14px;
  --sidebar-width: 236px;
  --shadow: 0 8px 24px rgba(30, 41, 59, .055);
}
html, body { height: 100%; }
body { color: var(--text); background: var(--background); font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif; letter-spacing: .005em; }
::selection { color: #fff; background: #4f46e5; }
.brand-mark { background: linear-gradient(135deg, #4f46e5, #2563eb 58%, #06b6d4); box-shadow: 0 7px 20px rgba(79,70,229,.22); }
.sidebar { color: #cbd5e1; background: radial-gradient(circle at 20% 0, rgba(79,70,229,.18), transparent 28%), linear-gradient(180deg, #080f1f, #070d1a 70%); border-right: 1px solid rgba(148,163,184,.08); }
.sidebar-brand { padding-bottom: 20px; }
.sidebar-brand strong { font-size: 14px; letter-spacing: .01em; }
.sidebar-brand span { color: #64748b; }
.sidebar nav { overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.sidebar nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item, .nav-group-summary { min-height: 40px; border-radius: 9px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.nav-item:hover, .nav-group-summary:hover { color: #f8fafc; background: rgba(99,102,241,.1); }
.nav-item.active { color: #fff; background: linear-gradient(100deg, #4f46e5, #3b82f6); box-shadow: 0 8px 20px rgba(79,70,229,.24); }
.nav-item.active::before { background: #67e8f9; }
.nav-subitems { border-color: rgba(148,163,184,.12); }
.sidebar-security { width: 100%; border: 1px solid rgba(99,102,241,.18); color: inherit; text-align: left; background: linear-gradient(110deg, rgba(79,70,229,.12), rgba(6,182,212,.05)); cursor: pointer; transition: border-color .18s, background .18s; }
.sidebar-security:hover { border-color: rgba(103,232,249,.32); background: rgba(79,70,229,.18); }
.sidebar-security strong { color: #e0e7ff; }
.sidebar-security small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { height: 68px; min-height: 68px; padding: 12px 26px; border-bottom-color: rgba(203,213,225,.75); background: rgba(255,255,255,.82); backdrop-filter: blur(18px); }
.topbar h1 { font-size: 19px; font-weight: 700; }
.main-content { max-width: none; padding: 22px 26px 36px; }
.page:not(#page-dashboard) { width: 100%; max-width: 1560px; margin: 0 auto; }
.page.active { animation: page-in .24s cubic-bezier(.2,.8,.2,1); }
.section-toolbar, .hero-row { margin-bottom: 18px; }
.section-toolbar h2, .hero-row h2 { font-size: 24px; }
.card { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-card { border-color: rgba(203,213,225,.78); }
.table-tools { background: rgba(248,250,252,.7); }
th { height: 40px; color: #64748b; letter-spacing: .025em; background: #f7f9fd; }
td { padding-top: 12px; padding-bottom: 12px; }
tbody tr:hover { background: #f8faff; }
.button { min-height: 40px; border-radius: 9px; letter-spacing: .01em; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.button.primary { background: linear-gradient(105deg, #4f46e5, #3b82f6); box-shadow: 0 6px 16px rgba(79,70,229,.2); }
.button.primary:hover { background: linear-gradient(105deg, #4338ca, #2563eb); box-shadow: 0 8px 22px rgba(79,70,229,.28); transform: translateY(-1px); }
.button.secondary:hover { border-color: #a5b4fc; color: #4338ca; background: #f8faff; }
.text-button { color: var(--primary); }
.icon-button { border-radius: 9px; }
input, select, textarea { border-color: #cbd5e1; border-radius: 9px; background: rgba(255,255,255,.95); }
input:focus, select:focus, textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-section, .form-section-block { border-color: var(--border); }
.modal { border: 1px solid rgba(255,255,255,.65); border-radius: 18px; box-shadow: 0 28px 90px rgba(7,13,26,.28); }
.modal::backdrop { background: rgba(7,13,26,.58); backdrop-filter: blur(6px); }
.modal-head { border-bottom-color: #e7ecf4; }
.modal-heading-icon { background: var(--primary-soft); color: var(--primary); }
.toast { border-radius: 11px; box-shadow: 0 16px 40px rgba(15,23,42,.18); }
.auth-shell { background: radial-gradient(circle at 15% 15%, rgba(79,70,229,.34), transparent 34%), radial-gradient(circle at 85% 80%, rgba(6,182,212,.17), transparent 30%), linear-gradient(145deg, #070d1a, #111b35); }
.auth-panel { border: 1px solid rgba(255,255,255,.75); box-shadow: 0 32px 90px rgba(0,0,0,.35); }
@media (min-width: 821px) {
  body { overflow: hidden; }
  .app-shell { height: 100dvh; min-height: 0; display: flex; overflow: hidden; }
  .sidebar { position: relative; inset: auto; z-index: 40; width: var(--sidebar-width); height: 100dvh; flex: 0 0 var(--sidebar-width); min-height: 0; padding: 18px 13px 13px; }
  .content-shell { height: 100dvh; min-height: 0; flex: 1; margin-left: 0 !important; overflow: hidden; }
  .main-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 820px) {
  .main-content { min-height: calc(100dvh - 68px); }
}
.compact-button { min-height: 34px; padding: 5px 12px; font-size: 11px; }
#main-content.dashboard-mode { padding: 12px 16px 16px; }
#page-dashboard { height: 100%; }
.security-center { height: 100%; min-height: 620px; display: flex; flex-direction: column; margin: 0; padding: 14px 16px; border-color: rgba(99,102,241,.25); border-radius: 18px; background: radial-gradient(circle at 88% -5%, rgba(79,70,229,.25), transparent 30%), radial-gradient(circle at 5% 100%, rgba(6,182,212,.08), transparent 28%), linear-gradient(145deg, #080f1f, #0d192b 62%, #0a1424); box-shadow: 0 20px 48px rgba(15,23,42,.16); }
.security-center::before { opacity: .1; background-size: 32px 32px; }
.security-center-head { flex: 0 0 auto; margin-bottom: 10px; }
.security-center-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: #f8fafc; font-size: 17px; letter-spacing: .01em; }
.security-center-head p { margin-top: 3px; color: #7d91ad; }
.compact-button svg { width: 14px; height: 14px; }
.security-metrics { flex: 0 0 auto; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.security-metric { min-height: 66px; padding: 10px 11px; color: inherit; text-align: left; background: linear-gradient(135deg, rgba(30,41,59,.72), rgba(15,29,48,.74)); }
.security-metric > span { width: 26px; height: 26px; color: #818cf8; background: rgba(99,102,241,.12); }
.security-metric strong { font-size: 20px; }
.security-metric p { margin-top: 2px; }
.cockpit-grid { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1.12fr) minmax(0, .88fr); gap: 10px; }
.security-center .cockpit-panel { display: flex; flex-direction: column; min-height: 0; padding: 12px; overflow: hidden; border-color: rgba(148,163,184,.12); background: rgba(8,21,38,.78); }
.trend-panel { grid-column: span 5; }
.risk-panel { grid-column: span 4; }
.notification-panel { grid-column: span 3; }
.inactive-panel { grid-column: span 4; }
.live-panel { grid-column: span 3; }
.asset-panel { grid-column: span 5; }
.cockpit-panel-head { flex: 0 0 auto; margin-bottom: 8px; }
.cockpit-panel-head h3 { font-size: 12px; letter-spacing: .02em; }
.request-trend-chart { flex: 1; min-height: 0; }
.request-trend-chart svg { width: 100%; height: 100%; min-height: 140px; max-height: 230px; }
.risk-alerts, .inactive-devices, .live-requests, .notification-list { flex: 1; min-height: 0; max-height: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(129,140,248,.3) transparent; }
.risk-alert { padding: 9px 10px; }
.risk-alert h4 { margin-top: 4px; }
.risk-alert p { line-height: 1.45; }
.notification-list { display: grid; align-content: start; gap: 8px; }
.notification-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 9px; border: 1px solid rgba(148,163,184,.1); border-radius: 9px; color: inherit; text-decoration: none; background: rgba(30,41,59,.34); transition: border-color .18s, background .18s; }
a.notification-item:hover { border-color: rgba(129,140,248,.36); background: rgba(79,70,229,.1); }
.notification-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #fbbf24; background: rgba(251,191,36,.09); }
.notification-icon.high { color: #fb7185; background: rgba(251,113,133,.1); }
.notification-icon.ok { color: #34d399; background: rgba(52,211,153,.09); }
.notification-icon svg { width: 13px; height: 13px; }
.notification-item strong { display: block; color: #e2e8f0; font-size: 10px; line-height: 1.45; }
.notification-item p { margin: 3px 0 0; color: #8296b0; font-size: 9px; line-height: 1.5; }
.notification-item time { display: block; margin-top: 4px; color: #526b88; font-size: 8px; }
.asset-status-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(150px, .8fr); gap: 12px; overflow: auto; }
.panel-subhead { display: flex; align-items: center; justify-content: space-between; min-height: 25px; color: #8ea9c5; font-size: 10px; }
.panel-subhead .text-button { min-height: 25px; font-size: 9px; }
.compact-license-list { display: grid; gap: 5px; }
.compact-license-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 6px 7px; border: 1px solid rgba(148,163,184,.08); border-radius: 7px; background: rgba(30,41,59,.3); }
.license-symbol { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; color: #818cf8; background: rgba(99,102,241,.1); }
.license-symbol svg { width: 12px; height: 12px; }
.compact-license-row strong, .compact-license-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-license-row strong { color: #cbd5e1; font-size: 9px; }
.compact-license-row small { margin-top: 2px; color: #607c9b; font-size: 8px; }
.compact-license-row .status { min-height: 19px; padding: 2px 6px; font-size: 8px; }
.asset-panel .security-list { padding: 0; }
.asset-panel .security-item { grid-template-columns: 20px 1fr; gap: 6px; padding: 5px 0; }
.asset-panel .security-item > span { width: 19px; height: 19px; }
.asset-panel .security-item svg { width: 11px; height: 11px; }
.asset-panel .security-item strong { color: #cbd5e1; font-size: 9px; }
.asset-panel .security-item small { color: #607c9b; font-size: 8px; }
.detection-rules { flex: 0 0 auto; margin-top: 8px; }
.detection-rules > summary { padding: 5px 9px; }
#detection-rules { max-height: 140px; overflow: auto; }
.security-limited .trend-panel, .security-limited .risk-panel, .security-limited .inactive-panel, .security-limited .live-panel, .security-limited .detection-rules { display: none; }
.security-limited .notification-panel { grid-column: span 4; }
.security-limited .asset-panel { grid-column: span 8; }
@media (min-width: 1280px) and (min-height: 700px) {
  #main-content.dashboard-mode { overflow: hidden; }
  .security-center { min-height: 0; }
}
@media (max-width: 1279px) {
  #main-content.dashboard-mode { overflow-y: auto; }
  .security-center { height: auto; min-height: 720px; }
  .cockpit-grid { grid-template-rows: none; }
  .trend-panel { grid-column: span 12; min-height: 280px; }
  .risk-panel, .notification-panel, .inactive-panel, .live-panel { grid-column: span 6; min-height: 260px; }
  .asset-panel { grid-column: span 12; min-height: 260px; }
  .security-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .security-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-panel, .notification-panel, .inactive-panel, .live-panel, .asset-panel { grid-column: span 12; }
  .asset-status-grid { grid-template-columns: 1fr; }
  .security-center-head { flex-wrap: wrap; }
  .security-center-head .cockpit-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
