:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-2: rgba(30, 41, 59, 0.9);
  --border: rgba(71, 85, 105, 0.45);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --amber: #f59e0b;
  --amber-dark: #b45309;
  --red: #ef4444;
  --teal: #10b981;
  --shadow: 0 24px 64px rgba(0,0,0,0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, sans-serif;
  background:
    radial-gradient(circle at top, rgba(29, 78, 216, 0.10), transparent 35%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea {
  font: inherit;
}
button { cursor: pointer; }
code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92em;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.panel-view { display: none; }
.panel-view.active { display: block; }

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  width: min(100%, 480px);
  border-radius: 32px;
  padding: 2rem;
  text-align: center;
}
.shield-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border: 1px solid rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
  font-size: 2rem;
}
.login-card h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.subtitle {
  margin: 0.35rem 0 1.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
}
.form-grid {
  display: grid;
  gap: 1rem;
  text-align: left;
}
label span {
  display: block;
  margin-bottom: 0.42rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
  color: var(--muted);
}
input, textarea {
  width: 100%;
  border: 1px solid rgba(71,85,105,0.55);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,0.7);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  border: none;
  border-radius: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: 46px;
  padding: 0.9rem 1rem;
}
.btn-large { min-height: 54px; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: white;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: rgba(30, 41, 59, 0.92);
  color: var(--text);
  border: 1px solid rgba(71,85,105,0.65);
}
.btn-secondary:hover { background: rgba(51,65,85,0.92); }

#dashboard-screen {
  padding: 1rem;
}
.topbar {
  border-radius: 22px;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 1rem;
  z-index: 20;
}
.brand-block {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.brand {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.05em;
}
.brand-title {
  font-weight: 800;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.nav-btn {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
  border: 1px solid rgba(71,85,105,0.5);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-height: 42px;
}
.nav-btn.active,
.nav-btn:hover {
  color: white;
  border-color: rgba(59,130,246,0.6);
}
.main-shell {
  max-width: 1280px;
  margin: 1.2rem auto 0;
}
.hero {
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.hero h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.55;
}
.live-chip {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
  color: #6ee7b7;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.45rem;
  background: var(--teal);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.action-card {
  text-align: left;
  border-radius: var(--radius);
  padding: 1.2rem;
  min-height: 144px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.action-card:hover {
  transform: translateY(-2px);
}
.action-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.55rem;
}
.action-card span {
  color: var(--muted);
  line-height: 1.45;
  display: block;
}
.action-blue { border-bottom: 3px solid var(--blue); }
.action-amber { border-bottom: 3px solid var(--amber); }
.action-red { border-bottom: 3px solid var(--red); }
.action-teal { border-bottom: 3px solid var(--teal); }
.two-col {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1fr);
  gap: 1rem;
}
.form-panel, .result-panel, .panel-view {
  border-radius: var(--radius);
  padding: 1.25rem;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-header h3 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mode-badge {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(59,130,246,0.14);
  color: #93c5fd;
}
.mode-badge.neutral { background: rgba(148,163,184,0.12); color: #cbd5e1; }
.mode-badge.alert { background: rgba(239,68,68,0.14); color: #fca5a5; }
.mode-badge.briefing { background: rgba(16,185,129,0.14); color: #86efac; }
.case-grid, .input-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.input-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.result-stack {
  display: grid;
  gap: 0.9rem;
}
.result-card {
  border-radius: 16px;
  padding: 1rem 1rem 1.05rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(71,85,105,0.35);
}
.result-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}
.result-card p {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}
.result-card.subtle {
  background: rgba(2, 6, 23, 0.65);
}
.alert-card { border-left: 4px solid var(--red); }
.tip-box {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
}
.tip-box strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #93c5fd;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.tip-box code {
  color: #dbeafe;
  word-break: break-all;
}
.section-accent-blue { border-top: 3px solid var(--blue); }
.section-accent-red { border-top: 3px solid var(--red); }
.section-accent-teal { border-top: 3px solid var(--teal); }

@media (max-width: 980px) {
  .button-grid,
  .two-col,
  .case-grid,
  .input-actions {
    grid-template-columns: 1fr;
  }
  .hero,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-actions { width: 100%; }
  .nav-btn { flex: 1 1 auto; }
}
