:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #192338;
  --text: #e8eefc;
  --muted: #9fb1d1;
  --accent: #4da3ff;
  --border: #2b3854;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), #0f1728);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subtle {
  color: var(--muted);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
}

nav a:hover {
  color: var(--text);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 24px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

input, button {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

input {
  background: #0f1728;
  color: var(--text);
}

button {
  background: var(--accent);
  color: white;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

a {
  color: var(--accent);
}

.digest-body {
  line-height: 1.6;
}

.login-wrap {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-banner {
  background: #4a1820;
  border: 1px solid #7c2733;
  color: #ffd9de;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.nav-user {
  color: var(--muted);
  margin-left: 16px;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.wrap-form {
  flex-wrap: wrap;
}

.success-banner {
  background: #143320;
  border: 1px solid #1f5b36;
  color: #d9ffe7;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.login-wrap {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-banner {
  background: #4a1820;
  border: 1px solid #7c2733;
  color: #ffd9de;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.nav-user {
  color: var(--muted);
  margin-left: 16px;
}

.compact-card {
  padding: 14px 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 32px;
  line-height: 1.1;
}

.small-value {
  font-size: 16px;
  line-height: 1.4;
}

.table-header {
  margin-bottom: 12px;
}

.digest-preview-shell {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.digest-preview-body {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel-row {
    flex-direction: column;
    align-items: stretch;
  }
}
.time-col {
  white-space: nowrap;
  width: 160px;
  font-size: 12px;
  color: var(--muted);
}
.panel-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.wrap-form {
  flex-wrap: wrap;
}

.success-banner {
  background: #143320;
  border: 1px solid #1f5b36;
  color: #d9ffe7;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1728;
  color: var(--text);
}

.top-threat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.threat-stat-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 900px) {
  .top-threat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .top-threat-grid {
    grid-template-columns: 1fr;
  }
}

.top-threat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.threat-stat-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 22px;
  font-weight: bold;
}

.tag-zero-day { background: #7f1d1d; color: #fecaca; }
.tag-ransomware { background: #78350f; color: #fde68a; }
.tag-breach { background: #1e3a8a; color: #bfdbfe; }
.tag-phishing { background: #064e3b; color: #a7f3d0; }
.tag-cloud { background: #0c4a6e; color: #bae6fd; }
.tag-identity { background: #4c1d95; color: #ddd6fe; }
.tag-ai-security { background: #312e81; color: #c7d2fe; }
.tag-vulnerability { background: #374151; color: #e5e7eb; }
.tag-general { background: #1f2937; color: #d1d5db; }

.threat-link {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 2px 0 0 0;
  font-size: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7f1d1d, #0f172a);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-mark.large {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin: 0 auto 14px auto;
  font-size: 20px;
}

.edition-badge {
  background: #10263f;
  border: 1px solid #1f4e85;
  color: #dbeafe;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

@media (max-width: 700px) {
  .topbar-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a,
  .nav-user {
    margin-left: 0;
  }
}
