:root {
  --bg: #0f1216;
  --card: #171c23;
  --card2: #1f2630;
  --line: #2a323d;
  --text: #e6eaf0;
  --muted: #8b97a7;
  --accent: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --grey: #6b7280;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
header {
  padding: 28px 24px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 28px; letter-spacing: .5px; }
.sub { color: var(--muted); margin: 6px 0 0; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.gap { margin-top: 14px; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.err { color: var(--red); }
.hidden { display: none !important; }
code { background: var(--card2); padding: 1px 6px; border-radius: 5px; color: #cbd5e1; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; }
.btn { background: var(--card2); border: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; }
input, select {
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 36px 18px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: #16202e; }
.dropzone .big { font-size: 18px; margin: 0 0 6px; }
#fileName { margin-top: 8px; color: var(--green); }

.counts { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.chip b { color: var(--accent); }

.progress { background: var(--card2); border-radius: 999px; height: 12px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
td.model, td.note { white-space: normal; max-width: 280px; }
tr.expired td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.expiring td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tr.active td:first-child { box-shadow: inset 3px 0 0 var(--green); }
tr.manual td:first-child, tr.not_found td:first-child, tr.error td:first-child { box-shadow: inset 3px 0 0 var(--grey); }

.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.expired { background: #3b1d22; color: #fca5a5; }
.badge.expiring { background: #3a2f12; color: #fcd34d; }
.badge.active { background: #14321f; color: #86efac; }
.badge.manual, .badge.not_found, .badge.error { background: #262b33; color: #cbd5e1; }

.notice { color: var(--muted); font-size: 13px; }
a { color: var(--accent); }
