@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
  --color-primary:        #4f46e5;
  --color-primary-hover:  #4338ca;
  --color-primary-light:  #eef2ff;
  --color-primary-ring:   rgba(79, 70, 229, 0.15);
  --color-bg:             #f1f5f9;
  --color-surface:        #ffffff;
  --color-border:         #e2e8f0;
  --color-border-input:   #d1d5db;
  --color-text:           #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted:     #94a3b8;
  --color-nav-bg:         #0f172a;
  --color-nav-text:       #cbd5e1;
  --color-nav-text-hover: #ffffff;
  --color-nav-active:     #ffffff;
  --shadow-card:          0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --radius-sm:            6px;
  --radius-md:            8px;
  --radius-lg:            12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 52px;
}
.nav-brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-nav-active);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-brand:hover { color: var(--color-nav-active); opacity: 0.9; }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--color-nav-text);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}
.nav-link:hover { color: var(--color-nav-text-hover); background: rgba(255,255,255,0.06); }
.nav-link.active {
  color: var(--color-nav-active);
  background: rgba(255,255,255,0.10);
  font-weight: 600;
}

/* ── Card ── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

/* ── Severity badges ── */
.severity-badge {
  display: inline-block;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
}
.severity-low      { background: #d1fae5; color: #065f46; }
.severity-medium   { background: #fef3c7; color: #92400e; }
.severity-high     { background: #fee2e2; color: #991b1b; }
.severity-critical { background: #7f1d1d; color: #fff; }

/* ── Back link ── */
.back {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 1.25rem;
}
.back:hover { text-decoration: underline; }

/* ── Form inputs ── */
label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}
textarea,
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { font-size: 0.875rem; line-height: 1.6; resize: vertical; }
textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

/* ── Primary button (submit) ── */
button[type="submit"],
.save-btn {
  padding: 0.75rem 1.75rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
  transition: background 0.12s, transform 0.1s, box-shadow 0.12s;
}
button[type="submit"]:hover,
.save-btn:hover {
  background: var(--color-primary-hover);
  transform: scale(1.005);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

/* ── Table ── */
.table-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead { background: #f8fafc; }
thead th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
tbody tr { border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 0.85rem 1.25rem; font-size: 0.875rem; color: var(--color-text-secondary); vertical-align: top; }

/* ── Coverage pill ── */
.coverage-pill {
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

/* ── Banners ── */
.success-banner {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-left: 4px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 1rem;
}
.form-error {
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #f87171;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #991b1b;
  margin-bottom: 1rem;
}
.ai-disclaimer {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 1rem;
}

/* ── Settings sub-nav tabs ── */
.settings-tabs {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}
.settings-tab {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.settings-tab--active {
  background: var(--color-primary);
  color: #fff;
}
.settings-tab--inactive {
  background: #f1f5f9;
  color: var(--color-text-secondary);
}
.settings-tab--inactive:hover {
  background: #e2e8f0;
  color: var(--color-text);
}
