:root {
  color-scheme: dark;
  --bg: #090c12;
  --panel: #111620;
  --panel-2: #151b27;
  --line: rgba(255,255,255,.09);
  --text: #f4f7fb;
  --muted: #8f9bac;
  --accent: #8bf0ce;
  --accent-2: #5bc8ff;
  --danger: #ff7d8b;
  --warning: #f4ca79;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 65% -20%, #15263a 0, var(--bg) 42%); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; letter-spacing: .2em; font-weight: 700; }
.muted { color: var(--muted); line-height: 1.65; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #06110e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 900; box-shadow: 0 0 24px rgba(91,200,255,.16); }
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(400px, 560px); align-items: center; gap: 9vw; padding: 8vw; }
.login-brand { display: flex; gap: 14px; align-items: center; font-size: 30px; }
.login-brand small, .sidebar-brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; letter-spacing: .08em; }
.login-panel { width: 100%; padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: rgba(17,22,32,.82); backdrop-filter: blur(24px); box-shadow: 0 30px 100px rgba(0,0,0,.38); }
.login-panel h1 { margin: 0; font-size: 32px; }
label { display: grid; gap: 8px; margin-top: 20px; color: #c9d2df; font-size: 13px; }
input, select { width: 100%; border: 1px solid var(--line); background: #0c1119; color: var(--text); border-radius: 10px; padding: 12px 13px; outline: none; }
input:focus, select:focus { border-color: rgba(139,240,206,.65); box-shadow: 0 0 0 3px rgba(139,240,206,.08); }
button { border: 0; border-radius: 9px; padding: 10px 15px; color: var(--text); background: transparent; }
.primary { color: #07100d; background: var(--accent); font-weight: 750; }
.primary:hover { background: #a4f6dc; }
.primary.danger { color: #21070a; background: var(--danger); }
.primary.danger:hover { background: #ff9daa; }
.secondary { border: 1px solid var(--line); background: #161c27; }
.quiet { color: var(--muted); text-align: left; }
.wide { width: 100%; margin-top: 24px; padding: 13px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.app-view { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px 18px; border-right: 1px solid var(--line); background: rgba(9,12,18,.9); display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 25px; }
nav { display: grid; gap: 3px; }
nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; color: var(--muted); }
nav button:hover, nav button.active { color: var(--text); background: rgba(255,255,255,.055); }
nav button.active::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.advanced-nav { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.advanced-nav summary { cursor: pointer; list-style: none; padding: 9px 12px; color: var(--muted); font-size: 12px; }
.advanced-nav summary::-webkit-details-marker { display: none; }
.advanced-nav summary::after { content: "+"; float: right; }
.advanced-nav[open] summary::after { content: "−"; }
.advanced-nav nav { margin-top: 3px; }
.privacy-boundary { margin-top: auto; padding: 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.privacy-boundary b { color: #c9d2df; }
main { min-width: 0; padding: 34px 4vw 60px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
#operatorBadge { color: var(--muted); font-size: 12px; }
.content { min-height: 420px; }
.notice { margin: -12px 0 22px; padding: 12px 14px; border: 1px solid rgba(139,240,206,.22); border-radius: 10px; color: #bfeedd; background: rgba(139,240,206,.06); font-size: 13px; }
.quick-tasks { margin-bottom: 24px; padding: 22px 24px; border: 1px solid rgba(139,240,206,.16); border-radius: 16px; background: linear-gradient(110deg, rgba(139,240,206,.07), rgba(91,200,255,.025)); }
.quick-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.quick-heading p { margin: 0; font-size: 12px; }
.quick-title { font-size: 17px; font-weight: 760; }
.license-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; border-block: 1px solid var(--line); }
.license-flow-step { position: relative; display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; padding: 14px 18px 14px 0; }
.license-flow-step:not(:last-child)::after { content: "→"; position: absolute; right: 12px; top: 24px; color: rgba(139,240,206,.45); }
.license-flow-step i { grid-row: 1 / 3; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(139,240,206,.32); border-radius: 50%; color: var(--accent); font-size: 11px; font-style: normal; }
.license-flow-step b { font-size: 12px; }
.license-flow-step span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.task-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.task-button { min-height: 76px; display: grid; align-content: center; gap: 6px; padding: 13px 14px; text-align: left; border: 1px solid var(--line); background: rgba(9,12,18,.42); }
.task-button:hover { border-color: rgba(139,240,206,.3); background: rgba(139,240,206,.05); }
.task-button b { font-size: 13px; }
.task-button span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-button.primary-task { border-color: transparent; color: #07100d; background: var(--accent); }
.task-button.primary-task span { color: rgba(7,16,13,.68); }
.task-button.primary-task:hover { background: #a4f6dc; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.metric { padding: 22px; background: var(--panel); }
.metric b { display: block; margin-top: 8px; font-size: 28px; }
.metric span { color: var(--muted); font-size: 12px; }
.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.section h2 { margin: 0; font-size: 16px; }
.section-head span { color: var(--muted); font-size: 12px; }
.alert-list { display: grid; border-top: 1px solid var(--line); }
.alert-row { display: grid; grid-template-columns: 8px minmax(130px, 1fr) auto; gap: 12px; align-items: center; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.alert-dot.high { background: var(--danger); }
.alert-dot.medium { background: var(--warning); }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: rgba(17,22,32,.7); }
th { padding: 12px 14px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
td { padding: 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.055); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; color: #b8c5d5; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; color: #bcebdc; background: rgba(139,240,206,.08); font-size: 11px; }
.pill.suspended, .pill.pending { color: var(--warning); background: rgba(244,202,121,.09); }
.pill.revoked, .pill.disabled, .pill.failed, .pill.missing, .pill.modified, .pill.unverified { color: var(--danger); background: rgba(255,125,139,.09); }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions button { padding: 6px 8px; color: #b7c3d2; background: #171e2a; font-size: 11px; }
.row-actions button.danger { color: var(--danger); }
dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(2,5,9,.72); backdrop-filter: blur(6px); }
#dialogForm { padding: 24px; }
#stepUpForm { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.dialog-head h2 { margin: 0; font-size: 21px; }
.icon-button { padding: 3px 9px; color: var(--muted); font-size: 24px; }
.dialog-fields { margin-top: 18px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 24px; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.check-grid label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.check-grid input { width: auto; }
.secret-box { margin-top: 15px; padding: 14px; border: 1px dashed rgba(139,240,206,.35); border-radius: 10px; word-break: break-all; background: #0b1018; }
.delivery-list { display: grid; gap: 10px; max-height: 42vh; overflow: auto; }
.delivery-list .secret-box { margin-top: 0; }
.delivery-list small, .delivery-list strong { display: block; }
.delivery-list strong { margin-top: 4px; font-size: 15px; letter-spacing: .02em; }
@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; padding: 28px; }
  .login-brand { display: none; }
  .app-view { display: block; }
  .sidebar { position: sticky; z-index: 20; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
  .sidebar-brand { padding: 0; }
  .sidebar-brand div, .privacy-boundary { display: none; }
  nav { display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
  .advanced-nav { position: relative; margin: 0; padding: 0; border: 0; }
  .advanced-nav summary { padding: 9px 10px; white-space: nowrap; border-radius: 8px; background: rgba(255,255,255,.04); }
  .advanced-nav summary::after { margin-left: 7px; }
  .advanced-nav nav { position: absolute; top: calc(100% + 9px); right: 0; width: 190px; display: grid; gap: 3px; padding: 8px; overflow: visible; border: 1px solid var(--line); border-radius: 12px; background: #0e141e; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
  .advanced-nav nav button { width: 100%; justify-content: flex-start; }
  nav button { flex: 0 0 auto; justify-content: center; padding: 9px 10px; white-space: nowrap; }
  nav button span, #logoutButton { display: block; }
  #logoutButton { padding: 9px 10px; white-space: nowrap; }
  main { padding: 26px 20px 50px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .task-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .license-flow { grid-template-columns: 1fr; }
  .license-flow-step { padding-right: 0; }
  .license-flow-step:not(:last-child)::after { display: none; }
}
@media (max-width: 520px) {
  .login-view { padding: 18px; }
  .login-panel { padding: 28px 22px; }
  .topbar { align-items: start; }
  #operatorBadge { display: none; }
  main { padding-inline: 14px; }
  .metric { padding: 17px; }
  .quick-tasks { padding: 18px; }
  .quick-heading { display: block; }
  .quick-heading p { margin-top: 6px; }
  .task-actions { grid-template-columns: 1fr; }
}
