:root {
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #1C2333;
  --muted: #5D6678;
  --line: #DDE2E8;
  --saffron: #E8890C;
  --saffron-soft: #FCEBD3;
  --green: #18864B;
  --green-soft: #E3F3EA;
  --red: #B42318;
  --focus: #2F6FED;
  --navy: #2B1D63;
  --navy-text: #F3EEFF;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161D;
    --surface: #1B212B;
    --ink: #E9EDF2;
    --muted: #9AA4B5;
    --line: #2C3441;
    --saffron: #F39A2B;
    --saffron-soft: #3A2A14;
    --green: #2FA866;
    --green-soft: #15301F;
    --red: #F97066;
    --focus: #7EA6F6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; }
.brand-mark { width: 14px; height: 28px; background: var(--saffron); border-radius: 3px; }
.bar-spacer { flex: 1; }
.who { color: var(--muted); font-size: 15px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px 60px; }
.wrap.wide { max-width: 1100px; }

/* ---------- brand ---------- */
.brand-logo { width: 38px; height: 38px; flex: none; }

/* Swamiji quote banner (staff page) */
.quote-banner {
  display: flex; align-items: flex-end; gap: 4px;
  background: var(--navy); color: var(--navy-text);
  border-radius: 12px; overflow: hidden; margin: 0 0 24px; min-height: 132px;
}
.quote-banner .q { flex: 1; padding: 18px 0 18px 20px; align-self: center; }
.quote-banner blockquote { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; }
.quote-banner cite { display: block; margin-top: 8px; font-style: normal; font-size: 14px; color: #F7B65A; }
.quote-banner img { width: 128px; height: 128px; display: block; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 15px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--saffron); border-color: var(--saffron); color: #1C1205; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], input[type=search], textarea {
  width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.error { color: var(--red); font-size: 15px; margin: 8px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 8px;
  font-size: 15px; z-index: 50; max-width: calc(100% - 32px);
}

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art {
  background: var(--navy); color: var(--navy-text);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.login-art .q { padding: 56px 48px 0; }
.login-art blockquote { max-width: 15em; }
.login-art blockquote { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 700; }
.login-art cite { display: block; margin-top: 14px; font-style: normal; font-size: 17px; color: #F7B65A; }
.login-art img { width: min(440px, 80%); align-self: flex-end; display: block; margin-top: 24px; }
.login-form-side { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-box .logo-row { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.login-box .logo-row img { width: 56px; height: 56px; }
.login-box h1 { font-size: 30px; line-height: 1.15; margin: 20px 0 6px; }
.login-box p.lead { color: var(--muted); margin: 0 0 24px; }
.login-box .btn { width: 100%; }

@media (max-width: 760px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { flex-direction: row; align-items: flex-end; min-height: 170px; }
  .login-art .q { padding: 22px 0 22px 20px; align-self: center; }
  .login-art blockquote { font-size: 20px; }
  .login-art cite { font-size: 14px; margin-top: 6px; }
  .login-art img { width: 150px; margin: 0; flex: none; }
  .login-form-side { place-items: start center; padding-top: 28px; }
}

/* ---------- staff: progress ---------- */
.progress-text { font-size: 22px; line-height: 1.3; margin: 4px 0 10px; font-weight: 600; }
.progress-text strong { color: var(--saffron); }
.meter { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--saffron); border-radius: 5px; transition: width .4s ease; }

.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 24px 0 8px; }
.switch button { border: 0; background: var(--surface); padding: 8px 16px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); }
.switch button[aria-pressed=true] { background: var(--ink); color: var(--bg); }

/* ---------- staff: post ---------- */
.post { padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.post-date { color: var(--muted); font-size: 14px; }
.post h2 { font-size: 21px; line-height: 1.3; margin: 2px 0 6px; }
.post .desc { white-space: pre-wrap; margin: 4px 0 14px; font-size: 18px; line-height: 1.5; }
.post.done .post-date::after { content: "  ✓ all done"; color: var(--green); font-weight: 600; }

.engage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eng {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface);
  text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.eng:hover { border-color: var(--muted); }
.eng .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 2px solid var(--muted); }
.eng.done { background: var(--green); border-color: var(--green); color: #fff; }
.eng.done .dot { border-color: #fff; background: #fff; }

.comment-box { margin-top: 14px; }
.comment-box summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.comment-box[open] summary { margin-bottom: 8px; }
.comment-saved { margin-top: 12px; font-size: 15px; background: var(--saffron-soft); padding: 8px 12px; border-radius: 8px; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }

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

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--saffron); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.title-cell { min-width: 220px; }
.muted { color: var(--muted); }
.hidden-tag { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin-left: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.row-actions .btn { white-space: nowrap; }
.tick { color: var(--green); font-weight: 700; }
.cross { color: var(--muted); }

.pct-bar { display: inline-block; width: 60px; height: 6px; background: var(--line); border-radius: 3px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.pct-bar > span { display: block; height: 100%; background: var(--saffron); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.panel h2, .section-title { font-size: 20px; margin: 0 0 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { max-width: 380px; }
.table-scroll td:first-child { white-space: nowrap; }

.detail-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h2 { margin: 0; }
.stat-line { display: flex; gap: 22px; flex-wrap: wrap; margin: 0 0 20px; }
.stat-line div { font-size: 15px; color: var(--muted); }
.stat-line b { display: block; font-size: 24px; color: var(--ink); }

.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .who { display: none; }
  .brand { font-size: 18px; }
  .brand-sub { display: none; }
  .quote-banner blockquote { font-size: 17px; }
  .quote-banner img { width: 112px; height: 112px; }
  .bar-inner { gap: 8px; }
  td.title-cell { min-width: 170px; }
}
.brand, .btn { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .meter > span { transition: none; }
}
