:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1d2330;
  --muted: #667085;
  --line: #e3e6ec;
  --primary: #41512c;
  --primary-dark: #2e3a1f;
  --danger: #c23434;
  --ok: #1d8a52;
  --warn: #a8660b;
  --radius: 10px;
  --gold: #e5a34c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2 { margin: 0 0 .75rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
code { background: #eef0f4; padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); }
.loading { padding: 2rem; text-align: center; color: var(--muted); }

/* layout */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .6rem 1.25rem; background: #fff; color: var(--text); flex-wrap: wrap;
  border-bottom: 3px solid var(--gold);
}
.brand { font-weight: 700; font-size: 1.05rem; }
.user { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.role {
  background: #e9eee2; color: var(--primary); padding: 1px 8px; border-radius: 99px;
  font-size: .75rem; text-transform: capitalize;
}
.tabs {
  display: flex; gap: .25rem; padding: 0 1rem; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tabs button {
  border: 0; background: none; padding: .85rem 1rem; font: inherit; color: var(--muted);
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
main { max-width: 1000px; margin: 1.25rem auto; padding: 0 1rem 3rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; }

/* forms */
label { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 .85rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem;
  font: inherit; font-weight: 400; color: var(--text);
  border: 1px solid #cfd4dc; border-radius: 7px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: transparent; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > label { flex: 1 1 180px; }
.row.end { align-items: flex-end; }
.row.end .btn { margin-bottom: .85rem; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: .25rem; }

.btn {
  display: inline-block; padding: .55rem 1rem; font: inherit; font-weight: 600;
  border: 1px solid #cfd4dc; border-radius: 7px; background: #fff; color: var(--text); cursor: pointer;
}
.btn:hover { background: #f6f7f9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn-link { background: none; border: 0; padding: .5rem 0; color: var(--primary); cursor: pointer; font: inherit; }
.btn-link.light { color: var(--primary); padding: 0; font-weight: 600; }

/* tables */
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.right { text-align: right; }
td.note { max-width: 240px; color: var(--muted); font-size: .9rem; }
table.grid input { margin: 0; min-width: 90px; }
tfoot td { font-weight: 700; border-bottom: 0; }

.badge {
  display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .78rem;
  font-weight: 600; text-transform: capitalize; background: #eef0f4; color: var(--muted);
}
.badge-submitted, .badge-pending { background: #fdf1dc; color: var(--warn); }
.badge-approved { background: #dcf3e6; color: var(--ok); }
.badge-rejected, .badge-denied { background: #fbe3e3; color: var(--danger); }
.count { background: var(--primary); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .8rem; vertical-align: middle; }

.notice { background: #f1f5ec; border: 1px solid #d3dfc4; border-radius: 7px; padding: .6rem .8rem; margin-bottom: 1rem; }

/* signature */
fieldset.sign { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
fieldset.sign legend { font-weight: 700; padding: 0 .4rem; }
.sig-box { position: relative; }
.sig-box canvas {
  display: block; width: 100%; height: 160px; background: #fff;
  border: 1px dashed #aab2c0; border-radius: 7px; cursor: crosshair;
}
.sig-box .btn { position: absolute; top: 8px; right: 8px; }
.hint { font-size: .8rem; color: var(--muted); margin: .3rem 0 .9rem; }
.sig-record { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.sig-record img { max-width: 320px; width: 100%; border-bottom: 1px solid #333; display: block; }
.sig-record p { margin: .4rem 0 0; font-size: .9rem; }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
dl.details dt { font-weight: 600; color: var(--muted); }
dl.details dd { margin: 0; }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(15, 20, 30, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3vh 1rem; overflow-y: auto; z-index: 50;
}
.modal-box {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 1.5rem; width: 100%; max-width: 820px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute; top: .5rem; right: .75rem; border: 0; background: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted);
}
.review { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }

/* toast */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: #1d2330; color: #fff; padding: .7rem 1.1rem; border-radius: 8px;
  z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* timesheet entry form */
table.entry td.day { white-space: nowrap; }
table.entry td.day span { display: block; font-size: .78rem; color: var(--muted); }
table.entry .t-expl { min-width: 200px; }
table.entry .t-hours { font-weight: 600; min-width: 60px; }
table.extras th { text-align: left; text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--text); white-space: nowrap; }
table.extras th label { margin: 0; font-size: inherit; }
table.extras input { margin: 0; max-width: 110px; }
table.extras td.hint { margin: 0; font-size: .8rem; max-width: 360px; }
table.extras tr.total th, table.extras tr.total td.num { font-weight: 700; font-size: 1rem; }
table.extras td.num { text-align: left; padding-left: .9rem; }
.notice.warn { background: #fff6e5; border-color: #f2d49b; }
.sign-statement { color: #c00000; font-weight: 600; margin: 0 0 .6rem; font-size: .9rem; }
.modal-head { margin: 0 2rem .9rem 0; }
.modal-head .actions { margin-top: .5rem; }

/* printable Deputies Daily Report — mirrors the paper form */
.sheet {
  font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff;
  border: 2px solid #000; max-width: 7.5in; margin: 0 auto;
}
.sheet-head { text-align: center; padding: 4px 6px 2px; border-bottom: 1.5px solid #000; line-height: 1.15; }
.sheet-head .org { font-size: 19px; }
.sheet-head .title { font-size: 15px; }
.sheet-head .emp { font-size: 15px; font-weight: 700; }
.sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet-table th, .sheet-table td {
  border: 1px solid #000; padding: 1px 4px; font-size: 12px; text-transform: none;
  letter-spacing: 0; color: #000; vertical-align: middle;
}
.sheet-table tr > :first-child { border-left: 0; }
.sheet-table tr > :last-child { border-right: 0; }
.sheet-table thead th { text-align: center; font-weight: 700; font-size: 11.5px; line-height: 1.1; height: 34px; }
.sheet-table tr.d td { height: 37px; }
.sheet-table .c-date { font-size: 15px; padding-left: 8px; }
.sheet-table .c { text-align: center; font-size: 13px; }
.sheet-table .c-expl { font-size: 11.5px; line-height: 1.15; overflow-wrap: anywhere; }
.sheet-table tr.s th { text-align: center; font-size: 12.5px; font-weight: 700; height: 26px; }
.sheet-table tr.s.tall th { height: 40px; }
.sheet-table tr.s .c { font-weight: 700; }
.sheet-table .s-note { text-align: center; font-size: 8.5px; font-weight: 700; line-height: 1.2; }
.sheet-sign { border-top: 1.5px solid #000; padding: 5px 10px 6px; text-align: center; }
.sheet-sign .red { color: #e00000; font-weight: 700; font-size: 10.5px; }
.sig-line { display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-top: 2px; }
.sig-space { display: inline-flex; align-items: flex-end; justify-content: center; width: 3.4in; height: 46px; border-bottom: 1px solid #e00000; position: relative; }
.sig-space img { max-height: 44px; max-width: 100%; mix-blend-mode: multiply; position: relative; top: 6px; }
.sig-meta { font-size: 8.5px; color: #333; margin-top: 2px; }
.sheet-after { max-width: 7.5in; margin: 4px auto 0; font: 9px Arial, sans-serif; color: #333; }
.sheet-page + .sheet-page { margin-top: 1.5rem; }

/* print: only the timesheet(s) in the open window */
@page { size: letter; margin: 0.45in; }
@media print {
  body { background: #fff; }
  body > *:not(#modal) { display: none !important; }
  .modal { position: static; background: none; padding: 0; overflow: visible; display: block; }
  .modal-box { box-shadow: none; max-width: none; padding: 0; border-radius: 0; }
  .modal-close, .review, .no-print { display: none !important; }
  .sheet { max-width: none; }
  .sheet-page { break-inside: avoid; page-break-inside: avoid; }
  .sheet-page + .sheet-page { margin-top: 0; break-before: page; page-break-before: always; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* special duties (K9, DEA, Supervisor, grant OT) */
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700;
  background: #fff1c2; color: #7a4d00; border: 1px solid #f0cf6a; white-space: nowrap;
}
.chip.muted-chip { background: #eef0f4; color: var(--muted); border-color: #dde1e8; font-weight: 600; }
.chip-check { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0; font-weight: 600; font-size: .85rem; white-space: nowrap; cursor: pointer; }
.chip-check input { width: auto; margin: 0; }
.duty-checks { min-width: 180px; }
table.team .p-name { min-width: 150px; }
table.team td.email { font-size: .88rem; color: var(--muted); }
table.duties input { margin: 0; }
table.duties .d-name { min-width: 90px; }
table.duties .d-label { min-width: 180px; }
table.duties .d-note { min-width: 180px; }
table.duties .d-default { width: 80px; }
table.duties input[type=checkbox] { width: auto; }
td.center { text-align: center; }
tr.new-duty td { background: #f7f9ff; }
table.extras tr.duty-row th, table.extras tr.duty-row td { background: #fffaf0; }
table.extras tr.duty-row.has-hours th, table.extras tr.duty-row.has-hours td { background: #fff1c2; }

/* special-duty lines on the printed sheet */
.special-flag {
  display: inline-block; margin: 2px 0 3px; padding: 1px 8px; border: 1.5px solid #000;
  font-size: 11px; font-weight: 700; background: #ffe98a;
}
.sheet-table tr.s.duty.hl th, .sheet-table tr.s.duty.hl td { background: #ffe98a; }
.sheet-table tr.s.duty.hl .c { font-size: 14px; }
.sheet.compact .sheet-table tr.d td { height: 32px; }
.sheet.compact .sheet-table tr.s th { height: 23px; }
.sheet.compact .sheet-table tr.s.tall th { height: 36px; }

/* logo */
.visually-hidden, .brand:has(.brand-logo) > span, .auth-card:has(.auth-logo) h1.auth-org {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.auth-logo { display: block; margin: 0 auto 1.1rem; width: 100%; max-width: 340px; height: auto; }
.auth-card { border-top: 4px solid var(--gold); }
.auth-card:has(.auth-logo) > p.muted { text-align: center; }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand-logo { height: 46px; width: auto; display: block; }
@media (max-width: 520px) { .brand { font-size: .9rem; } .brand-logo { height: 34px; max-width: 70vw; } }

/* person filter on Approvals */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; padding-bottom: .5rem; }
.filter-bar label { flex: 0 1 320px; margin-bottom: .6rem; }
.filter-bar .btn { margin-bottom: .6rem; }
.filter-bar .hint { flex-basis: 100%; margin: 0 0 .5rem; }

/* deactivate */
td.nowrap { white-space: nowrap; }
td.nowrap .btn + .btn { margin-left: .35rem; }
.count.muted-count { background: #8a93a3; }
table.team .p-role { min-width: 125px; }
.auth-card:has(.auth-logo) h1 { text-align: center; }

/* half-hour time pickers */
table.entry select.t-in, table.entry select.t-out { margin: 0; min-width: 118px; }

/* case numbers */
.row > label.narrow { flex: 0 1 110px; }
.case-result {
  margin-top: 1rem; padding: 1rem; border: 2px solid var(--gold); border-radius: var(--radius);
  background: #fffaf0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.case-result > div:first-child { color: var(--muted); font-weight: 600; }
.case-big { font-size: 1.9rem; font-weight: 800; letter-spacing: .04em; color: var(--primary); font-variant-numeric: tabular-nums; }
.case-log-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .5rem 1rem; }
.case-log-head form { flex: 1 1 420px; justify-content: flex-end; }
.case-log-head form label { margin-bottom: .6rem; }
.case-log-head form .btn { margin-bottom: .6rem; }
table.case-log td.case-no { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.case-log tr.is-void td:not(:last-child) { color: var(--muted); }
table.case-log tr.is-void td.case-no { text-decoration: line-through; }
.pager { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pager span { color: var(--muted); font-size: .9rem; }
.pager #case-print { margin-left: auto; }

/* printed case log — mirrors the paper sheet, 30 per page */
.case-sheet { font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff; max-width: 7.6in; margin: 0 auto; }
.case-sheet-title { display: flex; justify-content: space-between; font-size: 9px; color: #333; margin-bottom: 4px; }
.case-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.case-sheet th { font-size: 12.5px; font-weight: 700; color: #000; text-transform: none; letter-spacing: 0;
  text-align: center; vertical-align: bottom; line-height: 1.15; padding: 2px 3px; border: 0; border-bottom: 1px solid #000; }
.case-sheet td { border: 1px solid #000; height: 25px; padding: 0 4px; font-size: 13px; color: #000;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.case-sheet td.r { text-align: right; }
.case-sheet td.c { text-align: center; }
.case-sheet td.sm { font-size: 10.5px; }
.case-sheet tr.is-void td { color: #555; }
.case-sheet tr.is-void td:last-child { text-decoration: line-through; }
#case-next label { flex: 0 1 220px; }

/* invite form */
#invite-form label { margin-bottom: .6rem; }
#invite-form .btn { margin-bottom: .6rem; }
#invite-form label.narrow-role { flex: 0 1 150px; }

/* ---------- calendar & announcements ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.ann { border: 1px solid var(--line); border-left: 4px solid #c9d2bd; border-radius: 8px; padding: .7rem .85rem; margin-bottom: .6rem; }
.ann.pinned { border-left-color: var(--gold); background: #fffcf5; }
.ann-training { border-left-color: var(--primary); }
.ann-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ann-date { font-size: .8rem; margin-left: auto; }
.ann-body { margin-top: .35rem; font-size: .93rem; white-space: normal; overflow-wrap: anywhere; }
.small-link { font-size: .82rem; padding: 0; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 1px 7px; border-radius: 4px; background: #eef0f4; color: var(--muted); }
.tag-training { background: #e3ebd8; color: var(--primary); }
.tag-court { background: #fff1c2; color: #7a4d00; }
.tag-other { background: #e8edf5; color: #3b4a63; }
.tag-pin { background: var(--gold); color: #fff; }
.tag-mine { background: #c23434; color: #fff; }
.tag-danger { background: #fbe3e3; color: var(--danger); }

.cal-head { align-items: center; }
.cal-nav { display: flex; align-items: center; gap: .4rem; }
.cal-nav h2 { min-width: 11ch; text-align: center; }
.cal-legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .4rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: .35rem .4rem;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; }
.cal-day { min-height: 96px; padding: .25rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.cal-day.other-month { background: #fafbfc; }
.cal-day.other-month .cal-num { color: #b3bac6; }
.cal-num { font-size: .8rem; font-weight: 700; margin: 0 0 .2rem .15rem; }
.cal-day.is-today .cal-num { background: var(--primary); color: #fff; border-radius: 99px; display: inline-block; min-width: 1.6em; text-align: center; }
.ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px;
  font: inherit; font-size: .74rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev-time { font-weight: 700; }
.ev-training, .ev-dot.ev-training { background: #e3ebd8; border-color: var(--primary); color: #2e3a1f; }
.ev-court, .ev-dot.ev-court { background: #fff1c2; border-color: #d18a1d; color: #6b4300; }
.ev-other, .ev-dot.ev-other { background: #e8edf5; border-color: #6c7a92; color: #2b3547; }
.ev-dot.ev-mine { background: #fff; outline: 2px solid #c23434; outline-offset: -2px; }
.ev.ev-is-mine { box-shadow: inset 0 0 0 2px #c23434; font-weight: 700; }
.ev-more { border: 0; background: none; color: var(--primary); font: inherit; font-size: .74rem; font-weight: 600; padding: 0 4px; cursor: pointer; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { border-bottom: 1px solid var(--line); }
.agenda li.is-mine { background: #fff7f7; }
.agenda-item { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; width: 100%; text-align: left; background: none; border: 0;
  padding: .6rem .3rem; font: inherit; color: inherit; cursor: pointer; align-items: center; }
.agenda-item .tag { grid-row: span 2; align-self: start; margin-top: .15rem; }
.agenda-title { font-weight: 600; }
.agenda-when { font-size: .85rem; }
.people-picker { display: flex; flex-wrap: wrap; gap: .2rem .4rem; max-height: 180px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 7px; padding: .5rem; margin: -.4rem 0 .9rem; }

/* ---------- off-duty jobs ---------- */
.job { display: flex; gap: 1rem; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px;
  padding: .85rem 1rem; margin-bottom: .7rem; }
.job.is-closed { opacity: .75; }
.job-main { min-width: 0; flex: 1; }
.job-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.02rem; margin-bottom: .15rem; }
.job-details { font-size: .92rem; margin: .4rem 0; overflow-wrap: anywhere; }
.job-spots { font-size: .9rem; margin-top: .35rem; }
.spots { font-weight: 700; color: var(--ok); }
.spots.full { color: var(--muted); }
.pay { color: var(--text); }
.job-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; flex-shrink: 0; }
.job-requests { margin-top: .6rem; padding: .5rem .6rem; background: #fafbfc; border: 1px solid var(--line); border-radius: 7px; font-size: .9rem; }
.job-requests.muted-block { background: #f3f7ef; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .3rem 0; border-top: 1px dashed var(--line); }
.req-row:first-of-type { border-top: 0; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  main { margin-top: .75rem; padding: 0 .6rem 2.5rem; }
  .card { padding: 1rem .85rem; border-radius: 8px; }
  .topbar { padding: .5rem .75rem; }
  .user { font-size: .85rem; gap: .45rem; }
  .tabs { padding: 0 .25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: .8rem .75rem; }
  /* 16px inputs stop iPhones from zooming in when you tap a field */
  input, select, textarea { font-size: 16px; }
  .btn { padding: .65rem 1rem; }
  .btn.small { padding: .45rem .8rem; }
  .row { gap: 0 .75rem; }
  .row > label { flex: 1 1 140px; }

  /* modal becomes a full-screen sheet */
  .modal { padding: 0; }
  .modal-box { max-width: none; min-height: 100%; border-radius: 0; padding: 1.1rem .9rem 2rem; }
  .modal-close { font-size: 2rem; top: .3rem; right: .5rem; }

  /* timesheet: each day becomes a small card */
  table.entry thead { display: none; }
  table.entry, table.entry tbody { display: block; }
  table.entry tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
  table.entry td { border: 0; padding: 0; }
  table.entry td.day { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: baseline; }
  table.entry td.day span { display: inline; }
  table.entry select.t-in, table.entry select.t-out { min-width: 0; }
  table.entry .t-hours { align-self: center; text-align: right; min-width: 3.2em; }
  table.entry td:last-child { grid-column: 1 / -1; }
  table.entry .t-expl { min-width: 0; }
  table.entry .t-in::before { content: none; }
  table.extras, table.extras tbody { display: block; }
  table.extras tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); align-items: center; }
  table.extras th, table.extras td { border: 0; padding: 0; white-space: normal; }
  table.extras td.hint { grid-column: 1 / -1; max-width: none; }
  table.extras input { max-width: 96px; }
  .sig-box canvas { height: 150px; }

  /* lists scroll sideways inside their card instead of squashing */
  .table-wrap { margin: 0 -.85rem 1rem; padding: 0 .85rem; }
  table.list th, table.list td { padding: .5rem .45rem; font-size: .9rem; }
  table.list td { white-space: nowrap; }
  table.team input, table.duties input { min-width: 120px; }

  /* calendar: compact month with colored bars; tap a day to see it */
  .cal-legend { order: 3; width: 100%; }
  .cal-day { min-height: 54px; padding: .15rem; cursor: pointer; }
  .cal-num { font-size: .75rem; }
  .ev { font-size: 0; height: 6px; padding: 0; margin-bottom: 2px; border-left-width: 0; }
  .ev .ev-time { display: none; }
  .ev.ev-is-mine { box-shadow: none; outline: 2px solid #c23434; }
  .ev-more { font-size: .65rem; padding: 0; }
  .cal-dow { font-size: .65rem; padding: .3rem .15rem; text-align: center; }

  /* off-duty */
  .job { flex-direction: column; gap: .6rem; padding: .8rem; }
  .job-actions { flex-direction: row; align-items: center; }
  .req-row .btn { margin-top: .2rem; }

  /* case numbers */
  .case-big { font-size: 1.5rem; }
  .pager #case-print { margin-left: 0; }
  .filter-bar label { flex: 1 1 100%; }
}
@media (max-width: 760px) { .cal-day .ev { pointer-events: none; } }
/* polish */
.ev-dot.ev-training { background: var(--primary); }
.ev-dot.ev-court { background: #d18a1d; }
.ev-dot.ev-other { background: #6c7a92; }
.agenda-item { grid-template-columns: 5.8rem 1fr; }
.agenda-item .tag { justify-self: start; }
.tabs-wrap { position: relative; background: #fff; border-bottom: 1px solid var(--line); }
.tabs-wrap .tabs { border-bottom: 0; }
@media (max-width: 760px) {
  .tabs-wrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 28px; pointer-events: none;
    background: linear-gradient(to right, rgba(255,255,255,0), #fff); }
  .agenda-item { grid-template-columns: 4.9rem 1fr; }
}
