/* AfriProcurement Scout — brand UI (navy #073B63 / gold #F2B705) */
:root {
  --navy: #073b63;
  --navy-900: #03243d;
  --navy-700: #0a4a7d;
  --gold: #f2b705;
  --gold-2: #d9a404;
  --gold-soft: #fff7dd;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3eaf1;
  --text: #0f1b2a;
  --muted: #5c6b7c;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #8a5a00;
  --warning-soft: #fff7e6;
  --success: #0f7a44;
  --success-soft: #e8f7ef;
  --info: #0a4a7d;
  --info-soft: #eaf3fb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(7, 59, 99, 0.09);
  --shadow-sm: 0 4px 16px rgba(7, 59, 99, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef4f9 0, var(--bg) 260px);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--navy); line-height: 1.18; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--navy-900), var(--navy));
  color: #fff;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 8px 26px rgba(3, 36, 61, 0.18);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.72rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand-tag {
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-900);
  background: var(--gold);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.topnav { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; flex: 1; }
.topnav a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  transition: 0.18s;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); text-decoration: none; }
.topnav a.external { color: var(--gold); }
.topnav a.external:hover { background: rgba(242, 183, 5, 0.14); }
.userbox { display: flex; align-items: center; gap: 0.6rem; color: rgba(255, 255, 255, 0.8); font-size: 0.82rem; }
.userbox .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: var(--navy-900);
  display: grid; place-items: center; font-weight: 800; font-family: var(--display);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta small { color: rgba(255, 255, 255, 0.55); font-size: 0.72rem; }
.inline-form { display: inline; margin: 0; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.4rem 1.25rem 2.5rem; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 0.2rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 760px; }

/* ---------- hero / workflow ---------- */
.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 2rem 2.1rem;
  margin-bottom: 1.3rem;
  color: #fff;
  background:
    radial-gradient(700px 300px at 88% 10%, rgba(242, 183, 5, 0.22), transparent 60%),
    linear-gradient(135deg, var(--navy-900), var(--navy) 62%, var(--navy-700));
  box-shadow: var(--shadow);
}
.hero-panel::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 78%);
}
.hero-panel > * { position: relative; }
.hero-panel .eyebrow { color: var(--gold); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.hero-panel h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0.35rem 0 0.5rem; }
.hero-panel p { color: #c7d8e8; max-width: 720px; margin: 0; }
.hero-panel .hero-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.hero-panel .hero-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #eaf2fa; border-radius: 999px; padding: 0.4rem 0.8rem; font-size: 0.8rem;
}
.hero-panel .hero-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }

.steps { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.step {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.42rem 0.85rem; font-size: 0.82rem; color: var(--muted); font-weight: 600;
}
.step span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--navy); font-size: 0.72rem; font-weight: 800;
}
.step.done { border-color: #cfe6d8; color: var(--success); }
.step.done span { background: var(--success-soft); color: var(--success); }
.step.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.step.active span { background: var(--gold); color: var(--navy-900); }

/* ---------- layout ---------- */
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 1rem; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.1rem;
}
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
.card > h2 { margin-bottom: 0.7rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 1.1rem 1.2rem 0; }
.card.accent { border-top: 3px solid var(--gold); }

/* ---------- stats ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--gold); opacity: .85; }
.stat .label { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.stat .value { font-family: var(--display); font-size: 1.65rem; font-weight: 800; color: var(--navy); line-height: 1.15; margin-top: 0.15rem; }
.stat .hint { color: var(--muted); font-size: 0.76rem; margin-top: 0.2rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; padding: 0.22rem 0.6rem;
  font-size: 0.74rem; font-weight: 700; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap;
}
.badge.success, .badge.succeeded, .badge.completed, .badge.ok { background: var(--success-soft); color: var(--success); border-color: #c9ebd8; }
.badge.danger, .badge.failed, .badge.error { background: var(--danger-soft); color: var(--danger); border-color: #f5cdc7; }
.badge.warning, .badge.partial, .badge.running, .badge.blocked { background: var(--warning-soft); color: var(--warning); border-color: #f0dfb8; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #cfe3f3; }
.badge.muted { background: var(--surface-2); color: var(--muted); }

/* ---------- alerts ---------- */
.alert {
  border: 1px solid var(--line); border-left: 4px solid var(--info);
  background: var(--info-soft); color: #123b5c;
  border-radius: 12px; padding: 0.85rem 1rem; margin-bottom: 1rem; font-size: 0.9rem;
}
.alert.warning { background: var(--warning-soft); border-left-color: var(--gold-2); color: #6b4700; }
.alert.error { background: var(--danger-soft); border-left-color: var(--danger); color: #7c1d14; }
.alert.success { background: var(--success-soft); border-left-color: var(--success); color: #0b5a33; }
.alert.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 2px solid transparent; border-radius: 10px;
  background: var(--gold); color: var(--navy-900);
  padding: 0.62rem 1.05rem; font: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: 0.18s;
  box-shadow: 0 8px 20px rgba(242, 183, 5, 0.22);
}
.button:hover { background: var(--gold-2); transform: translateY(-1px); text-decoration: none; box-shadow: 0 12px 26px rgba(242,183,5,.3); }
.button.secondary { background: #fff; border-color: var(--line); color: var(--navy); box-shadow: none; }
.button.secondary:hover { border-color: #c8d8e6; background: var(--surface-2); }
.button.danger { background: var(--danger); color: #fff; box-shadow: none; }
.button.danger:hover { background: #941d14; }
.button.small { padding: 0.4rem 0.7rem; font-size: 0.78rem; border-radius: 8px; }
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 0.95rem; }
.form-row { display: flex; flex-direction: column; gap: 0.32rem; min-width: 0; }
label { font-size: 0.8rem; font-weight: 600; color: var(--navy); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], select, textarea {
  width: 100%; padding: 0.68rem 0.8rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font: inherit; font-size: 0.9rem; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(7, 59, 99, 0.1);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.help { color: var(--muted); font-size: 0.78rem; }
.errorlist { color: var(--danger); font-size: 0.8rem; margin: 0.2rem 0 0; padding-left: 1rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; }
.checkbox-grid label { display: flex; align-items: center; gap: 0.45rem; font-weight: 500; color: var(--text); }

.filters { display: flex; gap: 0.8rem; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 200px; }
.field { display: flex; flex-direction: column; gap: 0.32rem; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
table.data th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); font-weight: 700; padding: 0.7rem 0.8rem;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 0.72rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:hover { background: #fbfdff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
table.data .empty strong { display: block; color: var(--navy); margin-bottom: 0.2rem; }

/* ---------- progress ---------- */
.progress {
  height: 8px; border-radius: 999px; background: #edf2f7; overflow: hidden;
  border: 1px solid #e6edf4;
}
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  transition: width 0.35s ease;
}

/* ---------- misc ---------- */
.pagination { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; flex-wrap: wrap; }
.timeline { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.6rem; }
.timeline li { border-left: 3px solid var(--gold); padding: 0.15rem 0 0.15rem 0.8rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0.5rem 0 1rem; }
.dl dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.dl dd { margin: 0; font-size: 0.88rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem; font-size: 0.82rem; }

/* ---------- login ---------- */
.login-page main.container { max-width: 1040px; padding-top: 2.2rem; }
.login-wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 1.2rem; align-items: stretch; }
.login-brand {
  position: relative; overflow: hidden; border-radius: 22px; padding: 2.4rem;
  color: #fff; background:
    radial-gradient(500px 260px at 80% 15%, rgba(242,183,5,.22), transparent 60%),
    linear-gradient(145deg, var(--navy-900), var(--navy) 65%, var(--navy-700));
  box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center;
}
.login-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 40%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 80%);
}
.login-brand > * { position: relative; }
.login-brand img { height: 46px; width: auto; margin-bottom: 1.6rem; }
.login-brand h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.7rem; }
.login-brand p { color: #c7d8e8; max-width: 380px; }
.login-brand ul { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.55rem; }
.login-brand li { color: #dbe8f3; font-size: 0.88rem; display: flex; gap: 0.55rem; }
.login-brand li::before { content: "✓"; color: var(--gold); font-weight: 800; }
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 2.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center;
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.35rem; }
.login-card .muted { margin-bottom: 1.2rem; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 1.2rem 1.25rem; color: var(--muted); font-size: 0.8rem;
}
.footer .container { padding-top: 0; padding-bottom: 0; }
.footer p { max-width: 1100px; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 1.8rem; }
}
@media (max-width: 760px) {
  .topbar-inner { gap: 0.6rem; }
  .topnav { order: 3; width: 100%; }
  .userbox { margin-left: auto; }
  .user-meta { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .hero-panel { padding: 1.5rem; }
  h1 { font-size: 1.45rem; }
  .login-card { padding: 1.5rem; }
  table.data { font-size: 0.8rem; }
  .filters { flex-direction: column; align-items: stretch; }
}
