/* ===========================================================================
   Chapman Reporting Portal — design system
   Palette carried over from the fraternity prototype so the real app matches
   the approved look: warm cream, fraternity gold, black header rail.
   =========================================================================== */
:root {
  --cream: #f7f3ea;
  --cream-soft: #faf7ee;
  --panel: #ffffff;
  --ink: #1c1c1c;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e3ddd0;
  --line-strong: #d8d0bd;

  --gold: #b9972f;
  --gold-deep: #8f7420;
  --gold-soft: #f4ebc9;
  --gold-band: #faf3db;

  --green: #2f855a;
  --green-soft: #d9f2e3;
  --amber: #b7791f;
  --amber-soft: #fff1cc;
  --red: #c53030;
  --red-soft: #fde1e1;
  --blue: #2b6cb0;
  --blue-soft: #dbe9f8;

  --shadow: 0 6px 18px rgba(28, 28, 28, 0.06);
  --shadow-lg: 0 14px 40px rgba(28, 28, 28, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; margin: 0; line-height: 1.25; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: 0.98rem; }
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Shell -------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: #111;
  color: #fff;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 38px; height: 52px; object-fit: contain; }
.brand .brand-name { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.brand .brand-sub { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-group { margin-top: 10px; }
.nav-group-label {
  color: #8c8c8c; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 6px 10px 2px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: #e8e8e8; font-size: 0.9rem; text-decoration: none;
  border: 1px solid transparent;
}
.nav a:hover { background: #1e1e1e; text-decoration: none; }
.nav a.active { background: var(--gold); color: #111; font-weight: 700; border-color: var(--gold); }
.nav a .icon { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-foot { margin-top: auto; border-top: 1px solid #2a2a2a; padding-top: 14px; font-size: 0.8rem; color: #b9b9b9; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: var(--gold); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }

.content { padding: 22px 26px 60px; max-width: 1400px; }

/* ---------- Page header -------------------------------------------------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .lede { color: var(--muted); max-width: 720px; margin-top: 6px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Cards -------------------------------------------------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- KPI --------------------------------------------------------- */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.kpi .kpi-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .kpi-value { font-size: 1.9rem; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.kpi .kpi-note { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.kpi.gold { border-top: 4px solid var(--gold); }
.kpi.green { border-top: 4px solid var(--green); }
.kpi.amber { border-top: 4px solid var(--amber); }
.kpi.red { border-top: 4px solid var(--red); }
.kpi.blue { border-top: 4px solid var(--blue); }

/* ---------- Badges / pills ---------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #eceae5; color: var(--muted); }
.badge.gold { background: var(--gold-soft); color: var(--gold-deep); }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 0.78rem; }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid #111; background: #111; color: #fff;
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #2a2a2a; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #111; }
.btn.gold:hover { background: #c9a63a; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--cream-soft); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.btn.block { width: 100%; }

/* ---------- Forms -------------------------------------------------------- */
label.field { display: block; }
label.field > span { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="file"], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > * { min-width: 150px; }
.filters .grow { flex: 1; }

/* ---------- Tables ------------------------------------------------------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.88rem; }
th { background: var(--cream-soft); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); position: sticky; top: 0; z-index: 1; }
tbody tr:hover { background: #fcfaf4; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Progress ----------------------------------------------------- */
.progress { height: 10px; background: #ececec; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #dcc069); }
.progress.blue > span { background: linear-gradient(90deg, var(--blue), #6ba3dd); }
.progress.green > span { background: linear-gradient(90deg, var(--green), #57b07f); }

/* ---------- Rubric / scorecard ------------------------------------------ */
.section-band {
  background: var(--gold-band); border: 1px solid #ecdfb6; border-radius: var(--radius-sm);
  padding: 10px 14px; font-weight: 800; margin: 18px 0 8px; font-family: Georgia, serif;
}
.subsection-head { font-weight: 700; color: var(--ink-soft); padding: 10px 2px 6px; border-bottom: 2px solid var(--gold-soft); margin-bottom: 4px; }
.criterion {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
  align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.criterion:last-child { border-bottom: none; }
.criterion .code { font-weight: 700; color: var(--gold-deep); }
.criterion .req { color: var(--red); font-size: 0.72rem; font-weight: 700; margin-left: 6px; }
.criterion .type { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
.answer-set { display: inline-flex; gap: 6px; }
.answer-set form { display: inline; }
.answer-btn {
  min-width: 52px; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.answer-btn.yes { background: var(--green-soft); color: var(--green); }
.answer-btn.yes.on { background: var(--green); color: #fff; }
.answer-btn.no { background: var(--red-soft); color: var(--red); }
.answer-btn.no.on { background: var(--red); color: #fff; }
.answer-btn.na { background: var(--amber-soft); color: var(--amber); }
.answer-btn.na.on { background: var(--amber); color: #fff; }
.answer-btn.readonly { background: #f1f1f1; color: var(--muted); }

/* ---------- Queue rows --------------------------------------------------- */
.queue-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.queue-item:last-child { border-bottom: none; }
.queue-item .who { font-weight: 700; }
.queue-item .meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

/* ---------- Workflow diagram -------------------------------------------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.flow .step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; position: relative; }
.flow .step .n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 800; align-items: center; justify-content: center; font-size: 0.78rem; margin-bottom: 6px; }
.flow .step.parallel { border-color: var(--blue); background: var(--blue-soft); }

/* ---------- Callouts ----------------------------------------------------- */
.callout { border-left: 4px solid var(--gold); background: #fffaf0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; }
.callout.blue { border-color: var(--blue); background: var(--blue-soft); }
.callout.green { border-color: var(--green); background: var(--green-soft); }
.callout.red { border-color: var(--red); background: var(--red-soft); }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.tiny { font-size: 0.76rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.84rem; }
.error { color: var(--red); font-weight: 600; font-size: 0.88rem; }
.success { color: var(--green); font-weight: 600; font-size: 0.88rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Login -------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #fbf7ea, var(--cream)); }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px 26px; }
.login-card .crest { display: block; width: 74px; height: 100px; margin: 0 auto 14px; object-fit: contain; }
.login-card h1 { text-align: center; font-size: 1.35rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 6px 0 20px; }

/* ---------- Banners ------------------------------------------------------ */
.demo-banner {
  background: #111; color: #f6e6b8; font-size: 0.82rem;
  padding: 8px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.demo-banner .tag { background: var(--gold); color: #111; font-weight: 800; border-radius: 6px; padding: 2px 8px; font-size: 0.72rem; letter-spacing: 0.05em; }
.demo-banner form { display: inline; }
.demo-banner select { padding: 4px 8px; font-size: 0.8rem; width: auto; }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* ---------- Print -------------------------------------------------------- */
@media print {
  .sidebar, .demo-banner, .page-head .actions, .filters { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .content { padding: 0; max-width: none; }
}

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
