:root {
  --bg: #080B14;
  --card: #111827;
  --card-2: #172033;
  --primary: #6366F1;
  --primary-2: #818CF8;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --border: #232f4b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, #1a2242 0%, transparent 45%),
    radial-gradient(circle at 90% 10%, #241a3d 0%, transparent 40%),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 70px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand .shield { filter: drop-shadow(0 0 6px rgba(99,102,241,0.6)); }

.pill {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 999px;
  padding: 2px 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-links a {
  color: var(--muted);
  margin-left: 22px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.card {
  background: linear-gradient(180deg, var(--card) 0%, #0e1524 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.3);
}
.card h2, .card h3 { margin-top: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 11px;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, var(--primary), #8b5cf6); color: white; box-shadow: 0 6px 20px rgba(99,102,241,0.35); }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #241800; }
.btn-success { background: var(--success); color: #052e12; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.badge-low { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-elevated { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-critical { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-compromised { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-revoked { background: rgba(148,163,184,0.15); color: var(--muted); }

.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: #0a0f1c;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 9px;
  color: #a5b4fc;
  word-break: break-all;
  display: inline-block;
}

.banner {
  padding: 13px 18px;
  border-radius: 11px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.banner-info { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.35); color: #c7d2fe; }
.banner-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35); color: #fcd34d; }
.banner-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.35); color: #fca5a5; }

.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; flex-shrink: 0;
}
.avatar-alice { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.avatar-bob { background: linear-gradient(135deg, #3b82f6, #22d3ee); }

.text-muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.stats-row { display: flex; gap: 26px; margin-top: 12px; }
.stat { text-align: center; }
.stat .num { font-size: 1.25rem; font-weight: 800; display: block; }
.stat .label { font-size: 0.78rem; color: var(--muted); }

.field-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.field-row:last-child { border-bottom: none; }
.field-row .k { color: var(--muted); font-size: 0.87rem; }

.risk-meter { width: 100%; height: 16px; background: #0a0f1c; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.risk-meter-fill { height: 100%; border-radius: 999px; transition: width 0.55s cubic-bezier(.22,.68,0,1.71), background 0.4s ease; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; display: flex; gap: 10px; }
.timeline li:last-child { border-bottom: none; }
.timeline .time { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.pop-in { animation: popIn 0.5s cubic-bezier(.22,.68,0,1.71); }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

.pulse-danger { animation: pulseDanger 1.5s ease-in-out infinite; }
@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

input[type="text"], input[type="password"] {
  width: 100%; padding: 13px 15px; border-radius: 10px;
  border: 1px solid var(--border); background: #0a0f1c; color: var(--text);
  font-size: 0.95rem; margin-bottom: 14px;
}
input:focus { outline: 2px solid var(--primary); }
label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 6px; }
