@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }

:root {
  --red: #B21F29;
  --red-dark: #8a1820;
  --red-light: #fdf2f2;
  --slate-900: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--slate-500);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--slate-900); }
h1 { font-size: 1.5rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
a { color: var(--red); text-decoration: none; }
p { line-height: 1.5; }

.navbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: linear-gradient(135deg, #c62a35 0%, #9a1820 100%);
  box-shadow: 0 2px 8px rgba(138, 24, 32, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: white; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand img { background: white; border-radius: 6px; padding: 2px; }
.nav-links { display: flex; align-items: center; gap: 0.75rem; }
.nav-user { color: rgba(255,255,255,0.85); font-size: 0.82rem; font-weight: 500; }
.nav-button {
  background: transparent; color: rgba(255,255,255,0.85); border: 0; font: inherit; font-weight: 500;
  border-radius: 6px; padding: 0.35rem 0.6rem; cursor: pointer;
}
.nav-button:hover { background: rgba(255,255,255,0.12); color: white; }

.app-shell { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 230px; background: #1e1e2d; padding: 1.5rem 0; flex: none; }
.side-section { margin-bottom: 1.5rem; }
.side-label {
  margin: 0 0 0.4rem; padding: 0 1.25rem;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.side-link {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 1.25rem; color: rgba(255,255,255,0.6);
  font-size: 0.84rem; font-weight: 500; border-left: 3px solid transparent;
}
.side-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.side-link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.side-link.active { background: rgba(178, 31, 41, 0.15); color: #ff6b73; font-weight: 600; border-left-color: var(--red); }
.content { flex: 1; min-width: 0; }
.page { max-width: 1120px; margin: 1.5rem auto 2rem; padding: 0 1.25rem; animation: fadeUp 0.35s ease-out; }
.page-head { margin-bottom: 1rem; }
.mode-banner, .callout {
  margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 8px;
  background: var(--red-light); color: var(--red-dark); font-size: 0.82rem;
}
.mode-banner { margin: 1rem 1.25rem 0; }
.mode-banner.operational { background: #eff6ff; color: #1e3a8a; }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat {
  background: white; border-radius: 14px; padding: 1.25rem; min-width: 140px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.04); color: inherit;
}
.stat span { display: block; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate-500); }
.stat strong { display: block; font-size: 2rem; color: var(--slate-900); }
.card {
  background: white; border-radius: 14px; border: 1px solid #e2e8f0; border-left: 4px solid #B21F29;
  box-shadow: var(--shadow-sm); padding: 1.5rem; margin-bottom: 1.25rem;
}
.filters, .stack, .inline-form { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.stack { flex-direction: column; align-items: stretch; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--slate-700); }
input, select, textarea {
  width: 100%; padding: 0.6rem 0.75rem; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font: inherit; font-size: 0.88rem; color: var(--slate-900); background: white;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(178, 31, 41, 0.15);
}
.check { flex-direction: row; align-items: center; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
.btn-primary, .btn-secondary, .btn-outline, .ms-button {
  border-radius: 8px; padding: 0.7rem 1.5rem; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, #c62a35 0%, #B21F29 100%); color: white; border: 0;
  box-shadow: 0 1px 3px rgba(178, 31, 41, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #B21F29 0%, #8a1820 100%); transform: translateY(-1px); }
.btn-secondary, .ms-button { background: white; color: var(--slate-700); border: 1.5px solid #e2e8f0; }
a.ms-button { display: inline-block; text-align: center; text-decoration: none; }
.btn-outline { background: white; color: var(--red); border: 1.5px solid var(--red); display: inline-block; }
.full { width: 100%; }
.ms-button:disabled { opacity: 0.7; cursor: not-allowed; }
.table-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 0.8rem; background: white; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.data th { background: #1e293b; color: white; font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; text-align: left; padding: 0.5rem 0.75rem; }
.data td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f1f5f9; color: var(--slate-700); }
.data tr:hover td { background: #f8fafc; }
.badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.45rem; font-size: 0.65rem; font-weight: 600; background: var(--slate-100); color: var(--slate-700); }
.badge.warn { background: #fffbeb; color: #b45309; }
.status-needs_review, .sens-unknown { background: #fffbeb; color: #b45309; }
.status-approved, .sens-non_sensitive { background: #f0fdf4; color: #166534; }
.status-failed, .sens-sensitive { background: #fef2f2; color: #991b1b; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0 0 1rem; }
.facts div { margin: 0; }
.facts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-400); }
.facts dd { margin: 0.15rem 0 0; color: var(--slate-900); font-weight: 600; }
.evidence { padding-left: 1.1rem; }
.evidence li { margin-bottom: 0.55rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.muted { color: var(--slate-500); font-size: 0.82rem; }
.crumb { font-size: 0.8rem; }
.login-shell { display: flex; min-height: calc(100vh - 56px); }
.login-brand {
  flex: 0 0 420px; background: linear-gradient(160deg, #c62a35 0%, #7a1118 100%);
  color: white; padding: 4rem 3rem;
}
.login-brand h1 { color: white; font-size: 1.75rem; }
.login-brand p, .login-brand li { color: rgba(255,255,255,0.8); }
.login-panel { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 2rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--slate-400); font-size: 0.78rem; margin: 1rem 0; }
.divider:before, .divider:after { content: ""; height: 1px; background: #e2e8f0; flex: 1; }
.error-banner { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); border-radius: 8px; padding: 0.7rem 0.8rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .login-brand { display: none; }
  .split, .facts { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0.4rem 0; }
  .side-section { display: flex; margin: 0; }
  .side-label { display: none; }
  .side-link { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .side-link.active { border-bottom-color: var(--red); }
  .data thead { display: none; }
  .data tr { display: block; margin-bottom: 0.8rem; border: 1px solid var(--slate-200); border-radius: 10px; background: white; }
  .data td { display: flex; justify-content: space-between; gap: 1rem; }
  .data td:before { content: attr(data-label); color: var(--slate-400); font-weight: 600; }
}
