/* SILENCE loader panel - admin UI (dark neon purple) */
:root {
  --bg: #0b0710;
  --panel: #140d1d;
  --panel-2: #1a1026;
  --border: #2a1b3d;
  --border-soft: #201430;
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --accent-dim: rgba(168, 85, 247, 0.14);
  --text: #e8e2f2;
  --muted: #9a8fb0;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
  --radius: 12px;
  --mono: "Cascadia Mono", "Segoe UI Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(168, 85, 247, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #c084fc; text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0.2px; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 7, 16, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 1.6px;
  font-size: 15px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(168, 85, 247, 0.65);
}
.brand-sub {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 550;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-link.is-active {
  color: #f5edff;
  background: var(--accent-dim);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: inset 0 0 18px rgba(168, 85, 247, 0.12);
}
.nav-button {
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
}
.nav-logout { margin-left: auto; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head p { color: var(--muted); margin-top: 4px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- flash ---------- */
.flash {
  margin-bottom: 18px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13.5px;
}
.flash.ok { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.09); color: #a7f3d0; }
.flash.warn { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.09); color: #fde68a; }
.flash.bad { border-color: rgba(248, 113, 113, 0.42); background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.flash.info { border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.09); color: #bfdbfe; }

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.75;
}
.card-k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.1px; }
.card-v { font-size: 26px; font-weight: 700; line-height: 1.2; color: #f6f0ff; }
.card-sub { color: var(--muted); font-size: 11.5px; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-head h2 { color: #f3ecff; }
.link { font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(168, 85, 247, 0.045); }
td.empty, .empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}
.sub-block { display: block; color: var(--muted); margin-top: 2px; }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }

/* log row colours */
.row-ok td:first-child { box-shadow: inset 3px 0 var(--ok); }
.row-warn td:first-child { box-shadow: inset 3px 0 var(--warn); }
.row-bad td:first-child { box-shadow: inset 3px 0 var(--bad); }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: lowercase;
  white-space: nowrap;
  background: var(--panel-2);
  color: var(--muted);
}
.badge.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); }
.badge.warn { color: #fde68a; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.1); }
.badge.bad { color: #fecaca; border-color: rgba(248, 113, 113, 0.42); background: rgba(248, 113, 113, 0.1); }
.badge.info { color: #bfdbfe; border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.1); }

/* ---------- forms ---------- */
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="file"], select, textarea {
  width: 100%;
  background: #0e0916;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}
input::placeholder, textarea::placeholder { color: #6f6484; }
input[type="file"] { padding: 7px 9px; }
select { appearance: auto; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1 1 150px; margin-bottom: 0; }
.input-sm { padding: 6px 8px !important; font-size: 12px !important; width: auto !important; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.help { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--accent); color: #f5edff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}
.btn-accent:hover { color: #fff; filter: brightness(1.08); }
.btn-danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.btn-danger:hover { border-color: var(--bad); color: #fff; background: rgba(248, 113, 113, 0.18); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 250px; }

/* ---------- lists ---------- */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-soft);
}
.plain-list li:last-child { border-bottom: 0; }
.plain-list .right { display: flex; align-items: center; gap: 9px; }

/* ---------- pagination / filters ---------- */
.toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter-form .field { margin-bottom: 0; min-width: 170px; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  background: var(--panel-2);
}
.page:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.page.is-current { color: #fff; background: var(--accent-dim); border-color: var(--accent); }
.page.disabled { opacity: 0.4; }
.pagination .info { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ---------- login ---------- */
body.auth {
  background:
    radial-gradient(700px 460px at 50% 15%, rgba(124, 58, 237, 0.28), transparent 65%),
    radial-gradient(500px 340px at 80% 90%, rgba(168, 85, 247, 0.12), transparent 60%),
    var(--bg);
}
.auth-main {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168, 85, 247, 0.08) inset;
}
.auth-brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.auth-brand span { color: var(--accent); font-size: 11px; letter-spacing: 3px; margin-left: 8px; }
.auth-card .muted { margin-bottom: 18px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .flash { margin-bottom: 14px; }

/* ---------- footer ---------- */
.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6f6484;
  font-size: 11.5px;
  border-top: 1px solid var(--border-soft);
}
.foot-meta { letter-spacing: 0.6px; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; gap: 2px; }
  .nav-logout { margin-left: auto; }
  .wrap { padding: 18px 14px 36px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; flex-direction: column; }
  table { font-size: 12.5px; }
  .row-actions { min-width: 0; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .auth-card { padding: 22px; }
}
