/* 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 ---- */
.fc-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px 24px; margin-bottom: 14px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #17211A 0%, #1d2b20 70%, #24352a 100%);
  border-radius: 14px;
}
.fc-header img { height: 52px; }
.fc-header .fc-sub { font-size: 13px; color: #cfd8cf; }
.fc-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg,
    #3E7C8C 0 25%, #5E9633 25% 50%, #E08A2B 50% 75%, #C0483D 75% 100%);
}
.fc-header .fc-chip {
  margin-left: auto; margin-right: 26px; z-index: 1;
  background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 18%);
  color: #f3efe6; border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.fc-header .fc-ring {
  position: absolute; right: -30px; top: -34px; width: 150px; height: 150px;
  border-radius: 50%; opacity: .14; pointer-events: none;
  background: conic-gradient(#3E7C8C 0 25%, #5E9633 25% 50%, #E08A2B 50% 75%, #C0483D 75% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent 55%, #000 56%);
          mask: radial-gradient(farthest-side, transparent 55%, #000 56%);
}

.quad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.quad-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.quad-head { padding: 9px 12px 8px; color: #fff; }
.quad-head .qnum { font-size: 9.5px; font-weight: 700; opacity: .85; letter-spacing: .08em; }
.quad-head .qname { font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.quad-head .qtag { font-size: 10.5px; font-style: italic; opacity: .9; margin-top: 1px; }
.quad-body { padding: 9px 12px 11px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.quad-owner { font-size: 10.5px; color: var(--muted); }
.goal { border-top: 1px solid var(--line); padding-top: 7px; }
.goal:first-of-type { border-top: none; padding-top: 0; }
.goal .g-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.goal .g-now { font-size: 16px; font-weight: 800; }
.goal .g-now small { font-size: 11px; font-weight: 500; color: var(--muted); }
.goal .meter { margin: 5px 0 2px; height: 8px; }
.goal .g-note { font-size: 10.5px; color: var(--muted); }
.alert-line { font-size: 11px; font-weight: 700; color: var(--amber); }
.meter > div { transition: width .8s cubic-bezier(.2,.8,.2,1); }
.quad-card.q1 .quad-body { background: linear-gradient(180deg, #E6F0F2 0%, #fff 55%); }
.quad-card.q2 .quad-body { background: linear-gradient(180deg, #EEF4E7 0%, #fff 55%); }
.quad-card.q3 .quad-body { background: linear-gradient(180deg, #FBF0E1 0%, #fff 55%); }
.quad-card.q4 .quad-body { background: linear-gradient(180deg, #F8E9E7 0%, #fff 55%); }
.quad-card.q1 .g-now { color: #2d6273; }
.quad-card.q2 .g-now { color: #457323; }
.quad-card.q3 .g-now { color: #a8641a; }
.quad-card.q4 .g-now { color: #a03a30; }
.quad-card .quad-head { background-image: linear-gradient(120deg, rgb(0 0 0 / 12%), rgb(255 255 255 / 8%)); }
@media (max-width: 980px) { .quad-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .quad-grid { grid-template-columns: 1fr; } }

.dash-hero {
  background: linear-gradient(135deg, #17211a 0%, #1f3a22 60%, #229622 160%);
  color: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.dash-hero img { height: 32px; }
.dash-hero .big { font-size: 30px; 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(185px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ministry-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
}
.ministry-card .band {
  height: 58px; display: flex; align-items: center; justify-content: center; padding: 7px;
}
.ministry-card .band img { max-height: 44px; max-width: 85%; }
.ministry-card .body { padding: 10px 12px 12px; }
.ministry-card .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.ministry-card .lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.ministry-card .foot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.spark { display: block; width: 100%; height: 34px; margin-top: 6px; }
.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; }

/* ---- calendar ---- */
.series-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.series-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid #5E9633;
  border-radius: 10px; padding: 8px 14px;
}
.series-card.now { border-left-color: #E08A2B; background: #FBF0E1; }
.series-name { font-weight: 700; font-size: 14px; }
.series-dates { font-size: 12px; color: var(--muted); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; padding: 0 2px; }
.cal-head div { padding: 4px 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  min-height: 86px; padding: 4px 5px; overflow: hidden;
}
.cal-day.dim { opacity: .45; background: var(--bg); }
.cal-day.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cal-num { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.cal-item {
  font-size: 10.5px; line-height: 1.3; border-radius: 4px; padding: 1px 5px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;
}
.cal-item.ev { background: #eaf4e6; color: #177016; }
.cal-item.comms { background: #FBF0E1; color: #a8641a; font-weight: 600; }
.cal-item.anchor { background: #E6F0F2; color: #2d6273; font-weight: 600; }
.cal-item.ptask { background: #eef0ee; color: #444; }
.cal-item.mine { background: #f1f1f1; color: #666; border: 1px dashed #ccc; }
.cal-more { font-size: 10px; color: var(--muted); }
.cal-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.cal-key.ev { background: #eaf4e6; border: 1px solid #177016; }
.cal-key.comms { background: #FBF0E1; border: 1px solid #a8641a; }
.cal-key.anchor { background: #E6F0F2; border: 1px solid #2d6273; }
.cal-key.ptask { background: #eef0ee; border: 1px solid #888; }
.cal-key.mine { background: #f1f1f1; border: 1px dashed #999; }
.task-link { color: inherit; text-decoration: none; }
.task-link:hover { text-decoration: underline; }

@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; }
}
