/* Палитра взята из DESIGN.md Volametric, чтобы панель не выглядела чужой
   рядом с продуктами. Тёмная тема — те же токены, что в Accrual Scanner 0.9.3. */
:root {
  --bg: #efe6c9; --panel: #faf4e2; --border: #ccbf95; --field: #fbf7e8;
  --fg: #111111; --muted: #4a4a4a; --accent: #0f2f66;
  --ok: #1a7f37; --bad: #b0121e; --warn: #9a6700;
  --sel: #e8dfbe; --msel: #dce9f7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #0d0d0d; --border: #282828; --field: #131313;
    --fg: #e6edf3; --muted: #8b949e; --accent: #58a6ff;
    --ok: #3fb950; --bad: #f85149; --warn: #d29922;
    --sel: #1c1c1c; --msel: #16283d;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 13px/1.5 system-ui, -apple-system, sans-serif;
}
body.panel { padding: 14px 16px; }
body.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.hidden { display: none !important; }

/* ── Шапка ───────────────────────────────────────────────────────────────── */
header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
header h1 { font-size: 17px; font-weight: 800; color: var(--accent); }
.spacer { flex: 1; }
.tab {
  background: transparent; color: var(--fg); border: 1px solid transparent;
  border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer;
}
.tab.active { background: var(--panel); border-color: var(--border); }

/* ── Поля и кнопки ───────────────────────────────────────────────────────── */
input, select {
  background: var(--field); border: 1px solid var(--border); border-radius: 7px;
  color: var(--fg); padding: 7px 10px; font-size: 13px; outline: none; font-family: inherit;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,.18); }
input[type=checkbox] { padding: 0; width: 15px; height: 15px; accent-color: var(--accent); }

button {
  background: var(--accent); color: #fff; border: 0; border-radius: 7px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
button.danger { background: var(--bad); }
button.warn { background: var(--warn); }
button.good { background: var(--ok); }
button.lnk { background: none; color: var(--accent); border: 0; padding: 2px 4px; font-weight: 700; }

/* ── Строка выдачи ───────────────────────────────────────────────────────── */
.issue {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px;
}
.issue label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.issue input#email { width: 200px; }
.issue input#note { width: 170px; }
.issue input#days { width: 78px; }
.presets { color: var(--muted); }
.plan-btn { margin-left: 6px; }
.plan-btn.p-trial { background: #9a6700; }
.plan-btn.p-basic { background: #1a7f37; }
.plan-btn.p-pro   { background: var(--accent); }

/* ── Таблицы ─────────────────────────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--sel); }
tbody tr.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.msel { background: var(--msel); }
td.mono { font-family: ui-monospace, SFMono-Regular, monospace; font-weight: 600; }
td.plan { font-weight: 700; }
td.p-trial { color: var(--warn); }
td.p-basic { color: var(--ok); }
td.p-pro   { color: var(--accent); }
td.st-active { color: var(--ok); font-weight: 600; }
td.st-expired, td.st-disabled, td.st-revoked { color: var(--bad); font-weight: 600; }
td.live { color: var(--ok); font-weight: 700; }
td.off { color: var(--muted); }
.c-cb { width: 30px; }

/* Имя класса «empty» занято сообщением под таблицей — модификаторы так
   не называть (Accrual Scanner, MEMORY W10). */
.empty { display: none; padding: 34px; text-align: center; color: var(--muted); }
.empty:not(.hidden) { display: block; }

/* ── Нижняя полоса ───────────────────────────────────────────────────────── */
.bot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 2px; }
.bot input#bulk-days { width: 62px; }
.bulkn { font-weight: 700; color: var(--accent); }
#bulk-bar { display: inline-flex; align-items: center; gap: 6px; }
#bulk-bar.hidden { display: none; }
.cnt { margin-left: auto; color: var(--muted); }
.filters { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; color: var(--muted); }

#banner { font-weight: 600; }
#banner.good { color: var(--ok); }
#banner.bad { color: var(--bad); }

/* ── Экран входа ─────────────────────────────────────────────────────────── */
.box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px 36px; width: 340px; text-align: center;
}
.box h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; color: var(--accent); }
.box .sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.box .icon { font-size: 34px; margin-bottom: 14px; }
.box input { width: 100%; margin-bottom: 10px; }
.box input#otp { font-size: 20px; text-align: center; letter-spacing: 6px; font-family: ui-monospace, monospace; }
.box button { width: 100%; padding: 12px; }
.err { color: var(--bad); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ── Окно правки ─────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 24px; width: 420px; max-width: 92vw; max-height: 86vh; overflow: auto;
}
.modal h3 { font-size: 15px; font-weight: 800; margin-bottom: 14px; color: var(--accent); }
.frow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.frow label { width: 96px; color: var(--muted); }
.frow input, .frow select { flex: 1; }
.merr { color: var(--bad); font-size: 13px; min-height: 18px; }
.mbot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.devlist { max-height: 300px; overflow: auto; }
.devlist .mono { font-family: ui-monospace, monospace; padding: 4px 0; border-bottom: 1px solid var(--border); }
.sub { color: var(--muted); }
