/* SAED Kaduna Women Connect — pilot styles */
:root {
  --green: #0b5d3b;
  --green-dark: #08452c;
  --green-soft: #e7f2ec;
  --gold: #e8b10e;
  --gold-soft: #fdf4d8;
  --orange: #e2651b;
  --orange-soft: #fdeadf;
  --red: #b42318;
  --red-soft: #fde8e6;
  --ink: #1d2521;
  --muted: #5b6660;
  --line: #dfe5e1;
  --bg: #f5f7f6;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg);
}
a { color: var(--green); }
a:hover { color: var(--green-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.topbar { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow); }
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--gold); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.brand small { display: block; font-weight: 500; font-size: .72rem; opacity: .85; }
.spacer { flex: 1; }
.menu-btn { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 1rem; cursor: pointer; }
.nav { display: none; background: var(--green-dark); }
.nav.open { display: block; }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 6px 16px 12px; display: flex; flex-direction: column; }
.nav a { color: #fff; text-decoration: none; padding: 9px 10px; border-radius: 8px; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); }
.account { display: flex; align-items: center; gap: 8px; }
.account .who { font-size: .85rem; opacity: .9; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1000px) {
  .menu-btn { display: none; }
  .nav { display: block; }
  .nav-inner { flex-direction: row; flex-wrap: wrap; padding: 4px 16px; }
  .nav a { padding: 8px 10px; font-size: .93rem; }
}

/* Layout */
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; min-height: 60vh; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two, .grid.three, .grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; }
.card .meta { color: var(--muted); font-size: .85rem; margin-bottom: .5em; }
.card-img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; background: var(--green-soft); }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero { background: linear-gradient(120deg, var(--green) 0%, var(--green-dark) 100%); color: #fff; border-radius: 14px; padding: 28px 22px; }
.hero h1 { font-size: 1.75rem; }
.hero p { opacity: .95; max-width: 720px; }
.hero .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
@media (min-width: 760px) { .hero { padding: 44px 40px; } .hero h1 { font-size: 2.2rem; } }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.secondary:hover { background: var(--green-soft); color: var(--green-dark); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .93rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #c7d1cb; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(232, 177, 14, .55); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 6px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.narrow { max-width: 520px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select { width: auto; flex: 1 1 200px; }

/* Badges and notices */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--green-soft); color: var(--green-dark); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: #7a5a00; }
.badge.orange { background: var(--orange-soft); color: #9a3d06; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.grey { background: #eceff1; color: #4a5560; }
.notice { border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; background: var(--gold-soft); border: 1px solid #f1d27a; }
.notice.info { background: var(--green-soft); border-color: #b9d9c7; }
.notice.warn { background: var(--orange-soft); border-color: #f4bf9c; }
.notice.error { background: var(--red-soft); border-color: #f3b7b0; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); background: #fff; border: 1px dashed #c7d1cb; border-radius: var(--radius); }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f4f2; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* Stats */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 1.7rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
progress { width: 100%; height: 12px; accent-color: var(--green); }

/* Admin layout */
.admin { display: grid; gap: 16px; grid-template-columns: 1fr; }
.side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.side a { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: .92rem; }
.side a.active, .side a:hover { background: var(--green-soft); color: var(--green-dark); }
@media (min-width: 960px) { .admin { grid-template-columns: 230px 1fr; } .side { flex-direction: column; align-self: start; position: sticky; top: 120px; } }

/* Lessons */
.lesson { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson:last-child { border-bottom: 0; }
.lesson .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.lesson.done .num { background: var(--green); color: #fff; }
.lesson .body { flex: 1; min-width: 0; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; margin: 8px 0; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Modal and toast */
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 15, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 92vw; box-shadow: var(--shadow); }
.update-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--gold); color: var(--ink); padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; z-index: 55; flex-wrap: wrap; }

footer { background: #fff; border-top: 1px solid var(--line); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 18px 16px 28px; color: var(--muted); font-size: .85rem; }

dl.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
ul.clean { padding-left: 1.1em; margin: 0 0 .8em; }
.history { border-left: 3px solid var(--green-soft); padding-left: 12px; margin: 8px 0; }
.history div { margin-bottom: 8px; }

@media print {
  .topbar, .nav, footer, .side, .btn, .btn-row, .toolbar, .update-bar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card, .table-wrap { box-shadow: none; border-color: #999; }
  .admin { display: block; }
}

/* Small screens: keep the header on one or two tidy rows */
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .brand { font-size: .92rem; }
  .brand small { display: none; }
  .account .who { display: none; }
  .account .btn { white-space: nowrap; }
  .account { order: 3; width: 100%; justify-content: flex-end; }
}
a.stat { display: block; text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--green); }
@media (max-width: 639px) { .grid.four { grid-template-columns: repeat(2, 1fr); gap: 10px; } .stat .n { font-size: 1.4rem; } }
