:root {
  --congo-green: #009543;
  --congo-yellow: #fbde4a;
  --congo-red: #dc241f;
  --primary: #0f4c81;
  --primary-dark: #0a355c;
  --secondary: #2c7a7b;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a202c;
  --text-light: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --danger: #e53e3e;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(15, 76, 129, .11);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.flag-banner { height: 6px; background: linear-gradient(135deg, var(--congo-green) 0 33%, var(--congo-yellow) 33% 66%, var(--congo-red) 66% 100%); }
.skip-link { position: absolute; top: -50px; left: 16px; background: var(--primary-dark); color: white; padding: 10px 14px; z-index: 100; }
.skip-link:focus { top: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 40; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px min(32px, 4vw); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 250px; }
.brand img { width: 56px; height: 56px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--primary); line-height: 1.15; }
.brand small { color: var(--text-light); }
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a { padding: 10px 12px; border-radius: var(--radius); text-decoration: none; font-weight: 700; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { background: #edf4fb; color: var(--primary); }
.menu-btn { display: none; border: 1px solid var(--border); background: white; border-radius: var(--radius); padding: 10px 14px; }

.hero {
  min-height: 620px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: center;
  padding: 72px min(64px, 5vw); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white;
}
.hero-content { max-width: 840px; }
.eyebrow { margin: 0 0 14px; color: var(--congo-yellow); font-weight: 900; text-transform: uppercase; font-size: .84rem; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 5.1rem); }
.hero p, .page-title p { color: rgba(255,255,255,.82); font-size: 1.15rem; max-width: 760px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 800; text-decoration: none; cursor: pointer; font: inherit; }
.btn.primary { background: var(--primary); color: white; }
.hero .btn.primary { background: var(--congo-green); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.light { background: rgba(255,255,255,.14); color: white; border-color: rgba(255,255,255,.38); }
.btn.ghost { background: white; color: var(--primary); border-color: var(--border); }
.btn.danger { background: var(--danger); color: white; }
.hero-card { padding: 26px; border-radius: var(--radius); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); box-shadow: var(--shadow); }
.hero-card img { width: 112px; margin-bottom: 18px; }
.hero-card strong { display: block; font-size: 1.4rem; }
.hero-card span { display: block; color: rgba(255,255,255,.78); margin-top: 8px; }

.section { padding: 70px min(64px, 5vw); }
.section.compact { padding: 28px; }
.soft { background: #edf2f7; }
.section-head { margin-bottom: 26px; }
.section-head h2, .page-title h1 { font-size: clamp(2rem, 4vw, 3.45rem); color: var(--primary); }
.page-title { padding: 64px min(64px, 5vw); background: var(--primary); color: white; }
.page-title h1 { color: white; }
.grid { display: grid; gap: 20px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .panel, .document-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card h3 { color: var(--primary); margin-bottom: 10px; }
.card p, .panel p, .document-card p, small { color: var(--text-light); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); background: white; box-shadow: var(--shadow); }
.metrics div { padding: 28px; border-right: 1px solid var(--border); }
.metrics div:last-child { border-right: 0; }
.metrics strong { display: block; font-size: 2.8rem; color: var(--primary); line-height: 1; }
.metrics span { color: var(--text-light); }

.appointment-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.slots span { padding: 12px; background: #edf4fb; color: var(--primary); border-radius: var(--radius); text-align: center; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; font-weight: 700; }
.wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cbd5e0; border-radius: var(--radius); padding: 10px 12px; font: inherit; background: white; }
textarea { min-height: 130px; resize: vertical; }
.honeypot { position: absolute; left: -9999px; opacity: 0; }
.inline-form, .filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters { margin-bottom: 24px; }
.filters input { flex: 1 1 180px; }

.document-list { display: grid; gap: 16px; }
.document-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.document-card h3 { margin: 10px 0 6px; color: var(--primary); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 10px; border-radius: 99px; background: #c6f6d5; color: #22543d; font-weight: 800; font-size: .78rem; }

.login-page { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 32px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.login-box { width: min(420px, 100%); background: white; padding: 34px; border-radius: var(--radius); box-shadow: 0 22px 44px rgba(0,0,0,.25); display: grid; gap: 16px; }
.login-box img { width: 92px; margin: 0 auto; }
.login-box h1, .login-box p { text-align: center; }

.admin-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 82px); }
.sidebar { background: var(--primary); color: white; padding: 24px; display: grid; align-content: start; gap: 16px; }
.sidebar img { width: 82px; }
.sidebar a, .sidebar button { color: white; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); text-align: left; }
.admin-main { background: var(--bg); }
.table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--text-light); background: #f8fafc; }
.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; padding: 32px; }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 24px min(64px, 5vw); background: #0a355c; color: white; }
.footer span { display: block; color: rgba(255,255,255,.7); }

@media (max-width: 940px) {
  .menu-btn { display: inline-flex; }
  .topbar nav { position: absolute; left: 16px; right: 16px; top: 84px; display: none; flex-direction: column; align-items: stretch; padding: 14px; background: white; border: 1px solid var(--border); box-shadow: var(--shadow); }
  .topbar nav.open { display: flex; }
  .hero, .appointment-layout, .grid.two, .grid.three, .admin-shell { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-card { grid-template-columns: 1fr; }
  .doc-actions { justify-content: start; }
}

@media (max-width: 620px) {
  .brand { min-width: 0; }
  .brand small { display: none; }
  .hero { min-height: auto; padding-top: 52px; }
  .form-grid, .metrics { grid-template-columns: 1fr; }
  .metrics div { border-right: 0; border-bottom: 1px solid var(--border); }
  .footer { display: block; }
}
