:root {
  --bg: #11161c; --panel: #1a2129; --line: #2b3540; --text: #e3e8ee; --muted: #8b97a5;
  --accent: #3d8bfd; --ok: #2fb36b; --bad: #e5484d; --warn: #f5a524;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, "Segoe UI", sans-serif; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: var(--text); background: #0d1117; border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; }
button { cursor: pointer; background: var(--panel); }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { border-color: var(--bad); color: var(--bad); }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); } .error { color: var(--bad); min-height: 1em; }
.login { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.login .card { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.login h1 { margin: 0 0 6px; font-size: 20px; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; }
.top nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.top nav button.active { border-color: var(--accent); color: var(--accent); }
main { padding: 16px; max-width: 1200px; }
#notice:not(:empty) { margin: 12px 16px 0; padding: 8px 12px; border: 1px solid var(--warn); color: var(--warn);
  border-radius: 6px; background: #f5a52418; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats .card { padding: 12px; cursor: pointer; } .stats .card b { display: block; font-size: 22px; }
.stats .card.sel { border-color: var(--accent); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: #ffffff08; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.s-active { background: #2fb36b33; color: var(--ok); } .s-perpetual { background: #3d8bfd33; color: var(--accent); }
.s-expiring { background: #f5a52433; color: var(--warn); } .s-expired { background: #e5484d33; color: var(--bad); }
.s-none { background: #8b97a533; color: var(--muted); }
.modal { position: fixed; inset: 0; background: #000a; display: flex; justify-content: center; align-items: flex-start;
  padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px;
  width: 100%; max-width: 760px; }
.modal-box h2 { margin-top: 0; font-size: 18px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form label { display: flex; flex-direction: column; gap: 4px; } .form label span { color: var(--muted); font-size: 12px; }
.form .wide { grid-column: 1 / -1; }
.end { justify-content: flex-end; margin-top: 14px; margin-bottom: 0; }
.keybox { word-break: break-all; padding: 10px; border: 1px solid var(--ok); border-radius: 6px; background: #2fb36b14; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 16px; right: 16px; padding: 10px 14px; border-radius: 6px; background: var(--ok);
  color: #000; z-index: 20; } .toast.err { background: var(--bad); color: #fff; }
@media (max-width: 640px) { main { padding: 12px; } .modal { padding: 12px; } }
