:root {
  --bg: #0b1220;
  --panel: #121b2e;
  --panel-raised: #17223a;
  --border: #233049;
  --text: #e6ecf7;
  --text-dim: #93a2bd;
  --accent: #4f8cff;
  --accent-dim: #2a4a85;
  --ok: #3dd68c;
  --warn: #f5b942;
  --crit: #f0516a;
  --radius: 10px;
}

* { box-sizing: border-box; }

/* Author styles (e.g. .login-screen{display:flex}) beat the browser's default
   [hidden]{display:none} UA rule by cascade origin, not specificity — without
   this, toggling el.hidden in JS does nothing and both screens render stacked. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

a { color: var(--accent); }

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 10px; margin-bottom: 4px; }

.nav-item {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-item:hover { background: var(--panel-raised); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--text); }

.nav-item .count {
  font-size: 11px;
  background: var(--panel-raised);
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--text-dim);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 { font-size: 16px; margin: 0; }
.topbar .sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.stat-row {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 120px;
}
.stat-card .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 4px; }

.content { padding: 0 24px 24px; flex: 1; overflow: auto; }

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filters select, .filters input, .btn {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.btn { cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { border-color: var(--crit); color: var(--crit); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel-raised); }
tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.open { background: #3a2a0f; color: var(--warn); }
.badge.reviewing { background: #1f2d49; color: var(--accent); }
.badge.dismissed { background: #1c2636; color: var(--text-dim); }
.badge.escalated { background: #3a1420; color: var(--crit); }
.badge.resolved { background: #123a2b; color: var(--ok); }

.sev-bar { width: 60px; height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.sev-bar > div { height: 100%; background: var(--crit); }

.mono { font-family: "SF Mono", Consolas, monospace; font-size: 12px; color: var(--text-dim); }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.overlay[hidden] { display: none; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(640px, 92vw);
  max-height: 85vh;
  overflow: auto;
  padding: 22px;
}
.modal h2 { margin: 0 0 4px; font-size: 16px; }
.modal .reasons { background: var(--panel-raised); border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 13px; }
.modal pre { background: #080d17; border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; max-height: 240px; }
.modal .row { display: flex; gap: 10px; margin-top: 14px; }
.modal textarea { width: 100%; min-height: 70px; background: var(--panel-raised); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px; font-family: inherit; }
.modal label { font-size: 12px; color: var(--text-dim); display: block; margin-top: 10px; }
.close-x { float: right; cursor: pointer; color: var(--text-dim); font-size: 18px; }

.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; width: 320px; text-align: center;
}
.login-card input { width: 100%; margin: 14px 0; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-raised); color: var(--text); font-size: 14px; }
.login-card .error { color: var(--crit); font-size: 12px; min-height: 16px; }

.empty { color: var(--text-dim); padding: 40px; text-align: center; }

.ignore-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: var(--panel-raised); margin-bottom: 6px; font-size: 12px;
}
.ignore-row .tag { background: var(--accent-dim); padding: 1px 7px; border-radius: 999px; font-size: 10px; text-transform: uppercase; }
.ignore-row .note { color: var(--text-dim); flex: 1; }
.quick-ignore { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quick-ignore button { font-size: 11px; padding: 5px 9px; }
