:root {
  --bg: #09090b;
  --shell: #0e0e12;
  --panel: #14141a;
  --hover: #1b1b24;
  --border: #252530;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.13);
  --emerald-bd: rgba(16, 185, 129, 0.35);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.13);
  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.14);
  --mono: "JetBrains Mono", monospace;
  --sans: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 12.5px;
}
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #52525b; }

.btn {
  height: 32px; padding: 0 13px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; white-space: nowrap; transition: 0.12s;
}
.btn-sm { height: 27px; padding: 0 10px; font-size: 11px; }
.btn-primary { background: #fafafa; color: #09090b; }
.btn-emerald { background: var(--emerald); color: #042f1a; }
.btn-emerald:hover { background: #34d399; }
.btn-secondary { background: #1c1c25; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover); }
.btn-danger { background: var(--rose-bg); color: #fda4af; border-color: rgba(244,63,94,0.35); }

/* PUBLIC CHECKER */
.public-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.checker-card {
  width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--emerald-bg);
  border: 1px solid var(--emerald-bd); color: #6ee7b7; font-family: var(--mono);
  font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.checker-card h1 { margin: 0; font-size: 17px; }
.sub { margin: 3px 0 0 0; color: var(--muted); font-size: 11.5px; }
.search-row { display: flex; gap: 8px; margin-top: 18px; }
.pub-result {
  margin-top: 18px; padding: 16px; border-radius: 10px; background: var(--shell); border: 1px solid var(--border);
}

/* ADMIN SHELL */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 56px; padding: 0 22px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.top-title { font-weight: 700; font-size: 14.5px; margin-right: 8px; }
.top-actions { display: flex; gap: 8px; }

.pill {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: #1c1c25; color: var(--muted);
}
.pill.live { background: var(--emerald-bg); color: #6ee7b7; border-color: var(--emerald-bd); }
.pill.warn { background: var(--amber-bg); color: #fcd34d; border-color: rgba(245,158,11,0.35); }
.pill.err { background: var(--rose-bg); color: #fda4af; border-color: rgba(244,63,94,0.35); }

.admin-body { max-width: 1460px; width: 100%; margin: 0 auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 10px; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.kpi-k { font-size: 10.5px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-v { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-top: 5px; }
.kpi-v.emerald { color: #6ee7b7; }
.kpi-v.amber { color: #fcd34d; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; }
.panel-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 13.5px; }
.panel-body { padding: 14px 16px; }

.workspace-grid { display: grid; grid-template-columns: 390px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1060px) { .workspace-grid { grid-template-columns: 1fr; } }

.form-stack { display: flex; flex-direction: column; gap: 11px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.hint { color: #6ee7b7; font-size: 10.5px; }

.quick-parse-row { display: flex; gap: 8px; margin-bottom: 12px; }

.econ-banner {
  padding: 9px 11px; border-radius: 8px; background: var(--emerald-bg);
  border: 1px solid var(--emerald-bd); color: #a7f3d0; font-size: 11px; line-height: 1.45;
}
.econ-banner.warn { background: var(--amber-bg); border-color: rgba(245,158,11,0.4); color: #fde68a; }

.chk-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.chk-row input { width: auto; margin-top: 2px; }

.adv-details summary { cursor: pointer; color: var(--dim); font-size: 11px; margin-bottom: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  background: #171720; color: var(--dim); text-align: left; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; padding: 9px 11px; border-bottom: 1px solid var(--border);
}
td { padding: 10px 11px; border-bottom: 1px solid #1d1d26; vertical-align: middle; }
tr:hover td { background: var(--hover); }

.prog-track { width: 100%; height: 6px; background: #23232e; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.prog-fill { height: 100%; background: var(--emerald); border-radius: 99px; }
.prog-fill.high { background: var(--amber); }
.prog-fill.full { background: var(--rose); }

.act-group { display: flex; gap: 5px; flex-wrap: wrap; }

/* MODAL */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 780px; overflow: hidden;
}
.modal-card.modal-sm { max-width: 390px; }
.modal-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { margin: 0; font-size: 14px; }

.toast-box { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 250; }
.toast {
  background: #191922; border: 1px solid var(--emerald-bd); color: #ecfdf5;
  padding: 10px 14px; border-radius: 8px; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
