/* Sadbhavana portal. Navy and gold, carried over from the ideation mockups; layout shared with the Sewa Sankalp Portal. */
:root {
  --indigo: #1B2559;
  --indigo-2: #121A40;
  --saffron: #F2B134;
  --saffron-dark: #b8811a;
  --gold: #F2B134;
  --gold-soft: #ffe2a3;
  --cream: #f6f7fb;
  --paper: #ffffff;
  --ink: #1f1b2e;
  --muted: #6b6780;
  --line: #dfe3ee;
  --green: #1e7d4f;
  --red: #b3202a;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(27, 37, 89, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Noto Sans", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; color: var(--indigo); }
h3 { font-size: 0.95rem; color: var(--indigo); }
a { color: var(--indigo); }
img { max-width: 100%; }
small, .muted { color: var(--muted); }

/* ---- staff header: scope (block / district / scheme) prominent, operator in the corner ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--indigo); color: #fff;
  border-bottom: 3px solid var(--saffron);
}
.topbar .brand { color: var(--gold-soft); text-decoration: none; font-weight: 700; font-size: 0.85rem; line-height: 1.2; }
.topbar .brand small { display: block; color: #c9bfe0; font-weight: 400; font-size: 0.68rem; }
.topbar .scope { text-align: center; min-width: 0; }
.topbar .scope strong { display: block; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .scope small { color: var(--gold-soft); font-size: 0.72rem; letter-spacing: 0.04em; }
.topbar .who { text-align: right; font-size: 0.8rem; line-height: 1.25; cursor: pointer; position: relative; }
.topbar .who small { display: block; color: #c9bfe0; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); overflow: hidden; text-align: left;
}
.menu button { display: block; width: 100%; padding: 11px 14px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--cream); }

.tabs { display: flex; gap: 2px; overflow-x: auto; background: var(--indigo-2); padding: 0 10px; position: sticky; top: 0; }
.tabs a { color: #d9d2ee; text-decoration: none; padding: 10px 14px; font-size: 0.9rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a.on { color: #fff; border-bottom-color: var(--gold); font-weight: 600; }

main.staff { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pagehead p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }

/* ---- building blocks ---- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tile { display: block; padding: 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.tile strong { display: block; font-size: 1.6rem; color: var(--indigo); }
.tile:hover { border-color: var(--saffron); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--saffron); background: var(--saffron); color: var(--indigo-2);
  font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #e0a326; }
.btn.ghost { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn.ghost:hover { background: #eef0f8; }
.btn.small { padding: 5px 12px; font-size: 0.8rem; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.55; cursor: default; }

label.field { display: block; margin-bottom: 12px; font-size: 0.85rem; font-weight: 600; color: var(--indigo); }
label.field small { font-weight: 400; }
input[type=text], input[type=tel], input[type=password], input[type=url], input[type=number], input[type=search], input[type=month], input[type=date], input[type=email], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #cfc7b6; border-radius: 9px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--saffron); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 200px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--saffron); }
.picker { border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; padding: 8px; margin-top: 4px; }
.picker input[type=search] { margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; font-size: 0.85rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #e7e3f7; color: var(--indigo); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 0.85rem; font-weight: 600; }
.chip button { border: 0; background: rgba(33,22,80,.12); color: var(--indigo); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0; }
.chip button:hover { background: var(--red); color: #fff; }
.picklist { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.pick { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; text-align: left; width: 100%; border: 0; background: transparent; padding: 7px 10px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); }
.pick:hover, .pick:focus { background: #fff1dc; outline: none; }
.pick small { color: var(--muted); white-space: nowrap; font-size: 0.75rem; }
.checks { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-height: 260px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; margin-top: 4px; }

/* switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbc5b8; border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; cursor: default; }

/* tables: become stacked cards on a phone */
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.list th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: #fffaf0; }
table.list td.num, table.list th.num { text-align: right; }
table.list tr.off td { color: var(--muted); }
code.acct { font-family: ui-monospace, Consolas, monospace; background: #f1ecdf; padding: 2px 7px; border-radius: 6px; font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.list td, table.list td.num { display: block; position: relative; border: 0; padding: 4px 4px 4px 104px; text-align: left; min-height: 1.9em; overflow-wrap: anywhere; }
  table.list td::before { content: attr(data-th); position: absolute; left: 4px; top: 5px; width: 96px; color: var(--muted); font-size: 0.78rem; }
  table.list td:not([data-th]) { padding-left: 104px; }
  /* header: brand and operator on the first line, the block / district name on a line of its own */
  .topbar { grid-template-columns: 1fr auto; grid-template-areas: "brand who" "scope scope"; row-gap: 4px; }
  .topbar .brand { grid-area: brand; }
  .topbar .who { grid-area: who; }
  .topbar .scope { grid-area: scope; text-align: left; border-top: 1px solid rgba(255,255,255,.15); padding-top: 4px; }
  .topbar .scope strong { white-space: normal; font-size: 1.1rem; }
}

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: #eee8da; color: var(--muted); white-space: nowrap; }
.pill.on { background: #dff3e8; color: var(--green); }
.pill.warn { background: #fdecd2; color: var(--saffron-dark); }
.pill.central { background: #e7e3f7; color: var(--indigo); }
.pill.state { background: #fdecd2; color: var(--saffron-dark); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters > * { flex: 1 1 170px; margin: 0; }
.filters input, .filters select { margin-top: 0; padding: 8px 10px; font-size: 0.9rem; }

.notice { padding: 10px 14px; border-radius: 9px; background: #fff3e6; border: 1px solid #f5d3a8; font-size: 0.9rem; margin-bottom: 12px; }
.notice.ok { background: #e8f6ee; border-color: #b7dfc7; }
.notice.err { background: #fdeaea; border-color: #f1b9bc; color: var(--red); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .12em; font-weight: 700; color: var(--indigo); user-select: all; }

/* dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20, 13, 46, .55); }
dialog form, dialog .body { padding: 20px; }
dialog h2 { margin-bottom: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--indigo); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
#toast.err { background: var(--red); }

/* document checklist editor */
.doclist { display: grid; gap: 8px; }
.docrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.docrow input[type=text] { margin: 0; }
.thumb { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f1ecdf; }

/* ---- login ---- */
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(255, 150, 50, .28), transparent 60%), linear-gradient(180deg, var(--indigo) 0%, #140d2e 100%); }
.loginbox { width: min(400px, 100%); background: var(--paper); border-radius: 18px; padding: 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.loginbox .crest { text-align: center; margin-bottom: 18px; }
.loginbox .crest strong { display: block; font-size: 1.3rem; color: var(--indigo); }
.loginbox .crest small { letter-spacing: .04em; }
.loginbox .btn { width: 100%; padding: 12px; font-size: 1rem; margin-top: 4px; }

/* ---- public home (foundation version; the full public portal follows) ---- */
.pubbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--indigo); color: #fff; border-bottom: 3px solid var(--saffron); }
.pubbar strong { color: var(--gold-soft); font-size: 1.05rem; }
.pubbar small { display: block; color: #c9bfe0; font-size: 0.72rem; }
.hero { text-align: center; padding: 46px 18px 40px; color: #fff;
  background: radial-gradient(1000px 500px at 50% -20%, rgba(255, 150, 50, .35), transparent 60%), linear-gradient(180deg, var(--indigo) 0%, #140d2e 100%); }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); color: var(--gold-soft); }
.hero p { max-width: 640px; margin: 12px auto 0; color: #e6def7; }
main.public { max-width: 1180px; margin: 0 auto; padding: 26px 16px 60px; }
.schemegrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 14px 0 30px; }
.scheme { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.scheme .pic { height: 130px; background: linear-gradient(135deg, var(--indigo-2), var(--saffron)); background-size: cover; background-position: center; }
.scheme .txt { padding: 12px 14px 16px; }
.scheme .txt strong { display: block; color: var(--indigo); }
.scheme .txt small { display: block; margin-top: 4px; }
footer.site { text-align: center; padding: 22px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }

/* The QR hand-off is for a laptop screen; on the phone itself it only takes up room. */
@media (max-width: 640px) { .qrbox { display: none; } }

/* camp photo gallery (staff dialog and public page) */
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photogrid figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.photogrid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee8da; }
.photogrid figcaption { padding: 6px 8px; font-size: 0.78rem; line-height: 1.35; display: grid; gap: 2px; }
.photogrid figcaption small { color: var(--muted); }
.photogrid figcaption .btn { justify-self: start; margin-top: 4px; }


/* ---- Sadbhavana additions ---- */
.pill.blue { background: #e3e8fa; color: var(--indigo); }
.pill.grey { background: #ececec; color: #555; }
.result { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.result.off { opacity: .6; background: #fafafa; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; padding: 5px 0; border-bottom: 1px solid #f0f0f0; font-size: .92rem; }
.kv > span { color: var(--muted); }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } }
.card.head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--indigo); color: #fff; border: 0; }
.caseid { font: 700 clamp(1.6rem, 6vw, 2.4rem) ui-monospace, Consolas, monospace; letter-spacing: .04em; color: var(--gold-soft); }
ul.history { list-style: none; margin: 0; padding: 0; }
ul.history li { padding: 8px 0 8px 14px; border-left: 3px solid var(--line); margin-left: 4px; }
ul.history li small { color: var(--muted); display: block; }
.tabs2 { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs2 button { flex: 1; border: 0; background: none; padding: 10px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs2 button.on { color: var(--indigo); border-bottom-color: var(--gold); }
.radios { display: grid; gap: 6px; margin-top: 6px; font-weight: 400; }
.tile small { color: var(--muted); font-size: .78rem; }

/* ---- public home ---- */
body.pubpage { background: #fff; }
.publinks { display: flex; gap: 14px; align-items: center; }
.publinks a { color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.publinks a.btn { color: var(--indigo-2); }
.hero .kicker { color: var(--gold); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.hero { text-align: left; padding: 56px 24px 50px; background: linear-gradient(100deg, #121A40 0%, #1B2559 55%, #2F3D7E 100%); }
.hero > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.hero h1 { color: #fff; font-family: Cambria, Georgia, serif; font-size: clamp(1.9rem, 4.5vw, 3rem); }
.hero p { color: #C5CDEA; font-size: 1.1rem; margin: 14px auto 22px 0; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.big { padding: 13px 28px; font-size: 1.05rem; }
.btn.big.ghost { color: #fff; border-color: #C5CDEA; }
.btn.big.ghost:hover { background: rgba(255,255,255,.1); }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: -34px; }
.card.k { border-top: 4px solid var(--gold); }
.card.k h2 { font-size: 1rem; margin-bottom: 6px; }
.card.k p { margin: 0; font-size: .9rem; line-height: 1.45; }
.counters { display: flex; gap: 34px; flex-wrap: wrap; padding: 26px 4px 6px; }
.counters b { display: block; font-family: Cambria, Georgia, serif; font-size: 2rem; color: var(--indigo); }
.counters span { font-size: .82rem; color: var(--muted); }


/* ---- public home, Mission Sadbhavana 3.0: white page, banner image, navy / saffron / green ---- */
:root { --mission-navy: #143A8A; --mission-saffron: #F28C28; --mission-green: #1E8449; --mission-red: #C62828; }
.govline { background: #f4f4f4; color: #444; font-size: .7rem; letter-spacing: .05em; padding: 5px 20px; }
.pubhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: #fff; border-bottom: 3px solid var(--mission-saffron); flex-wrap: wrap; }
.pubbrand { display: flex; align-items: center; gap: 12px; }
.pubbrand .mark { width: 46px; height: 46px; border-radius: 50%; background: var(--mission-saffron); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; }
.pubbrand strong { display: block; color: var(--mission-red); font-size: 1.35rem; letter-spacing: .01em; }
.pubbrand small { color: var(--mission-navy); font-size: .78rem; }
.pubnav { display: flex; gap: 4px; flex-wrap: wrap; }
.pubnav a { color: #fff; background: var(--mission-navy); text-decoration: none; font-weight: 600; font-size: .85rem; padding: 9px 14px; border-radius: 8px; }
.pubnav a:hover { background: #0f2c6b; }
.banner img { display: block; width: 100%; height: auto; }
.bigcounters { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: -28px; }
.bc { background: #fff; border-radius: 12px; box-shadow: 0 6px 22px rgba(20,58,138,.12); padding: 18px 18px 16px; text-decoration: none; color: inherit; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; gap: 2px 12px; border-top: 5px solid var(--mission-navy); }
.bc:nth-child(2) { border-top-color: var(--mission-green); } .bc:nth-child(3) { border-top-color: var(--mission-saffron); } .bc:nth-child(4) { border-top-color: var(--mission-red); }
.bc .ic { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 10px; background: #eef2fb; }
.bc .ic1 { background: linear-gradient(135deg, #dbe4fb, #c3d1f7); } .bc .ic2 { background: linear-gradient(135deg, #d8f2e2, #b9e6cb); } .bc .ic3 { background: linear-gradient(135deg, #fde6cf, #fbd0a3); } .bc .ic4 { background: linear-gradient(135deg, #fbd9d9, #f5b5b5); }
.bc b { font-size: 2.1rem; line-height: 1.1; color: #1c1c1c; font-family: Cambria, Georgia, serif; }
.bc span:last-child { color: #555; font-size: .9rem; font-weight: 600; }
.howto { margin: 34px 0 10px; }
.howto h2 { font-size: 1.6rem; color: var(--mission-navy); }
.howto .lead { max-width: 820px; color: #333; font-size: 1.05rem; margin: 8px 0 18px; }
.threesteps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.threesteps > div { background: #fff; border: 1px solid #e6e8f0; border-radius: 12px; padding: 16px 18px; position: relative; }
.threesteps .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mission-saffron); color: #fff; font-weight: 700; margin-bottom: 8px; }
.threesteps b { display: block; color: var(--mission-navy); margin-bottom: 4px; }
.threesteps p { margin: 0; font-size: .9rem; color: #444; }
.howto .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 10px; }
.howto .btn.big { background: var(--mission-saffron); border-color: var(--mission-saffron); color: #fff; }
.howto .btn.big.ghost { background: transparent; color: var(--mission-navy); border-color: var(--mission-navy); }
.fine { font-size: .82rem; color: #666; max-width: 900px; }
.tables { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 24px; }
.tables.one { grid-template-columns: 1fr; }
.tables .card h2 { color: var(--mission-navy); }
.small { font-size: .82rem; }
@media (max-width: 640px) { .bigcounters { margin-top: 10px; } .bc b { font-size: 1.7rem; } }
