:root {
  --navy: #0b2f55;
  --navy-2: #123f6f;
  --navy-3: #1b5490;
  --saffron: #f39c12;
  --saffron-2: #ffb547;
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1c2635;
  --muted: #66758a;
  --green: #17a35b;
  --red: #d64545;
  --amber: #e08a00;
  --blue: #2a6fd6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 4px 14px rgba(16, 32, 64, .06);
  --side-w: 262px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); font-size: 14.5px; }
a { color: inherit; text-decoration: none; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.t-green { color: var(--green); }
.t-red { color: var(--red); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: linear-gradient(180deg, var(--navy) 0%, #0a2645 100%);
  color: #cfdbea; display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--saffron), var(--saffron-2)); color: var(--navy); font-size: 24px; font-weight: 700; flex: none; }
.logo.big { width: 72px; height: 72px; font-size: 40px; border-radius: 20px; }
.brand-name { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; color: #93a9c4; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cfdbea; font-size: 13.8px; margin: 1px 0; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--saffron); color: var(--navy); font-weight: 600; box-shadow: 0 4px 12px rgba(243,156,18,.3); }
.nav-sec { margin-top: 6px; }
.nav-sec-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; color: #8ea6c3; font: inherit; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; padding: 10px 12px 6px; cursor: pointer; }
.nav-sec-btn .ic { width: 14px; height: 14px; transition: transform .2s; }
.nav-sec.open .nav-sec-btn .ic { transform: rotate(180deg); }
.nav-sec-items { display: none; }
.nav-sec.open .nav-sec-items { display: block; }
.side-foot { padding: 12px 18px; font-size: 11px; color: #7f97b5; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Main ---------- */
.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.page-title { font-size: 19px; margin: 0; flex: 1; }
.top-right { display: flex; align-items: center; gap: 12px; }
.today { color: var(--muted); font-size: 13px; }
.role-chip { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.role-admin { background: #fff1db; color: #a35f00; }
.role-manager { background: #e3eefc; color: var(--navy-3); }
.logout { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; }
.logout:hover { background: var(--navy-3); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 7px; cursor: pointer; color: var(--navy); }
.menu-btn { display: none; }
.content { padding: 20px 24px 28px; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.foot { padding: 14px 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }
.asof { color: var(--muted); font-size: 13px; margin-bottom: -6px; }
.asof b { color: var(--navy); }
.hero-subs small { font-weight: 400; color: #a9bfd9; font-size: 12px; }
.pill-red { background: var(--red); color: #fff; }
.sample-note { background: #fff7e6; border: 1px dashed #f0b44c; color: #8a5a00; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.hero-main, .hero-today { border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.hero-main { background: radial-gradient(circle at 90% -10%, #2b6cb0 0%, transparent 45%), linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.hero-label { font-size: 13px; color: #a9bfd9; font-weight: 600; letter-spacing: .3px; }
.hero-value { font-size: 38px; font-weight: 800; margin: 6px 0 18px; letter-spacing: .5px; }
.hero-subs { display: flex; flex-wrap: wrap; gap: 26px; }
.hero-subs div { display: flex; flex-direction: column; gap: 4px; }
.hero-subs span { font-size: 12px; color: #a9bfd9; }
.hero-subs b { font-size: 17px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; }
.pill-green { background: var(--green); color: #fff; }
.hero-today { background: #fff; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 10px 20px; align-items: center; }
.hero-today .hero-label { grid-column: 1 / -1; color: var(--muted); }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), #e8eef5 0); display: grid; place-items: center; }
.ring span { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--navy); }
.today-rows div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); gap: 10px; }
.today-rows div:last-child { border-bottom: 0; }
.today-rows span { color: var(--muted); }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); border-top: 3px solid var(--tone); }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); }
.stat-ic .ic { width: 22px; height: 22px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin: 2px 0; color: var(--navy); }
.stat-note { font-size: 12px; color: var(--muted); }
.tone-blue  { --tone: var(--blue);  --tone-bg: #e5effc; }
.tone-green { --tone: var(--green); --tone-bg: #e3f6ec; }
.tone-amber { --tone: var(--amber); --tone-bg: #fff2dc; }
.tone-red   { --tone: var(--red);   --tone-bg: #fdeaea; }

/* ---------- Cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2.wide-left { grid-template-columns: 1.7fr 1fr; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15.5px; color: var(--navy); }
.link { color: var(--navy-3); font-weight: 600; font-size: 13px; }

/* Bars */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { width: 40%; max-width: 18px; border-radius: 5px 5px 0 0; }
.bar.due { background: #c9d7ea; }
.bar.col { background: var(--navy-3); }
.bar-x { font-size: 11px; color: var(--muted); padding: 6px 0 4px; white-space: nowrap; }
.legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.lg.due { background: #c9d7ea; }
.lg.col { background: var(--navy-3); }

/* Products */
.prod { margin-bottom: 14px; }
.prod-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13.5px; }
.meter { height: 9px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.meter div { height: 100%; background: linear-gradient(90deg, var(--saffron), var(--saffron-2)); border-radius: 999px; }

/* Table */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:hover td { background: #f7f9fc; }
.r { text-align: right; }
.status { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.s-collected { background: #e3f6ec; color: var(--green); }
.s-partial { background: #fff2dc; color: var(--amber); }
.s-pending { background: #fdeaea; color: var(--red); }

/* Key-value */
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.kv span { color: var(--muted); }
.highlight { margin-top: 14px; background: #fff5e3; border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.highlight span { color: #8a5a00; font-weight: 600; }
.highlight b { font-size: 22px; color: var(--navy); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 12px 1fr auto 110px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.d-in { background: var(--green); }
.d-out { background: var(--red); }
.d-info { background: var(--blue); }
.act-main { display: flex; flex-direction: column; min-width: 0; }
.act-main span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-amt { font-weight: 700; }
.act-when { color: var(--muted); font-size: 12px; text-align: right; }

/* Placeholder page */
.empty { text-align: center; padding: 48px 24px; }
.empty-ic { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: #e9f0f9; color: var(--navy-3); }
.empty-ic .ic { width: 30px; height: 30px; }
.empty h3 { margin: 4px 0; color: var(--navy); font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 22px; }
.chip { background: #eef2f7; color: var(--navy-2); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; }
.chip-admin { background: #fff1db; color: #a35f00; }
.btn { display: inline-block; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; }
.btn:hover { background: var(--navy-3); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 15% 20%, #1b5490 0%, transparent 40%), linear-gradient(135deg, #0a2645, #0b2f55 60%, #123f6f); padding: 16px; }
.login-wrap { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-art { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 40px 36px; display: flex; flex-direction: column; }
.login-art h1 { margin: 18px 0 4px; font-size: 26px; }
.login-art p { margin: 0; color: #a9bfd9; }
.art-points { margin: 28px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.art-points li { padding-left: 24px; position: relative; color: #dbe6f3; font-size: 14px; }
.art-points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 3px; background: var(--saffron); }
.art-foot { margin-top: auto; font-size: 12px; color: #8ea6c3; }
.login-card { padding: 38px 36px 24px; text-align: center; }
.login-card h2 { margin: 0; color: var(--navy); font-size: 24px; }
.login-card .muted { margin: 6px 0 0; }
.pin-boxes { display: flex; justify-content: center; gap: 14px; margin: 24px 0 14px; }
.pin-boxes span { width: 52px; height: 58px; border-radius: 14px; border: 2px solid var(--line); display: grid; place-items: center; transition: border-color .15s, transform .15s; }
.pin-boxes span.filled { border-color: var(--navy-3); }
.pin-boxes span.filled::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--navy); }
.pin-boxes.shake { animation: shake .35s; }
.pin-boxes.shake span { border-color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.alert { background: #fdeaea; color: #a32a2a; padding: 9px 12px; border-radius: 10px; font-size: 13px; margin: 0 auto 12px; max-width: 290px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 290px; margin: 6px auto 12px; }
.keypad button { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: #f7f9fc; font-size: 22px; font-weight: 600; color: var(--navy); cursor: pointer; font-family: inherit; transition: background .1s, transform .05s; }
.keypad button:hover { background: #eaf1fa; }
.keypad button:active { transform: scale(.96); background: #dde8f6; }
.keypad .k-alt { font-size: 15px; color: var(--muted); }
.keypad.disabled { opacity: .45; pointer-events: none; }
.login-ver { margin-top: 18px; font-size: 11.5px; color: var(--muted); }

/* ---------- Responsive ---------- */
.scrim { display: none; }
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero, .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 20, 40, .45); z-index: 30; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .today { display: none; }
  .logout span { display: none; }
  .login-wrap { grid-template-columns: 1fr; max-width: 420px; }
  .login-art { padding: 24px; align-items: center; text-align: center; }
  .login-art .logo.big { width: 56px; height: 56px; font-size: 30px; }
  .login-art h1 { font-size: 21px; margin-top: 10px; }
  .art-points, .art-foot { display: none; }
  .login-card { padding: 26px 20px 20px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-value { font-size: 30px; }
  .hero-today { grid-template-columns: 1fr; justify-items: center; }
  .today-rows { width: 100%; }
  .activity li { grid-template-columns: 12px 1fr auto; }
  .act-when { display: none; }
  .page-title { font-size: 17px; }
}

/* ================= App components (CRUD, forms, registers) ================= */
.intro { margin: 0 0 -4px; font-size: 13.5px; }
.intro a, .card a.link, .muted a { color: var(--navy-3); font-weight: 600; }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 4px; }
.flash-ok { background: #e3f6ec; color: #0f6b3b; border: 1px solid #bfe8d0; }
.flash-err { background: #fdeaea; color: #9b2222; border: 1px solid #f5c6c6; }
.flash-warn { background: #fff5e3; color: #8a5a00; border: 1px solid #f3dcae; }
.btn { border: 0; cursor: pointer; font: inherit; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.btn .ic { width: 16px; height: 16px; }
.btn-light { background: #eef2f7; color: var(--navy); }
.btn-light:hover { background: #e2e9f2; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b83333; }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=date], .toolbar input[type=text], .toolbar input[type=number] { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 13.5px; background: #fff; color: var(--text); }
.toolbar label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tb-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 38px; background: #fff; min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.tb-search input { border: 0; outline: 0; font: inherit; font-size: 13.5px; width: 100%; background: transparent; }
.tb-search .ic { color: var(--muted); width: 16px; height: 16px; }
.tb-grow { flex: 1; }
.tbl-list th a { color: inherit; }
.tbl .num, .num { font-variant-numeric: tabular-nums; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.mini { display: inline-block; padding: 4px 9px; border-radius: 8px; background: #eef2f7; color: var(--navy-2); font-size: 12px; font-weight: 600; margin-left: 4px; }
.mini:hover { background: #dfe8f3; }
.mini-danger { background: #fdeaea; color: var(--red); }
.empty-row { text-align: center; padding: 26px !important; }
.list-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 10px; border-radius: 8px; font-size: 13px; background: #f2f5f9; }
.pager .cur { background: var(--navy); color: #fff; }
.sumbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.sumbar div { background: #f5f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.sumbar span { font-size: 12px; color: var(--muted); }
.sumbar b { font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
.form-card { max-width: 1050px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form-sec { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--navy-3); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld-full { grid-column: 1 / -1; }
.fld label { font-size: 12.5px; font-weight: 600; color: #405069; }
.req { color: var(--red); font-style: normal; }
.fld input, .fld select, .fld textarea { width: 100%; border: 1px solid #d5dde8; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px; background: #fff; color: var(--text); }
.fld input:focus, .fld select:focus, .fld textarea:focus, .toolbar select:focus { outline: 2px solid rgba(27,84,144,.25); border-color: var(--navy-3); }
.fld input[readonly], .fld select:disabled, .fld textarea[readonly] { background: #f3f6fa; color: #4a5a70; }
.help { color: var(--muted); font-size: 12px; }
.sel-filter { margin-bottom: 4px; font-size: 13px !important; padding: 6px 10px !important; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.photo-fld { display: flex; align-items: center; gap: 10px; }
.photo-fld input[type=file] { padding: 6px; font-size: 12.5px; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; background: #eef2f7; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; text-align: center; background: rgba(11,47,85,.7); color: #fff; }
.thumb.nofile img { display: none; }
.thumb.nofile::before { content: "No file"; font-size: 10px; color: var(--muted); }
.empty-ic.danger { background: #fdeaea; color: var(--red); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.kv-grid div { display: flex; flex-direction: column; gap: 2px; }
.kv-grid span { font-size: 12px; color: var(--muted); }
.kv-grid b { font-size: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: #eef2f7; font-size: 13px; font-weight: 600; color: var(--navy-2); }
.tabs a.on { background: var(--navy); color: #fff; }
.tabs a small { opacity: .75; font-weight: 400; }
.tbl input.cell { width: 100px; border: 1px solid #d5dde8; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13.5px; text-align: right; }
.tbl input.cell:focus { outline: 2px solid rgba(27,84,144,.3); }
.tbl tr.short td { background: #fff7f0; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #f7f9fc; }
.calc-box { background: #f5f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; grid-column: 1 / -1; }
.calc-box div { display: flex; flex-direction: column; }
.calc-box span { font-size: 12px; color: var(--muted); }
.calc-box b { font-size: 16px; color: var(--navy); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.report-head { display: none; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .tb-search { max-width: none; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Print (sheets, reports, letters) ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; font-size: 11.5px; }
  .sidebar, .topbar, .scrim, .foot, .toolbar, .no-print, .form-actions, .tabs, .intro, .flash, .list-foot .pager { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; gap: 10px; }
  .card { box-shadow: none; padding: 0; border: 0; }
  .report-head { display: block; text-align: center; margin-bottom: 8px; }
  .report-head h2 { margin: 0; font-size: 16px; }
  .report-head p { margin: 2px 0; font-size: 11px; }
  .tbl th, .tbl td { padding: 4px 6px; border: 1px solid #999; white-space: normal; }
  .tbl th { color: #000; }
  .table-wrap { overflow: visible; }
  .page-break { page-break-after: always; }
  a { color: #000; text-decoration: none; }
  .status { border: 1px solid #999; background: none !important; color: #000 !important; }
}
.mini-on { background: var(--navy); color: #fff; }
.letter { max-width: 820px; }
.letter p { line-height: 1.6; }
.sign-row { display: flex; justify-content: space-between; margin-top: 60px; }
.sign-row div { border-top: 1px solid #555; padding-top: 4px; min-width: 200px; text-align: center; font-size: 13px; }
.audit-json { font-family: Consolas, monospace; font-size: 11.5px; color: #405069; max-width: 520px; white-space: normal; word-break: break-word; }

/* ===== Website Reminder additions ===== */
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { transform: translateY(-1px); }
.s-inactive { background: #eef0f3; color: #5f5e5a; }
.s-sub { background: #EEEDFE; color: #3C3489; }
.s-add { background: #E1F5EE; color: #085041; }
.s-primary { background: #e6f1fb; color: #0C447C; }
.radio-row { display: flex; gap: 22px; padding: 8px 0; flex-wrap: wrap; }
.fld .radio-row input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--navy); }
.fld .radio-row label { display: flex; margin: 0; font-size: 14px; color: var(--text); white-space: nowrap; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.type-box { border: 1.5px dashed #c9d3e0; border-radius: 12px; padding: 12px 14px; background: #fafcff; }
.type-box.type-sub { border-color: #AFA9EC; }
.type-box.type-additional { border-color: #5DCAA5; }
.type-box[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { padding: 0 14px; height: 38px; display: flex; align-items: center; cursor: pointer; color: var(--text); font-weight: 600; }
.seg label.on { background: var(--navy); color: #fff; }
.seg input { display: none; }
.report-head { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 8px; }
.report-head h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; }
.card-due { border-top: 3px solid var(--red); }
.card-head h3 .ic { width: 18px; height: 18px; vertical-align: -3px; color: var(--red); }
@media print { .seg { display: none; } .report-head { border: 0; } }
