:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #1b2430; --muted: #667085; --line: #e3e7ee;
  --brand: #0f4c81; --brand-2: #0b3a63; --brand-soft: #e8f0f8;
  --ok: #117a4b; --ok-soft: #e3f4ec; --warn: #9a5b00; --warn-soft: #fdf1dc; --bad: #b42318; --bad-soft: #fde7e5;
  --info: #3a4ed8; --info-soft: #e9ecfd; --grey-soft: #eef0f3;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--brand-2); color: #cfe0f1; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { color: #fff; font-weight: 700; font-size: 15px; padding: 4px 10px 16px; line-height: 1.25; }
.side .logo small { display: block; font-weight: 400; color: #9fbad6; font-size: 12px; }
.side nav a { display: flex; align-items: center; justify-content: space-between; color: #cfe0f1; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; }
.side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.side nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #86a4c3; padding: 14px 10px 4px; }
.side .count { background: #f59e0b; color: #1b2430; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.side .me { border-top: 1px solid rgba(255,255,255,.12); margin-top: 16px; padding: 12px 10px 0; font-size: 12px; }
.side .me b { color: #fff; display: block; font-size: 13px; }
.main { padding: 22px 26px 60px; min-width: 0; }
.topbar { display: none; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--brand-2); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; padding: 0 4px; cursor: pointer; }
  .main { padding: 16px 16px 60px; }
}

/* ---------- components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > .cardhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card.flush > .cardhead { padding: 14px 16px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.bad .value { color: var(--bad); } .stat.warn .value { color: var(--warn); } .stat.ok .value { color: var(--ok); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ccd8; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f1c3be; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: #475467; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }
.tablewrap { overflow-x: auto; }
tr.click { cursor: pointer; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid #cfd5df; border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8d2ec; border-color: var(--brand); }
.filters input[type=search] { min-width: 220px; flex: 1; max-width: 340px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: #344054; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13px; }
.form .check input { margin-top: 3px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; background: var(--info-soft); color: #243182; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--bad-soft); color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 640px) { dl.kv { grid-template-columns: 120px 1fr; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; object-fit: cover; flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 26px; border-radius: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.who .n { font-weight: 600; }

.bar { height: 8px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }
.bar.full > span { background: var(--bad); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 820px; }
.modal.xwide { max-width: 1100px; }
.modal .body { min-width: 0; }
.modal .body.form { grid-template-columns: minmax(0, 1fr); }
.modal .body > * , .modal .body details { max-width: 100%; min-width: 0; }
.modal .tablewrap { overflow: auto; max-width: 100%; }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal header h2 { margin: 0; }
.modal header button { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
#toast div { background: #1b2430; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 90vw; }
#toast div.err { background: var(--bad); }

/* attendance */
.att-grid td, .att-grid th { padding: 4px 5px; font-size: 12px; text-align: center; }
.att-grid td:first-child, .att-grid th:first-child, .att-grid td:nth-child(2), .att-grid th:nth-child(2) { text-align: left; white-space: nowrap; }
.att-grid .wk { background: #f7f7fa; }
.code { display: inline-block; min-width: 24px; border-radius: 4px; font-weight: 700; font-size: 11px; padding: 1px 3px; }
.code.present { background: var(--ok-soft); color: var(--ok); }
.code.late { background: var(--warn-soft); color: var(--warn); }
.code.absent { background: var(--bad-soft); color: var(--bad); }
.code.mc, .code.leave { background: var(--info-soft); color: var(--info); }
.code.off, .code.half { background: var(--grey-soft); color: #475467; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 5px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }
.seg button.on.absent { background: var(--bad); } .seg button.on.late { background: #c77700; } .seg button.on.present { background: var(--ok); }
.att-row.dirty td { background: #fffbea !important; }
.timein { width: 86px; padding: 4px 6px; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.chart .col .b { width: 100%; max-width: 28px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .col .b.abs { background: #e7a39c; }
.chart .col span { font-size: 10px; color: var(--muted); }

.approval-dots { display: flex; gap: 4px; flex-wrap: wrap; }

/* login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: linear-gradient(160deg, #0b3a63, #0f4c81 60%, #1d6fa5); }
.login-card { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { margin-bottom: 4px; }

/* face capture */
.cam { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.samples { display: flex; gap: 8px; margin-top: 8px; }
.samples img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }

@media print { .side, .topbar, .actions, .filters, .btn { display: none !important; } .shell { display: block; } .card { box-shadow: none; } }

/* daily attendance as cards on phones */
@media (max-width: 640px) {
  .att-table thead { display: none; }
  .att-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .att-table td { border: 0; padding: 0; }
  .att-table td:nth-child(1), .att-table td:nth-child(3), .att-table td:nth-child(8) { grid-column: 1 / -1; }
  .att-table .seg { flex-wrap: wrap; }
  .att-table .timein { display: inline-block; width: 48%; }
  .att-table .timein + .timein { margin: 0 0 0 2%; }
  .att-table td:nth-child(1) { order: -2; } .att-table td:nth-child(3) { order: -1; }
  .att-table td:nth-child(4)::before { content: 'OT: '; font-size: 12px; color: var(--muted); }
  .att-table td:nth-child(5)::before { content: 'AD/AN: '; font-size: 12px; color: var(--muted); }
  .att-table td:nth-child(6)::before { content: 'Replaced by: '; font-size: 12px; color: var(--muted); }
  .att-table .seg { display: flex; width: 100%; }
  .att-table .seg button { flex: 1; padding: 8px 4px; font-size: 13px; }
  .att-table .timein { width: 100%; }
  .pagehead .actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 640px) { .hide-sm { display: none; } }

/* ---------- attendance number boxes ---------- */
.boxes { display: grid; grid-template-columns: 1fr 1fr 1.7fr .8fr 1fr; gap: 12px; margin-bottom: 16px; }
.box { background: var(--panel); border: 1.5px solid #e8864a; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 132px; }
.box.alert { background: #fff6f2; }
.box.main { border-color: var(--brand); border-width: 2px; }
.box .bl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #344054; }
.box .bl2 { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.box .bs { font-size: 11px; color: var(--muted); margin-top: auto; }
.box .big { font-size: 34px; font-weight: 700; text-align: center; margin: auto 0; font-variant-numeric: tabular-nums; }
.box .split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; }
.box .split > div + div { border-left: 1.5px solid #f2c4a8; }
.frac { position: relative; height: 66px; margin: 6px auto 4px; width: 110px; font-variant-numeric: tabular-nums;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), #2a6f97 calc(50% - 1px), #2a6f97 calc(50% + 1px), transparent calc(50% + 1px)) no-repeat center / 54px 54px; }
.frac .t { position: absolute; left: 4px; top: 4px; font-size: 22px; font-weight: 700; }
.frac .b { position: absolute; right: 4px; bottom: 2px; font-size: 18px; color: #475467; }
.box.alert .frac .t { color: var(--bad); }
.box.main .frac .t { color: var(--brand); }
@media (max-width: 1100px) { .boxes { grid-template-columns: repeat(3, 1fr); } .box.wide { grid-column: span 2; } }
@media (max-width: 640px) { .boxes { grid-template-columns: 1fr 1fr; } .box.wide, .box.main { grid-column: span 2; } }
.sumtable td.num, .sumtable th.num { text-align: center; }
.sumtable tr.total td { background: #fbe7dc; font-weight: 700; }
.sumtable th { background: #28607f; color: #fff; }
.att-table .seg { flex-wrap: nowrap; }
.att-table .seg button { padding: 5px 7px; white-space: nowrap; }
.att-table .timein { width: 124px; display: block; }
.att-table .timein + .timein { margin-top: 4px; }
.ot-sel { padding: 4px 6px; font-size: 12px; }
.ot-sel.on { background: #fff4e5; border-color: #e8864a; font-weight: 700; }
.ot-sel.need { background: #fff1f1; border-color: #dc2626; }
.shift-sel { padding: 4px 6px; font-size: 12px; }
.badge.agent { background: #f4ecff; color: #6b2fbf; }

/* monthly attendance table (management layout) */
.mtable { border-collapse: collapse; font-size: 12px; min-width: 900px; }
.mtable th, .mtable td { border: 1px solid #b9cde4; padding: 4px 3px; text-align: center; white-space: nowrap; min-width: 30px; background: #fff; color: var(--ink); }
.mtable th { font-weight: 700; background: #fff; }
.mtable th.dn { font-weight: 500; }
.mtable .lbl { text-align: center; min-width: 110px; font-weight: 500; background: #fff; position: sticky; left: 0; z-index: 1; }
.mtable .wk { background: #dde9f7; }
.mtable td.short { background: #0b2a5b; color: #fff; font-weight: 700; }
.mtable td.extra { background: #ef2b2b; color: #fff; font-weight: 700; }
.mtable .tot { background: #f3f6fa; font-weight: 700; }
.mtable tr.perf td { font-size: 11px; }
.legend { padding: 0 5px; border-radius: 3px; color: #fff; font-weight: 700; }
.legend.short { background: #0b2a5b; } .legend.extra { background: #ef2b2b; }

/* attendance checks */
.checks { margin-bottom: 16px; }
.checks summary { cursor: pointer; font-weight: 600; }
.checks .chk { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.checks .chk:first-of-type { border-top: 0; }
.chk .lvl { flex: none; }
tr.has-warn td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.warn-ico { color: var(--bad); font-weight: 700; cursor: help; }
.rbadge { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: #eef2f7; color: #475467; margin-left: 4px; }
.rbadge.RD { background: #e9ecfd; color: var(--info); } .rbadge.N { background: #1f2d44; color: #fff; } .rbadge.AL { background: #fdf1dc; color: var(--warn); }
.rcode { font-size: 11px; font-weight: 700; }
.rcode.D { color: #1d6fa5; } .rcode.N { color: #fff; background: #1f2d44; border-radius: 3px; padding: 0 2px; } .rcode.RD { color: var(--info); background: var(--info-soft); border-radius: 3px; padding: 0 2px; } .rcode.AL { color: var(--warn); }
.hosttable td.num, .hosttable th.num, .billgrid th.num { white-space: nowrap; }
.hosttable tr.tot td, .billgrid tr.tot td { font-weight: 700; background: #f4f6fa; }
.billgrid td { padding: 4px 6px; }
.hosttable td:first-child { white-space: nowrap; }
dl.kv.tight { grid-template-columns: auto 1fr; } dl.kv dd.num { text-align: right; white-space: nowrap; }
.tgrid input.tcell { width: 88px; text-align: right; padding: 4px 6px; }
.tgrid input.tnote { width: 220px; padding: 4px 6px; }
.tgrid td { padding: 3px 8px; }
.tgrid tr.wk td { background: #f4f7fb; }
.tgrid thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.tgrid tfoot td { position: sticky; bottom: 0; background: #f4f6fa; font-weight: 700; }
.grid.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.g6 .stat .value { font-size: 20px; white-space: nowrap; }
@media (max-width: 1250px) { .grid.g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g6 .stat .value { font-size: 16px; } }
.btn.ghost { background: transparent; border-style: dashed; }
dl.kv dd { min-width: 0; } dl.kv dd.num .small { white-space: normal; }
.grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.paybox .stat .value { font-size: 20px; white-space: nowrap; }
.dpgrid th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.dpgrid th.sub { font-size: 11px; font-weight: 600; color: var(--muted); }
.dpgrid input.pax { width: 70px; }
.dpgrid input.bud { width: 96px; }
.dpgrid td.amt { color: #344054; white-space: nowrap; }
.dpgrid td.over { background: #fdecec; color: var(--bad); }
.dpgrid tfoot td { white-space: nowrap; }
.dpsum td.lbl { font-weight: 700; color: var(--muted); }
.linkbtn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; }
.dpgrid thead tr:nth-child(2) th { top: 36px; }
.side nav .sec .ro { text-transform: none; letter-spacing: 0; font-size: 10px; background: rgba(255,255,255,.12); color: #cfe0f1; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.acctable td, .acctable th { padding: 6px 10px; } .acctable input[type=radio] { width: 18px; height: 18px; }
.addl { font-weight: 700; color: #1a7f4b; }
.paytable td, .paytable th { white-space: nowrap; }
.paytable th.ded { background: #fdf1ec; }
.paytable input.adv { width: 86px; text-align: right; padding: 3px 6px; }
.paytable select.pm { padding: 3px 6px; }
.paytable .neg { color: var(--bad); }
.paytable thead th { position: sticky; top: 0; z-index: 1; }
.paytable tfoot td { position: sticky; bottom: 0; background: #fbe7dc; font-weight: 700; }

/* driver fuel entry */
.tgrid td.fromdrv { background: #fff8e6; }
.tgrid td.fromdrv > span { margin-right: 2px; }
.photos3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.photoslot { display: flex; flex-direction: column; gap: 6px; border: 2px dashed var(--line); border-radius: 10px; padding: 10px; cursor: pointer; text-align: center; min-height: 130px; }
.photoslot .pl { font-weight: 600; font-size: 13px; }
.photoslot .pv { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; gap: 4px; }
.photoslot .pv img { max-width: 100%; max-height: 110px; border-radius: 6px; object-fit: cover; }
.photoslot.done { border-style: solid; border-color: var(--ok, #2e7d32); }
.btn.big { padding: 12px 22px; font-size: 16px; }
@media (max-width: 640px) { .photos3 { grid-template-columns: minmax(0, 1fr); } .photoslot { min-height: 90px; flex-direction: row; align-items: center; } .photoslot .pl { flex: 1; text-align: left; } .photoslot .pv img { max-height: 70px; } }
.paytable th.er, table th.er { background: #eaf3fb; }
.paytable th.pay { background: #edf7ee; }
.paytable td.er { color: #1f5f8b; }
table th.ded { background: #fdf1ec; }

/* v1.6 automatic attendance */
.code.pending { background: #fde8e8; color: #b42318; outline: 1px dashed #b42318; }
.code.ap { background: #fff1d6; color: #9a5b00; }
.seg button.on.pending { background: #b42318; } .seg button.on.ap { background: #c77700; }
.vote { display: inline-block; font-size: 12px; padding: 2px 7px; border-radius: 10px; margin: 1px 2px 1px 0; background: var(--grey-soft); }
.vote.approved { background: var(--ok-soft); color: var(--ok); } .vote.rejected { background: var(--bad-soft); color: var(--bad); } .vote.pending { background: var(--warn-soft); color: var(--warn); }
.just { white-space: pre-wrap; background: #f7f8fa; border-left: 3px solid var(--brand); padding: 6px 10px; border-radius: 4px; margin-top: 4px; font-size: 13px; }

/* v1.7 collapsible sidebar */
.side nav .grp { margin-bottom: 2px; }
.side nav .grp > .sec { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: 13px; font-weight: 600; color: #e6eef7; padding: 9px 10px; border-radius: 8px; text-transform: none; letter-spacing: 0; }
.side nav .grp > .sec:hover { background: rgba(255,255,255,.08); }
.side nav .grp.here > .sec { color: #fff; }
.side nav .grp .secr { display: flex; align-items: center; gap: 6px; }
.side nav .grp .chev { font-size: 11px; color: #86a4c3; transition: transform .15s; }
.side nav .grp.open .chev { transform: rotate(90deg); }
.side nav .grp .items { display: none; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); margin: 0 0 6px 12px; }
.side nav .grp.open .items { display: block; }
.side nav .grp.open > .sec .secr > .count { display: none; }
.side nav .sec.plain { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #86a4c3; padding: 14px 10px 4px; }
/* monthly grid: roster plan above the actual code */
.att-grid td .rplan { font-size: 9px; line-height: 1; font-weight: 700; color: #98a2b3; margin-bottom: 1px; }
.att-grid td .rplan.N { color: #5b4bb7; } .att-grid td .rplan.RD { color: #667085; } .att-grid td .rplan.AL { color: #1b6fb3; }
.att-grid td.shiftoff { outline: 2px solid var(--bad); outline-offset: -2px; }
.att-grid tr.grp-row td { background: #eef3f9; text-align: left; padding: 6px 10px; position: sticky; left: 0; }

/* v1.8 Forecast Report tables */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip { cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; background: #fff; color: #475467; user-select: none; }
.chip.on { color: #fff; border-color: transparent; background: #475467; }
.yr-wrap { max-height: 72vh; }
.yr-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.yr-table th, .yr-table td { padding: 3px 5px; white-space: nowrap; border-bottom: 1px solid #edf0f3; border-right: 1px solid #f1f3f5; text-align: center; }
.yr-table td.nm, .yr-table th.stk.s2 { text-align: left; }
.yr-table thead th { position: sticky; top: 0; z-index: 2; background: #dbe7f5; font-weight: 700; }
.yr-table thead tr.h2 th { top: 34px; font-size: 11px; }
.yr-table thead tr.tots th, .yr-table thead tr.tots td { position: sticky; top: 62px; z-index: 2; background: #1b2430; color: #fff; font-weight: 700; }
.yr-table .stk { position: sticky; z-index: 1; background: #fff; }
.yr-table thead .stk { z-index: 3; background: #dbe7f5; }
.yr-table thead tr.tots .stk { background: #1b2430; }
.yr-table .s0 { left: 0; min-width: 34px; } .yr-table .s1 { left: 34px; min-width: 84px; } .yr-table .s2 { left: 118px; min-width: 210px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.yr-table.money .s2 { left: 34px; }
.yr-table td.na { background: #f6f7f9; }
.yr-table td.tot, .yr-table th.tot { background: #fffbe8; border-left: 2px solid #e2e8f0; }
.yr-table thead tr.tots th.tot { background: #3b4656; }
.yr-table.money td { text-align: right; font-variant-numeric: tabular-nums; }
.yr-table.money td.fc, .yr-table.money th.fc { font-style: italic; color: #52606d; background: #f8fafc; }
.yr-table.money thead th.fc { background: #e8eef6; }
/* category colours (like the head-office sheet) */
.sec-al.gh, .chip.sec-al.on { background: #1a73e8; color: #fff; } .yr-table th.sec-al { background: #cfe3fb; } .yr-table td.c-al { background: #eef5fd; } .yr-table td.c-al.hit { background: #29a8e0; color: #fff; font-weight: 700; }
.sec-ab.gh, .chip.sec-ab.on { background: #e11d1d; color: #fff; } .yr-table th.sec-ab { background: #fbd0d0; } .yr-table td.c-ab { background: #fdeeee; } .yr-table td.c-ab.hit { background: #e11d1d; color: #fff; font-weight: 700; }
.sec-ul.gh, .chip.sec-ul.on { background: #ea7c1e; color: #fff; } .yr-table th.sec-ul { background: #fbe0c8; } .yr-table td.c-ul { background: #fdf2e7; } .yr-table td.c-ul.hit { background: #ea7c1e; color: #fff; font-weight: 700; }
.sec-ml.gh, .chip.sec-ml.on { background: #3fa53f; color: #fff; } .yr-table th.sec-ml { background: #d4efd0; } .yr-table td.c-ml { background: #eef8ec; } .yr-table td.c-ml.hit { background: #1ea34a; color: #fff; font-weight: 700; }
.sec-hosp.gh, .chip.sec-hosp.on { background: #f2c53d; color: #1b2430; } .yr-table th.sec-hosp { background: #fcefc2; } .yr-table td.c-hosp { background: #fffaeb; } .yr-table td.c-hosp.hit { background: #e0a800; color: #fff; font-weight: 700; }
.sec-mat.gh, .chip.sec-mat.on { background: #e94cc0; color: #fff; } .yr-table th.sec-mat { background: #f8d2ee; } .yr-table td.c-mat { background: #fdf0fa; } .yr-table td.c-mat.hit { background: #e94cc0; color: #fff; font-weight: 700; }
.sec-ol.gh, .chip.sec-ol.on { background: #7a5af8; color: #fff; } .yr-table th.sec-ol { background: #e2dcfd; } .yr-table td.c-ol { background: #f5f3ff; } .yr-table td.c-ol.hit { background: #7a5af8; color: #fff; font-weight: 700; }
.sec-ap.gh, .chip.sec-ap.on { background: #9a5b00; color: #fff; } .yr-table th.sec-ap { background: #f5e1c4; } .yr-table td.c-ap { background: #fdf6ec; } .yr-table td.c-ap.hit { background: #c77700; color: #fff; font-weight: 700; }
.yr-table td.tot.over { background: #fde2e2; color: var(--bad); }
.yr-table thead th.gh.part-basic, .yr-table thead th.gh.part-gross { background: #8fd06a; } .yr-table thead th.gh.part-ot { background: #1b2430; color: #ffd400; }
.yr-table thead th.gh.part-allowance { background: #f2c53d; } .yr-table thead th.gh.part-deductions { background: #fbd0d0; } .yr-table thead th.gh.part-net { background: #29a8e0; color: #fff; }
.yr-table thead th.gh.part-er { background: #cfe3fb; } .yr-table thead th.gh.part-cost { background: #7a5af8; color: #fff; }
/* resigned rows black, MIA / terminated red */
.yr-table tr.st-left td.inf { background: #111; color: #fff; } .yr-table tr.st-left td a { color: #fff; }
.yr-table tr.st-bad td.inf { background: #e11d1d; color: #fff; } .yr-table tr.st-bad td a { color: #fff; }
@media print { .yr-wrap { max-height: none; } .chips, #yf, #ypager { display: none; } }

/* v1.8.1 view bar, frozen columns, colours */
.yr-table td.inf, .yr-table th.inf { text-align: left; } .yr-table td.c-no, .yr-table th.c-no { text-align: center; }
.yr-table .stk-last { box-shadow: 3px 0 4px -2px rgba(16,24,40,.25); }
.yr-table thead tr.tots th.stk { background: #1b2430; }
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: #f5f7fa; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; margin-bottom: 6px; }
.viewbar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.viewbar select { padding: 3px 6px; font-size: 13px; }
.viewbar .vb-l { font-weight: 700; color: #475467; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.viewbar .vb-grp { display: inline-flex; align-items: center; gap: 4px; } .viewbar .vb-grp b { min-width: 36px; text-align: center; }
.vb-drop { position: relative; }
.vb-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 12px; min-width: 230px; }
.vb-menu .vb-h { font-size: 11px; text-transform: uppercase; color: #667085; margin: 6px 0 2px; font-weight: 700; }
.vb-menu .check { display: flex; gap: 6px; padding: 2px 0; font-size: 13px; }
.vb-menu .vb-months { display: grid; grid-template-columns: repeat(3, 1fr); }
.vb-menu .vb-acts { display: flex; gap: 6px; margin-top: 8px; }
.yr-table td.up { color: #b42318; font-weight: 700; background: #fff1f0 !important; }
.yr-table td.down { color: #067647; font-weight: 700; background: #ecfdf3 !important; }
.yr-table td .arw { font-size: 9px; margin-right: 2px; }
.yr-table td.plain { background: #fff !important; color: inherit !important; font-weight: 400 !important; }
.yr-table td.heat { transition: background .2s; }
@media print { .viewbar { display: none; } }
.yr-table thead th.stk, .yr-table thead tr.tots th.stk { z-index: 4; }
.yr-table tbody td.stk { z-index: 1; }
.rowacts { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; }
/* v1.9.2 report frame: resizable, full screen */
.yr-wrap { height: 68vh; max-height: none; resize: vertical; overflow: auto; min-height: 200px; }
#yarea:fullscreen, #yarea.yr-full { background: #f4f6f9; padding: 12px 16px; overflow: auto; }
#yarea.yr-full { position: fixed; inset: 0; z-index: 300; }
#yarea:fullscreen .yr-wrap, #yarea.yr-full .yr-wrap { height: calc(100vh - 190px) !important; resize: none; }
#yarea:fullscreen #ybox, #yarea:fullscreen > .hint, #yarea.yr-full #ybox, #yarea.yr-full > .hint { display: none; }

/* v1.11 Human Resources: worker picker */
.wpick { position: relative; }
.wpick-res { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.wpick-res:empty { display: none; }
.wpick-res button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; cursor: pointer; font: inherit; }
.wpick-res button:hover { background: var(--brand-soft); }
.form details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.form details summary { cursor: pointer; }

/* v1.12 salary levels, value filters, colours */
.vfbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #fffaf0; border: 1px solid #f3e1b8; border-radius: 10px; padding: 6px 10px; font-size: 13px; margin-bottom: 6px; }
.vfbar .vb-l { font-weight: 700; color: #7a5200; }
.vfrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.vfrow.off { opacity: .5; }
.vfrow select, .vfrow input[type=number] { padding: 3px 6px; font-size: 13px; width: auto; }
.vfrow input[type=number] { width: 90px; }
.vfrow input[type=color], .lvrow input[type=color], .seccols input[type=color] { width: 34px; height: 26px; padding: 0 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.ylegend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 2px 0; }
.ylegend .lg { display: inline-flex; align-items: center; gap: 5px; } .ylegend .lg i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.ylegend .sep { width: 1px; height: 16px; background: var(--line); }
.lvrow { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.seccols { display: flex; flex-wrap: wrap; gap: 8px 16px; } .seccols label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.yr-table td.mark { font-weight: 700; }
.dpgrid td.cf { color: #52606d; background: #f8fafc; white-space: nowrap; } .dpgrid td.av { background: #f0f7ff; white-space: nowrap; }
.dpgrid td[data-bl] { white-space: nowrap; }
/* v1.13 client / project details */
.clientform table.kv { width: 100%; } .clientform table.kv th { width: 34%; background: none; color: #344054; font-size: 13px; padding: 5px 8px 5px 0; white-space: normal; }
.clientform table.kv td { padding: 4px 0; } .clientform table.kv input, .clientform table.kv textarea { width: 100%; }
.clientform table.kv input::placeholder, .clientform table.kv textarea::placeholder { color: #b0b8c4; }
.cp-sub { padding: 12px 14px; } .cp-subhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .cp-subhead .cp-subname { font-weight: 700; font-size: 16px; width: 220px; text-transform: uppercase; }
.cp-subhead .cp-delsub { margin-left: auto; }
.cp-post { display: grid; grid-template-columns: 220px 1fr; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; }
.cp-pname { display: flex; gap: 6px; align-items: flex-start; } .cp-pname input { width: 170px; font-weight: 600; text-transform: uppercase; }
.cp-shifts { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cp-shift { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .cp-shift select { width: 165px; } .cp-shift input[type=time] { width: 135px; } .cp-shift .cp-pax { width: 80px; text-align: right; }
.cp-foot { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--line); padding-top: 8px; }
@media (max-width: 700px) { .cp-post { grid-template-columns: 1fr; } }
/* v1.13 daily attendance sheet: tidy spacing, sticky header, view bar */
.att-wrap { max-height: 76vh; overflow: auto; }
.att-wrap .att-table thead th { position: sticky; top: 0; z-index: 3; background: #fafbfc; }
.att-table td { vertical-align: middle; }
.att-table td:nth-child(6) { max-width: 230px; white-space: normal; }
.att-table td:nth-child(7) { white-space: nowrap; }
.att-table .timein { width: 92px; }
@media (max-width: 900px) { .att-wrap { max-height: none; zoom: 1 !important; } #av { display: none; } }
@media (min-width: 901px) { .att-table td:nth-child(7) .timein { display: inline-block; width: 108px; margin: 0 2px 0 0; } }
/* v1.14 framed tables on every page: the list scrolls inside its frame, header stays on top, the frame can be made taller */
.main .tablewrap.framed { max-height: 72vh; overflow: auto; resize: vertical; }
.main .tablewrap.framed > table > thead th { position: sticky; top: 0; z-index: 3; }
.main .tablewrap.framed > table > tfoot th, .main .tablewrap.framed > table > tfoot td { position: sticky; bottom: 0; z-index: 2; } .main .tablewrap.framed > table > tfoot td { background-color: #f4f6fa; }
@media (max-width: 900px) { .main .tablewrap.framed { max-height: none; resize: none; } }
@media print { .main .tablewrap.framed { max-height: none; overflow: visible; } }
/* payment method: cash denomination */
.tabs.sub { margin-top: -6px; } .tabs.sub a { font-size: 13px; }
.cashgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .cashgrid { grid-template-columns: 1fr; } }
table.denom td, table.denom th { padding: 5px 8px; white-space: nowrap; } table.denom th.nt { background: #d0d5dd; text-align: center; } table.denom td.nt { text-align: center; }
table.denom td.nt.on { background: #fde2e7; font-weight: 700; } table.denom td.bal { background: #fff7b3; font-weight: 700; } table.denom td.cent { background: #eef0f3; }
table.denom tr.grp td { background: #eef3f9; font-weight: 700; }
table.denomsum { width: 100%; } table.denomsum th, table.denomsum td { padding: 5px 10px; } table.denomsum thead th { background: #fff200; color: #111; }

/* v1.16 monthly report legend */
.mlegend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 16px 12px; font-size: 12px; color: var(--ink); align-items: center; }
.mlegend > b { width: 100%; }
.mlegend > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-sw { display: inline-block; min-width: 26px; padding: 2px 5px; text-align: center; border-radius: 4px; font-size: 11px; font-weight: 700; }
.lg-sw.mt { border: 1px solid #b9cde4; background: #fff; border-radius: 2px; }
.lg-sw.mt.short { background: #0b2a5b; color: #fff; } .lg-sw.mt.extra { background: #ef2b2b; color: #fff; } .lg-sw.mt.wk { background: #dde9f7; }
.lg-sw.lg-off { outline: 2px solid var(--bad); outline-offset: -2px; background: var(--ok-soft); color: var(--ok); }
.lg-sw.lg-wk { background: #f7f7fa; border: 1px solid var(--line); }
.lg-plan { font-size: 10px; font-weight: 700; color: #98a2b3; } .lg-plan.N { color: #5b4bb7; } .lg-plan.RD { color: #667085; } .lg-plan.AL { color: #1b6fb3; }

/* v1.16 petty cash, payment requests, news */
.pcform { max-width: 1100px; }
.pc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; }
.pc-cats label { font-size: 12px; margin: 0; }
.pc-cats input { width: 100%; }
.pc-sum { display: flex; gap: 22px; flex-wrap: wrap; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.pc-sum > div { display: flex; flex-direction: column; } .pc-sum b { font-size: 18px; }
.pc-rec { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.pc-rec img { height: 60px; width: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.pc-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f7; border-radius: 12px; padding: 2px 4px 2px 10px; font-size: 12px; }
.pc-chip.new { background: #e7f6ec; } .pc-chip button { border: 0; background: transparent; cursor: pointer; font-size: 14px; }
.pctable th { background: #2b1a6b; color: #fff; font-size: 11px; white-space: normal; text-align: center; }
.pctable td { font-size: 12px; white-space: nowrap; }
.pc-st { display: inline-block; padding: 2px 6px; border-radius: 3px; font-weight: 700; font-size: 11px; }
.pc-st.ok { background: #1fd61f; color: #062; } .pc-st.draft { background: #eee; color: #555; }
td.pc-sr { text-align: center; font-weight: 700; }
td.pc-sr.submitted { background: #ff2a2a; color: #fff; } td.pc-sr.approved { background: #fff200; } td.pc-sr.paid { background: #fff; } td.pc-sr.rejected { background: #dbeafe; }
table.prl input { width: 100%; }
.newsbox .newslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.news { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.news.meeting.up { border-color: #7aa7e0; background: #f4f8fe; }
.news h3 { margin: 6px 0 4px; font-size: 15px; } .news .nb { font-size: 13px; margin: 6px 0; max-height: 160px; overflow: auto; }

/* v1.17 claims: expense lines, status colours, STAFF MIA */
.cl-lines { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.cl-line { display: grid; grid-template-columns: 110px 1fr 2fr 1fr 1fr 1fr; gap: 8px 10px; align-items: end; background: #f4f8fd; border: 1px solid #d6e3f3; border-radius: 8px; padding: 8px 10px; }
.cl-line label { margin: 0; font-size: 12px; } .cl-line input, .cl-line select { width: 100%; background: #dce9f7; }
.cl-line input:disabled, .cl-line select:disabled { background: #eef3f9; color: var(--ink); }
.cl-line .wide { grid-column: span 1; } .cl-lh { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.cl-line select.need { border-color: #dc2626; background: #fff1f1; }
.cl-cat { grid-column: 2 / -1; font-size: 12px; color: #1b6fb3; font-weight: 600; }
@media (max-width: 900px) { .cl-line { grid-template-columns: 1fr 1fr; } .cl-lh { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; } }
.btn.addexp { background: #1ea7e1; color: #fff; border-color: #1590c5; font-weight: 700; box-shadow: 0 2px 6px rgba(30,167,225,.35); }
.cl-st { display: inline-block; min-width: 92px; text-align: center; padding: 3px 8px; font-weight: 700; font-size: 12px; border-radius: 3px; }
.cl-pending { background: #ff2a2a; color: #fff; } .cl-progress { background: #fff200; color: #111; } .cl-returned { background: #ff2a2a; color: #fff; outline: 2px solid #7f1d1d; }
.cl-budget { background: #cfe3ff; color: #0b3a75; } .cl-paid { background: #d8f5df; color: #0a6b2b; } .cl-draft { background: #eee; color: #555; }
td.cl-sr { text-align: center; } .cl-notes { color: #334155; }
.sctable tr.mia td { background: #000 !important; color: #fff !important; font-weight: 700; }
.sctable tr.mia .btn { color: #111; }
.cl-hist { margin-top: 10px; line-height: 1.7; }
.grid.clboxes { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.pctable td.cl-sr, .pctable td.cl-notes, .sctable td.cl-sr { white-space: normal; min-width: 140px; max-width: 230px; }
.cl-notes { font-size: 11.5px; line-height: 1.35; }
.cl-line .catw { grid-column: 2 / -1; } .cl-line .catw select { max-width: 360px; }
.cl-lh .btn { align-self: flex-start; width: auto; padding: 2px 9px; }
.modal .cl-line { grid-template-columns: 90px 1fr 1.6fr 1fr 1.1fr 1fr; }

/* ---------- v1.18 training ---------- */
.trtabs a { font-size: 13px; padding: 8px 11px; }
.trcards { margin-bottom: 12px; }
.tcell { display: inline-block; min-width: 76px; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; white-space: nowrap; color: #fff; }
.tcell small { display: block; font-weight: 400; font-size: 10px; opacity: .9; }
a.tcell:hover { text-decoration: none; filter: brightness(.93); }
.tc-valid { background: #1e8e4e; }
.tc-expiring { background: #f2c230; color: #3b2f00; }
.tc-progress { background: #ea7a17; }
.tc-scheduled { background: #2f6fd6; }
.tc-expired { background: #c62828; }
.tc-missing { background: #1b1b1b; color: #ff8a80; }
.tc-na { background: #d7dbe0; color: #4b5563; }
.trlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.trlegend span { display: inline-flex; align-items: center; gap: 5px; }
.trlegend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.trbars { display: grid; gap: 6px; }
.trbar-row { display: grid; grid-template-columns: 130px 1fr 42px; gap: 8px; align-items: center; font-size: 12px; }
.trbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trbar-n { text-align: right; font-weight: 600; }
.trbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--grey-soft); gap: 2px; }
.trbar span { display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; min-width: 2px; }
.tb-ok { background: #1e8e4e; } .tb-soon { background: #f2c230; color: #3b2f00 !important; } .tb-inc { background: #ea7a17; } .tb-exp { background: #c62828; }
.tb-act { background: var(--brand); } .tb-fc { background: #9db8d6; } .tb-bud { background: transparent; border-top: 2px dashed var(--bad); height: 0 !important; margin-top: 5px; }
.trcols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.trcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trcol-v { font-size: 11px; color: var(--muted); }
.trcol-b { width: 70%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 1px; }
.trcol-l { font-size: 11px; color: var(--muted); margin-top: 4px; }
.trcol-bs { position: relative; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; height: 124px; }
.trcol-bs .trcol-b { width: 40%; }
.trcol-b.act { background: var(--brand); } .trcol-b.fc { background: #9db8d6; }
.trcol-bud { position: absolute; left: 4%; right: 4%; border-top: 2px dashed var(--bad); }
.trmatrix { max-height: 70vh; }
.trmatrix thead th { position: sticky; top: 0; background: #f7f8fa; z-index: 1; }
.tmc { text-align: center; min-width: 96px; }
.odtable tr.oddep td { background: #fde7e5; }
.trfiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.trcostrow > * { min-width: 110px; }
.trpick { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; margin-bottom: 10px; }
.trpick .check { display: block; margin: 2px 0; font-size: 13px; }
.trpick-scroll { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
@media (max-width: 800px) { .trpick { grid-template-columns: 1fr; } }
.trrep { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .trrep { grid-template-columns: 1fr; } }
.trreplist a { display: block; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.trreplist a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.obflow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 12px; }
.obflow span { background: var(--brand-soft); color: var(--brand); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.obflow i { color: var(--muted); font-style: normal; }
.obt { font-weight: 700; } .obt.ok { color: var(--ok); } .obt.no { color: var(--bad); }
.kv.tight dt, .kv.tight dd { padding: 2px 0; }

/* ---------- training: friendlier layout ---------- */
.trtabs { align-items: center; }
.trtabs .trsep { margin-left: 10px; padding: 0 8px 0 12px; border-left: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.trhelp { margin: -6px 0 14px; color: var(--muted); font-size: 13px; }
.trquick { margin-bottom: 12px; padding: 12px 14px; }
.trq-t { font-weight: 600; margin-bottom: 8px; }
.trq-b { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trfind { display: flex; gap: 6px; flex: 1 1 280px; max-width: 460px; }
.trfind input { flex: 1; min-width: 0; }
.trstart ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 12px; line-height: 1.5; }
.trstart .btn { margin-left: 8px; }
details.trmore, details.trfold { margin: 10px 0; }
details.trmore > summary, details.trfold > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand); padding: 6px 0; }
details.trfold { border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px 8px; }
.trmatrix td:first-child, .trmatrix th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.trmatrix thead th:first-child { background: #f7f8fa; z-index: 2; }
.odtable td { vertical-align: top; }
.odtable .rowacts { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 640px) { .trq-b .btn { flex: 1 1 auto; } .trfind { max-width: none; } .trhelp { font-size: 12.5px; } }

.odtable td:nth-child(5) { min-width: 170px; }
.odtable td:nth-child(7), .odtable th:nth-child(7) { width: 48px; padding-left: 4px; padding-right: 8px; }
.odtable td:nth-child(8) { min-width: 190px; max-width: 240px; white-space: normal; }
.odtable td:nth-child(3), .odtable td:nth-child(4) { min-width: 90px; }
.odtable th, .odtable td { padding-left: 7px; padding-right: 7px; }
.odtable td .small.muted { white-space: normal; }
.odtable td { vertical-align: top; }
.odtable .rowacts { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- v1.19 security money ---------- */
.smwho { position: relative; margin-bottom: 6px; }
.smpick { display: grid; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; background: #fff; max-height: 220px; overflow: auto; }
.smpick:empty { display: none; }
.smpick a { padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.smpick a:last-child { border-bottom: 0; }
.smpick a:hover { background: #eef6ff; text-decoration: none; }
.smwhoinfo { margin-top: 6px; font-size: 13px; }

.modebar{background:#b45309;color:#fff;text-align:center;font-weight:700;font-size:13px;padding:6px 10px;letter-spacing:.3px;position:sticky;top:0;z-index:50}

/* boxes: a click outside never closes them; ask before typed data is lost; drafts */
.modal { position: relative; }
.modal.shake { animation: mshake .35s ease; }
@keyframes mshake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.mguard { position: fixed; inset: 0; background: rgba(255,255,255,.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; }
.mguard-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 18px 20px; max-width: 440px; width: 100%; }
.mguard-box p { margin: 6px 0 14px; color: var(--muted); }
.mguard-act { display: flex; flex-wrap: wrap; gap: 8px; }
.mguard-act .btn.link { background: none; border-color: transparent; color: #b91c1c; }
.draftbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; }
.draftbar span { flex: 1 1 220px; }
@media print { .mguard, .draftbar { display: none !important; } }

/* combined package: switch between Security Money, Permit Renewal and Accounting */
.suitebar { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 7px 16px; background: #0b3a63; font-size: 12.5px; font-weight: 500; position: relative; z-index: 45; }
.suitebar a, .suitebar span { color: #c9dcef; text-decoration: none; white-space: nowrap; }
.suitebar a:hover { color: #fff; text-decoration: underline; }
.suitebar .on { color: #fff; font-weight: 700; border-bottom: 2px solid #5FB6C4; }
.suitebar .home { font-weight: 700; color: #fff; }
@media print { .suitebar { display: none !important; } }
[hidden] { display: none !important; }

.actions .check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
