/* RockPointe Ops — staff tool. Function first, RockPointe green accent. */

:root {
  --green: #229622;
  --green-dark: #1a751a;
  --ink: #1c2321;
  --muted: #6b7570;
  --line: #e2e6e3;
  --bg: #f6f8f6;
  --card: #ffffff;
  --amber: #b45309;
  --red: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.hidden { display: none !important; }
a { color: var(--green-dark); }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; background: #fff; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #22962233; border-color: var(--green); }

/* ---- sign-in ---- */
.signin {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.signin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 40px 48px; text-align: center; box-shadow: 0 8px 30px rgb(0 0 0 / 6%);
}
.signin-card h1 { margin: 0 0 4px; font-size: 26px; }
.signin-card h1 span, .brand span { color: var(--green); }
.signin-card p { color: var(--muted); margin: 4px 0 20px; }
.signin-note { font-size: 13px; margin-top: 16px; }
.signin-error { color: var(--red); font-size: 14px; }
#gsi-button { display: flex; justify-content: center; }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  padding: 18px 0; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 17px; padding: 0 18px 14px; }
.sidebar a {
  padding: 9px 18px; text-decoration: none; color: var(--ink); font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--bg); }
.sidebar a.active { border-left-color: var(--green); background: #2296220d; color: var(--green-dark); }
.sidebar-foot {
  margin-top: auto; padding: 14px 18px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.linkish { background: none; border: none; color: var(--green-dark); padding: 0; text-align: left; }
.badge {
  background: var(--green); color: #fff; border-radius: 10px; font-size: 11px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px;
}

main { flex: 1; padding: 26px 32px; max-width: 1100px; }
h2 { margin: 0 0 4px; font-size: 21px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

/* ---- cards, lists ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.strip { border-left: 4px solid var(--green); }
.strip.amber { border-left-color: var(--amber); }

.task-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.task-row:last-child { border-bottom: none; }
.task-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); }
.task-title { flex: 1; }
.task-title small { color: var(--muted); display: block; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--red); font-weight: 600; }
.due.today { color: var(--amber); font-weight: 600; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 160px; }

.btn {
  background: var(--green); color: #fff; border: none; border-radius: 6px;
  padding: 8px 16px; font-weight: 600;
}
.btn:hover { background: var(--green-dark); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.small { padding: 4px 10px; font-size: 13px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line);
}
table.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.status {
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap;
}
.status.pending_approval { background: #fef3c7; color: #92400e; }
.status.approved { background: #dcfce7; color: #166534; }
.status.denied { background: #fee2e2; color: #991b1b; }
.status.paid { background: #e0e7ff; color: #3730a3; }
.status.active { background: #dcfce7; color: #166534; }

.muted { color: var(--muted); }
.error { color: var(--red); }
.ok { color: var(--green-dark); }
textarea.json { width: 100%; min-height: 340px; font: 13px/1.5 ui-monospace, Menlo, monospace; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---- dashboard ---- */
.dash-hero {
  background: linear-gradient(135deg, #17211a 0%, #1f3a22 60%, #229622 160%);
  color: #fff; border-radius: 14px; padding: 22px 26px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.dash-hero img { height: 46px; }
.dash-hero .big { font-size: 46px; font-weight: 800; line-height: 1; }
.dash-hero .big small { font-size: 15px; font-weight: 500; opacity: .75; display: block; margin-top: 4px; }
.dash-hero .chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  background: rgb(255 255 255 / 12%); border-radius: 999px; padding: 5px 14px;
  font-size: 13px; font-weight: 600;
}
.chip b { font-size: 15px; }
.delta { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.delta.up { background: #dcfce7; color: #166534; }
.delta.down { background: #fee2e2; color: #991b1b; }
.dash-hero .delta.up { background: rgb(255 255 255 / 18%); color: #b5f0b5; }
.dash-hero .delta.down { background: rgb(255 255 255 / 18%); color: #ffd0d0; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ministry-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
}
.ministry-card .band {
  height: 86px; display: flex; align-items: center; justify-content: center; padding: 10px;
}
.ministry-card .band img { max-height: 66px; max-width: 85%; }
.ministry-card .body { padding: 14px 16px 16px; }
.ministry-card .num { font-size: 34px; font-weight: 800; line-height: 1.1; }
.ministry-card .lbl { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ministry-card .foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.spark { display: block; width: 100%; height: 44px; margin-top: 8px; }
.meter { background: var(--line); border-radius: 999px; height: 14px; overflow: hidden; margin: 10px 0 6px; }
.meter > div { height: 100%; border-radius: 999px; background: var(--green); min-width: 6px; }
.stale-badge {
  font-size: 11px; font-weight: 700; color: var(--amber); background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px;
}
.dash-cta { font-size: 26px; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin-top: 0; border-top: none; margin-left: auto; }
  main { padding: 16px; }
}
