@font-face {
  font-family: "NightCorp Display";
  src: url("assets/AnoxicSC-Medium.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Source Han Sans TC UI";
  src: url("assets/fonts/SourceHanSansTC-VF.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  size-adjust: 108%;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3100-312F, U+31A0-31BF, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

:root {
  --paper: #f2f1e7;
  --surface: #fbfaf2;
  --surface-strong: #ffffff;
  --ink: #17180c;
  --muted: #666243;
  --line: #d7d3a7;
  --line-strong: #918b45;
  --navy: #121309;
  --navy-2: #766d00;
  --cyan: #bca900;
  --cyan-bg: #fff8c7;
  --amber: #d88912;
  --amber-bg: #fff0cf;
  --violet: #6b6fd6;
  --brand: #ffeb00;
  --brand-hover: #fff237;
  --brand-ink: #080909;
  --brand-text: #766d00;
  --brand-soft: #fff8c7;
  --brand-border: #b8a300;
  --sidebar-bg: #070808;
  --sidebar-ink: #edf5f7;
  --sidebar-muted: #aeb6a0;
  --rack-bg: #dedcc5;
  --rack-inset: #ebe9d8;
  --rack-rail: #716d4e;
  --rack-dash: #b7b38e;
  --row-bg: #fffef7;
  --row-border: #c7c28f;
  --table-head: #eae8d7;
  --table-ink: #41412c;
  --notice: #8e81d8;
  --signal-live: #d6bd00;
  --online-bg: #fff8c7;
  --online-text: #625700;
  --online-border: #b8a300;
  --attention-bg: #fff0cf;
  --attention-text: #855306;
  --attention-border: #dca84f;
  --danger: #ba4b45;
  --shadow: 0 18px 44px rgba(29, 48, 62, 0.11);
  --sidebar: 246px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #080909;
  --surface: #0d0f0f;
  --surface-strong: #141716;
  --ink: #f4f4ee;
  --muted: #a8ada6;
  --line: #30342f;
  --line-strong: #5b6158;
  --navy: #050606;
  --navy-2: #ffeb00;
  --cyan: #ffeb00;
  --cyan-bg: #373200;
  --amber: #ff9d00;
  --amber-bg: #3c2700;
  --violet: #9b9eed;
  --brand-hover: #fff45c;
  --brand-text: #ffeb00;
  --brand-soft: #2c2900;
  --brand-border: #d1bf00;
  --sidebar-bg: #050606;
  --sidebar-ink: #f4f4ee;
  --sidebar-muted: #a8ada6;
  --rack-bg: #080909;
  --rack-inset: #171a18;
  --rack-rail: #9d9b76;
  --rack-dash: #45473c;
  --row-bg: #141716;
  --row-border: #5a5b40;
  --table-head: #080909;
  --table-ink: #d8e1d0;
  --notice: #9b9eed;
  --signal-live: #ffeb00;
  --online-bg: #2c2900;
  --online-text: #fff25b;
  --online-border: #d1bf00;
  --attention-bg: #342300;
  --attention-text: #ffbd54;
  --attention-border: #9c6500;
  --shadow: 0 20px 54px rgba(0, 0, 0, .34);
}

html[data-tenant="rain"] {
  --paper: #edf7fa;
  --surface: #f8fcfd;
  --surface-strong: #ffffff;
  --ink: #0b2531;
  --muted: #52707c;
  --line: #c1dce5;
  --line-strong: #6eaec3;
  --navy: #06222d;
  --navy-2: #087da4;
  --cyan: #20add8;
  --cyan-bg: #d9f5ff;
  --brand: #53d3ff;
  --brand-hover: #79ddff;
  --brand-ink: #041117;
  --brand-text: #087a9e;
  --brand-soft: #d9f5ff;
  --brand-border: #20a9d4;
  --sidebar-bg: #04141b;
  --sidebar-ink: #eafaff;
  --sidebar-muted: #91b5c1;
  --rack-bg: #d7eaf0;
  --rack-inset: #e8f5f8;
  --rack-rail: #537b89;
  --rack-dash: #9fc4cf;
  --row-bg: #fbfeff;
  --row-border: #9bc9d8;
  --table-head: #dfedf2;
  --table-ink: #214653;
  --notice: #53d3ff;
  --signal-live: #27bce8;
  --online-bg: #d9f5ff;
  --online-text: #086887;
  --online-border: #20a9d4;
}

html[data-theme="dark"][data-tenant="rain"] {
  --paper: #040c10;
  --surface: #07151b;
  --surface-strong: #0b2028;
  --ink: #eafaff;
  --muted: #8db2bf;
  --line: #1e4553;
  --line-strong: #347b94;
  --navy: #02090c;
  --navy-2: #53d3ff;
  --cyan: #53d3ff;
  --cyan-bg: #073546;
  --brand: #53d3ff;
  --brand-hover: #82e2ff;
  --brand-ink: #041117;
  --brand-text: #53d3ff;
  --brand-soft: #073546;
  --brand-border: #39bce7;
  --sidebar-bg: #02090d;
  --sidebar-ink: #eafaff;
  --sidebar-muted: #86abb8;
  --rack-bg: #040c10;
  --rack-inset: #0c2028;
  --rack-rail: #79a7b6;
  --rack-dash: #244e5d;
  --row-bg: #0b2028;
  --row-border: #2b6579;
  --table-head: #040c10;
  --table-ink: #d7f4fc;
  --notice: #70dcff;
  --signal-live: #53d3ff;
  --online-bg: #073546;
  --online-text: #9be9ff;
  --online-border: #39bce7;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", "Source Han Sans TC UI", "Noto Sans TC", "Microsoft JhengHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.auth-loading { visibility: hidden; }

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 38%, transparent); outline-offset: 2px; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  border-right: 1px solid rgba(255,255,255,.08);
  z-index: 20;
}

.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-block strong { display: block; color: var(--brand); font: 400 20px/1 "NightCorp Display", "Segoe UI Variable", sans-serif; letter-spacing: .08em; }
.brand-block span { display: block; margin-top: 2px; color: var(--sidebar-muted); font: 700 9px/1.2 Consolas, monospace; letter-spacing: .16em; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }

.nav-list { display: grid; gap: 6px; margin-top: 26px; }
.nav-item { width: 100%; min-height: 46px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--sidebar-muted); text-align: left; cursor: pointer; }
.nav-item svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.is-active { background: var(--brand); color: var(--brand-ink); }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 10px; background: rgba(255,255,255,.12); font: 700 11px/1 Consolas, monospace; text-align: center; }
.nav-item.is-active .nav-count { background: color-mix(in srgb, var(--brand-ink) 13%, transparent); color: var(--brand-ink); }

.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.13); }
.demo-stamp { display: inline-block; padding: 5px 8px; color: var(--brand); border: 1px solid var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); font: 700 10px/1 Consolas, monospace; letter-spacing: .12em; }
.sidebar-foot p { margin: 10px 0 0; color: var(--sidebar-muted); font-size: 12px; line-height: 1.6; }
.account-button { margin-top: 12px; padding: 7px 0; border: 0; background: transparent; color: var(--sidebar-muted); font-size: 12px; cursor: pointer; }
.account-button:hover { color: var(--brand); }

.main-content { margin-left: var(--sidebar); padding: 34px clamp(22px, 3vw, 48px) 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.section-label { margin: 0 0 7px; color: var(--navy-2); font: 800 10px/1.2 Consolas, monospace; letter-spacing: .15em; }
h1, h2 { margin: 0; font-weight: 680; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; }
h2 { font-size: 20px; line-height: 1.25; }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; padding-top: 10px; }

.search-box { width: min(300px, 28vw); height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.search-box svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: #7b8790; }
.primary-button, .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border-radius: 3px; cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: .02em; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.primary-button { border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); }
.primary-button:hover { background: var(--brand-hover); border-color: var(--brand-hover); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.primary-button svg, .secondary-button svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.primary-button.is-loading svg { animation: spin .7s linear infinite; }
.secondary-button { border: 1px solid var(--brand-border); background: transparent; color: var(--brand-text); }
.secondary-button:hover { background: var(--brand); color: var(--brand-ink); transform: translateY(-1px); }
.secondary-button:active { transform: translateY(0); }
.theme-toggle { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--navy-2); cursor: pointer; }
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.theme-toggle svg { grid-area: 1 / 1; width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-toggle .sun-icon { display: none; }
html[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
html[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); }
.status-strip article { min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-right: 1px solid var(--line); }
.status-strip article:last-child { border-right: 0; }
.status-strip strong, .status-strip span { display: block; }
.status-strip strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.status-strip div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-lamp { width: 13px; height: 13px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px rgba(97,112,123,.12); }
.status-lamp.online { background: var(--signal-live); box-shadow: 0 0 0 5px color-mix(in srgb, var(--signal-live) 18%, transparent); animation: livePulse 1.65s cubic-bezier(.2,.7,.25,1) infinite; }
.status-lamp.discord { background: var(--notice); box-shadow: 0 0 0 5px color-mix(in srgb, var(--notice) 18%, transparent); }
.metric-icon { width: 36px; height: 36px; display: grid!important; place-items: center; border: 1px solid var(--brand-border); border-radius: 4px; background: var(--brand-soft); color: var(--brand-text); }
.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-icon.amber { border-color: var(--attention-border); background: var(--attention-bg); color: var(--attention-text); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .7fr); gap: 20px; }
.rack-panel, .activity-panel, .device-section { background: var(--surface); border: 1px solid var(--line); }
.panel-heading { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { padding-inline: 18px; }
.panel-heading .section-label { margin-bottom: 5px; }

.filter-group { display: flex; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--brand) 5%, var(--surface)); border: 1px solid var(--line); border-radius: 4px; }
.filter-button { min-width: 58px; min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.filter-button:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-button.is-active { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(31,47,56,.16); }

.rack-frame { display: grid; grid-template-columns: 30px 1fr 30px; margin: 20px; border: 1px solid var(--line-strong); background: var(--rack-bg); box-shadow: inset 0 0 0 5px var(--rack-inset); }
.rack-rail { display: grid; grid-template-rows: repeat(4, 1fr); padding: 8px 0; color: var(--rack-rail); font: 700 8px/1 Consolas, monospace; text-align: center; }
.rack-rail span { display: grid; place-items: center; border-bottom: 1px dashed var(--rack-dash); }
.rack-rail span:last-child { border: 0; }
.tool-list { display: grid; gap: 7px; padding: 8px 0; }
.tool-unit { min-height: 76px; display: grid; grid-template-columns: 44px 13px minmax(180px, 1fr) 58px 92px 72px 18px; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--row-border); background: var(--row-bg); box-shadow: 0 2px 0 color-mix(in srgb, var(--navy) 8%, transparent); text-align: left; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.tool-unit:hover { border-color: var(--navy-2); transform: translateY(-1px); }
.tool-unit[hidden] { display: none; }
.unit-id { color: #66747d; font: 700 10px/1 Consolas, monospace; letter-spacing: .08em; }
.tool-led { width: 10px; height: 10px; border-radius: 50%; }
.tool-led.online { background: var(--signal-live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal-live) 18%, transparent); animation: livePulse 1.65s cubic-bezier(.2,.7,.25,1) infinite; }
.tool-led.attention { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.tool-identity strong, .tool-identity small, .tool-metric small, .tool-metric strong { display: block; }
.tool-identity strong { font-size: 14px; }
.tool-identity small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.tool-metric { font-variant-numeric: tabular-nums; }
.tool-metric small { color: var(--muted); font-size: 9px; }
.tool-metric strong { margin-top: 5px; font-size: 11px; }
.tool-status, .table-status { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; min-height: 30px; padding: 0 11px; border: 1px solid currentColor; border-radius: 3px; font-size: 11px; font-weight: 850; letter-spacing: .03em; white-space: nowrap; }
.tool-status.online, .table-status.online { border-color: var(--online-border); background: var(--online-bg); color: var(--online-text); }
.tool-status.attention, .table-status.attention { border-color: var(--attention-border); background: var(--attention-bg); color: var(--attention-text); }
.chevron { width: 16px; fill: none; stroke: #78868f; stroke-width: 2; }

.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--brand-border); background: transparent; color: var(--brand-text); border-radius: 50%; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.icon-button:hover { background: var(--brand); color: var(--brand-ink); transform: translateX(2px); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.activity-list { list-style: none; margin: 0; padding: 4px 18px 10px; }
.activity-list li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 17px 0; border-bottom: 1px solid #d9dee1; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 32px; bottom: -18px; width: 1px; background: #cbd2d6; }
.event-node { width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; background: var(--muted); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--muted); z-index: 1; }
.event-node.online { background: var(--signal-live); box-shadow: 0 0 0 1px var(--signal-live); }
.event-node.discord { background: var(--notice); box-shadow: 0 0 0 1px var(--notice); }
.event-node.attention { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.activity-list strong { font-size: 13px; }
.activity-list p { margin: 5px 0 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.activity-list time { color: #7c8890; font: 700 9px/1 Consolas, monospace; text-transform: uppercase; }

.device-section { margin-top: 20px; }
.device-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { height: 42px; padding: 0 20px; background: var(--table-head); color: var(--muted); font: 800 9px/1 Consolas, monospace; letter-spacing: .12em; text-align: left; }
td { height: 64px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--table-ink); font-size: 12px; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.port-count { padding: 4px 6px; border: 1px solid #aeb9bf; color: var(--navy-2); font: 700 9px/1 Consolas, monospace; letter-spacing: .06em; }

.detail-drawer { position: fixed; inset: 0 0 0 auto; width: min(420px, 94vw); padding: 34px 30px; background: var(--surface-strong); box-shadow: -20px 0 60px rgba(20,37,48,.22); transform: translateX(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); z-index: 60; overflow-y: auto; }
.detail-drawer.is-open { transform: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(17,31,41,.35); z-index: 50; }
.drawer-close { position: absolute; top: 22px; right: 22px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.drawer-close svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.drawer-summary { margin-top: 28px; padding: 18px; background: #edf1f2; border: 1px solid var(--line); }
.drawer-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0; }
.drawer-summary dt { color: var(--muted); font-size: 10px; }
.drawer-summary dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; }
.drawer-section { margin-top: 28px; }
.drawer-section h3 { margin: 0 0 12px; font-size: 14px; }
.drawer-section ul { margin: 0; padding: 0; list-style: none; }
.drawer-section li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.drawer-section li span { color: var(--muted); }

.toast { position: fixed; right: 26px; bottom: 26px; padding: 13px 18px; background: var(--ink); color: white; border-radius: 4px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; z-index: 80; font-size: 13px; }
.toast.is-visible { opacity: 1; transform: none; }

.license-console[hidden], .monitor-console[hidden], .overview-surface[hidden], .hq-only[hidden] { display: none!important; }
.license-console { display: grid; gap: 20px; }
.monitor-console { display: grid; gap: 20px; }
.console-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--brand-border); }
.monitor-actions { display: flex; align-items: end; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.monitor-actions .inline-select { grid-template-columns: 1fr; min-width: 190px; }
.monitor-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.monitor-summary article { min-height: 94px; display: grid; align-content: center; gap: 7px; padding: 18px 22px; border-right: 1px solid var(--line); }
.monitor-summary article:last-child { border-right: 0; }
.monitor-summary strong { color: var(--brand-text); font: 800 24px/1 Consolas, monospace; }
.monitor-summary span { color: var(--muted); font-size: 11px; font-weight: 750; }
.monitor-panel, .notification-list { background: var(--surface); border: 1px solid var(--line); }
.monitor-table-wrap { overflow-x: auto; }
.monitor-table { min-width: 1250px; }
.monitor-table td { min-height: 76px; vertical-align: top; }
.device-fleet { padding: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, var(--paper)); }
.device-fleet-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 0 2px 15px; border-bottom: 1px solid var(--line); }
.device-fleet-heading span, .device-fleet-heading strong { display: block; }
.device-fleet-heading span { margin-bottom: 5px; color: var(--brand-text); font: 800 9px/1 Consolas, monospace; letter-spacing: .12em; }
.device-fleet-heading strong { font-size: 14px; }
.device-fleet-heading p { max-width: 460px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: right; }
.device-card-list { display: grid; gap: 14px; }
.device-card { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface-strong); transition: border-color .16s ease, background-color .16s ease; }
.device-card::before { position: absolute; inset: 0 0 auto; height: 1px; background: var(--brand); content: ""; opacity: .72; }
.device-card:hover { border-color: var(--brand-border); }
.device-card-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px 18px; }
.device-card-identity { display: flex; align-items: center; min-width: 0; gap: 14px; }
.device-icon { width: 46px; height: 46px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-text); }
.device-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.device-code { display: block; margin-bottom: 5px; color: var(--brand-text); font: 800 9px/1 Consolas, monospace; letter-spacing: .11em; }
.device-card h2 { margin: 0; color: var(--ink); font-size: 18px; line-height: 1.2; letter-spacing: .01em; }
.device-card-identity p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.device-state { min-width: 106px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 12px; border: 1px solid currentColor; font-size: 11px; font-weight: 850; white-space: nowrap; }
.device-state.online { border-color: var(--online-border); background: var(--online-bg); color: var(--online-text); }
.device-state.attention { border-color: var(--attention-border); background: var(--attention-bg); color: var(--attention-text); }
.device-state-lamp { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; background: currentColor; }
.device-state.online .device-state-lamp { animation: livePulse 2.2s ease-in-out infinite; }
.device-facts { display: grid; grid-template-columns: .85fr 1.65fr 1.1fr 1fr; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.device-fact { min-width: 0; min-height: 116px; padding: 17px 20px; border-right: 1px solid var(--line); }
.device-fact:last-child { border-right: 0; }
.device-fact dt { margin-bottom: 13px; color: var(--muted); font: 800 9px/1 Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.device-fact dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 760; overflow-wrap: anywhere; }
.device-fact small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.device-network dd, .device-network small { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; font-family: Consolas, monospace; }
.device-network dd span, .device-network small span { color: var(--brand-text); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.device-network .device-hwid { font-size: 9px; }
.device-license-fact dd { font-weight: 600; }
.device-card .monitor-license { padding-left: 12px; border-left: 1px solid var(--brand-border); }
.device-card .monitor-license strong, .device-card .monitor-license small { display: block; }
.device-card .monitor-license small { margin-top: 5px; color: var(--muted); }
.monitor-license-heading { display: block; }
.monitor-license-key { width: 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) 16px; align-items: center; gap: 8px; margin-top: 9px; padding: 8px 9px; border: 1px solid var(--brand-border); border-radius: 2px; background: var(--brand-soft); color: var(--brand-text); text-align: left; cursor: pointer; }
.monitor-license-key span { color: var(--muted); font: 800 8px/1 Consolas, monospace; letter-spacing: .08em; }
.monitor-license-key code { min-width: 0; color: var(--brand-text); font: 800 10px/1.35 Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.monitor-license-key svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.monitor-license-key:hover { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.monitor-license-key:hover span, .monitor-license-key:hover code { color: var(--brand-ink); }
.monitor-license-key:disabled { cursor: default; opacity: .62; }
.device-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; }
.device-note-copy { min-width: 0; }
.device-note-editor { width: 100%; }
[data-device-note][hidden] { display: none!important; }
.device-note-copy span, .device-note-copy strong { display: block; }
.device-note-copy span { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.device-note-copy strong { color: var(--ink); font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.device-empty-state { min-height: 180px; display: grid; place-content: center; gap: 8px; padding: 30px; border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; }
.device-empty-state strong, .device-empty-state span { display: block; }
.device-empty-state strong { color: var(--ink); font-size: 14px; }
.device-empty-state span { font-size: 11px; }
.monitor-license { display: block; margin-bottom: 6px; font-size: 11px; }
.monitor-license:last-child { margin-bottom: 0; }
.muted-value { color: var(--muted); }
.note-button { min-height: 36px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid var(--brand-border); border-radius: 3px; background: var(--brand-soft); color: var(--brand-text); font-size: 10px; font-weight: 800; cursor: pointer; }
.note-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.note-button:hover { background: var(--brand); color: var(--brand-ink); }
.note-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 2px; }
.event-payload { max-width: 360px; color: var(--muted); font: 600 10px/1.55 Consolas, monospace; overflow-wrap: anywhere; }
.notification-list { margin: 0; padding: 0 20px 8px; list-style: none; }
.notification-list > li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 17px 0; border-bottom: 1px solid var(--line); }
.notification-list > li:last-child { border-bottom: 0; }
.notification-list strong, .notification-list span, .notification-list time { display: block; }
.notification-list strong { margin-bottom: 5px; font-size: 12px; }
.notification-list span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.notification-list time { color: var(--muted); font: 700 9px/1.35 Consolas, monospace; text-align: right; white-space: nowrap; }
.notification-signal { width: 9px; height: 9px; margin-top: 3px; border: 2px solid color-mix(in srgb, var(--signal-live) 65%, var(--line)); border-radius: 50%; background: var(--signal-live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal-live) 12%, transparent); }
.notification-signal.attention { border-color: color-mix(in srgb, var(--attention) 70%, var(--line)); background: var(--attention); box-shadow: 0 0 0 3px color-mix(in srgb, var(--attention) 13%, transparent); }
.notification-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.notification-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.notification-filters button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.notification-filters button span { font: 700 11px/1 Consolas, monospace; }
.notification-filters button:hover { border-color: var(--brand-border); color: var(--ink); }
.notification-filters button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.notification-filters button:focus-visible, .notification-details summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.notification-summary { margin: 0; color: var(--muted); font-size: 12px; }
.notification-content { min-width: 0; }
.notification-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.notification-title strong { margin: 0; color: var(--ink); font-size: 14px; }
.notification-title .notification-total { color: var(--brand-text); font-size: 12px; font-weight: 750; }
.notification-content > p { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.notification-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.notification-meta span { font-size: 11px; }
.notification-meta .notification-attention { color: var(--attention-text); font-weight: 750; }
.notification-time time { font-size: 11px; }
.notification-time small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; text-align: right; }
.notification-details { margin-top: 12px; }
.notification-details summary { width: fit-content; color: var(--brand-text); font-size: 12px; font-weight: 700; cursor: pointer; }
.notification-details ul { max-height: 320px; overflow-y: auto; margin: 12px 0 0; padding: 0 14px; border: 1px solid var(--line); background: var(--surface-strong); list-style: none; }
.notification-details li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notification-details li:last-child { border-bottom: 0; }
.notification-details b { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.notification-details p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.notification-details time { font-size: 10px; }
.notification-list > .empty-cell { display: block; }
.notification-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.notification-pagination > span { color: var(--muted); font-size: 12px; }
.notification-pagination > div { display: flex; gap: 8px; }
.notification-pagination button:disabled { cursor: default; opacity: .45; }
.license-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.operation-panel, .license-list-panel, .audit-panel { background: var(--surface); border: 1px solid var(--line); }
.operation-panel { padding: 20px; }
.operation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.permission-chip { display: inline-flex; min-height: 26px; align-items: center; padding: 0 8px; border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-text); font: 800 9px/1 Consolas, monospace; letter-spacing: .08em; white-space: nowrap; }
.operation-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.operation-form + .operation-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.operation-form label, .inline-select { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.operation-form label[hidden] { display: none!important; }
.operation-form input:not([type="checkbox"]), .operation-form select, .inline-select select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface-strong); color: var(--ink); }
.operation-form select, .inline-select select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--brand-text) 50%), linear-gradient(135deg, var(--brand-text) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.operation-form select:hover, .inline-select select:hover { border-color: var(--brand-border); background-color: color-mix(in srgb, var(--brand) 5%, var(--surface-strong)); }
.operation-form select:disabled, .inline-select select:disabled { cursor: not-allowed; opacity: .58; }
.operation-form input:focus, .operation-form select:focus, .inline-select select:focus { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); border-color: var(--brand-border); }
.operation-form button { align-self: end; }
.compact-form { grid-template-columns: minmax(0, 1.5fr) minmax(100px, .8fr) auto; }
.license-generator-form { grid-template-columns: 1fr; gap: 16px; }
.license-generator-form > .hq-only { padding: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 82%, var(--paper)); }
.generator-field { min-width: 0; display: grid; align-content: start; gap: 11px; padding: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 82%, var(--paper)); }
.generator-field-heading { display: flex!important; align-items: center; gap: 10px!important; color: var(--ink)!important; }
.generator-field-heading > span:last-child { min-width: 0; display: grid; gap: 3px; }
.generator-field-heading strong, .generator-field-heading small { display: block; }
.generator-field-heading strong { color: var(--ink); font-size: 11px; font-weight: 850; }
.generator-field-heading small { color: var(--muted); font-size: 9px; font-weight: 650; line-height: 1.35; }
.generator-field-icon { width: 30px; height: 30px; display: grid; flex: 0 0 30px; place-items: center; border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-text); }
.generator-field-icon svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.65; }
.product-select-shell { position: relative; min-height: 54px; display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid var(--line-strong); background: var(--surface-strong); transition: border-color .16s ease, box-shadow .16s ease; }
.product-select-shell:focus-within { border-color: var(--brand-border); box-shadow: inset 3px 0 0 var(--brand), 0 0 0 2px color-mix(in srgb, var(--brand) 16%, transparent); }
.product-select-label { color: var(--brand-text); font: 800 8px/1 Consolas, monospace; letter-spacing: .1em; }
.license-generator-form .product-select-shell select { min-width: 0; min-height: 52px; padding: 0; border: 0; outline: 0; appearance: none; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; }
.select-chevron { width: 17px; fill: none; stroke: var(--brand-text); stroke-width: 1.8; pointer-events: none; }
.license-type-field { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 82%, var(--paper)); }
.license-type-field legend { width: 100%; margin: 0 0 11px; padding: 0; }
.license-type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; border: 1px solid var(--line-strong); background: var(--surface-strong); }
.license-type-options label { position: relative; display: block; cursor: pointer; }
.license-type-options input { position: absolute; opacity: 0; pointer-events: none; }
.license-type-options label > span { display: grid; min-height: 66px; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid transparent; color: var(--muted); transition: border-color .16s ease, background .16s ease, color .16s ease; }
.license-type-options svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.license-type-options label > span > span { display: grid; gap: 4px; }
.license-type-options strong, .license-type-options small { display: block; }
.license-type-options strong { color: inherit; font-size: 12px; }
.license-type-options small { font-size: 10px; font-weight: 600; }
.license-type-options label:hover > span { color: var(--ink); }
.license-type-options input:checked + span { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 3px 0 0 var(--brand); }
.license-type-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); }
.generator-parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.generator-number-field, .duration-field { min-height: 162px; }
.quantity-surface, .duration-surface { min-height: 105px; display: grid; grid-template-rows: 58px 45px; border: 1px solid var(--line-strong); background: var(--surface-strong); }
.number-stepper { min-height: 58px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: stretch; }
.number-value, .duration-input-wrap { min-width: 0; display: flex; justify-content: center; align-items: stretch; }
.license-generator-form .number-stepper button { min-width: 0; min-height: 56px; align-self: stretch; border: 0; background: color-mix(in srgb, var(--surface) 76%, var(--paper)); color: var(--brand-text); font: 800 18px/1 Consolas, monospace; cursor: pointer; transition: background .16s ease, color .16s ease; }
.license-generator-form .number-stepper button:first-child { border-right: 1px solid var(--line); }
.license-generator-form .number-stepper button:last-child { border-left: 1px solid var(--line); }
.license-generator-form .number-stepper button:hover { background: var(--brand); color: var(--brand-ink); }
.license-generator-form .number-stepper button:focus-visible { z-index: 1; outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: -3px; }
.license-generator-form .number-stepper input { width: 4ch; min-width: 0; min-height: 56px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 850 18px/1 Consolas, monospace; text-align: center; appearance: textfield; }
.license-generator-form .number-stepper input::-webkit-outer-spin-button, .license-generator-form .number-stepper input::-webkit-inner-spin-button { margin: 0; appearance: none; }
.number-unit { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.duration-surface #license-days { width: 6ch; min-width: 0; min-height: 56px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 850 18px/1 Consolas, monospace; text-align: center; appearance: textfield; }
.duration-surface #license-days::-webkit-outer-spin-button, .duration-surface #license-days::-webkit-inner-spin-button { margin: 0; appearance: none; }
.quantity-surface:focus-within, .duration-surface:focus-within { border-color: var(--brand-border); box-shadow: inset 0 2px 0 var(--brand); }
.duration-surface #license-days[hidden], .duration-permanent-copy[hidden] { display: none!important; }
.duration-permanent-copy { grid-area: 1 / 1 / 3 / 2; display: grid; grid-template-rows: 58px 45px; align-items: center; text-align: center; color: var(--brand-text); }
.duration-permanent-copy strong, .duration-permanent-copy small { display: block; }
.duration-permanent-copy strong { font-size: 12px; }
.duration-permanent-copy small { height: 100%; display: grid; place-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.quantity-presets, .duration-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.license-generator-form .quantity-presets button, .license-generator-form .duration-presets button { min-width: 0; min-height: 44px; align-self: stretch; padding: 0 2px; border: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 76%, var(--paper)); color: var(--muted); font: 750 10px/1 Consolas, monospace; white-space: nowrap; cursor: pointer; }
.license-generator-form .quantity-presets button:last-child, .license-generator-form .duration-presets button:last-child { border-right: 0; }
.license-generator-form .quantity-presets button:hover, .license-generator-form .quantity-presets button.is-active, .license-generator-form .duration-presets button:hover, .license-generator-form .duration-presets button.is-active { background: var(--brand-soft); color: var(--brand-text); }
.license-generator-form .quantity-presets button:focus-visible, .license-generator-form .duration-presets button:focus-visible { z-index: 1; outline: 3px solid var(--brand); outline-offset: -3px; }
.duration-field.is-permanent .duration-input-wrap { display: none; }
.duration-field.is-permanent .duration-presets { display: none; }
.generator-action-bar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 10px 10px 15px; border: 1px solid var(--brand-border); background: var(--brand-soft); }
.generator-action-bar > div span, .generator-action-bar > div strong { display: block; }
.generator-action-bar > div span { margin-bottom: 6px; color: var(--brand-text); font: 800 8px/1 Consolas, monospace; letter-spacing: .12em; }
.generator-action-bar > div strong { color: var(--ink); font-size: 11px; }
.license-submit { min-width: 154px; min-height: 48px; flex: 0 0 auto; align-self: center!important; justify-self: auto; }
.license-guide-panel { display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 86%, var(--paper)); }
html[data-tenant="nc"] .license-guide-panel { grid-column: 1 / -1; }
.license-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; border: 1px solid var(--line); list-style: none; }
.license-rule-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; min-height: 92px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.license-rule-list li:nth-child(2n) { border-right: 0; }
.license-rule-list li:nth-last-child(-n+2) { border-bottom: 0; }
.license-rule-list li > span { color: var(--brand-text); font: 800 10px/1 Consolas, monospace; }
.license-rule-list strong, .license-rule-list p { display: block; }
.license-rule-list strong { margin-bottom: 6px; color: var(--ink); font-size: 11px; }
.license-rule-list p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.license-issue-preview { min-height: 190px; display: grid; align-content: start; gap: 14px; margin-top: 16px; padding: 15px; border: 1px solid var(--line-strong); background: var(--surface-strong); }
.issue-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.issue-preview-heading > div span, .issue-preview-heading > div strong { display: block; }
.issue-preview-heading > div span { margin-bottom: 6px; color: var(--brand-text); font: 800 8px/1 Consolas, monospace; letter-spacing: .12em; }
.issue-preview-heading > div strong { color: var(--ink); font-size: 12px; }
.issue-preview-state { min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-text); font: 800 8px/1 Consolas, monospace; letter-spacing: .1em; }
.license-issue-preview dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); }
.license-issue-preview dl > div { min-width: 0; min-height: 64px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.license-issue-preview dl > div:nth-child(2n) { border-right: 0; }
.license-issue-preview dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.license-issue-preview dt { margin-bottom: 7px; color: var(--muted); font: 800 8px/1 Consolas, monospace; letter-spacing: .08em; }
.license-issue-preview dd { margin: 0; color: var(--ink); font-size: 10px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-meter { display: grid; gap: 8px; }
.seat-meter > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seat-meter > div span { color: var(--muted); font-size: 9px; font-weight: 750; }
.seat-meter > div strong { color: var(--brand-text); font: 800 9px/1 Consolas, monospace; }
.seat-meter-track { height: 5px; display: block; overflow: hidden; background: var(--line); }
.seat-meter-track i { width: 0; height: 100%; display: block; background: var(--brand); }
.license-guide-note { margin-top: 14px; padding: 16px; border: 1px solid var(--brand-border); background: var(--brand-soft); }
.license-guide-note strong, .license-guide-note span { display: block; }
.license-guide-note strong { margin-bottom: 5px; color: var(--brand-text); font-size: 11px; }
.license-guide-note span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.generated-keys { margin-top: 18px; padding: 14px; border: 1px solid var(--brand-border); background: var(--brand-soft); }
.generated-keys-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.generated-keys-heading strong, .generated-keys-heading span { display: block; }
.generated-keys-heading strong { margin-bottom: 4px; font-size: 13px; }
.generated-keys-heading span { color: var(--muted); font-size: 11px; }
.generated-key-actions, .generated-key-list li { display: flex; align-items: center; gap: 8px; }
.generated-key-actions { flex-wrap: wrap; justify-content: flex-end; }
.generated-key-actions button, .generated-key-list button { min-height: 34px; border: 1px solid var(--brand-border); background: var(--surface-raised); color: var(--brand-text); font-weight: 800; cursor: pointer; }
.generated-key-actions button { padding: 0 12px; }
.generated-key-actions button:first-child { background: var(--brand); color: var(--brand-ink); }
.generated-key-actions button:hover, .generated-key-list button:hover { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.generated-key-list { max-height: 260px; margin: 0; padding: 6px 0 0; overflow: auto; list-style-position: inside; }
.generated-key-list li { min-height: 42px; border-bottom: 1px solid var(--line); }
.generated-key-list li:last-child { border-bottom: 0; }
.generated-key-list code { flex: 1; min-width: 0; padding: 7px 0; color: var(--brand-text); font: 700 12px/1.4 Consolas, monospace; user-select: all; overflow-wrap: anywhere; }
.generated-key-list button { flex: 0 0 auto; padding: 0 14px; }
.inline-select { grid-template-columns: auto minmax(180px, 240px); align-items: center; }
.panel-support { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.license-list-heading { align-items: stretch; }
.license-search { width: min(430px, 48vw); display: grid; grid-template-columns: 18px minmax(180px, 1fr) auto; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface-strong); color: var(--muted); }
.license-search:focus-within { border-color: var(--brand-border); outline: 3px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.license-search svg { width: 17px; fill: none; stroke: var(--brand-text); stroke-width: 1.8; }
.license-search input { width: 100%; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.license-search input::placeholder { color: var(--muted); }
.license-search strong { padding-left: 10px; border-left: 1px solid var(--line); color: var(--brand-text); font: 800 9px/1 Consolas, monospace; white-space: nowrap; }
.license-card-list { display: grid; gap: 14px; padding: 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, var(--paper)); }
.license-card { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface-strong); transition: border-color .16s ease; }
.license-card::before { position: absolute; inset: 0 0 auto; height: 1px; background: var(--brand); content: ""; opacity: .72; }
.license-card:hover { border-color: var(--brand-border); }
.license-card-header { display: flex; align-items: stretch; justify-content: space-between; gap: 18px; padding: 17px 18px; }
.license-key-copy { min-width: 0; display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--brand-border); border-radius: 2px; background: var(--brand-soft); color: var(--brand-text); text-align: left; cursor: pointer; }
.license-key-copy span { min-width: 0; }
.license-key-copy small, .license-key-copy code { display: block; }
.license-key-copy small { margin-bottom: 7px; color: var(--muted); font: 800 8px/1 Consolas, monospace; letter-spacing: .11em; }
.license-key-copy code { color: var(--brand-text); font: 800 13px/1.45 Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.license-key-copy svg { width: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .16s ease; }
.license-key-copy:hover { background: var(--brand); color: var(--brand-ink); }
.license-key-copy:hover small { color: color-mix(in srgb, var(--brand-ink) 72%, transparent); }
.license-key-copy:hover svg { transform: translateY(-2px); }
.license-key-copy:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 2px; }
.license-key-copy.is-legacy { cursor: default; }
.license-key-copy.is-legacy em { color: var(--muted); font: 700 9px/1 Consolas, monospace; font-style: normal; }
.license-state { min-width: 106px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid currentColor; font-size: 11px; font-weight: 850; white-space: nowrap; }
.license-state > span { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; background: currentColor; }
.license-state.online { border-color: var(--online-border); background: var(--online-bg); color: var(--online-text); }
.license-state.attention { border-color: var(--attention-border); background: var(--attention-bg); color: var(--attention-text); }
.license-state.neutral { border-color: var(--line-strong); background: var(--surface); color: var(--muted); }
.license-card-facts { display: grid; grid-template-columns: 1.05fr 1.15fr .9fr 1.1fr; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.license-card-facts > div { min-width: 0; min-height: 118px; padding: 17px 18px; border-right: 1px solid var(--line); }
.license-card-facts > div:last-child { border-right: 0; }
.license-card-facts dt { margin-bottom: 12px; color: var(--muted); font: 800 9px/1 Consolas, monospace; letter-spacing: .08em; }
.license-card-facts dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.license-card-facts small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.license-card .license-expiry strong, .license-card .license-expiry small { display: block; }
.license-card .license-expiry small { margin-top: 7px; }
.license-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 13px 18px; }
.license-card-footer > div:first-child span, .license-card-footer > div:first-child strong { display: block; }
.license-card-footer > div:first-child span { margin-bottom: 5px; color: var(--brand-text); font: 800 8px/1 Consolas, monospace; letter-spacing: .1em; }
.license-card-footer > div:first-child strong { color: var(--muted); font-size: 10px; font-weight: 650; }
.license-empty-state { min-height: 180px; display: grid; place-content: center; gap: 8px; color: var(--muted); text-align: center; }
.license-empty-state strong, .license-empty-state span { display: block; }
.license-empty-state strong { color: var(--ink); font-size: 14px; }
.license-empty-state span { font-size: 11px; }
.license-table-wrap { overflow-x: auto; }
.license-table { min-width: 1260px; }
.license-table td { height: 70px; }
.license-hint { color: var(--muted); font: 700 11px/1 Consolas, monospace; }
.license-key-cell { min-width: 300px; }
.license-key-cell code { display: block; margin-bottom: 8px; color: var(--brand-text); font: 700 11px/1.4 Consolas, monospace; user-select: all; }
.license-key-cell small { display: block; margin-top: 5px; color: var(--muted); }
.license-note-cell button { min-height: 28px; padding: 0 9px; border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-text); font-size: 10px; font-weight: 800; cursor: pointer; }
.license-note-cell button:hover { background: var(--brand); color: var(--brand-ink); }
.license-note-cell { min-width: 0; }
.license-note-display[hidden], .license-note-editor[hidden] { display: none!important; }
.license-note-display strong { display: block; margin-bottom: 10px; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.license-note-editor { display: grid; min-width: 0; gap: 7px; }
.license-note-editor input { width: 100%; min-height: 34px; padding: 0 9px; border: 1px solid var(--brand-border); border-radius: 3px; background: var(--surface-strong); color: var(--ink); font-size: 11px; }
.license-note-editor input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); }
.license-note-editor div { display: flex; gap: 6px; }
.license-note-editor .note-save-button { background: var(--brand); color: var(--brand-ink); }
.license-expiry strong, .license-expiry small { display: block; }
.license-expiry small { margin-top: 5px; color: var(--muted); }
.license-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 250px; }
.action-button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.action-button:hover { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-text); }
.action-button.danger { border-color: color-mix(in srgb, var(--danger) 62%, var(--line)); color: var(--danger); }
.action-button.danger:hover { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.empty-cell { padding: 28px!important; color: var(--muted)!important; text-align: center; }
.audit-list { list-style: none; margin: 0; padding: 0 20px 8px; }
.audit-list li:not(.empty-cell) { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, 1fr) auto; gap: 18px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.audit-list li:last-child { border-bottom: 0; }
.audit-list strong, .audit-list span, .audit-list time { font-size: 11px; }
.audit-list span, .audit-list time { color: var(--muted); }
.audit-list time { font: 700 9px/1.3 Consolas, monospace; text-align: right; }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal-live) 58%, transparent), 0 0 8px color-mix(in srgb, var(--signal-live) 24%, transparent); }
  55% { box-shadow: 0 0 0 7px transparent, 0 0 14px color-mix(in srgb, var(--signal-live) 42%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .status-lamp.online,
  .tool-led.online,
  .device-state.online .device-state-lamp { animation: none; }
}

html[data-theme="dark"] body { background-image: linear-gradient(color-mix(in srgb, var(--brand) 2%, transparent) 1px, transparent 1px); background-size: 100% 32px; }
html[data-theme="dark"] .status-strip,
html[data-theme="dark"] .rack-panel,
html[data-theme="dark"] .activity-panel,
html[data-theme="dark"] .device-section { border-color: var(--brand-border); }
html[data-theme="dark"] .panel-heading { border-color: color-mix(in srgb, var(--brand-border) 46%, var(--line)); }
html[data-theme="dark"] .nav-item.is-active { background: var(--brand); color: var(--brand-ink); }
html[data-theme="dark"] .nav-item.is-active .nav-count { background: rgba(0,0,0,.16); color: #111; }
html[data-theme="dark"] .metric-icon { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }
html[data-theme="dark"] .metric-icon.amber { background: var(--attention-bg); color: var(--attention-text); }
html[data-theme="dark"] .filter-group { background: #10181e; border-color: var(--line); }
html[data-theme="dark"] .filter-button.is-active { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .icon-button { color: var(--brand); }
html[data-theme="dark"] .rack-frame { background: var(--rack-bg); box-shadow: inset 0 0 0 5px var(--rack-inset); }
html[data-theme="dark"] .rack-rail { color: var(--rack-rail); }
html[data-theme="dark"] .rack-rail span { border-color: var(--rack-dash); }
html[data-theme="dark"] .tool-unit { background: var(--row-bg); border-color: var(--row-border); box-shadow: 0 2px 0 rgba(0,0,0,.22); }
html[data-theme="dark"] .tool-unit:hover { border-color: var(--brand); }
html[data-theme="dark"] .chevron { stroke: #9dabb3; }
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .secondary-button:hover { background: var(--brand); color: var(--brand-ink); }
html[data-theme="dark"] .activity-list li { border-color: var(--line); }
html[data-theme="dark"] .activity-list li:not(:last-child)::before { background: #43515a; }
html[data-theme="dark"] th { background: var(--table-head); color: var(--muted); }
html[data-theme="dark"] td { color: var(--table-ink); border-color: var(--line); }
html[data-theme="dark"] .port-count { border-color: var(--brand-border); color: var(--brand); }
html[data-theme="dark"] .drawer-summary { background: #080909; border-color: var(--line); }
html[data-theme="dark"] .drawer-close { background: var(--surface-strong); }
html[data-theme="dark"] .drawer-section li { border-color: var(--line); }
html[data-theme="dark"] .drawer-backdrop { background: rgba(0, 0, 0, .58); }
html[data-theme="dark"] .toast { background: #e6eef1; color: #17202a; }

@media (max-width: 1280px) {
  :root { --sidebar: 82px; }
  .sidebar { padding-inline: 12px; }
  .brand-block { justify-content: center; padding-inline: 0; }
  .brand-block > div, .nav-item > span, .sidebar-foot p { display: none; }
  .nav-item { grid-template-columns: 1fr; place-items: center; padding: 0; }
  .sidebar-foot { padding-inline: 0; text-align: center; }
  .demo-stamp { writing-mode: vertical-rl; padding: 7px 5px; }
  .tool-unit { grid-template-columns: 40px 12px minmax(170px, 1fr) 60px 72px 18px; }
  .tool-metric:nth-of-type(5) { display: none; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; z-index: 30; }
  .brand-block { padding: 0 14px 0 0; border: 0; border-right: 1px solid rgba(255,255,255,.13); }
  .brand-logo { width: 32px; height: 32px; }
  .nav-list { display: flex; flex: 1; justify-content: space-around; margin: 0; gap: 4px; }
  .nav-item { width: 44px; min-height: 42px; }
  .sidebar-foot { display: none; }
  .main-content { margin-left: 0; padding: 24px 16px 46px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { padding-top: 0; }
  .search-box { width: 100%; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-strip article:nth-child(2) { border-right: 0; }
  .status-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .license-workbench { grid-template-columns: 1fr; }
  html[data-tenant="nc"] .license-guide-panel { grid-column: auto; }
  .console-heading { flex-direction: column; }
  .monitor-actions { width: 100%; justify-content: flex-start; }
  .device-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-fact:nth-child(2) { border-right: 0; }
  .device-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .license-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .license-card-facts > div:nth-child(2) { border-right: 0; }
  .license-card-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 600px) {
  .main-content { padding-inline: 12px; }
  h1 { font-size: 27px; }
  .license-list-heading { flex-direction: column; align-items: stretch; }
  .license-search { width: 100%; grid-template-columns: 18px minmax(0, 1fr) auto; }
  .topbar-actions { display: grid; grid-template-columns: 1fr auto auto; }
  .theme-toggle { grid-column: 2; }
  .primary-button { width: 44px; padding: 0; }
  .primary-button { grid-column: 3; }
  .primary-button span { display: none; }
  .status-strip article { min-height: 76px; padding: 14px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading.compact { flex-direction: row; align-items: center; }
  .rack-frame { grid-template-columns: 20px 1fr 20px; margin: 12px; }
  .tool-unit { grid-template-columns: 34px 10px 1fr 66px 16px; gap: 8px; padding: 10px; }
  .tool-metric { display: none; }
  .tool-status { grid-column: 4; grid-row: 1; }
  .chevron { grid-column: 5; }
  .tool-identity small { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .operation-form, .compact-form { grid-template-columns: 1fr; }
  .generator-parameter-grid { grid-template-columns: 1fr; }
  .generator-action-bar { align-items: stretch; flex-direction: column; }
  .generator-action-bar .license-submit { width: 100%; grid-column: auto; }
  .generator-action-bar .license-submit span { display: inline; }
  .inline-select { grid-template-columns: 1fr; }
  .generated-keys-heading { align-items: stretch; flex-direction: column; }
  .generated-key-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .generated-key-actions button:first-child { grid-column: 1 / -1; }
  .audit-list li:not(.empty-cell) { grid-template-columns: 1fr; gap: 6px; }
  .audit-list time { text-align: left; }
  .license-type-options, .license-rule-list { grid-template-columns: 1fr; }
  .license-rule-list li { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .license-rule-list li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .license-rule-list li:last-child { border-bottom: 0; }
  .license-submit { width: 100%; }
  .license-card-list { padding: 12px; }
  .license-card-header, .license-card-footer { align-items: stretch; flex-direction: column; }
  .license-state { min-height: 36px; align-self: flex-start; }
  .license-card-facts { grid-template-columns: 1fr; }
  .license-card-facts > div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .license-card-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .license-card-facts > div:last-child { border-bottom: 0; }
  .license-card-footer .license-actions { min-width: 0; }
  .monitor-summary { grid-template-columns: 1fr; }
  .monitor-summary article { min-height: 72px; border-right: 0; border-bottom: 1px solid var(--line); }
  .monitor-summary article:last-child { border-bottom: 0; }
  .monitor-actions, .monitor-actions .inline-select, .monitor-actions button { width: 100%; }
  .notification-list > li { grid-template-columns: 12px minmax(0, 1fr); }
  .notification-time { grid-column: 2; }
  .notification-list time, .notification-time small { text-align: left; white-space: normal; }
  .notification-details li { grid-template-columns: 1fr; gap: 5px; }
  .device-fleet { padding: 12px; }
  .device-fleet-heading, .device-card-header, .device-card-footer { align-items: stretch; flex-direction: column; }
  .device-fleet-heading p { text-align: left; }
  .device-state { align-self: flex-start; }
  .device-facts { grid-template-columns: 1fr; }
  .device-fact { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .device-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .device-fact:last-child { border-bottom: 0; }
  .note-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
