:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #18202a;
  --muted: #657080;
  --line: #dfe5ee;
  --primary: #234b8f;
  --primary-2: #0e6f74;
  --danger: #b42318;
  --warning: #b65c00;
  --success: #067647;
  --shadow: 0 18px 45px rgba(17, 24, 39, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top right, #e9f1ff, transparent 30%), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-size: 1.35rem; font-weight: 900; color: var(--primary); }
.tagline { color: var(--muted); font-size: .9rem; }
.user-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #eef4ff;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d4e5ff;
  font-size: .9rem;
}
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 32px;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topnav a {
  padding: 8px 12px;
  border-radius: 12px;
  color: #1f2937;
  background: #f7f9fc;
  border: 1px solid #e6ebf2;
  font-weight: 700;
}
.topnav a:hover { background: #eef4ff; text-decoration: none; }
.container { max-width: 1240px; margin: 28px auto; padding: 0 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.hero { background: linear-gradient(135deg, #fff, #f0f7ff); }
h1, h2, h3 { margin-top: 0; line-height: 1.35; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { text-align: center; }
.stat span { display: block; color: var(--muted); font-weight: 700; }
.stat strong { display: block; font-size: 2.35rem; color: var(--primary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  min-height: 42px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { text-decoration: none; box-shadow: 0 8px 18px rgba(17, 24, 39, .08); }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.warning { background: #fff7ed; color: var(--warning); border-color: #fed7aa; }
.button.danger { background: #fff1f1; color: var(--danger); border-color: #ffc9c9; }
.form { display: grid; gap: 16px; }
.form.narrow { max-width: 420px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form label { display: grid; gap: 7px; font-weight: 800; color: #374151; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 95px; resize: vertical; }
.alert { padding: 12px 14px; border-radius: 14px; margin: 12px 0; font-weight: 800; }
.alert.danger, .danger-card { background: #fff1f1; border-color: #ffc9c9; }
.success-card { background: #ecfdf3; border-color: #abefc6; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .82rem;
  font-weight: 900;
  background: #eef2f7;
  color: #344054;
  border: 1px solid #d0d5dd;
}
.badge.low, .badge.closed, .badge.resolved, .badge.completed, .badge.effective { background: #ecfdf3; color: var(--success); border-color: #abefc6; }
.badge.medium, .badge.acknowledged, .badge.in_progress, .badge.active, .badge.planned, .badge.partially_effective { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.badge.high, .badge.escalated, .badge.needs_attention { background: #fff7ed; color: var(--warning); border-color: #fdba74; }
.badge.urgent, .badge.danger, .badge.not_effective, .badge.ineffective { background: #fff1f1; color: var(--danger); border-color: #ffc9c9; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { background: #f8fafc; color: #475467; font-size: .85rem; }
.matrix th, .matrix td { white-space: nowrap; font-size: .78rem; }
code, pre {
  direction: ltr;
  unicode-bidi: plaintext;
  background: #f3f6fa;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 3px 7px;
  color: #243b53;
}
pre { padding: 14px; overflow-x: auto; }
.mini-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fbfdff;
  margin: 8px 0;
}
.demo-codes code { display: block; margin-top: 8px; }
.rowline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #d9e2ec;
}
.recommendation { border-right: 4px solid var(--primary-2); padding: 10px 12px; background: #f5fbfb; border-radius: 12px; margin: 8px 0; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { min-width: 260px; }
.timeline { display: grid; gap: 14px; margin-top: 18px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start; }
.dot { width: 14px; height: 14px; margin-top: 7px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 5px #eaf1ff; }
.report { print-color-adjust: exact; }
.footer { color: var(--muted); text-align: center; padding: 28px 16px; font-size: .85rem; }
@media (max-width: 860px) {
  .site-header { padding: 14px 16px; flex-direction: column; align-items: stretch; }
  .topnav { padding: 10px 16px; }
  .grid.two, .grid.three, .grid.four, .grid-form { grid-template-columns: 1fr; }
  .container { margin: 18px auto; padding: 0 12px; }
  .card { padding: 18px; border-radius: 18px; }
}
@media print {
  .topnav, .site-header, .footer, .actions, form { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
