/* Reddwatch Admin Console — dark shell, red accent. No framework, no build step. */
:root {
  --bg: #0d0e12; --bg2: #14161c; --bg3: #1b1e26; --line: #262a35;
  --fg: #e6e8ee; --fg-dim: #9aa1b2; --fg-faint: #5f6675;
  --red: #e5484d; --red-dim: #3a1d20;
  --green: #46c07a; --amber: #e0a532; --blue: #5b9dd9;
  --radius: 10px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.86em; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 380px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 36px 30px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px rgba(229,72,77,.55); }
.brand h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.brand .sub { color: var(--fg-dim); font-size: 13px; margin: 0 0 22px 24px; }
.login-card label { display: block; font-size: 13px; color: var(--fg-dim); margin: 14px 0 5px; }
.login-card .btn { width: 100%; margin-top: 20px; }
.login-note { margin-top: 18px; font-size: 12px; color: var(--fg-faint); text-align: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg2); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 10px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--fg-dim); font-size: 14px; cursor: pointer; user-select: none;
}
.nav-item:hover { background: var(--bg3); color: var(--fg); text-decoration: none; }
.nav-item.active { background: var(--red-dim); color: #ff8f93; font-weight: 550; }
.nav-item.disabled { opacity: .38; cursor: default; pointer-events: none; }
.nav-item .soon { margin-left: auto; font-size: 10px; border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; color: var(--fg-faint); }
.sidebar .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--line); padding: 12px 10px 2px; font-size: 13px; color: var(--fg-dim); display: flex; align-items: center; justify-content: space-between; }
.userbox .who { overflow: hidden; text-overflow: ellipsis; }
.userbox .who b { color: var(--fg); display: block; font-weight: 570; }

.main { padding: 26px 34px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; font-weight: 640; }
.page-head .desc { color: var(--fg-dim); font-size: 13px; margin-top: 4px; }

/* ---------- components ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card .k { color: var(--fg-dim); font-size: 12.5px; margin-bottom: 6px; }
.card .v { font-size: 24px; font-weight: 640; letter-spacing: .3px; }
.card .v small { font-size: 14px; color: var(--fg-dim); font-weight: 450; }

.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.panel-head { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel-head .hint { color: var(--fg-faint); font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--fg-faint); font-weight: 560; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.018); }
td.num, th.num { text-align: right; }
.empty { padding: 26px 18px; color: var(--fg-faint); text-align: center; font-size: 13.5px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 570; border: 1px solid transparent; }
.badge.ok { background: rgba(70,192,122,.13); color: var(--green); border-color: rgba(70,192,122,.35); }
.badge.warn { background: rgba(224,165,50,.12); color: var(--amber); border-color: rgba(224,165,50,.35); }
.badge.bad { background: rgba(229,72,77,.13); color: #ff7d81; border-color: rgba(229,72,77,.4); }
.badge.dim { background: var(--bg3); color: var(--fg-dim); border-color: var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.dot.on { background: var(--green); box-shadow: 0 0 6px rgba(70,192,122,.6); }
.dot.off { background: var(--fg-faint); }

.btn {
  background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 550; cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: #3a4050; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #ef5a5f; }
.btn.danger { color: #ff8f93; border-color: rgba(229,72,77,.5); background: transparent; }
.btn.danger:hover { background: var(--red-dim); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

input, select, textarea {
  width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #4a5165; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--fg-dim); margin-bottom: 5px; }
.field .note { font-size: 11.5px; color: var(--fg-faint); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 9px; align-items: center; font-size: 13.5px; color: var(--fg-dim); }
.check input { width: auto; }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(5,6,9,.72); display: flex;
  align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; overflow: auto;
}
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  width: 480px; max-width: 100%; padding: 22px 24px;
}
.modal.wide { width: 620px; }
.modal h3 { margin: 0 0 4px; font-size: 16.5px; }
.modal .sub { color: var(--fg-dim); font-size: 13px; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .warn-box {
  background: rgba(224,165,50,.09); border: 1px solid rgba(224,165,50,.3); color: #ecc06a;
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px;
}
.token-box {
  background: var(--bg); border: 1px dashed #3a4050; border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all;
  display: flex; align-items: center; gap: 10px; margin: 6px 0 12px;
}
.token-box code { flex: 1; }

/* ---------- misc ---------- */
.banner {
  border-radius: var(--radius); padding: 11px 16px; font-size: 13px; margin-bottom: 18px;
  border: 1px solid rgba(224,165,50,.32); background: rgba(224,165,50,.08); color: #ecc06a;
}
.banner.info { border-color: rgba(91,157,217,.35); background: rgba(91,157,217,.08); color: #8fbde6; }
.vbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.vbar .lbl { width: 110px; color: var(--fg-dim); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.vbar .track { flex: 1; height: 9px; background: var(--bg3); border-radius: 6px; overflow: hidden; }
.vbar .fill { height: 100%; background: var(--red); border-radius: 6px; }
.vbar .n { width: 30px; text-align: right; color: var(--fg-dim); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.err-inline { color: #ff8f93; font-size: 13px; margin-top: 12px; min-height: 17px; }
.loading { padding: 40px; text-align: center; color: var(--fg-faint); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: var(--bg3); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: 9px; padding: 11px 16px; font-size: 13.5px; max-width: 420px;
  box-shadow: 0 6px 24px rgba(0,0,0,.45); animation: slidein .18s ease-out;
}
.toast.err { border-left-color: var(--red); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
