/* NSMS v10.0 — shared UI styles
 * Restrained, official Government-of-Zambia aesthetic.
 * One set of design tokens drives every screen (v10.0 Section 32).
 */
:root {
  --navy: #0b2545;
  --navy-deep: #081a33;
  --emerald: #1b7f4b;
  --copper: #9c5b2e;
  --crimson: #9b1c1c;
  --gold: #c9a227;
  --ink: #1a2230;
  --muted: #5b6472;
  --line: #d8deea;
  --bg: #eef1f7;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(11,37,69,.12), 0 6px 18px rgba(11,37,69,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ---- 3D button (v10.0 Section 32.1) ---- */
.btn3d {
  --face: var(--navy);
  --edge: var(--navy-deep);
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--face);
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--edge), 0 7px 10px rgba(0,0,0,.18);
  transform: translateY(0);
  transition: transform .06s ease, box-shadow .06s ease, filter .12s ease;
  user-select: none;
}
.btn3d:hover { filter: brightness(1.06); }
.btn3d:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--edge), 0 2px 5px rgba(0,0,0,.2);
  filter: brightness(.92);
}
.btn3d:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn3d.emerald { --face: var(--emerald); --edge: #115f37; }
.btn3d.copper  { --face: var(--copper);  --edge: #6e3f20; }
.btn3d.crimson { --face: var(--crimson); --edge: #6e1414; }
.btn3d.gold    { --face: var(--gold);    --edge: #9c7d1e; color: #2a2208; }
.btn3d.block   { width: 100%; }

/* ---- Header ---- */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.app-header .brand { font-weight: 700; letter-spacing: .2px; }
.app-header .right { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
#sync-status { font-weight: 600; }

/* ---- Layout ---- */
.shell { display: flex; min-height: calc(100vh - 52px); }
.sidebar {
  width: 240px; background: var(--card); border-right: 1px solid var(--line);
  padding: 18px 12px; flex-shrink: 0;
}
.sidebar h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 16px 8px 6px; }
.nav-item {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font-size: .94rem; cursor: pointer;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--navy); color: #fff; font-weight: 600; }
.main { flex: 1; padding: 24px; max-width: 1100px; }

/* ---- Cards & grids ---- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: .85rem; text-transform: uppercase;
  letter-spacing: .05em; }
.muted { color: var(--muted); }
.role-pill { background: var(--gold); color: #2a2208; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; font-size: .78rem; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); padding: 20px; }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  width: 100%; max-width: 380px; padding: 32px 28px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 2px; color: var(--navy); }
.login-card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; }
.field input:focus { outline: 2px solid var(--navy); border-color: var(--navy); }
.error { color: var(--crimson); font-size: .85rem; min-height: 1.1em; margin-bottom: 8px; }

/* ---- Responsive: single column on phones (v10.0 Section 33) ---- */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar h3 { width: 100%; }
  .main { padding: 16px; }
}
