:root {
  color-scheme: dark;
  font: 15px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #07120e;
  color: #e8f4ed;
  --panel: rgba(16, 31, 25, .94);
  --panel-raised: #142820;
  --line: rgba(136, 188, 159, .16);
  --muted: #91aa9b;
  --mint: #79e7aa;
  --green: #20b96d;
  --green-deep: #0c6841;
  --amber: #ffd68a;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  padding: 38px 28px 64px;
  background:
    radial-gradient(ellipse at 14% -10%, rgba(28, 178, 101, .16), transparent 36%),
    radial-gradient(ellipse at 100% 30%, rgba(53, 119, 78, .11), transparent 30%),
    #07120e;
}
.app-shell { width: min(1560px, 100%); margin: 0 auto; }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.hero { position: relative; padding: 10px 4px 26px; }
.brand-lockup { display: flex; align-items: center; gap: 15px; }
.brand-mark {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px;
  color: #052b18; font-size: 28px; font-weight: 900;
  background: linear-gradient(145deg, #a6ffc4, #35ce7d 58%, #149150);
  box-shadow: 0 8px 30px rgba(35, 203, 113, .2), inset 0 1px rgba(255,255,255,.7);
}
.eyebrow { margin: 0 0 3px; color: #71c997; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.hero-copy { max-width: 850px; margin: 13px 0 0 69px; color: #9bb0a3; font-size: 14px; }
.service-chip, .quiet-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 999px; color: #b6c9bd; background: rgba(14, 28, 22, .8);
  font-size: 12px; white-space: nowrap;
}
.service-chip { position: absolute; top: 18px; right: 4px; }
.service-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.access-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 16px; margin-bottom: 16px; }
.panel {
  min-width: 0; border: 1px solid var(--line); border-radius: 19px;
  background: linear-gradient(135deg, rgba(20, 39, 30, .98), var(--panel));
  box-shadow: 0 14px 38px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.025);
}
.access-panel, .security-panel, .devices-panel, .log-panel { padding: 20px 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-row { display: flex; align-items: end; gap: 10px; margin-top: 17px; }
.field { display: grid; gap: 6px; color: #b9cbbf; font-size: 12px; font-weight: 650; }
.field.grow { flex: 1; min-width: 140px; }
input, select, button { font: inherit; }
input, select {
  min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid #344f40; border-radius: 10px;
  outline: 0; color: #edf8f1; background: #0c1a13; transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, select:focus { border-color: #55cf89; background: #0d2016; box-shadow: 0 0 0 3px rgba(71, 214, 132, .14); }
.button {
  min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px;
  color: #eaf8ef; font-weight: 750; cursor: pointer; transition: transform .15s, filter .15s, border-color .15s;
}
.button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(170,255,197,.72); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { color: #062817; background: linear-gradient(135deg, #86efb0, #2ec778); box-shadow: 0 8px 20px rgba(24, 180, 98, .17); }
.button.secondary { border-color: #355b45; background: #1a3024; }
.button.danger { border-color: #70413b; color: #ffd5cf; background: #392320; }
.button.danger:hover { background: #512b26; }
.panel-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.panel-toggle { list-style: none; cursor: pointer; }
.panel-toggle::-webkit-details-marker { display: none; }
.panel-toggle::after { content: "+"; flex: 0 0 auto; color: var(--mint); font-size: 22px; line-height: 1; }
details[open] > .panel-toggle::after { content: "−"; }
.panel-toggle:focus-visible, .version-policy-summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; border-radius: 5px; }
.password-fields { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 16px; }
.inline-message { min-height: 18px; margin: 9px 0 0; color: var(--mint); font-size: 12px; }
.devices-panel { padding-bottom: 15px; }
.devices-heading { margin-bottom: 14px; }
.devices-tools { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.filter-field { width: 180px; }
.filter-field select { width: 100%; }
.notice { min-height: 39px; margin: 0 0 14px; padding: 10px 13px; border: 1px solid rgba(95, 191, 132, .19); border-radius: 10px; color: #a8c2b2; background: rgba(22, 61, 39, .24); font-size: 12px; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid rgba(136,188,159,.11); }
th { position: sticky; top: 0; z-index: 1; color: #91b29e; background: #102219; font-size: 11px; font-weight: 800; letter-spacing: .045em; white-space: nowrap; }
td { color: #dce9e0; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(84, 168, 113, .07); }
.device-cell { min-width: 180px; max-width: 245px; color: #f0f8f3; font-weight: 700; overflow-wrap: anywhere; }
.device-code { color: #c1d2c7; font-weight: 750; letter-spacing: .04em; }
.state-cell { font-weight: 750; white-space: nowrap; }
.state-active { color: #8ce8ad; }
.state-expired, .state-disabled { color: #d5a5a1; }
.state-pending { color: #f5cf82; }
.days-cell input { width: 92px; min-height: 38px; font-variant-numeric: tabular-nums; }
.row-sources { min-width: 230px; }
.row-sources label { display: inline-flex; align-items: center; gap: 4px; margin: 3px 8px 3px 0; color: #bdcfc3; white-space: nowrap; font-size: 11px; }
.row-sources input { width: 15px; min-height: 15px; margin: 0; accent-color: #50d289; }
.actions-cell { min-width: 276px; white-space: nowrap; }
.actions-cell .button { min-height: 36px; margin: 2px 4px 2px 0; padding: 7px 10px; font-size: 11px; }
.table-footnote { margin: 11px 2px 0; color: #829a8c; font-size: 11px; }
.version-policy-panel { margin-top: 16px; padding: 20px 22px; }
.version-policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.version-policy-card { display: grid; align-content: start; gap: 10px; padding: 15px; border: 1px solid rgba(133,182,151,.16); border-radius: 14px; background: rgba(8, 22, 15, .68); }
.version-policy-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; }
.version-policy-summary::-webkit-details-marker { display: none; }
.version-policy-summary::after { content: "+"; color: var(--mint); font-size: 20px; line-height: 1; }
.version-policy-card[open] > .version-policy-summary::after { content: "−"; }
.version-policy-card h3 { margin: 0; color: #edf7f0; font-size: 15px; }
.policy-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.version-policy-card .button { justify-self: start; margin-top: 2px; }
.log-panel { margin-top: 16px; }
.log-summary { list-style: none; cursor: pointer; }
.log-body { margin-top: 15px; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.log-toolbar .panel-note { margin: 0; }
.audit-list { display: grid; gap: 8px; max-height: 400px; padding: 3px 6px 3px 1px; overflow: auto; scrollbar-color: #355f46 #0c1912; }
.audit-entry { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border: 1px solid rgba(133,182,151,.13); border-radius: 12px; background: rgba(8, 22, 15, .7); }
.audit-marker { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #65d894; box-shadow: 0 0 11px rgba(101,216,148,.55); }
.audit-entry.kind-disable .audit-marker, .audit-entry.kind-shorten .audit-marker { background: var(--amber); box-shadow: 0 0 10px rgba(255,214,138,.35); }
.audit-entry.kind-rebind .audit-marker { background: #85b9ff; box-shadow: 0 0 10px rgba(133,185,255,.35); }
.audit-entry.kind-delete .audit-marker { background: #ff8b7e; box-shadow: 0 0 10px rgba(255,139,126,.35); }
.audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.audit-device { color: #edf7f0; font-size: 13px; font-weight: 750; }
.audit-time { margin-left: auto; color: #80988a; font-size: 11px; font-variant-numeric: tabular-nums; }
.audit-kind { padding: 2px 8px; border: 1px solid rgba(119,207,151,.2); border-radius: 999px; color: #9ce6b5; background: rgba(33,112,63,.16); font-size: 10px; font-weight: 750; }
.audit-entry.kind-disable .audit-kind, .audit-entry.kind-shorten .audit-kind { color: #f4d18d; border-color: rgba(244,209,141,.2); background: rgba(143,102,32,.12); }
.audit-entry.kind-rebind .audit-kind { color: #9dc5ff; border-color: rgba(157,197,255,.2); background: rgba(52,87,137,.15); }
.audit-entry.kind-delete .audit-kind { color: #ffb0a6; border-color: rgba(255,176,166,.22); background: rgba(143,48,38,.16); }
.audit-message { margin: 5px 0 0; color: #b1c3b7; font-size: 12px; overflow-wrap: anywhere; }
.audit-empty { margin: 0; padding: 24px 14px; border: 1px dashed rgba(136,188,159,.2); border-radius: 12px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  body { padding: 22px 14px 40px; }
  .access-grid { grid-template-columns: 1fr; }
  .hero-copy { margin-left: 0; padding-right: 0; }
  .service-chip { position: static; margin-top: 13px; }
}
@media (max-width: 600px) {
  .access-panel, .security-panel, .devices-panel, .log-panel, .version-policy-panel { padding: 16px 14px; }
  .login-row, .password-fields { display: grid; grid-template-columns: 1fr; }
  .login-row .button { width: 100%; }
  .panel-heading { align-items: flex-start; }
  .quiet-chip { white-space: normal; text-align: right; }
  .filter-field { width: 138px; }
  .log-toolbar { align-items: flex-start; flex-direction: column; }
  .audit-time { width: 100%; margin-left: 0; }
}
