/* Admin panel. Same tokens as the public site so the two feel like one product. */
:root {
  --brand: #1b5e44; --brand-deep: #134432; --brand-soft: #e3efe9;
  --yva: #007a08; --yva-deep: #006107;
  --bg: #f4f7f5; --surface: #fff; --fg: #14231c; --muted: #5a6b63; --line: #d9e3de;
  --red: #c2412d; --orange: #d98a1c;
  --font-display: "Archivo", "Hind Siliguri", system-ui, sans-serif;
  --font-body: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
body.adm { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.55; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.small { font-size: 13px; }
.adm-pad { padding: 16px 20px; margin: 0; }
.intro { margin: 0 0 18px; max-width: 75ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 14.5px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-sm { padding: 6px 14px; font-size: 13.5px; }
.btn-yva { background: var(--yva); color: #fff; border-color: var(--yva); }
.btn-yva:hover { background: var(--yva-deep); }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c9c2; }
.btn-danger:hover { background: #fdecea; }
.push-left { margin-right: auto; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; color: var(--fg); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.adm-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--yva); cursor: pointer; }
.adm-link.danger { color: var(--red); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Sign in */
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 0%, #e3efe9, transparent 60%), var(--bg); }
.adm-login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 30px; gap: 0 !important; }
.adm-login-logo { height: 56px; width: auto; margin-bottom: 12px; }
.adm-login-card h1 { font-family: var(--font-display); color: var(--brand); margin: 0 0 18px; font-size: 26px; }

/* Shell */
.adm-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.adm-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--brand-deep); color: #dcebe3; }
.adm-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px; }
.adm-brand img { height: 40px; width: auto; background: #fff; border-radius: 10px; padding: 4px 8px; }
.adm-brand span { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 17px; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav a { text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 500; color: #cfe2d8; }
.adm-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.adm-nav a.on { background: #fff; color: var(--brand-deep); font-weight: 600; }
.adm-me { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-top: 1px solid rgba(255,255,255,.14); font-size: 13px; word-break: break-all; }
.adm-me .adm-link { color: #fff; text-align: left; }
.adm-main { min-width: 0; }
.adm-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(244,247,245,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.adm-top h1 { font-family: var(--font-display); font-size: 22px; margin: 0; color: var(--brand); }
.adm-top-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.adm-burger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.adm-view { padding: 24px 28px 64px; }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .25s ease; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .adm-side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(8,26,19,.4); }
  .adm-burger { display: grid; place-items: center; }
  .adm-top { padding: 12px 16px; flex-wrap: wrap; }
  .adm-view { padding: 18px 14px 56px; }
}

/* Panels, tiles */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 14px; color: var(--fg); }
.panel.flush > h2 { margin: 0; border-bottom: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.tile b { font-family: var(--font-display); font-size: 32px; line-height: 1.1; color: var(--yva); }
.tile.warn b { color: #a86400; }
.tile span { color: var(--muted); font-size: 14px; }
a.tile:hover { border-color: var(--yva); }
.adm-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .adm-cols { grid-template-columns: 1fr; } }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.bar-row i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--yva) var(--w), var(--brand-soft) var(--w)); }
.bar-row b { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); font-size: 14px; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafcfb; white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #edf2ef; vertical-align: middle; }
.tbl tr[data-vol] { cursor: pointer; }
.tbl tr[data-vol]:hover td { background: #f6faf8; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.tbl .who img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.tbl .who b { display: block; }
.tbl .who small { color: var(--muted); }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.filters input, .filters select { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; font-size: 14px; color: var(--muted); }

/* Form field list */
.frows { list-style: none; margin: 0; padding: 0; }
.frow { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid #edf2ef; flex-wrap: wrap; }
.frow:last-child { border-bottom: 0; }
.frow.off .frow-main { opacity: .5; }
.frow-main { flex: 1; min-width: 220px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.frow-main .mono { color: var(--muted); }
.frow-tools { display: flex; gap: 6px; align-items: center; }
.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef3f0; color: var(--muted); }
.badge.req { background: #fff3dc; color: #8a5300; }
.badge.custom { background: #e6eefc; color: #2a4f9c; }

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c9d6cf; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--yva); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500 !important; margin-right: 18px; }
.checks { flex-direction: row !important; flex-wrap: wrap; }
.adv summary { cursor: pointer; font-weight: 600; }
.adv textarea { width: 100%; margin-top: 8px; }

/* Pages */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.pcard:hover { border-color: var(--yva); }
.pcard b { font-family: var(--font-display); font-size: 17px; }
.pcard .mono { color: var(--yva); }
.sec.off > .sec-body { opacity: .5; }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sec-label { font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 17px; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; min-width: 0; flex: 0 1 280px; }
.sec-label:hover, .sec-label:focus { border-color: var(--line); outline: none; }
.sec-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sec-json { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.sec .form-actions { margin-top: 14px; }

/* JSON editor */
.je-obj { display: grid; gap: 12px; }
.je-legend { font-weight: 700; font-size: 14px; color: var(--brand); margin-bottom: 6px; }
.je-field { display: flex; flex-direction: column; gap: 5px; }
.je-field > label { font-weight: 600; font-size: 13.5px; color: var(--muted); }
.je-field input:not([type=checkbox]):not([type=file]), .je-field textarea, .je-field select, .je-img input[type=text] {
  width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.je-field textarea { resize: vertical; }
.je-field input:focus, .je-field textarea:focus, .je-field select:focus { outline: none; border-color: var(--yva); }
.je-field input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; }
.je-img { display: flex; gap: 10px; align-items: center; }
.je-img img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.je-img label { flex: none; }
.je-arr { border-left: 3px solid var(--brand-soft); padding-left: 14px; }
.je-list { display: grid; gap: 8px; margin-bottom: 10px; }
.je-item { border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.je-item > summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; }
.je-item > summary::-webkit-details-marker { display: none; }
.je-item[open] > summary { border-bottom: 1px solid var(--line); }
.je-item > .je-obj { padding: 12px; }
.je-item.flat { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.je-item.flat .je-field { flex: 1; }
.je-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.je-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.je-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.je-tools button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.je-tools button:disabled { opacity: .35; cursor: default; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.set-json { grid-column: 1 / -1; }
@media (max-width: 760px) { .set-grid { grid-template-columns: 1fr; } }

/* Team cards */
.mcard { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.mcard.off { opacity: .55; }
.mcard img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--brand-soft); margin-bottom: 6px; }
.mcard .row { margin-top: 8px; }

/* Locations */
.loc-cols { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .loc-cols { grid-template-columns: 1fr; } }
.loc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.loc-head h2 { margin: 0; }
.loc-list { list-style: none; margin: 0; padding: 6px; max-height: 520px; overflow-y: auto; }
.loc-list button { width: 100%; display: flex; justify-content: space-between; text-align: left; font: inherit; padding: 8px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.loc-list button:hover { background: #f2f7f4; }
.loc-list button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.loc-row { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #f0f4f2; }

/* Dialog */
.adm-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 70px -30px rgba(8,26,19,.6); }
.adm-dialog.wide { width: min(920px, calc(100% - 24px)); }
.adm-dialog::backdrop { background: rgba(8,26,19,.5); backdrop-filter: blur(3px); }
.adm-dialog-inner { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.adm-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.adm-dialog header h2 { margin: 0; font-family: var(--font-display); font-size: 19px; color: var(--brand); }
.adm-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f0f4f2; font-size: 22px; cursor: pointer; line-height: 1; }
.adm-dialog-body { padding: 20px; overflow-y: auto; }
.adm-dialog footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.adm-dialog footer:empty { display: none; }
.vol-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.vol-head img { width: 80px; height: 96px; object-fit: cover; border-radius: 12px; background: var(--brand-soft); }
.vol-head h3 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.vol-head p { margin: 2px 0 0; }
.vol-head .btn { margin-left: auto; }
.note { background: #fff8e8; padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.vol-status { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: #f6faf8; border: 1px solid var(--line); margin-bottom: 18px; }
.vol-status label { font-weight: 600; font-size: 14px; }
.vol-status input { font: inherit; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; }

.loc-cc { margin-top: 16px; }
.loc-cc .row .btn span { opacity: .7; font-weight: 500; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; max-height: none; }
.loc-grid .loc-row { align-items: center; gap: 12px; }
.loc-grid .loc-row > span:last-child { white-space: nowrap; }

.avatar-initials { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-family: var(--font-display); font-weight: 700; }
.tbl .who .avatar-initials { width: 38px; height: 38px; font-size: 14px; }
.vol-head .avatar { width: 80px; height: 96px; object-fit: cover; border-radius: 12px; background: var(--brand-soft); }
.vol-head .avatar-initials { width: 80px; height: 80px; border-radius: 50%; font-size: 28px; }
