/* Made for elderly / first-time users: big text, big buttons, high contrast, one job per screen. */
:root { --bg:#f3f5f9; --card:#fff; --ink:#111827; --muted:#4b5563; --brand:#1d4ed8; --brand-soft:#e8efff; --ok:#047857; --ok-soft:#d1fae5; --warn:#b45309; --warn-soft:#fef3c7; --line:#d1d5db; }
* { box-sizing:border-box; }
html { font-size:18px; }
body { margin:0; font-family:system-ui,"Segoe UI",Roboto,"Noto Sans",sans-serif; background:var(--bg); color:var(--ink); line-height:1.45; }
header { background:var(--brand); color:#fff; padding:14px 18px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
header h1 { font-size:1.1rem; margin:0; line-height:1.25; }
header button { min-height:44px; }
main { max-width:720px; margin:16px auto; padding:0 14px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px; margin-bottom:14px; }
h2 { font-size:1.25rem; margin:0 0 12px; }
h3 { font-size:1.05rem; margin:16px 0 8px; }
p { margin:8px 0; }

input, select, textarea, button { font:inherit; font-size:1rem; min-height:52px; padding:10px 14px; border:2px solid var(--line); border-radius:10px; }
input:focus, select:focus, textarea:focus { outline:3px solid var(--brand-soft); border-color:var(--brand); }
button { background:var(--brand); color:#fff; border-color:var(--brand); font-weight:600; cursor:pointer; }
button.secondary { background:#fff; color:var(--ink); border-color:var(--line); }
button.green { background:var(--ok); border-color:var(--ok); }
button:disabled { opacity:.5; cursor:default; }
button.big, .big > button { width:100%; min-height:64px; font-size:1.2rem; border-radius:14px; }
a > button { pointer-events:none; } /* the link handles the tap */
a:has(> button) { text-decoration:none; display:block; }

form.row { display:flex; flex-wrap:wrap; gap:10px; }
form.row > * { flex:1 1 200px; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
.grid2 label, label.field { display:flex; flex-direction:column; gap:6px; font-weight:600; font-size:1rem; color:var(--ink); }
.grid2 label input, .grid2 label select, label.field input, label.field select { font-weight:400; width:100%; }
.actions { margin-top:16px; display:flex; gap:10px; flex-wrap:wrap; }
.actions > a, .actions > button { flex:1 1 auto; }
.actions > a > button { width:100%; }
.toolbar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.toolbar > * { flex:1 1 200px; }

table { width:100%; border-collapse:collapse; font-size:1rem; }
th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.table-wrap { overflow-x:auto; }
td input.mark { width:110px; }

.paid { color:var(--ok); font-weight:700; }
.pending { color:var(--warn); font-weight:700; }
.muted { color:var(--muted); font-size:.9rem; }
#msg { min-height:1.4em; color:var(--warn); font-weight:600; }
.link { background:none; color:var(--brand); padding:0; border:none; min-height:0; text-decoration:underline; font-weight:600; }
.badge { display:inline-block; padding:4px 12px; border-radius:20px; font-size:.9rem; font-weight:700; }
.badge.due { background:var(--warn-soft); color:var(--warn); }
.badge.ok { background:var(--ok-soft); color:var(--ok); }
.badge.chk { background:var(--brand-soft); color:var(--brand); }

/* Home screen: a few big picture buttons */
.home { display:grid; grid-template-columns:repeat(2, 1fr); gap:14px; }
.menu-btn { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:140px; padding:16px 10px;
  background:var(--card); color:var(--ink); border:2px solid var(--line); border-radius:18px; font-size:1.1rem; font-weight:700; text-align:center; position:relative; }
.menu-btn .ico { font-size:2.6rem; line-height:1; }
.menu-btn:active { background:var(--brand-soft); border-color:var(--brand); }
.menu-btn .count { position:absolute; top:10px; right:10px; background:var(--warn); color:#fff; border-radius:20px; padding:2px 10px; font-size:.9rem; }
.home .wide { grid-column:1 / -1; min-height:110px; flex-direction:row; gap:16px; }
.back { background:none; color:var(--brand); border:none; padding:0 4px; min-height:48px; font-size:1.1rem; font-weight:700; margin-bottom:6px; }
.alert { background:var(--warn-soft); border:2px solid #f59e0b; border-radius:14px; padding:14px 16px; margin-bottom:14px; font-weight:600; }
.alert button { margin-top:10px; width:100%; }

/* Big money figures */
.bigamount { font-size:2.4rem; font-weight:800; line-height:1.1; margin:4px 0; }
.due-amt { color:var(--warn); }
.ok-amt { color:var(--ok); }

/* Folded extra content */
details.more { border:2px solid var(--line); border-radius:12px; margin:14px 0 0; background:#fff; }
details.more > summary { cursor:pointer; padding:14px 16px; font-weight:700; list-style:none; min-height:52px; display:flex; align-items:center; justify-content:space-between; }
details.more > summary::-webkit-details-marker { display:none; }
details.more > summary::after { content:"▾"; font-size:1.2rem; color:var(--muted); }
details.more[open] > summary::after { content:"▴"; }
details.more > .inner { padding:0 16px 16px; }

.tab[hidden], [hidden] { display:none !important; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:14px; }
.tile { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; }
.tile .num { font-size:1.5rem; font-weight:800; margin-top:4px; }
.tile .lbl { color:var(--muted); font-size:.9rem; }

.login { max-width:420px; margin:40px auto; }
.login input { width:100%; margin-bottom:14px; font-size:1.2rem; }
.login button { width:100%; }

.regrow { border-top:1px solid var(--line); padding:14px 0; display:grid; grid-template-columns:1fr auto; gap:4px 12px; }
.regrow:first-child { border-top:none; }
.regrow .regamt { text-align:right; font-weight:800; }
.regrow .actions { grid-column:1 / -1; margin-top:8px; }

.child { border-top:1px solid var(--line); padding-top:14px; margin-top:14px; }
.child:first-child { border-top:none; margin-top:0; padding-top:0; }
nav.tabs { display:none; } /* replaced by the home menu */

/* ---------- phones ---------- */
@media (max-width:640px) {
  html { font-size:17px; }
  header { padding:12px 14px; }
  main { margin:12px auto; padding:0 12px; }
  .card { padding:16px; }
  .grid2 { grid-template-columns:1fr; }
  .tiles { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .menu-btn { min-height:130px; }

  /* Tables become one card per row; js/mobile-tables.js copies each heading into data-label. */
  .table-wrap table:not(.keep) thead { display:none; }
  .table-wrap table:not(.keep) tr { display:block; border:2px solid var(--line); border-radius:12px; padding:8px 12px; margin-bottom:10px; background:#fff; }
  .table-wrap table:not(.keep) td, .table-wrap table:not(.keep) tbody th { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px 12px; border:none; padding:6px 0; text-align:right; }
  .table-wrap table:not(.keep) td::before, .table-wrap table:not(.keep) tbody th::before { content:attr(data-label); color:var(--muted); font-weight:400; text-align:left; }
  .table-wrap table:not(.keep) td[colspan] { justify-content:center; }
  .table-wrap table:not(.keep) td[colspan]::before { content:none; }
}
