:root {
  --bg: #07080b;
  --panel: rgba(21, 24, 30, .78);
  --panel2: #1c2028;
  --line: #262b35;
  --line-soft: rgba(170, 253, 66, .14);
  --text: #eceef1;
  --muted: #8b919c;
  --lime: #aafd42;
  --amber: #ffc24b;
  --red: #ff5d5d;
  --green: #4ade80;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-color: #333a46 transparent; }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(170, 253, 66, .07), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(80, 120, 255, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, #000 30%, transparent 80%);
}
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.top {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
  background: rgba(13, 15, 19, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(170, 253, 66, .5), transparent);
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; }
.brand em { font-style: normal; color: var(--lime); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px var(--lime); animation: pulse 3s ease-in-out infinite; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 500; transition: all .18s; }
.top nav a:hover { color: var(--text); text-decoration: none; background: var(--panel2); }
.top nav a.on { color: #0a0b0d; background: var(--lime); box-shadow: 0 0 18px rgba(170, 253, 66, .35); }
.logout-form { margin: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 28px; position: relative; z-index: 1; animation: fadein .35s ease-out; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; position: relative; z-index: 1; }

@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 6px currentColor; } 50% { box-shadow: 0 0 16px currentColor; } }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
h1 { font-size: 26px; letter-spacing: -.3px; }
h2 { font-size: 16px; margin-bottom: 10px; }
h3 { font-size: 14px; margin: 18px 0 6px; }
.actions { display: flex; gap: 10px; }

button {
  font: inherit; cursor: pointer;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 16px; font-weight: 600;
  transition: border-color .18s, transform .12s, box-shadow .18s, background .18s;
}
button:hover { border-color: #3a4150; transform: translateY(-1px); }
button:active { transform: none; }
button.primary { background: var(--lime); color: #0a0b0d; border-color: var(--lime); }
button.primary:hover { box-shadow: 0 4px 22px rgba(170, 253, 66, .35); }
button.ghost { background: none; color: var(--muted); border: none; }
button.ghost:hover { color: var(--text); transform: none; }
button:disabled { opacity: .35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
button.busy { opacity: .6; pointer-events: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; position: relative; overflow: hidden;
  transition: transform .18s, border-color .18s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-soft); }
.stat::after { content: ""; position: absolute; left: 17px; bottom: 11px; width: 26px; height: 2px; border-radius: 2px; background: var(--lime); opacity: .8; }
.stat b { font-size: 28px; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat span { color: var(--muted); font-size: 12.5px; display: block; margin-bottom: 8px; }
.stat.warn b { color: var(--amber); } .stat.warn::after { background: var(--amber); }
.stat.bad b { color: var(--red); } .stat.bad::after { background: var(--red); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 17px; display: flex; flex-direction: column; gap: 12px;
  position: relative; backdrop-filter: blur(8px);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-soft); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.card-top > div { flex: 1; min-width: 0; }
.card h2 { margin: 0; font-size: 15.5px; }
.card .url { color: var(--muted); font-size: 12.5px; }
.card .wpv { font-size: 12px; color: var(--muted); background: var(--panel2); padding: 3px 9px; border-radius: 7px; white-space: nowrap; border: 1px solid var(--line); }
.health { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.health.ok { background: var(--green); color: var(--green); animation: pulse 3s ease-in-out infinite; }
.health.warn { background: var(--amber); color: var(--amber); animation: pulse 2.2s ease-in-out infinite; }
.health.bad { background: var(--red); color: var(--red); animation: pulse 1.4s ease-in-out infinite; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
}
.badge.ok { color: var(--green); border-color: rgba(74, 222, 128, .3); background: rgba(74, 222, 128, .07); }
.badge.warn { color: var(--amber); border-color: rgba(255, 194, 75, .3); background: rgba(255, 194, 75, .07); }
.badge.bad { color: var(--red); border-color: rgba(255, 93, 93, .35); background: rgba(255, 93, 93, .07); }

/* tabs inside cards */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
  color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 7px 11px;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .03); transform: none; }
.tab.on { color: var(--lime); border-bottom-color: var(--lime); }
.tab .cnt {
  display: inline-block; min-width: 17px; text-align: center;
  background: rgba(255, 194, 75, .15); color: var(--amber);
  border-radius: 9px; font-size: 10.5px; padding: 1px 5px; margin-left: 4px;
}
.tab.on .cnt { background: rgba(170, 253, 66, .15); color: var(--lime); }
.panes { min-height: 56px; }
.pane { display: none; animation: fadein .2s ease-out; }
.pane.on { display: block; }
.pane-empty { color: var(--green); font-size: 12.5px; padding: 10px 2px; }

.otherlist { list-style: none; font-size: 12.5px; }
.otherlist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.otherlist li:last-child { border-bottom: none; }
.otherlist i { font-style: normal; color: var(--muted); }
.otherlist b { font-weight: 600; text-align: right; }
.otherlist b.good { color: var(--green); }
.otherlist b.meh { color: var(--amber); }
.otherlist b.poor { color: var(--red); }

/* update tables */
.updtable { font-size: 12.5px; width: 100%; border-collapse: collapse; }
.updtable th { text-align: left; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; padding: 5px 8px; }
.updtable td { padding: 5px 8px; border-top: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
.updtable td.ver { font-family: ui-monospace, Menlo, monospace; white-space: nowrap; color: var(--muted); }
.updtable td.ver.new { color: var(--lime); font-weight: 600; }
.updtable td.arr { color: var(--muted); padding: 5px 2px; }
.updtable tr.is-major td { background: rgba(255, 93, 93, .06); }
.updtable tr.is-major td.ver.new { color: var(--red); }
.updtable .badge { font-size: 10px; padding: 1px 7px; margin-left: 6px; }
.updtable td.act-cell { text-align: right; padding: 3px 4px; }
.updtable .upd-one { padding: 3px 11px; font-size: 11.5px; color: var(--lime); border-color: rgba(170, 253, 66, .25); }
.updtable .upd-one:hover { box-shadow: 0 0 12px rgba(170, 253, 66, .25); }
.updtable tr.is-major .upd-one { color: var(--amber); border-color: rgba(255, 194, 75, .3); }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.sync-time { color: var(--muted); font-size: 12px; }
.btns { display: flex; gap: 6px; }
button.mini { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
button.mini.warn-btn { color: var(--amber); }

.progress { position: relative; height: 20px; background: var(--panel2); border-radius: 7px; overflow: hidden; }
.progress .bar {
  position: absolute; inset: 0 100% 0 0;
  background: linear-gradient(90deg, rgba(170, 253, 66, .18), rgba(170, 253, 66, .38));
  transition: right .3s;
}
.progress .ptext { position: relative; font-size: 11.5px; color: var(--muted); padding: 0 8px; line-height: 20px; }

.hint { color: var(--muted); font-size: 13px; margin-top: 24px; }

/* panels, tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; backdrop-filter: blur(8px); }
.panel.empty { text-align: center; padding: 52px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 6px 10px; }
td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; color: var(--muted); }
tr.st-error td { background: rgba(255, 93, 93, .05); }
td.detail { color: var(--muted); }
.logtable td:first-child { white-space: nowrap; color: var(--muted); }

.sitestable input { width: 100%; }
.sitestable td.del { text-align: center; }
.sitestable label { cursor: pointer; color: var(--red); }
.sitestable input[type="checkbox"] { margin-right: 4px; }

/* forms */
input, select {
  font: inherit; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  transition: border-color .18s, box-shadow .18s;
}
input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(170, 253, 66, .12); }
input.code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
input.wide { width: 100%; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.stack button { align-self: flex-start; }

/* filters */
.filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chips, .range { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { padding: 6px 13px; font-size: 13px; border-radius: 20px; }
.chip.on { background: var(--lime); color: #0a0b0d; border-color: var(--lime); box-shadow: 0 0 14px rgba(170, 253, 66, .3); }
.range input[type="date"] { padding: 5px 9px; font-size: 13px; color-scheme: dark; }

#chart { width: 100%; }

/* auth screens */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 38px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 16px;
  backdrop-filter: blur(10px); animation: fadein .4s ease-out;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.auth-card h1 { font-size: 20px; }
.auth-card .brand { font-size: 19px; margin-bottom: 4px; }
.auth-card button { background: var(--lime); color: #0a0b0d; border-color: var(--lime); padding: 11px; }
.auth-card button:hover { box-shadow: 0 4px 22px rgba(170, 253, 66, .35); }

.alert { background: rgba(255, 93, 93, .12); border: 1px solid rgba(255, 93, 93, .4); color: var(--red); padding: 10px 14px; border-radius: 9px; font-size: 13.5px; }
.alert.ok { background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .35); color: var(--green); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(90px);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 20px; font-size: 14px; transition: transform .25s; z-index: 50;
  max-width: 90vw; box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--red); color: var(--red); }
#toast.ok { border-color: var(--lime); }

@media (max-width: 640px) {
  .top { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  main { padding: 16px; }
}

/* email log tab */
.emailtable td.subj { color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-note { color: var(--muted); font-size: 11px; margin-top: 6px; }
.pane-empty.muted-empty { color: var(--muted); }
