/* ==========================================================================
   C&B Ghat Football Academy — clean, minimal, white & purple
   tokens → base → chrome → dashboard → lists → dialogs → admin → auth/splash
   → responsive → print
   ========================================================================== */

/* SolaimanLipi: put SolaimanLipi.ttf (and optionally SolaimanLipi_Bold.ttf) in public/assets/fonts/.
   Until then the browser falls back to Hind Siliguri. */
@font-face {
  font-family: "SolaimanLipi";
  src: local("SolaimanLipi"), local("Solaiman Lipi"), url("../fonts/SolaimanLipi.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "SolaimanLipi";
  src: local("SolaimanLipi Bold"), local("SolaimanLipi-Bold"), url("../fonts/SolaimanLipi_Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --font: "SolaimanLipi", "Hind Siliguri", "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif;
  --r: 16px;
  --r-sm: 10px;

  --p: #6d28d9;                       /* purple (theme colour) */
  --p-text: var(--p);
  --p-soft: color-mix(in srgb, var(--p) 9%, transparent);
  --p-line: color-mix(in srgb, var(--p) 28%, transparent);
  --on-p: #ffffff;

  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --ink: #1b1730;
  --muted: #6c6881;
  --line: #e9e6f2;
  --in: #0f8a5f;
  --out: #d6335b;
  --shadow: 0 1px 2px rgba(27, 23, 48, .05), 0 8px 24px -14px rgba(27, 23, 48, .18);
  --shadow-lg: 0 24px 60px -18px rgba(27, 23, 48, .35);
  --topbar-h: 64px;
}
[data-theme="purple"]   { --p: #6d28d9; }
[data-theme="royal"]    { --p: #2563eb; }
[data-theme="emerald"]  { --p: #0f8a5f; }
[data-theme="ember"]    { --p: #d9531e; }
[data-theme="crimson"]  { --p: #d6335b; }
[data-theme="midnight"] { --p: #334155; }

/* dark = ash charcoal */
[data-mode="dark"] {
  --bg: #1d1d1f;
  --surface: #292a2d;
  --surface-2: #2f3033;
  --ink: #ececf1;
  --muted: #a3a3ae;
  --line: #3e3f44;
  --in: #5fd1a1;
  --out: #ff8aa3;
  --p-text: color-mix(in srgb, var(--p) 40%, #ffffff);
  --p-soft: color-mix(in srgb, var(--p) 22%, transparent);
  --p-line: color-mix(in srgb, var(--p) 50%, transparent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 26px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16.5px; line-height: 1.6; color: var(--ink); background: var(--bg); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
html[lang="en"] { --font: "Inter", "Hind Siliguri", "Segoe UI", system-ui, sans-serif; }
html[lang="en"] body { font-size: 15.5px; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
.inline { display: inline; margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
::selection { background: var(--p-line); }

.when-dark { display: none; }
[data-mode="dark"] .when-light { display: none; }
[data-mode="dark"] .when-dark { display: block; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.dash { color: var(--muted); }
.reveal { animation: rise .45s ease both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.brand-logo .logo-img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.nav-desktop { display: flex; gap: 2px; margin-left: auto; }
.nav-desktop a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-sm); font-size: 15.5px; color: var(--muted); transition: background .15s, color .15s; }
.nav-desktop a:hover { background: var(--p-soft); color: var(--ink); }
.nav-desktop a.on { background: var(--p-soft); color: var(--p-text); font-weight: 700; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; transition: border-color .15s, color .15s, background .15s; }
.icon-btn:hover { border-color: var(--p); color: var(--p-text); }
.icon-btn.sm { min-width: 34px; height: 34px; padding: 0 8px; }
.icon-btn.danger:hover { border-color: var(--out); color: var(--out); background: color-mix(in srgb, var(--out) 8%, transparent); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; max-width: 130px; }
.user-meta b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 12.5px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--p-text); background: var(--p-soft); }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; }
.nav-bottom { display: none; }

/* ---------- flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); font-size: 15.5px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.flash .ic { margin-top: 3px; }
.flash-success { border-color: color-mix(in srgb, var(--in) 40%, var(--line)); background: color-mix(in srgb, var(--in) 7%, var(--surface)); }
.flash-success .ic { color: var(--in); }
.flash-error { border-color: color-mix(in srgb, var(--out) 40%, var(--line)); background: color-mix(in srgb, var(--out) 7%, var(--surface)); }
.flash-error .ic { color: var(--out); }
.auth-card .flash { margin-bottom: 0; box-shadow: none; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 700; font-size: 15.5px; white-space: nowrap; user-select: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14.5px; }
.btn.lg { height: 50px; font-size: 17px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.primary { color: var(--on-p); background: var(--p); box-shadow: 0 6px 14px -8px var(--p); }
.btn.primary:hover { background: color-mix(in srgb, var(--p) 88%, #000); }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--p); color: var(--p-text); }
.btn.danger { background: var(--out); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
[data-mode="dark"] .btn.danger { color: #26121a; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 700; font-size: 14.5px; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 400; }
.input, .input-icon input, select.input { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input.big { font-size: 21px; font-weight: 700; height: 52px; }
.input:hover, .input-icon input:hover { border-color: var(--p-line); }
.input:focus, .input-icon input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.input:read-only:not(select) { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 44px; padding-right: 44px; height: 50px; }
.eye { position: absolute; right: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; }
.eye:hover { color: var(--ink); }
.eye .when-shown { display: none; }
.eye.shown .when-shown { display: block; }
.eye.shown .when-hidden { display: none; }
.hint { color: var(--muted); font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--p); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.b-admin { background: var(--p-soft); color: var(--p-text); border-color: transparent; font-weight: 700; }
.badge.b-ok { background: color-mix(in srgb, var(--in) 12%, transparent); color: var(--in); border-color: transparent; }
.badge.b-off { background: color-mix(in srgb, var(--out) 12%, transparent); color: var(--out); border-color: transparent; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 8px; background: var(--p-soft); color: var(--p-text); white-space: nowrap; font-weight: 600; }

/* ---------- dashboard ---------- */
.hero { display: flex; align-items: center; gap: 18px; padding: 2px 0 4px; }
.hero-logo { order: 1; flex: none; width: 76px; height: 76px; display: grid; place-items: center; padding: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.hero-img { width: 100%; height: 100%; object-fit: contain; }
.hero-text { order: 2; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px 2px 9px; margin-bottom: 6px; border-radius: 999px; background: var(--p-soft); color: var(--p-text); font-size: 14px; font-weight: 600; }
.hero-title { font-size: clamp(25px, 4vw, 36px); line-height: 1.3; font-weight: 700; text-wrap: balance; }
.hero-sub { margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .1em; }
html[lang="bn"] .hero-sub { letter-spacing: .03em; font-size: 15px; }

.fund { position: relative; overflow: hidden; margin-top: 22px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 30px 34px; border-radius: 22px; color: var(--on-p); background: var(--p); box-shadow: 0 18px 36px -18px var(--p); }
[data-mode="dark"] .fund { background: color-mix(in srgb, var(--p) 75%, #1d1d1f); box-shadow: none; }
.fund::before { content: ""; position: absolute; right: -90px; top: -110px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.fund::after { content: ""; position: absolute; right: 120px; bottom: -150px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.fund > * { position: relative; z-index: 1; }
.fund-label { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; opacity: .85; }
.fund-amount { display: block; margin-top: 2px; font-size: clamp(36px, 6vw, 54px); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fund-amount.neg { color: #ffd3dc; }
.fund-note { font-size: 14.5px; opacity: .75; margin-top: 4px; }
.fund-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fund-stat { display: flex; flex-direction: column; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .13); }
.fund-stat small { font-size: 14px; opacity: .8; }
.fund-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.meter { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.meter-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 999px; background: #fff; }
.meter small { font-size: 14px; opacity: .8; }

.box-list { margin-top: 16px; display: grid; gap: 12px; }
.box-row { display: grid; grid-template-columns: 1fr minmax(190px, 32%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s, transform .18s; }
.box-row:hover { border-color: var(--p-line); transform: translateY(-1px); }
.box-tile { display: flex; align-items: center; gap: 16px; padding: 18px 22px; min-width: 0; }
.box-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.box-txt b { font-size: 19px; line-height: 1.35; }
.box-txt small { color: var(--muted); font-size: 14.5px; }
.box-go { color: var(--muted); transition: transform .18s, color .18s; }
.box-row:hover .box-go { transform: translateX(3px); color: var(--p-text); }
.box-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--p-text); background: var(--p-soft); overflow: hidden; }
.box-ic.sm { width: 48px; height: 48px; }
.box-ic.box-donations { color: var(--in); background: color-mix(in srgb, var(--in) 12%, transparent); }
.box-ic.box-expenses { color: var(--out); background: color-mix(in srgb, var(--out) 11%, transparent); }
.box-ic:has(.box-img) { background: var(--surface-2); border: 1px solid var(--line); }
.box-img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.box-balance { display: flex; flex-direction: column; justify-content: center; padding: 14px 24px; border-left: 1px solid var(--line); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }
.box-balance small { color: var(--muted); font-size: 14px; }
.box-balance strong { font-size: clamp(22px, 3vw, 28px); font-weight: 700; color: var(--in); font-variant-numeric: tabular-nums; line-height: 1.25; }
.tone-out .box-balance strong { color: var(--out); }

.panel { margin-top: 16px; padding: 24px 26px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.panel-head h2 .ic { color: var(--p-text); }
.panel-head p { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.panel.stack { gap: 20px; }
.panel.stack .panel-head { margin-bottom: 0; }

.due-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.due { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--out) 5%, var(--surface)); border: 1px solid color-mix(in srgb, var(--out) 22%, var(--line)); }
.due-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.due-who b { font-size: 17.5px; }
.due-who small { color: var(--muted); font-size: 14px; }
.due-amt { text-align: right; display: flex; flex-direction: column; }
.due-amt small { color: var(--muted); font-size: 13.5px; }
.due-amt b { color: var(--out); font-size: 23px; font-variant-numeric: tabular-nums; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 16px; color: var(--muted); text-align: center; }
.empty.ok { flex-direction: row; color: var(--in); padding: 16px; background: color-mix(in srgb, var(--in) 8%, transparent); border-radius: 14px; }

/* ---------- list pages ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-title h1 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; line-height: 1.25; }
.page-title p { color: var(--muted); font-size: 14.5px; }
.balance-chip { display: flex; flex-direction: column; padding: 8px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); text-align: right; }
.balance-chip small { color: var(--muted); font-size: 14px; }
.balance-chip strong { font-size: 25px; font-weight: 700; color: var(--in); font-variant-numeric: tabular-nums; line-height: 1.25; }
.balance-chip.out strong { color: var(--out); }

.week-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border-radius: 14px; background: var(--p-soft); }
.week-ic { color: var(--p-text); flex: none; }
.week-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.week-txt small { color: var(--muted); font-size: 14.5px; }
.week-card .input { width: 170px; height: 40px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-note { flex: 1; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14.5px; }
.search { flex: 1; min-width: 150px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 14px; color: var(--muted); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
.search input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }

.sheet-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.sheet { width: 100%; border-collapse: collapse; min-width: 900px; }
.sheet td.c-name { min-width: 180px; }
.sheet th { text-align: left; padding: 13px 16px; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet tbody tr:last-child td { border-bottom: 0; }
.sheet tbody tr { transition: background .12s; }
.sheet tbody tr:hover { background: var(--p-soft); }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet .c-serial { width: 74px; text-align: center; color: var(--muted); }
.sheet .c-act { width: 1%; white-space: nowrap; }
.sheet small.by { display: block; color: var(--muted); font-size: 13px; }
.sheet tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; font-size: 17px; }
.tot-label { text-align: right; font-weight: 700; }
.money { font-weight: 700; color: var(--in); }
.money.out { color: var(--out); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.signed { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-style: italic; font-weight: 600; color: var(--p-text); }
.input.signed-field { font-style: italic; font-weight: 600; color: var(--p-text); }

.thumb { width: 52px; height: 40px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; display: block; cursor: zoom-in; transition: border-color .15s, transform .15s; }
.thumb:hover { border-color: var(--p); transform: scale(1.05); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.proof { width: 54px; height: 54px; }
.thumb.proof img { object-fit: cover; }

/* ---------- dialog ---------- */
dialog.dlg { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink); width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.dlg[open] { display: flex; flex-direction: column; animation: pop .22s ease; }
dialog.dlg > form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 24px); }
dialog.dlg::backdrop { background: rgba(20, 15, 35, .5); animation: fade .2s; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 20px; font-weight: 700; }
.dlg-body { padding: 22px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.dlg-sm { width: min(390px, calc(100vw - 24px)); text-align: center; }
.dlg-sm .dlg-body { padding: 28px 24px 8px; }
.dlg-sm h3 { font-size: 20px; margin: 12px 0 4px; }
.dlg-sm p { color: var(--muted); }
.dlg-sm .dlg-foot { justify-content: center; background: none; border: 0; padding-bottom: 24px; }
.confirm-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--out) 12%, transparent); color: var(--out); }

.drop { display: block; cursor: pointer; border-radius: 14px; border: 1.5px dashed var(--p-line); background: var(--surface-2); min-height: 110px; overflow: hidden; transition: background .15s, border-color .15s; }
.drop:hover { border-color: var(--p); background: var(--p-soft); }
.drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 24px 12px; text-align: center; color: var(--p-text); }
.drop-empty small { color: var(--muted); font-size: 13.5px; }
.drop-preview { display: block; width: 100%; max-height: 230px; object-fit: contain; background: var(--surface-2); }
.drop.has-img .drop-empty { display: none; }
.proof-remove { margin-top: 8px; }

.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(15, 12, 24, .88); animation: fade .15s; }
.lightbox img { max-width: min(94vw, 1100px); max-height: 82dvh; border-radius: 12px; box-shadow: var(--shadow-lg); cursor: zoom-in; transition: transform .2s; }
.lightbox img.zoomed { transform: scale(1.8); cursor: zoom-out; }
.lb-close { position: absolute; right: 16px; top: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .15); color: #fff; }
.lb-close:hover { background: rgba(255, 255, 255, .28); }
.lb-open { position: absolute; bottom: 20px; left: 50%; translate: -50% 0; color: #fff; padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .15); }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--p-text); border-bottom-color: var(--p); font-weight: 700; }
.tabs + .panel, .tabs + .toolbar { margin-top: 20px; }

.logo-edit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-preview { width: 104px; height: 104px; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; padding: 10px; }
.logo-preview img, .logo-preview svg { width: 100%; height: 100%; object-fit: contain; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s; }
.swatch-card i { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--c1); }
.swatch-card b { font-size: 15.5px; font-weight: 600; }
.swatch-card em { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c1); color: #fff; opacity: 0; }
.swatch:hover .swatch-card { border-color: var(--p-line); }
.swatch input:checked + .swatch-card { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 16%, transparent); }
.swatch input:checked + .swatch-card em { opacity: 1; }
.swatch input:focus-visible + .swatch-card { outline: 2px solid var(--c1); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; gap: 7px; padding: 7px 18px; border-radius: 9px; font-size: 15px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--p-text); font-weight: 700; box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--p); }

.box-uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.box-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.box-upload .box-ic { width: 76px; height: 76px; border-radius: 20px; }

/* ---------- auth + splash ---------- */
body.auth { background: color-mix(in srgb, var(--p) 6%, var(--bg)); }
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.auth-bg i { position: absolute; border-radius: 50%; background: var(--p); opacity: .07; }
.auth-bg i:nth-child(1) { width: 520px; height: 520px; left: -160px; top: -200px; }
.auth-bg i:nth-child(2) { width: 380px; height: 380px; right: -120px; bottom: -120px; }
.auth-bg i:nth-child(3) { display: none; }
.auth-lang { position: fixed; right: 16px; top: 16px; z-index: 5; }
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 36px 30px 30px; border-radius: 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .5s ease both; }
.auth-card.wide { width: min(540px, 100%); }
.auth-card .stack { text-align: left; margin-top: 24px; }
.auth-logo { width: 88px; height: 88px; margin: 0 auto 14px; display: grid; place-items: center; }
.auth-img { width: 100%; height: 100%; object-fit: contain; }
.auth-title { font-size: clamp(22px, 5vw, 27px); font-weight: 700; line-height: 1.35; text-wrap: balance; }
.auth-sub { color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 2px; letter-spacing: .08em; }
html[lang="bn"] .auth-sub { letter-spacing: .02em; font-size: 15px; }

.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; text-align: center; color: var(--on-p); background: var(--p); animation: splashOut .6s ease 2.2s forwards; }
[data-mode="dark"] .splash { background: color-mix(in srgb, var(--p) 60%, #1a1a1c); }
.splash-logo { width: 120px; height: 120px; margin-bottom: 18px; display: grid; place-items: center; background: #fff; border-radius: 32px; padding: 14px; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .4); animation: splashPop .7s cubic-bezier(.2, .9, .3, 1) both; }
.splash-img { width: 100%; height: 100%; object-fit: contain; }
.splash h1 { font-size: clamp(26px, 6vw, 38px); font-weight: 700; line-height: 1.3; max-width: 640px; animation: rise .7s .25s both; }
.splash p { opacity: .85; letter-spacing: .1em; animation: rise .7s .4s both; }
html[lang="bn"] .splash p { letter-spacing: .02em; }
.splash-bar { width: 120px; height: 3px; margin-top: 26px; border-radius: 999px; background: rgba(255, 255, 255, .3); overflow: hidden; animation: rise .7s .5s both; }
.splash-bar i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; animation: load 1.9s .2s ease-in-out both; }
@keyframes splashPop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-desktop { display: none; }
  .top-actions { margin-left: auto; }
  .user-meta { display: none; }
  .container { padding-bottom: 96px; }
  .nav-bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .nav-bottom a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 13px; min-width: 0; }
  .nav-bottom a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-bottom a.on { color: var(--p-text); background: var(--p-soft); font-weight: 700; }
}

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .container { padding: 18px 14px 96px; }
  .topbar-in { padding: 0 14px; gap: 10px; }
  .brand-name { font-size: 14.5px; }
  .hero { gap: 14px; }
  .hero-logo { width: 62px; height: 62px; border-radius: 18px; padding: 7px; }
  .fund { grid-template-columns: 1fr; padding: 24px 20px; gap: 18px; border-radius: 20px; }
  .box-row { grid-template-columns: 1fr; }
  .box-tile { padding: 16px 18px 12px; }
  .box-balance { flex-direction: row; align-items: center; justify-content: space-between; border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); padding: 11px 18px; }
  .panel { padding: 20px 16px; }
  .due { flex-wrap: wrap; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .toolbar .btn.primary { flex: 1; }
  .week-card .input { width: 100%; flex: 1; }
  .page-head { align-items: stretch; }
  .balance-chip { text-align: left; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }

  /* table → cards on phones */
  .sheet-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  .sheet { min-width: 0; display: block; }
  .sheet thead { display: none; }
  .sheet tbody { display: grid; gap: 12px; }
  .sheet tr { position: relative; display: block; background: var(--surface) !important; border: 1px solid var(--line); border-radius: 16px; padding: 6px 16px; box-shadow: var(--shadow); }
  .sheet td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border: 0 !important; border-bottom: 1px solid var(--line) !important; text-align: right; }
  .sheet td:last-child { border-bottom: 0 !important; }
  .sheet td::before { content: attr(data-label); color: var(--muted); font-size: 14.5px; text-align: left; flex: none; }
  .sheet td.blank { display: none; }
  .sheet td.c-serial { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; padding: 0; justify-content: center; border: 0 !important; border-radius: 50%; background: var(--p-soft); color: var(--p-text); font-size: 15px; font-weight: 700; }
  .sheet td.c-serial::before, .sheet td.c-name::before, .sheet td.c-act::before { content: none; }
  .sheet td.c-name { display: block; text-align: left; padding: 12px 52px 10px 0; font-size: 19px; }
  .sheet td.c-name small.by { text-align: left; }
  .sheet td.c-act { width: auto; padding-top: 10px; }
  .sheet td.c-act .row-actions { width: 100%; justify-content: flex-end; }
  .sheet tfoot { display: block; margin-top: 12px; }
  .sheet tfoot tr { display: flex; justify-content: space-between; align-items: center; background: var(--p-soft) !important; border-color: transparent; box-shadow: none; }
  .sheet tfoot td { display: block; background: none; padding: 8px 0; border: 0 !important; font-size: 18px; }
  .sheet tfoot td::before { content: none; }
  .sheet tfoot td:empty { display: none; }
  .tot-label { text-align: left !important; }

  dialog.dlg { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; max-height: 94dvh; }
  dialog.dlg > form { max-height: 94dvh; }
  dialog.dlg.dlg-sm { margin: auto; width: calc(100vw - 24px); border-radius: 20px; }
  @keyframes pop { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .splash { display: none; }
}

/* ---------- print ---------- */
.print-head { display: none; }
@media print {
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .topbar, .nav-bottom, .toolbar, .week-card, .page-head .box-ic, .no-print, dialog, .flash, .skip { display: none !important; }
  .container { padding: 0; max-width: none; }
  .print-head { display: block; margin-bottom: 10px; }
  .print-head h2 { font-size: 16pt; }
  .balance-chip { box-shadow: none; border-color: #999; }
  .sheet-wrap { box-shadow: none; border: 1px solid #999; border-radius: 0; overflow: visible; }
  .sheet { min-width: 0; font-size: 10pt; }
  .sheet th, .sheet td { border: 1px solid #bbb !important; background: #fff !important; color: #000 !important; }
}

/* ---------- weekly collection (members page + dashboard card) ---------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.balance-chip.alt { background: var(--surface-2); box-shadow: none; }
.balance-chip.alt strong { color: var(--p-text); }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--p-soft); font-size: 14.5px; }
.note .ic { color: var(--p-text); margin-top: 3px; }

.setup-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 14px; border-radius: var(--r); background: var(--surface); border: 1.5px dashed var(--p-line); }
.setup-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--p-soft); color: var(--p-text); flex: none; }
.setup-txt { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.setup-txt small { color: var(--muted); font-size: 14.5px; }
.setup-card .input { width: 180px; }

.week-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 32px; align-items: center; padding: 16px 20px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.week-nav { display: flex; align-items: center; gap: 8px; }
.icon-btn.is-off { opacity: .35; pointer-events: none; }
.week-pick { display: flex; flex-direction: column; min-width: 210px; }
.week-pick small { color: var(--p-text); font-weight: 700; font-size: 13.5px; }
.week-pick select { height: 36px; padding: 0 22px 0 0; border: 0; background: transparent; font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 9px) 16px, calc(100% - 4px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.week-pick select:focus-visible { outline: 2px solid var(--p); border-radius: 6px; }
.week-progress { min-width: 0; }
.wp-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15.5px; margin-bottom: 6px; }
.wp-top span { color: var(--p-text); font-weight: 700; }
.wp-bar { height: 8px; border-radius: 999px; background: var(--p-soft); overflow: hidden; }
.wp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--p); }
.week-set { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
.week-set summary { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14.5px; cursor: pointer; list-style: none; }
.week-set summary::-webkit-details-marker { display: none; }
.week-set summary:hover { color: var(--p-text); }
.week-set-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.week-set-form .input { width: 180px; height: 38px; }
.week-set-form .hint { flex-basis: 100%; }

.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; color: var(--muted); transition: background .15s, border-color .15s, color .15s; }
.chip b { font-weight: 700; color: var(--ink); }
.chip:hover { border-color: var(--p-line); }
.chip.on { background: var(--p); border-color: var(--p); color: var(--on-p); }
.chip.on b { color: var(--on-p); }
.chip.suggest { height: 34px; margin-top: 12px; color: var(--p-text); background: var(--p-soft); border-color: transparent; font-weight: 600; }

.amt { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 15.5px; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; font-variant-numeric: tabular-nums; }
.amt.paid { background: color-mix(in srgb, var(--in) 11%, transparent); color: var(--in); }
.amt.paid .ic { opacity: .6; }
.amt.paid:hover:not(:disabled) { border-color: var(--in); }
.amt.paid:disabled { cursor: default; }
.amt.add { background: var(--p-soft); color: var(--p-text); border: 1px dashed var(--p-line); }
.amt.add:hover { background: var(--p); border: 1px solid var(--p); color: var(--on-p); }
.sheet tr:target { animation: flash 1.8s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--p) 24%, transparent); } to { background: transparent; } }

.dlg-pay .dlg-head { align-items: flex-start; }
.pay-who small { color: var(--muted); font-size: 14px; }
.pay-who h3 { font-size: 22px; line-height: 1.3; }
.pay-week { display: flex; gap: 8px; align-items: center; color: var(--muted); margin-bottom: 14px; }
.pay-week b { color: var(--p-text); }
.input.huge { font-size: 34px; font-weight: 700; height: 72px; text-align: center; }
.pay-foot { flex-wrap: wrap; }
.pay-foot .btn { flex: 1 1 auto; }
#payRemove { order: -1; flex: 0 0 auto; }
.btn.ghost.danger-text { color: var(--out); }
.btn.ghost.danger-text:hover { border-color: var(--out); }

.week-now { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 16px; padding: 18px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.wn-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 5px; }
.wn-label { display: inline-flex; gap: 6px; align-items: center; color: var(--p-text); font-weight: 700; font-size: 14.5px; }
.wn-info b { font-size: 18px; }
.wn-amt { display: flex; flex-direction: column; text-align: right; }
.wn-amt small { color: var(--muted); font-size: 14px; }
.wn-amt strong { font-size: 24px; color: var(--in); font-variant-numeric: tabular-nums; line-height: 1.25; }

@media (max-width: 720px) {
  .chip-row { width: 100%; }
  .chip-row .balance-chip { flex: 1; width: auto; min-width: 0; flex-direction: column; text-align: left; align-items: flex-start; }
  .week-bar { grid-template-columns: 1fr; padding: 14px 16px; }
  .week-nav { width: 100%; }
  .week-pick { flex: 1; min-width: 0; }
  .chips { width: 100%; order: 3; }
  .chips .chip { flex: 1; justify-content: center; padding: 0 8px; }
  .setup-card .input, .week-set-form .input { width: 100%; }
  .week-now { padding: 16px; gap: 14px; }
  .wn-amt { text-align: left; }
  .week-now .btn { width: 100%; }
  .pay-foot .btn, #payRemove { flex: 1 1 100%; }
  .input.huge { font-size: 30px; height: 64px; }
  .sheet td.num .amt { height: 40px; }
}
@media print {
  .week-bar, .week-now, .chips, .setup-card { display: none !important; }
  .amt { border: 0; background: none !important; color: #000 !important; padding: 0; height: auto; }
  .amt .ic { display: none; }
}
/* members: compact one-tap cards on phones */
@media (max-width: 720px) {
  .is-members tr { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 0; align-items: center; padding: 12px 14px; }
  .is-members tr[data-paid="1"] { border-left: 4px solid var(--in); }
  .is-members td { display: block; padding: 0; border: 0 !important; text-align: left; min-width: 0; }
  .is-members td::before { content: none; }
  .is-members td.c-serial { position: static; grid-column: 1; grid-row: 1; width: 30px; height: 30px; display: grid; place-items: center; font-size: 14px; }
  .is-members td.c-name { grid-column: 2; grid-row: 1; padding: 0; font-size: 18px; line-height: 1.35; }
  .is-members td.c-name small.by { display: none; }
  .is-members td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 15px; }
  .is-members td:nth-child(4) { grid-column: 2 / 4; grid-row: 3; color: var(--muted); font-size: 14.5px; }
  .is-members td:nth-child(5), .is-members td:nth-child(6) { display: none; }
  .is-members td.num { grid-column: 3; grid-row: 1 / 3; text-align: right; }
  .is-members td.num .amt { height: 46px; min-width: 96px; justify-content: center; font-size: 17px; }
  .is-members td:nth-child(8) { grid-column: 1 / 3; grid-row: 4; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line) !important; font-size: 14px; }
  .is-members td.c-act { grid-column: 3; grid-row: 4; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line) !important; width: auto; }
  .is-members td.blank { display: none; }
  .is-members tfoot tr { display: flex; }
  .is-members tfoot td { display: block; }
}

.week-set-form { align-items: flex-end; }
.week-edit { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.week-edit .input { width: 180px; height: 38px; }
.week-set-form .btn.danger-text { color: var(--out); }
@media (max-width: 720px) {
  .week-actions .btn { width: 100%; }
  .week-edit { width: 100%; }
  .week-edit .field { flex: 1; }
  .week-edit .input { width: 100%; }
}
/* ---------- installer ---------- */
.choice-list { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--p); background: var(--p-soft); }
.choice input { margin-top: 5px; accent-color: var(--p); width: 18px; height: 18px; }
.choice span { display: flex; flex-direction: column; text-align: left; }
.choice small { color: var(--muted); font-size: 14px; }
textarea.input.code { height: auto; padding: 10px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
/* ==========================================================================
   Photos, search, toolbar actions, admin extras — and the mobile-first layer
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
button, a, input, select, label { touch-action: manipulation; }
.topbar { padding-top: env(safe-area-inset-top); }
.icon-btn.is-on { border-color: var(--p); color: var(--p-text); background: var(--p-soft); }

/* round profile pictures */
.av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; padding: 0; border: 0; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); background: var(--p-soft); color: var(--p-text); font-weight: 700; font-size: 18px; line-height: 1; }
button.av { cursor: zoom-in; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.lg { width: 54px; height: 54px; font-size: 21px; }
.av.xl { width: 64px; height: 64px; font-size: 25px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-t { display: flex; flex-direction: column; min-width: 0; }
a.tel { color: var(--p-text); font-weight: 600; }

.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-preview { width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--p-soft); color: var(--p-text); border: 2px dashed var(--p-line); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pay-head { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* toolbar: every action is visible and thumb-sized on phones */
.actions-row { display: flex; gap: 10px; }
.toolbar .btn { flex: none; }

/* find a person */
.find-box { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 0 16px; height: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--muted); }
.find-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 16.5px; }
.find-box:focus-within { border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.big-search { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); color: var(--muted); }
.big-search input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none; font-size: 17px; }
.big-search:focus-within { border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
.result-count { margin-top: 16px; color: var(--muted); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 22px 0 10px; }
.section-title span { font-size: 13px; padding: 0 10px; border-radius: 999px; background: var(--p-soft); color: var(--p-text); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.person { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.person:hover { border-color: var(--p-line); transform: translateY(-1px); }
.person-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-t b { font-size: 17.5px; line-height: 1.35; }
.person-t span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-n { display: flex; flex-direction: column; text-align: right; flex: none; }
.person-n small { color: var(--muted); font-size: 13.5px; }
.person-n .money { font-size: 17px; }

/* admin: switches, colour pickers, previews */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--p); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--p); outline-offset: 2px; }
.phone-frame { width: 108px; height: 192px; border-radius: 18px; border: 3px solid var(--ink); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.phone-frame.wide { width: 192px; height: 120px; }
.phone-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-empty { color: var(--muted); }
.color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-input { width: 56px; height: 44px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.swatch-color { margin-left: auto; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.swatch-card .swatch-color + em { margin-left: 8px; }

/* login background picture, admin-chosen splash */
.auth-photo { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: rgba(20, 15, 35, .45); }
.splash { background: var(--splash-bg, var(--p)); color: var(--splash-on, var(--on-p)); animation: splashOut .6s ease var(--splash-sec, 2.2s) forwards; }
[data-mode="dark"] .splash { background: var(--splash-bg, var(--p)); }
.splash-bar i { animation-duration: var(--splash-sec, 2.2s); animation-delay: 0s; }
.splash.has-img { justify-content: flex-end; padding-bottom: 12vh; background: var(--splash-bg) var(--splash-img) center / cover no-repeat; }
.splash.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0, 0, 0, .6)); }
.splash.has-img > * { position: relative; }
.splash.has-img .splash-logo { width: 84px; height: 84px; margin-bottom: 10px; }
.splash.has-img h1 { font-size: clamp(22px, 5.5vw, 30px); color: #fff; }
.splash.has-img p { color: #fff; }

/* ---------- mobile-first layer (phones) ---------- */
@media (max-width: 720px) {
  .icon-btn { min-width: 40px; height: 40px; }
  .icon-btn.sm { min-width: 40px; height: 40px; }
  .row-actions { gap: 8px; }
  .toolbar { gap: 10px; }
  .toolbar .search { order: 1; flex-basis: 100%; }
  .toolbar .actions-row { order: 2; flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  .toolbar .chips { order: 3; }
  .actions-row .btn { height: 46px; padding: 0 8px; gap: 6px; font-size: 14.5px; min-width: 0; }
  .actions-row .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .people-grid { grid-template-columns: 1fr; }
  .photo-row { gap: 14px; }
  .big-search .btn { height: 42px; padding: 0 16px; }

  /* members: compact one-tap cards, picture first */
  .is-members tr { grid-template-columns: 1fr auto; }
  .is-members td.c-serial { display: none; }
  .is-members td.c-name { grid-column: 1; grid-row: 1; }
  .is-members td.c-name .who-t small { display: block; font-size: 13px; }
  .is-members td:nth-child(3) { grid-column: 1; grid-row: 2; padding-left: 56px; }
  .is-members td:nth-child(4) { grid-column: 1 / 3; grid-row: 3; padding-left: 56px; }
  .is-members td.num { grid-column: 2; grid-row: 1 / 3; }
  .is-members td:nth-child(8) { grid-column: 1; }
  .is-members td.c-act { grid-column: 2; }

  /* donation / expense cards keep the picture beside the name */
  .sheet td.c-name .who { gap: 12px; }
}
@media (max-width: 560px) {
  .user-chip { display: none; }
  .topbar-in { gap: 8px; }
  .top-actions { gap: 6px; }
  .brand-name { -webkit-line-clamp: 2; font-size: 14px; }
}
@media print {
  .actions-row, .find-box, .big-search { display: none !important; }
  .av { box-shadow: none; width: 28px; height: 28px; }
}
/* phones: tighter header block so the list starts higher */
@media (max-width: 720px) {
  .page-head .box-ic { display: none; }
  .page-head { margin-bottom: 10px; }
  .page-title h1 { font-size: 22px; }
  .chip-row { gap: 8px; }
  .chip-row .balance-chip { padding: 6px 12px; border-radius: 12px; }
  .chip-row .balance-chip small { font-size: 13px; }
  .chip-row .balance-chip strong { font-size: 20px; }
  .week-bar { padding: 12px 14px; gap: 10px; }
  .week-pick select { font-size: 17px; }
  .wp-top { font-size: 14.5px; margin-bottom: 4px; }
  .week-set { padding-top: 8px; }
  .hero { padding: 0; }
  .fund { margin-top: 14px; }
}
