/* Makhanda M-PMMS — shared styles for server-rendered pages
   Token system: deep teal (governance/trust) + Eastern Cape ochre gold (accent)
   on warm paper, with a serif display face for institutional gravity. */

:root {
  --ink: #182A2C;
  --paper: #F6F4EE;
  --paper-raised: #FFFFFF;
  --teal-deep: #123B42;
  --teal-mid: #2C6E6F;
  --gold: #C8862E;
  --green-ok: #3E7A4C;
  --amber-watch: #C8862E;
  --red-off: #B5453B;
  --grey-line: #D9D5C9;
  --radius: 10px;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--paper); color: var(--ink); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .4em; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--paper-raised); border: 1px solid var(--grey-line); border-radius: var(--radius);
  padding: 40px; max-width: 420px; width: 100%; box-shadow: 0 10px 30px rgba(18,59,66,.08); }

.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.brand-mark { width: 44px; height: 44px; border-radius: 8px; background: var(--teal-deep); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; }
.brand h1 { font-size: 23px; line-height: 1.25; margin: 0; }
.brand p { margin: 4px 0 0; font-size: 13px; color: #5B6B6C; }

.stack { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 13px; font-weight: 600; margin-top: 12px; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--grey-line); border-radius: 8px; }
input:focus { outline: 2px solid var(--teal-mid); outline-offset: 1px; }

.btn { font: inherit; font-weight: 600; padding: 11px 18px; border-radius: 8px; border: none; cursor: pointer; margin-top: 18px; }
.btn-primary { background: var(--teal-deep); color: #fff; }
.btn-primary:hover { background: var(--teal-mid); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.alert-error { background: #FBEAE8; color: var(--red-off); border: 1px solid #F0C6C1; }

.fine-print { font-size: 12px; color: #7A857F; margin-top: 22px; }

/* ---- App shell (dashboard.php) ---- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--teal-deep); color: #EDEBE2; padding: 24px 18px; }
.sidebar h2 { font-size: 16px; color: #fff; }
.sidebar nav a { display: block; color: #C9D8D5; text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.main { padding: 32px 40px; }

.kpi-card { background: var(--paper-raised); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-5, .status-4 { background: var(--green-ok); }
.status-3 { background: var(--amber-watch); }
.status-2, .status-1 { background: var(--red-off); }

/* ---- Shared page chrome ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.page-head .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }
.fy-pill { font-family: var(--font-mono); font-size: 11.5px; background: #E4EDEC; color: var(--teal-deep); padding: 5px 10px; border-radius: 20px; }
.card { background: var(--paper-raised); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.card h3 { font-size: 15.5px; }
.hint { font-size: 11.5px; color: #5B6B6C; margin-top: 4px; }
.empty-state { text-align: center; padding: 40px 20px; color: #5B6B6C; }
select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--grey-line); border-radius: 7px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .form-row { grid-template-columns: 1fr; } }

/* ---- Status chips ---- */
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.chip-5, .chip-4 { background: #E4EFE5; color: var(--green-ok); }
.chip-3 { background: #FBEFDD; color: #D99A3D; }
.chip-2, .chip-1 { background: #FBEAE8; color: var(--red-off); }
.chip-0, .chip-none { background: #EFEDE5; color: #8B8B85; }
.dot-inline { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---- KPI rows / weight meter ---- */
.kpi-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--grey-line); }
.kpi-row:last-child { border-bottom: none; }
.kpi-title { font-weight: 600; font-size: 13.5px; }
.kpi-meta { font-size: 12px; color: #5B6B6C; margin-top: 2px; }
.weight-meter { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 14px; }
.weight-bar { flex: 1; height: 8px; border-radius: 4px; background: #EDEAE0; overflow: hidden; }
.weight-fill { height: 100%; background: var(--teal-mid); }
.weight-fill.over { background: var(--red-off); }
.progress-bar { height: 6px; background: #EDEAE0; border-radius: 4px; overflow: hidden; width: 120px; flex: none; }
.progress-fill { height: 100%; background: var(--teal-mid); }

/* ---- Upload zones ---- */
.upload-zone { border: 2px dashed var(--grey-line); border-radius: 10px; padding: 26px; text-align: center; color: #5B6B6C; font-size: 13px; cursor: pointer; transition: .15s; }
.upload-zone:hover { border-color: var(--teal-mid); background: #E4EDEC; }
.evidence-item { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--grey-line); border-radius: 7px; padding: 8px 12px; margin-top: 8px; font-size: 12.5px; }
.evidence-item .fname { font-family: var(--font-mono); font-size: 11.5px; }

/* ---- Rating scale (0-5) ---- */
.rating-scale { display: flex; gap: 6px; }
.rating-btn { flex: 1; text-align: center; padding: 8px 4px; border: 1px solid var(--grey-line); border-radius: 7px; font-size: 12px; font-weight: 600; background: #fff; color: #5B6B6C; cursor: pointer; }
.rating-btn.selected { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.competency-block { border: 1px solid var(--grey-line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.competency-block .cluster-tag { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--gold); letter-spacing: .05em; }

/* ---- Feedback ---- */
.error-row { background: #FBEAE8; border-left: 3px solid var(--red-off); padding: 8px 12px; border-radius: 6px; font-size: 12.5px; margin-bottom: 6px; }
.success-box { background: #E4EFE5; border-left: 3px solid var(--green-ok); padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; margin-top: 0; }
.btn-ghost { background: transparent; border: 1px solid var(--grey-line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal-mid); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #5B6B6C; padding: 8px 10px; border-bottom: 2px solid var(--grey-line); }
td { padding: 10px; border-bottom: 1px solid var(--grey-line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
