:root {
  --navy: #081a58;
  --navy-2: #12297a;
  --amber: #f5b942;
  --amber-2: #f7c968;
  --bg: #f1f4f8;
  --card: #ffffff;
  --line: #dfe5ec;
  --line-2: #edf1f5;
  --ink: #182230;
  --mut: #5b6b7d;
  --mut-2: #93a1b1;
  --ok: #1e7f4f;
  --ok-bg: #e3f3ea;
  --warn: #9a6a08;
  --warn-bg: #fdf1d8;
  --bad: #b3382e;
  --bad-bg: #fbe7e5;
  --info: #1f6fa8;
  --info-bg: #e4f0f8;
  --r: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20,48,77,.25); border-color: var(--navy-2); }
label { display: block; font-size: 12px; color: var(--mut); margin: 10px 0 4px; }
a { color: var(--info); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r); padding: 8px 14px; font-weight: 500;
}
.btn:hover { background: #f6f8fb; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--navy); font-weight: 600; }
.btn-amber:hover { background: var(--amber-2); }
.btn-danger { background: var(--card); border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 6px; padding: 28px; }
.login-brand { font-family: Georgia, serif; font-size: 20px; }
.login-brand span { color: var(--mut-2); }
.login-sub { font-size: 12px; color: var(--mut); letter-spacing: .04em; margin-top: 2px; }
.login-err { margin-top: 12px; background: var(--bad-bg); color: var(--bad); border-radius: var(--r); padding: 8px 10px; font-size: 13px; display: none; }

/* ---- shell ---- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: var(--navy); color: #b8c4d1;
  display: flex; flex-direction: column;
}
.sb-head { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sb-brand { font-family: Georgia, serif; color: #fff; font-size: 15px; line-height: 1.25; }
.sb-brand span { color: #7f8ea0; }
.sb-ver { font-size: 11px; color: #7f8ea0; margin-top: 2px; letter-spacing: .05em; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sb-group { padding: 10px 16px 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6c7d90; }
.sb-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: #b8c4d1; padding: 8px 16px; font-size: 13.5px; border-left: 3px solid transparent;
}
.sb-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.sb-item.on { color: #fff; background: rgba(255,255,255,.08); border-left-color: var(--amber); }
.sb-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #7f8ea0; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
}
.topbar .clock { font-variant-numeric: tabular-nums; color: var(--mut); font-size: 13px; }
.topbar .sp { flex: 1; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.who { line-height: 1.2; }
.who b { display: block; font-size: 13px; }
.who small { color: var(--mut); font-size: 11.5px; }
.iconbtn { position: relative; border: 0; background: none; padding: 6px; color: var(--mut); border-radius: var(--r); }
.iconbtn:hover { background: var(--line-2); color: var(--ink); }
.iconbtn .dot {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 15px;
}
.content { flex: 1; overflow-y: auto; padding: 20px; --cpad: 20px; }

/* mobile */
.mtabs { display: none; }
@media (max-width: 767px) {
  .sidebar { display: none; }
  .content { padding: 14px 14px 76px; --cpad: 14px; }
  .mtabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--card); border-top: 1px solid var(--line);
  }
  .mtab { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: 11px; color: var(--mut-2); }
  .mtab .bar { display: block; height: 3px; width: 32px; margin: 0 auto 4px; border-radius: 2px; background: transparent; }
  .mtab.on { color: var(--navy); font-weight: 600; }
  .mtab.on .bar { background: var(--amber); }
}

/* ---- layout bits ---- */
.pagetitle { font-size: 21px; margin-bottom: 2px; }
.pagesub { color: var(--mut); font-size: 13px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13.5px; }
.card-b { padding: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } .g2 { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--mut); }
.stat .s { font-size: 11px; color: var(--mut-2); }

/* ---- table ---- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--mut); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 26px; text-align: center; color: var(--mut); font-size: 13px; }

/* ---- badge ---- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-mut { background: var(--line-2); color: var(--mut); }
.pillrow { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- punch card ---- */
.punch { background: var(--navy); color: #fff; border-radius: 6px; padding: 20px; }
.punch-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.punch-status { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; }
.punch-status i { width: 7px; height: 7px; border-radius: 50%; background: #8fa1b5; }
.punch-status.in i { background: #3fce8b; }
.punch-status.done i { background: #58aef0; }
.punch-note { font-size: 12px; color: #9db0c4; }
.punch-times { display: flex; align-items: flex-end; gap: 22px; margin-top: 18px; }
.punch-times .lab { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8fa1b5; }
.punch-times .t { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.punch-times .t.dim { color: #9db0c4; }
.punch-times .arrow { color: #5c718a; padding-bottom: 8px; font-size: 18px; }
.punch-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; font-size: 13px; color: #b8c8d9; }
.punch-act { margin-top: 18px; }
.punch-done { margin-top: 18px; background: rgba(255,255,255,.06); border-radius: var(--r); padding: 11px 14px; font-size: 13px; color: #c7d4e2; }
.punch-foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 11.5px; color: #8fa1b5; }

/* weekly bars */
.wk { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 96px; }
.wk .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wk .bar { width: 100%; border-radius: 3px; background: var(--line); }
.wk .d { font-size: 10px; color: var(--mut-2); }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--mut); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ---- punch flow ---- */
.flow { max-width: 520px; margin: 0 auto; }
.flow-step { text-align: center; padding: 26px 18px; }
.flow-step .big { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.flow-step .sub { color: var(--mut); font-size: 13px; }
video.cam, img.shot { width: 100%; max-width: 300px; border-radius: 12px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
video.cam { transform: scaleX(-1); }   /* mirror the LIVE preview only — the saved photo is drawn unmirrored */
.spin {
  width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--navy);
  border-radius: 50%; margin: 0 auto 12px; animation: sp 0.9s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ---- dialog / toast ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(8,26,88,.5); z-index: 60;
  display: grid; place-items: center; padding: 16px;
}
.dlg { background: var(--card); border-radius: 6px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; }
.dlg-h { padding: 14px 18px; border-bottom: 1px solid var(--line-2); font-family: Georgia, serif; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.dlg-x { border: 0; background: none; font-size: 18px; color: var(--mut); line-height: 1; padding: 2px 6px; }
.dlg-b { padding: 8px 18px 16px; overflow-y: auto; }
.dlg-f { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: var(--r);
  font-size: 13.5px; box-shadow: 0 6px 24px rgba(8,26,88,.35); max-width: 92vw;
}
.toast.bad { background: var(--bad); }
@media (max-width: 767px) { .toast { bottom: 76px; } }

/* payslip */
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 560px) { .slip-grid { grid-template-columns: 1fr; } }
.slip-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--line-2); }
.slip-line .q { color: var(--mut-2); margin-left: 6px; font-size: 12px; }
.slip-net { display: flex; justify-content: space-between; margin-top: 12px; padding: 11px 14px; background: var(--navy); color: #fff; border-radius: var(--r); font-weight: 600; }

/* misc */
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .formrow { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 8px 12px; color: var(--mut); border-bottom: 2px solid transparent; font-size: 13.5px; }
.tab.on { color: var(--navy); border-bottom-color: var(--amber); font-weight: 600; }
.notif-pop {
  position: absolute; right: 16px; top: 52px; width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(8,26,88,.18); z-index: 50;
}
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.notif-item b { display: block; font-size: 13px; }
.notif-item small { color: var(--mut-2); }
.notif-item.unread { background: #f4f8fd; }
.hbar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--navy-2); }

/* print: only the open dialog (payslip) */
@media print {
  body * { visibility: hidden; }
  .overlay { position: static; background: none; padding: 0; display: block; height: auto; overflow: visible; }
  .dlg, .dlg * { visibility: visible; }
  .dlg { max-width: none; box-shadow: none; max-height: none; width: 100%; }
  .dlg-b { overflow: visible !important; max-height: none !important; }  /* scroll containers clip printouts */
  .dlg-x, .dlg-f { display: none; }
}

/* ============================== v1.2 design pass ============================== */

/* brand */
.login-logo { width: 56px; height: 56px; display: block; margin: 0 auto 14px; border-radius: 12px; }
.login-card { text-align: left; }
.login-brand, .login-sub { text-align: center; }
.sb-head { display: flex; align-items: center; gap: 10px; }
.sb-logo { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 34px; }

/* refined surfaces */
.card, .stat { box-shadow: 0 1px 2px rgba(8,26,88,.05); }
.tbl tbody tr:hover td { background: #f8fafc; }
.punch { background: linear-gradient(160deg, #122470 0%, #081a58 55%, #050f38 100%); box-shadow: 0 6px 20px rgba(8,26,88,.28); }
.btn, input, select, textarea { min-height: 38px; }
.btn-sm { min-height: 30px; }

/* toolbar + search */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.searchbox { max-width: 260px; min-height: 34px; }
.card-h .searchbox { min-height: 30px; max-width: 200px; font-weight: 400; }

/* password eye */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 58px; }
.pw-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--info); font-size: 12.5px; font-weight: 600;
  padding: 6px 8px; border-radius: var(--r);
}
.pw-eye:hover { background: var(--line-2); }

/* printable documents */
.doc-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 12px; border-bottom: 2px solid var(--navy); margin-bottom: 10px; }
.doc-logo { width: 46px; height: 46px; border-radius: 9px; }
.doc-co { font-family: Georgia, serif; font-size: 17px; font-weight: 700; color: var(--navy); }
.doc-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.doc-sub { font-size: 12px; color: var(--mut-2); }
.doc-tbl { font-size: 12.5px; }
.doc-foot { margin-top: 12px; font-size: 11.5px; color: var(--mut-2); }
.sig-row { display: flex; gap: 40px; margin-top: 40px; }
.sig { flex: 1; border-top: 1px solid var(--ink); padding-top: 5px; font-size: 12px; color: var(--mut); text-align: center; }
.print-only { display: none; }
.dlg-wide { max-width: min(940px, 96vw); }

/* mobile & touch */
@media (max-width: 600px) {
  .overlay { padding: 0; align-items: stretch; }
  .dlg, .dlg-wide { max-width: none; width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .clock { display: none; }
  .who small { display: none; }
  .pagetitle { font-size: 19px; }
  .content { padding: 12px 12px 76px; --cpad: 12px; }
  .searchbox { max-width: none; flex: 1; }
  .toolbar select { flex: 1; min-width: 140px; }
  .punch-times .t { font-size: 30px; }
}

@media print {
  .print-only { display: block; }
  .sig-row.print-only { display: flex; }
  .dlg { width: 100%; }
  .dlg-h { border-bottom: 0; font-size: 0; padding: 0; } /* the doc header carries the title */
  .dlg-h .dlg-x { display: none; }
}

/* ============================== v1.3 mobile pass ============================== */

.menubtn { display: none; font-size: 17px; }
.sb-backdrop { display: none; }

@media (max-width: 767px) {
  /* drawer navigation — every role reaches every page on a phone */
  .menubtn { display: inline-flex; }
  .sidebar {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: min(78vw, 300px); transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: 8px 0 30px rgba(8,26,88,.35);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .sb-backdrop {
    display: block; position: fixed; inset: 0; z-index: 70; background: rgba(8,26,88,.45);
  }

  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar .clock { font-size: 12px; }
  .who small { display: none; }
  .content { padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); --cpad: 12px; }
  .mtabs { padding-bottom: env(safe-area-inset-bottom); }
  .mtab { padding: 9px 0 11px; font-size: 11.5px; }

  /* touch targets and readable tables */
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 7px 11px; font-size: 12.5px; }
  input, select, textarea { padding: 10px 11px; font-size: 16px; } /* 16px stops iOS zoom */
  .tbl th, .tbl td { padding: 8px 9px; font-size: 12.5px; }
  .pagetitle { font-size: 19px; }
  .punch-times .t { font-size: 30px; }
  .stat .v { font-size: 18px; }

  /* dialogs go full screen */
  .overlay { padding: 0; align-items: stretch; }
  .dlg, .dlg-wide { max-width: none; width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .notif-pop { right: 8px; left: 8px; width: auto; }
}

/* ============================== v1.4: punch verification + polish ============ */

.punch-shot { width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; background: #0a1330; display: block; }
.punch-shot-empty { display: grid; place-items: center; color: var(--mut-2); font-size: 12px; border: 1px dashed var(--line); background: var(--line-2); }

.shell { height: 100dvh; }                 /* tracks the real visible viewport on phones */

@media (max-width: 767px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar .clock { display: none; }        /* the dashboard already carries date + time */
  .who small { display: none; }
  .pagetitle { font-size: 18px; }
  .punch-times .t { font-size: 28px; }
  .dlg { max-height: 94dvh; }
  .dlg-b { -webkit-overflow-scrolling: touch; }
}


/* v1.9 enterprise polish */
.card { transition: box-shadow .18s ease, transform .18s ease; }
.card:hover { box-shadow: 0 6px 22px rgba(8,26,88,.08); }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: rgba(8,26,88,.035); }
.btn { transition: background .14s ease, box-shadow .14s ease, transform .06s ease; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy-2, #12297a); outline-offset: 2px;
}
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.toolbar select, .toolbar input[type="date"] { background: var(--bg-2, #fff); }
.badge { letter-spacing: .015em; }
.pagetitle { letter-spacing: -.015em; }
.empty { padding: 26px 14px; text-align: center; color: var(--mut); font-size: 13px; }
.overlay .dlg { animation: dlgIn .16s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .punch-times { gap: 6px; }
  .punch-times .t { font-size: 16px; }
  .toolbar { gap: 6px; }
}

/* batch payslips: one per sheet */
.page-brk { break-after: page; page-break-after: always; border-bottom: 1px dashed var(--line); margin-bottom: 26px; padding-bottom: 26px; }
@media print { .page-brk { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; } }

/* driver roster cells */
.dcell { min-width: 62px; }
.d-on { background: var(--navy, #081a58); color: #fff; border-color: var(--navy, #081a58); }
.d-off { background: #f1f3f9; color: var(--mut); }
.d-none { opacity: .38; border-style: dashed; }
.dsticky { position: sticky; left: 0; background: var(--bg-2, #fff); z-index: 1; }

/* payslip — matches the SMOPC reference sheet; two per printed page */
.payslip-ref { font-size: 12.5px; max-width: 640px; margin: 0 auto; }
.ps-head { text-align: center; margin-bottom: 10px; }
.ps-logo { height: 34px; margin-bottom: 4px; }
.ps-title { font-weight: 800; letter-spacing: .04em; }
.ps-co { font-weight: 700; font-size: 12px; }
.ps-sub { font-size: 11px; color: var(--mut); }
.ps-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 4px 18px; margin: 8px 0 10px; }
.ps-inf { display: flex; justify-content: space-between; gap: 10px; padding: 1.5px 0; }
.ps-l { font-weight: 700; }
.ps-row, .ps-sec { display: grid; grid-template-columns: 1fr 70px 110px; gap: 8px; padding: 2.5px 6px; }
.ps-sec { background: #ececec; font-weight: 700; margin-top: 8px; }
.ps-sec.ps-plain { grid-template-columns: 1fr; background: none; padding-left: 0; }
.ps-q { text-align: center; }
.ps-r { text-align: right; }
.ps-total { font-weight: 800; background: #ececec; }
.ps-gold { background: #f3e8c8; }
.ps-red, .ps-red .ps-r { color: #c0392b; }
.ps-net .ps-r { font-size: 14px; }
@media (max-width: 560px) { .ps-grid { grid-template-columns: 1fr; } }
@media print {
  /* ---- batch payslips: hard-compact so two full slips always land on one landscape sheet ---- */
  .payslip-ref { max-width: none; font-size: 9px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }  /* keep the gold/gray/red bars on paper */
  .payslip-ref, .payslip-ref * { line-height: 1.18; }
  .payslip-ref .ps-row, .payslip-ref .ps-sec { padding: 0.7px 4px; grid-template-columns: 1fr 44px 76px; gap: 4px; }
  .payslip-ref .ps-inf { padding: 0; }
  .payslip-ref .ps-grid { gap: 0 12px; margin: 4px 0 5px; }
  .payslip-ref .ps-head { margin-bottom: 4px; }
  .payslip-ref .ps-logo { height: 18px; margin-bottom: 1px; }
  .payslip-ref .ps-title { font-size: 10px; }
  .payslip-ref .ps-co { font-size: 8.5px; }
  .payslip-ref .ps-sub { font-size: 7.5px; }
  .payslip-ref .ps-sec { margin-top: 3px; }
  .payslip-ref .ps-net .ps-r { font-size: 10px; }
  /* landscape sheet, two slips side by side, each filling ~48% of the page (the approved mock) */
  .slip-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; align-items: start;
    break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid;
    border: 0; margin: 0; padding: 0; }
  .slip-pair .payslip-ref { break-inside: avoid; page-break-inside: avoid;
    width: 100%; max-width: none; border: 1px solid #999; padding: 4mm; }
  .slip-pair > :nth-child(2) { position: relative; }
  .slip-pair > :nth-child(2)::before { content: ""; position: absolute; left: -3.5mm; top: 0; bottom: 0;
    border-left: 1px dashed #bbb; }
  .slip-pair:last-child { break-after: auto; page-break-after: auto; }  /* no blank trailing page */
  /* a single payslip printed from View: centered document width, never edge-to-edge */
  .dlg > .payslip-ref, .dlg-b > .payslip-ref { max-width: 150mm; margin: 0 auto; border: 1px solid #777; padding: 5mm 4mm; }
  /* the dialog chrome contributes zero height on paper */
  .dlg { padding: 0 !important; }
  .dlg-b { padding: 0 !important; }
  .slip-pair .doc, .slip-pair .payslip-ref.doc { padding: 0; margin: 0; border: 0; box-shadow: none; }
}
.slip-pair { display: block; }
@media screen { .slip-pair { border-bottom: 1px dashed var(--line); margin-bottom: 22px; padding-bottom: 22px; } }

/* history modal fits the screen */
.hist-wrap { max-width: 100%; overflow-x: auto; }
.hist-wrap .tbl { font-size: 12px; }
.hist-wrap .tbl th, .hist-wrap .tbl td { padding: 5px 6px; white-space: nowrap; }

/* v2.8 mobile pass */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 7px 8px; white-space: nowrap; }
  .formrow { grid-template-columns: 1fr; }
  .grid.g2, .grid.g3 { grid-template-columns: 1fr; }
  .toolbar { gap: 6px; }
  .toolbar .btn, .toolbar a.btn { flex: 0 1 auto; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .overlay { padding: 8px; align-items: flex-end; }
  .dlg { width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 14px 14px 0 0; }
  .dlg-b { max-height: calc(92vh - 110px); max-height: calc(92dvh - 110px); }
  .dlg-f { flex-wrap: wrap; gap: 8px; }
  .dlg-f .btn { flex: 1 1 40%; }
  .pagetitle { font-size: 20px; }
  .punch-times { flex-wrap: wrap; }
  .ps-grid { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .grid.g3 { grid-template-columns: 1fr 1fr; }
}

/* reports: branch cards fill the row evenly at any width (uses the existing card design) */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: stretch; }
@media (max-width: 640px) { .rep-grid { grid-template-columns: 1fr; } }

/* notification settings — system components: card, brand navy, bordered selection rows */
.nset-group { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.nset-title { font-weight: 700; font-size: 14px; }
.nset-sub { font-size: 12.5px; color: var(--mut); }
.nset-switch { width: 52px; height: 30px; border-radius: 30px; border: 0; background: #cfd6e4;
  position: relative; cursor: pointer; flex: 0 0 auto; transition: background .18s ease; }
.nset-switch.on { background: var(--brand, #081a58); }
.nset-switch .nset-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; transition: left .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.nset-switch.on .nset-knob { left: 25px; }
.nset-switch:focus-visible, .nset-row:focus-visible { outline: 3px solid #7c93e8; outline-offset: 2px; }
.nset-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.nset-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; min-height: 48px; transition: border-color .15s ease, background .15s ease; }
.nset-row.sel { border-color: var(--brand, #081a58); background: #eef1fb; }
.nset-row.off { opacity: .45; pointer-events: none; }
.nset-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b6bfd2; flex: 0 0 auto; }
.nset-row.sel .nset-dot { border-color: var(--brand, #081a58); background: radial-gradient(circle at center, var(--brand, #081a58) 0 6px, transparent 7px); }
.nset-name { flex: 1; font-size: 14px; display: flex; align-items: center; }
.nset-prev { min-height: 36px; flex: 0 0 auto; }
.nset-actions { display: flex; gap: 10px; margin-top: 14px; }
@media (max-width: 640px) {
  .nset-actions { flex-direction: column; }
  .nset-actions .btn { width: 100%; min-height: 44px; }
  .nset-row { min-height: 52px; }
}

.notif-link { font-weight: 600; font-size: 12.5px; display: inline-block; margin-top: 4px; }

.login-values { text-align: center; font-size: 11.5px; color: var(--mut); line-height: 1.5; margin: 2px 0 14px; }

/* schedule boards: legend + team subheaders (existing palette) */
.sched-legend { display: flex; gap: 16px; align-items: center; font-size: 12.5px; color: var(--mut); margin: 2px 0 0; flex-wrap: wrap; }
.sched-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg-duty { background: var(--brand, #081a58); }
.lg-rest { background: #fdf6e7; border: 1px solid #d9b96a; }
.lg-none { background: var(--card); border: 1px solid var(--line); }
.sched-team td { background: #eef1fb; color: var(--brand, #081a58); font-weight: 700; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; }

/* make a request: type picker tiles (reference layout, house palette) */
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.req-tile { border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); padding: 20px 12px;
  cursor: pointer; text-align: center; transition: border-color .15s ease, box-shadow .15s ease; font: inherit; }
.req-tile:hover, .req-tile:focus-visible { border-color: var(--brand, #081a58); box-shadow: 0 2px 8px rgba(8,26,88,.10); outline: none; }
.req-ic { font-size: 26px; margin-bottom: 8px; }
.req-nm { font-weight: 700; font-size: 13.5px; color: var(--brand, #081a58); }
@media (max-width: 640px) { .req-grid { grid-template-columns: repeat(2, 1fr); } }

/* month scheduler — his manual sheet's palette on the existing cell component */
.d-office { background: #fff3c4 !important; color: #6b5200 !important; border-color: #e6cf7a !important; }
.d-frontdesk { background: #dbeafe !important; color: #1e3a8a !important; border-color: #93b4f5 !important; }
.d-others { background: #ede9fe !important; color: #5b21b6 !important; border-color: #c4b5fd !important; }
.dcell { min-width: 64px; font-size: 10.5px; padding: 4px 4px; }
.mo-h { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; }
.mo-h small { font-weight: 400; color: var(--mut); font-size: 9px; }
.dsticky { position: sticky; left: 0; background: var(--card); z-index: 2; min-width: 168px; box-shadow: 2px 0 4px rgba(8,26,88,.06); }

/* e-forms mirroring the printed company forms */
.ef { border: 2px solid #222; padding: 14px; background: #fff; }
.ef-head { text-align: center; margin-bottom: 8px; }
.ef-logo { height: 34px; display: block; margin: 0 auto 2px; }
.ef-co { font-weight: 800; color: var(--brand, #081a58); font-size: 13px; letter-spacing: .04em; }
.ef-title { border: 1.5px solid #222; text-align: center; font-weight: 800; letter-spacing: .03em;
  padding: 6px 8px; margin: 8px 0 10px; font-size: 14px; }
.ef-sub { text-align: left; font-size: 12px; margin: -4px 0 8px; }
.ef-sec { font-weight: 800; font-size: 12.5px; letter-spacing: .04em; margin: 12px 0 4px; text-decoration: underline; }
.ef-grid1 { display: grid; grid-template-columns: 1fr; border: 1.5px solid #222; }
.ef-grid2 { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid #222; margin-bottom: 8px; }
.ef-kv { display: grid; grid-template-columns: 170px 1fr; border: .5px solid #999; min-height: 36px; }
.ef-l { padding: 7px 8px; font-size: 12px; font-weight: 600; background: #f7f8fb; border-right: .5px solid #999; display: flex; align-items: center; }
.ef-v { padding: 4px 8px; font-size: 13px; display: flex; align-items: center; }
.ef-v input, .ef-v select { border: 0; border-bottom: 1px solid #bbb; border-radius: 0; padding: 4px 2px; width: 100%; min-height: 30px; }
.ef-block { border: 1.5px solid #222; padding: 8px 10px; margin-bottom: 8px; }
.ef-it { font-style: italic; font-size: 12.5px; margin-bottom: 4px; }
.ef-checks { display: grid; gap: 4px 10px; }
.ef-check { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 2px;
  font-size: 13px; cursor: pointer; text-align: left; }
.ef-box { width: 16px; height: 16px; border: 1.5px solid #222; display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; background: #fff; }
.ef-check.on { font-weight: 700; }
.ef-lines { width: 100%; border: 0; border-bottom: 1px solid #999; background:
  repeating-linear-gradient(#fff, #fff 25px, #ccc 25px, #ccc 26px); line-height: 26px; padding: 0 2px; }
.ef-note { font-size: 11.5px; color: var(--mut); margin-top: 8px; }
@media (max-width: 640px) {
  .ef { padding: 10px; }
  .ef-grid2 { grid-template-columns: 1fr; }
  .ef-kv { grid-template-columns: 130px 1fr; }
  .ef-checks { grid-template-columns: 1fr 1fr !important; }
}

/* sidebar pending badges + dashboard pending strip */
.sb-item { display: flex; align-items: center; gap: 8px; }
.sb-count { margin-left: auto; background: #e5533d; color: #fff; border-radius: 10px; min-width: 20px;
  height: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; padding: 0 6px; }
.pend-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.pend-chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pend-chip b { font-size: 15px; }
.pend-chip.hot { border-color: #e5533d; color: #b33224; background: #fdf1ef; }

/* schedule boards: visible row/column gridlines + sticky name column */
.sched-tbl .tbl { border-collapse: collapse; }
.sched-tbl .tbl th, .sched-tbl .tbl td { border: 1px solid var(--line); }
.sched-tbl .tbl td:first-child, .sched-tbl .tbl th:first-child {
  position: sticky; left: 0; background: var(--card); z-index: 2; box-shadow: 1px 0 0 var(--line); }
.sched-tbl .tbl th:first-child { background: var(--brand, #081a58); }
.sched-tbl .tbl tr:nth-child(even) td { background-clip: padding-box; }

/* dashboard announcement popup */
.ann-sec { text-align: center; padding: 12px 6px; }
.ann-sec + .ann-sec { border-top: 1px dashed var(--line); }
.ann-big { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.ann-name { font-size: 14.5px; font-weight: 600; padding: 2px 0; }
.ann-sub { font-size: 12.5px; color: var(--mut); margin-top: 4px; }

/* portrait attendance camera (§20) */
.cam-frame { width: min(300px, 80vw); aspect-ratio: 3/4; margin: 0 auto; border-radius: 14px;
  overflow: hidden; background: #000; border: 2px solid var(--line); }
.cam-live { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.shot { width: min(300px, 80vw); aspect-ratio: 3/4; object-fit: cover; border-radius: 14px;
  display: block; margin: 0 auto; border: 2px solid var(--line); }

/* e-signatures + attendance photo viewer */
.esig { max-height: 60px; max-width: 180px; object-fit: contain; display: block; }   /* §55 */
.photo-full { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; }

/* BIG UPDATE §9/§41: friendlier controls for all ages — larger tap targets on employee pages */
@media (max-width: 640px) {
  .btn { min-height: 42px; font-size: 14.5px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 15px; min-height: 42px; }
  textarea { min-height: 72px; }
  .login-card input { min-height: 46px; font-size: 16px; }
  .login-card .btn-block { min-height: 48px; font-size: 16px; }
}
.login-card .btn-block { min-height: 46px; font-size: 15.5px; }

/* ============================================================
   DESIGN REFRESH — SMOPC premium corporate theme (additive layer)
   Restyles the existing components only; no selector renamed,
   no structure required from app.js. Overrides win by order.
   ============================================================ */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-2: #eef2f7;
  --ink: #16202e;
  --mut: #5d6b7e;
  --r: 10px;
  --r-sm: 8px;
  --shadow-1: 0 1px 2px rgba(13, 24, 66, .05), 0 1px 6px rgba(13, 24, 66, .04);
  --shadow-2: 0 4px 14px rgba(13, 24, 66, .08), 0 1px 4px rgba(13, 24, 66, .05);
  --shadow-3: 0 18px 50px rgba(10, 18, 52, .18);
  --focus: 0 0 0 3px rgba(18, 41, 122, .18);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* --- typography hierarchy (§8) --- */
.pagetitle { font-size: 23px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.pagesub { font-size: 13.5px; line-height: 1.45; }
.card-h { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }

/* --- cards (§6/§7): soft borders, gentle depth, no hover gimmicks --- */
.card, .stat {
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.card-h { border-bottom: 1px solid var(--line-2); }
.stat .v { letter-spacing: -.02em; }
.stat .l { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--mut); }

/* --- buttons (§9): one consistent family, quiet depth, clear focus --- */
.btn {
  border-radius: var(--r-sm);
  font-weight: 650;
  letter-spacing: .01em;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.btn:hover { box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.sb-item:focus-visible, .tab:focus-visible, .iconbtn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: linear-gradient(180deg, #142d85, var(--navy)); border-color: var(--navy); }
.btn-primary:hover { background: linear-gradient(180deg, #1a37a0, var(--navy-2)); }
.btn-danger:hover { box-shadow: 0 1px 6px rgba(179, 56, 46, .25); }

/* --- inputs (§22/§40): calm, roomy, readable --- */
input, select, textarea {
  border-radius: var(--r-sm);
  border-color: var(--line);
  background: #fbfcfe;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
input:focus, select:focus, textarea:focus { background: var(--card); border-color: var(--navy-2); }
label, .formrow label { font-size: 12.5px; font-weight: 600; color: var(--mut); }

/* --- sidebar: deeper premium navy, clear active state --- */
.sidebar { background: linear-gradient(180deg, #071448 0%, var(--navy) 55%, #0a1f66 100%); }
.sb-group { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; opacity: .55; }
.sb-item { border-radius: 8px; margin: 1px 8px; transition: background .12s ease, color .12s ease; }
.sb-item:hover { background: rgba(255, 255, 255, .07); }
.sb-item.on { background: rgba(245, 185, 66, .14); box-shadow: inset 3px 0 0 var(--amber); }

/* --- topbar: light, separated, calm --- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line); }

/* --- tables (§11–§13): consistent header, breathing room, hover, sticky --- */
.tbl th {
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: 10.5px;
  color: var(--mut);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
  padding-top: 11px; padding-bottom: 11px;
}
.tbl td { padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--line-2); }
.tbl tbody tr { transition: background .1s ease; }
.tbl tbody tr:hover { background: #f6f8fc; }
.tbl-wrap { border: 1px solid var(--line-2); border-radius: var(--r-sm); }

/* --- status badges (§28): one pill style everywhere --- */
.badge {
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: .02em;
  padding: 3px 10px;
  border: 1px solid transparent;
}
.b-ok   { border-color: rgba(30, 127, 79, .25); }
.b-warn { border-color: rgba(154, 106, 8, .25); }
.b-bad  { border-color: rgba(179, 56, 46, .22); }
.b-info { border-color: rgba(31, 111, 168, .22); }
.b-mut  { border-color: var(--line); }

/* --- dialogs (§18/§19/§29): roomier, elegant, detail views can breathe --- */
.overlay { background: rgba(9, 15, 40, .45); backdrop-filter: blur(2px); }
.dlg { border-radius: 14px; box-shadow: var(--shadow-3); border: 1px solid var(--line); }
.dlg-h { font-weight: 750; letter-spacing: -.01em; border-bottom: 1px solid var(--line-2); }
.dlg-f { border-top: 1px solid var(--line-2); background: #fafbfd; border-radius: 0 0 14px 14px; }
.dlg-x { border-radius: 8px; }
.dlg-x:hover { background: var(--line-2); }

/* --- filter toolbar (§15) + search (§31) --- */
.toolbar { gap: 10px; align-items: end; }
.searchbox { background: #fbfcfe; }

/* --- tabs --- */
.tab { border-radius: 8px 8px 0 0; transition: color .12s ease, background .12s ease; }
.tab.on { box-shadow: inset 0 -2px 0 var(--navy); font-weight: 700; }

/* --- punch card (Time Clock): the flagship employee surface --- */
.punch { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }

/* --- empty + loading states (§32/§33) --- */
.empty { color: var(--mut); font-size: 13.5px; line-height: 1.5; }
.spin { border-top-color: var(--navy); }

/* --- notifications --- */
.notif-pop { border-radius: 12px; box-shadow: var(--shadow-3); border: 1px solid var(--line); }
.notif-item { transition: background .1s ease; }
.notif-item:hover { background: #f6f8fc; }

/* --- login: premium first impression, still instant --- */
.login-wrap { background: radial-gradient(1100px 500px at 50% -10%, #16308f 0%, var(--navy) 45%, #050e33 100%); }
.login-card { border-radius: 16px; box-shadow: var(--shadow-3); border: 1px solid rgba(255, 255, 255, .5); }

/* --- accessibility & devices (§35–§37, §40) --- */
@media (max-width: 760px) {
  .btn, input, select { min-height: 46px; }
  .btn-sm { min-height: 40px; }
  .dlg { border-radius: 12px; }
  .pagetitle { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* --- scrollbars: invisible in the sidebar, slim everywhere else --- */
.sidebar, .sb-nav {
  overflow-x: hidden;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge/IE */
}
.sidebar::-webkit-scrollbar, .sb-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }

.content, .tbl-wrap, .dlg-b, .notif-pop { scrollbar-width: thin; scrollbar-color: #c3ccd9 transparent; }
.content::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar, .dlg-b::-webkit-scrollbar, .notif-pop::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb, .dlg-b::-webkit-scrollbar-thumb, .notif-pop::-webkit-scrollbar-thumb {
  background: #c3ccd9; border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
.content::-webkit-scrollbar-thumb:hover, .tbl-wrap::-webkit-scrollbar-thumb:hover, .dlg-b::-webkit-scrollbar-thumb:hover { background: #a9b5c6; border: 2px solid transparent; background-clip: content-box; }
.content::-webkit-scrollbar-track, .tbl-wrap::-webkit-scrollbar-track { background: transparent; }


/* ------- Announcement popups: centered, readable, fits every screen ------- */
.dlg { width: min(520px, calc(100vw - 28px)); }
.ann-post { padding: 16px 8px; }
.ann-post .ann-kicker { letter-spacing: .14em; font-size: 11.5px; font-weight: 700; color: var(--mut); margin-bottom: 6px; }
.ann-post .ann-big { font-size: clamp(17px, 4.5vw, 21px); line-height: 1.25; overflow-wrap: anywhere; }
.ann-post .ann-sub { margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.ann-post .ann-bodytext { text-align: left; max-height: 46vh; overflow-y: auto; padding: 0 2px; }
.ann-post .ann-from { margin-top: 10px; font-size: 12.5px; color: var(--mut); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .ann-post { padding: 12px 2px; }
  .ann-post .ann-bodytext { max-height: 52vh; }
}

/* ------- 15-minute break countdown (floating, Hide/Show) ------- */
.brk-cd { position: fixed; right: 16px; bottom: 16px; z-index: 260; background: var(--nv, #081a58); color: #fff;
  border-radius: 14px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(8,26,88,.35); text-align: center; min-width: 150px; }
.brk-cd-time { font-size: 34px; font-weight: 700; letter-spacing: .03em; line-height: 1.1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.brk-cd-lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.brk-cd .btn { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.brk-cd-min { padding: 8px 12px; min-width: 0; }
.brk-cd-min .brk-cd-lbl { display: none; }
.brk-cd-min .brk-cd-time { font-size: 18px; margin: 0 8px 0 0; display: inline-block; }
.brk-cd-min .btn { display: inline-block; }
.brk-cd-over { background: #7a1f1f; }
@media (max-width: 480px) { .brk-cd { right: 10px; bottom: 10px; } }

/* ------- e-form fit (yellow-mark fix): values never spill past the paper border ------- */
.ef { overflow: hidden; }
.ef-kv { grid-template-columns: minmax(96px, 150px) 1fr; min-width: 0; }
.ef-l { min-width: 0; }
.ef-v { min-width: 0; overflow-wrap: anywhere; word-break: break-word; flex-wrap: wrap; }
@media (max-width: 520px) {
  .ef { padding: 10px; }
  .ef-kv { grid-template-columns: 92px 1fr; }
  .ef-l { font-size: 11px; padding: 5px 6px; }
  .ef-v { font-size: 12px; padding: 4px 6px; }
}
/* trail e-sign preview sits right-aligned inside its review row */
.esig-trail { max-height: 40px; max-width: 130px; }
.ef-grid2 { min-width: 0; }
.ef-grid2 > .ef-kv { min-width: 0; }
@media (max-width: 440px) { .ef-grid2 { grid-template-columns: 1fr; } }

/* Request preview: a wide, responsive read-only view. This is intentionally scoped so
   approval dialogs, payroll, schedules, and every other modal keep their existing layout. */
.req-preview-dlg { width: min(820px, calc(100vw - 28px)); max-width: 820px; }
.req-preview-dlg .dlg-b { background: #f4f6fa; padding: 14px 18px 18px; }
.req-preview-dlg .dlg-f { flex-wrap: wrap; }
.rf-preview { overflow: hidden; margin-bottom: 10px; border: 1px solid #d9e1ec; border-radius: 14px;
  background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(8,26,88,.06); }
.rf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  padding: 18px 20px; background: var(--navy, #081a58); color: #fff; }
.rf-company { margin-bottom: 4px; font-size: 11px; font-weight: 800; letter-spacing: .075em; }
.rf-head h2 { margin: 0; color: inherit; font-size: 20px; line-height: 1.2; letter-spacing: .015em; }
.rf-code { flex: 0 0 auto; color: #d4ddff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rf-section { margin: 0; padding: 18px 20px 2px; }
.rf-section:last-child { padding-bottom: 20px; }
.rf-section h3 { margin: 0 0 10px; color: var(--navy, #081a58); font-size: 11.5px; font-weight: 800;
  letter-spacing: .065em; text-transform: uppercase; }
.rf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.rf-field { min-width: 0; padding: 10px 12px; border: 1px solid #d9e1ec; border-radius: 9px; background: #f7f9fc; }
.rf-wide { grid-column: 1 / -1; }
.rf-label { margin-bottom: 4px; color: #65758c; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.rf-value { min-width: 0; font-size: 13.5px; font-weight: 650; line-height: 1.4; overflow-wrap: break-word; word-break: normal; }
.rf-text { min-height: 54px; padding: 12px 13px; border: 1px solid #d9e1ec; border-radius: 9px;
  background: #f7f9fc; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }
.rf-confirm { min-height: 0; color: #185b43; font-weight: 650; }
.rf-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.rf-check { display: flex; min-width: 0; align-items: center; gap: 7px; font-size: 12px; line-height: 1.3; overflow-wrap: break-word; }
.rf-check span { display: inline-flex; width: 17px; height: 17px; flex: 0 0 17px; align-items: center; justify-content: center;
  border: 1.5px solid #8c99aa; border-radius: 3px; background: #fff; color: #fff; font-size: 11px; font-weight: 900; }
.rf-check.is-checked { color: var(--navy, #081a58); font-weight: 750; }
.rf-check.is-checked span { border-color: var(--navy, #081a58); background: var(--navy, #081a58); }
.rf-signatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.rf-signature { min-width: 0; min-height: 132px; padding: 10px 11px; border: 1px solid #d9e1ec; border-radius: 9px;
  background: #fff; text-align: center; }
.rf-sign-role { color: #65758c; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; text-align: left; }
.rf-sign-image, .req-preview-dlg .rf-sign-image { display: block; width: auto; max-width: 100%; height: 48px; margin: 6px auto -4px; object-fit: contain; }
.rf-sign-placeholder { display: flex; height: 48px; align-items: center; justify-content: center; color: #8a96a8;
  font-size: 10.5px; font-style: italic; }
.rf-sign-name { min-height: 23px; padding: 5px 3px 2px; border-bottom: 1px solid #8c99aa; font-size: 12px; font-weight: 750;
  line-height: 1.3; overflow-wrap: break-word; word-break: normal; }
.rf-sign-date, .rf-sign-actor-role { margin-top: 4px; color: #65758c; font-size: 9.5px; line-height: 1.25; }
.rf-signature.is-complete .rf-sign-date { color: #17855b; }
.req-trail-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.req-trail-item + .req-trail-item { margin-top: 8px; }
.req-trail-head, .req-trail-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.req-trail-head { font-size: 12.5px; }
.req-trail-head span, .req-trail-person { color: var(--mut); font-size: 12px; }
.req-trail-person { margin-top: 4px; }
.req-trail-comment { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.ef-v { overflow-wrap: break-word; word-break: normal; }
@media (max-width: 600px) {
  .req-preview-dlg .dlg-b { padding: 10px 12px 14px; }
  .rf-head { align-items: flex-start; padding: 15px 16px; }
  .rf-head h2 { font-size: 17px; }
  .rf-section { padding: 15px 16px 1px; }
  .rf-fields { grid-template-columns: 1fr; }
  .rf-wide { grid-column: auto; }
  .rf-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-signatures { grid-template-columns: 1fr; }
  .req-trail-head, .req-trail-person { align-items: flex-start; flex-direction: column; }
  .req-trail-person .esig-trail { align-self: flex-end; }
}
@media (max-width: 380px) {
  .rf-head { flex-direction: column; gap: 8px; }
  .rf-code { white-space: normal; }
  .rf-checks { grid-template-columns: 1fr; }
}


/* ============================================================
   DASHBOARD v2 — "time clock below the header" layout (d2-*)
   ============================================================ */
.d2-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.d2-ava { width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.d2-head-t { flex: 1; min-width: 200px; }
.d2-badges { flex-basis: 100%; margin-top: 2px; }
.d2-head { margin-bottom: 12px; }
.d2-chip { font-size: 12px; padding: 5px 14px; border-radius: 999px; background: var(--line-2);
  color: var(--mut); font-weight: 600; white-space: nowrap; }
.d2-chip.ok { background: var(--ok-bg); color: var(--ok); }
.d2-chip.done { background: var(--info-bg); color: var(--info); }
.d2-chip.info { background: var(--info-bg); color: var(--info); }

.d2-clock { padding: 0; overflow: hidden; }
.d2-clock-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.d2-kicker { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); font-weight: 700; }
.d2-shift { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--info); }
.d2-clock-body { display: flex; gap: 22px; padding: 16px; flex-wrap: wrap; align-items: center; }
.d2-clock-left { flex: 1.4; min-width: 280px; }
.d2-clock-right { flex: 1; min-width: 240px; }
.d2-clock-right .punch-act { margin: 0; }
.d2-line { display: flex; align-items: center; }
.d2-step { flex: 1; text-align: center; }
.d2-step-i { width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
  background: var(--line-2); color: var(--mut); border: 1px solid var(--line); }
.d2-step.on .d2-step-i { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.d2-step-t { font-size: 15px; font-weight: 700; }
.d2-step:not(.on) .d2-step-t { color: var(--mut); }
.d2-step-l { font-size: 11.5px; color: var(--mut); }
.d2-conn { flex: 1; height: 2px; background: var(--line); margin-top: -30px; min-width: 14px; }
.d2-conn.on { background: var(--ok); }
.d2-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mut); margin-top: 10px; justify-content: center; }
.d2-roster { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--mut); }
.d2-asg b { color: var(--ink); }

.d2-mid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; margin-top: 14px; align-items: start; }
.d2-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d2-side { display: flex; flex-direction: column; gap: 10px; }
.d2-qas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.d2-qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 11.5px; color: var(--mut); font-weight: 600; }
.d2-qa:hover { border-color: var(--navy-2); color: var(--ink); }
.d2-qa-i { width: 30px; height: 30px; border-radius: 8px; background: var(--line-2); color: var(--navy-2);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; }
.d2-alert { display: flex; gap: 10px; align-items: center; border-radius: 12px; padding: 10px 14px; }
.d2-alert.warn { background: var(--warn-bg); color: var(--warn); }
.d2-alert.bad { background: var(--bad-bg); color: var(--bad); }
.d2-alert.mut { background: var(--card); border: 1px solid var(--line); color: var(--mut); }
.d2-divider { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--mut);
  padding: 10px 0 4px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; font-weight: 700; }

@media (max-width: 767px) {
  .d2-mid { grid-template-columns: 1fr; }
  .d2-clock-body { gap: 14px; }
  .d2-clock-left, .d2-clock-right { min-width: 100%; }
  /* phone: navy hero band with the clock card overlapping it */
  .d2-head { background: var(--navy); margin: -14px -14px 0; padding: 14px 14px 42px; border-radius: 0; }
  .d2-head .pagetitle { color: #fff; }
  .d2-head .pagesub { color: #b8c4dd; }
  .d2-ava { background: rgba(255,255,255,.18); }
  .d2-clock { margin-top: -30px; }
  .d2-chip { background: rgba(255,255,255,.16); color: #cfe0d6; }
  .d2-chip.ok { background: rgba(30,158,110,.3); color: #9fe1cb; }
  .d2-chip.done, .d2-chip.info { background: rgba(80,150,220,.25); color: #b5d4f4; }
}

/* ============================================================
   DEVICE ACCESSIBILITY LAYER — phones, tablets/iPad, desktop
   ============================================================ */

/* phones: match the real 12px content padding + stop iOS zoom-on-focus */
@media (max-width: 767px) {
  .d2-head { margin: -12px -12px 0; padding: 12px 12px 42px; }
  input, select, textarea { font-size: 16px; }   /* <16px makes iOS Safari zoom the page on focus */
  .d2-step-t { font-size: 14px; }
  .d2-qa { min-height: 64px; }
  .iconbtn { min-width: 42px; min-height: 42px; }
  .d2-chip { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .card-h select { min-height: 36px; }
}

/* small phones: stat tiles single column so peso amounts never clip */
@media (max-width: 380px) {
  .d2-stats { grid-template-columns: 1fr; }
  .d2-qas { grid-template-columns: repeat(2, 1fr); }
}

/* tablet / iPad portrait (768–1024): sidebar slims, dashboard stacks early */
@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar { width: 188px; flex-basis: 188px; }
  .sb-item { padding: 9px 14px; font-size: 13px; }
  .content { padding: 16px; --cpad: 16px; }
  .d2-mid { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; }
}

/* iPad landscape / small laptops (1025–1180): two columns, tighter gaps */
@media (min-width: 1025px) and (max-width: 1180px) {
  .d2-mid { gap: 12px; }
  .d2-stats { gap: 8px; }
}

/* touch devices generally: hover-only affordances get an always-on fallback */
@media (hover: none) {
  .btn:hover { box-shadow: none; }
  .d2-qa:hover { border-color: var(--line); color: var(--mut); }
  .tbl-wrap, .hist-wrap { -webkit-overflow-scrolling: touch; }
}

/* landscape phones: keep the punch action reachable without scrolling past the hero */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .d2-head { padding-bottom: 30px; }
  .d2-clock { margin-top: -22px; }
  .d2-clock-body { padding: 12px; gap: 12px; }
}

/* very wide desktops: cap line lengths, keep the dashboard centered */
@media (min-width: 1600px) {
  .content { padding: 28px 40px; }
}

/* accessibility: visible keyboard focus everywhere, larger dialog close targets */
.dlg-x, .iconbtn { touch-action: manipulation; }
select, input[type="date"] { min-height: 38px; }

/* mobile tab bar polish — five labels incl "Application" fit on every width */
@media (max-width: 767px) {
  .mtab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 2px 10px; min-height: 52px; font-weight: 600; }
  .mtab.on { color: var(--navy); }
}
@media (max-width: 360px) { .mtab { font-size: 10px; letter-spacing: -.01em; } }

/* ---- Schedule boards: grouped toolbar (Team/Branch/Find | Month | actions) ---- */
.sched-bar{display:flex;flex-wrap:wrap;gap:14px 22px;align-items:flex-end;margin:2px 0 14px}
.sched-bar .sb-grp{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.sched-bar .sb-act{margin-left:auto;gap:8px;align-items:center}
.sb-f label{display:block;font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--mut);margin:0 0 4px 1px}
.sb-f select,.sb-f input{min-width:150px}
.mo-nav{display:flex;align-items:stretch}
.mo-nav .btn:first-child{border-radius:9px 0 0 9px;min-width:38px;padding:0 12px}
.mo-nav input{border-radius:0;border-left:0;border-right:0;width:158px;min-width:0}
.mo-nav .btn:last-child{border-radius:0 9px 9px 0;min-width:38px;padding:0 12px}
.sched-bar .sb-act .btn{white-space:nowrap}
@media (max-width:767px){
  .sched-bar{gap:12px}
  .sched-bar .sb-grp{width:100%}
  .sched-bar .sb-act{margin-left:0;justify-content:flex-start}
  .sb-f{flex:1 1 45%}
  .sb-f select,.sb-f input{width:100%;min-width:0;max-width:none}
  .mo-nav{width:100%}
  .mo-nav input{flex:1;width:auto}
}

/* ---- Schedule bar alignment polish (his Aug 26 screenshot): one tidy filter row,
   actions row left-aligned with even spacing; anchors styled like true buttons ---- */
.sched-bar{gap:12px 26px;align-items:flex-end}
.sched-bar .sb-act{margin-left:0;width:100%;justify-content:flex-start;gap:8px;margin-top:2px}
.sched-bar .btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-height:38px;line-height:1.1}
.sched-bar .sb-f select,.sched-bar .sb-f input{min-height:38px}
.mo-nav .btn{min-height:38px}
.mo-nav input{min-height:38px;margin:0}
@media (min-width:1200px){
  .sched-bar .sb-act{width:auto;margin-left:auto;margin-top:0}
}

/* ---- Labeled filter fields size to content, never the base 100% width ---- */
.sched-bar .sb-f > select, .sched-bar .sb-f > input { width: auto; min-width: 150px; max-width: 240px; }
@media (max-width: 767px) {
  .sched-bar .sb-f > select, .sched-bar .sb-f > input { width: 100%; max-width: none; }
}

/* ---- Delivery rows: route left, money + review cluster right, centered baselines ---- */
.slip-line { align-items: center; gap: 10px; flex-wrap: wrap; }
.slip-line > span:first-child { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.slip-line > span:last-child { margin-left: auto; white-space: nowrap; }

/* ============================================================
   COMPATIBILITY LAYER v2 — every screen, smooth (Hostinger era)
   ============================================================ */

/* iOS/Android text + tap behavior: no landscape font inflation, no grey tap flash */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }

/* Horizontal scrollers stay inside themselves — no page bounce while swiping a board */
.tbl-wrap, .hist-wrap { overscroll-behavior-x: contain; }
.dlg-b { overscroll-behavior: contain; }

/* Any image inside a dialog can never overflow it (punch photos, signatures, previews) */
/* Overflow guard for dialog images. `height:auto` used to beat .ps-logo (more specific),
   which blew the payslip logo up to its natural 447px and cut off the preview.
   Constrain width only; let each image keep the height its own rule sets. */
.dlg-b img { max-width: 100%; }

/* Month boards on phones: the sticky name column earns its keep but not half the screen */
@media (max-width: 480px) {
  .dsticky { min-width: 118px; max-width: 138px; font-size: 12px; }
  .dsticky .q { font-size: 10.5px; }
  .sched-tbl .tbl { font-size: 12px; }
  .dcell { min-width: 64px; padding: 4px 6px; font-size: 10.5px; }
}

/* Ultra-narrow devices (Fold cover screens, old compacts) */
@media (max-width: 360px) {
  .content { padding: 10px 10px 76px; }
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 7px 8px; }
  .badge, .chip { font-size: 10.5px; }
  .d2-head h1, .pagetitle { font-size: 17.5px; }
  .dlg-h { padding: 12px 14px; font-size: 15px; }
  .dlg-b { padding: 8px 14px 14px; }
}

/* Tablets in portrait: dialogs breathe instead of hugging the phone sheet style */
@media (min-width: 641px) and (max-width: 1024px) {
  .overlay { align-items: center; padding: 24px; }
  .dlg { border-radius: 14px; }
}

/* Very tall desktop screens: dialogs never stretch absurdly */
@media (min-height: 1000px) {
  .dlg { max-height: 860px; }
}

/* ---- Attendance Monitor: clickable summary chips + employee identity cell ---- */
.pend-chip.chip-f { cursor: pointer; border: 1px solid var(--line); background: var(--card); transition: all .12s ease; }
.pend-chip.chip-f:hover { border-color: var(--navy-2); transform: translateY(-1px); }
.pend-chip.chip-f.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pend-chip.chip-f.on b { color: #fff; }
.emp-cell { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 2px 0;
  cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.emp-cell:hover .emp-nm { color: var(--navy-2); }
.emp-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.emp-nm { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.emp-nm small { color: var(--mut); font-size: 11px; font-weight: 400; }
@media (max-width: 480px) { .emp-av { flex-basis: 28px; width: 28px; height: 28px; font-size: 10.5px; } }

/* ---- Monitor row actions as icons; the title attribute is the hover tag ---- */
.btn.ico { width: 32px; min-width: 32px; padding: 0; font-size: 15px; line-height: 1;
  display: inline-grid; place-items: center; height: 32px; margin-left: 4px; }
.btn.ico:first-child { margin-left: 0; }
@media (hover: none) { .btn.ico { width: 36px; min-width: 36px; height: 36px; } }

/* ================== Attendance Monitor — organized filters + status colour ==================
   Filters live in their own card so the page reads: filters, summary chips, then the list.
   Row tints are deliberately pale (4–7% alpha) so the text stays the loudest thing on screen. */
.mon-filters { margin-bottom: 12px; }
.mon-filters .card-b { padding: 12px 14px; }
.mon-filters .sched-bar .sb-grp { align-items: flex-end; }

/* single Print / Export control */
.xwrap { position: relative; display: inline-block; }
.xmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 210px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 28px rgba(8,26,88,.16); display: none; }
.xmenu.open { display: block; }
.xitem { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit;
  color: var(--ink); padding: 9px 11px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.xitem:hover { background: var(--navy); color: #fff; }

/* soft row tint by status */
.tbl tbody tr.r-ok    { background: rgba(22,163,74,.055); }
.tbl tbody tr.r-late  { background: rgba(217,119,6,.075); }
.tbl tbody tr.r-half  { background: rgba(217,119,6,.075); }
.tbl tbody tr.r-bad   { background: rgba(192,57,43,.06); }
.tbl tbody tr.r-lv    { background: rgba(37,99,235,.06); }
.tbl tbody tr.r-off   { background: rgba(100,116,139,.06); }
.tbl tbody tr.r-nd    { background: rgba(100,116,139,.045); }
.tbl tbody tr:hover   { background: rgba(8,26,88,.07); }

/* the list is wide now — keep it one scrollable table on every device (his pick) */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl th, .tbl td { white-space: nowrap; }
.tbl td .emp-nm small { white-space: normal; }
@media (max-width: 900px) {
  .mon-filters .sb-f { flex: 1 1 46%; }
  .mon-filters .sb-f select, .mon-filters .sb-f input { width: 100%; max-width: none; }
  .mon-filters .sb-act { width: 100%; margin-top: 4px; }
  .mon-filters .sb-act .xwrap, .mon-filters .sb-act .btn { width: 100%; }
  .xmenu { left: 0; right: auto; width: 100%; }
}
@media print {
  .mon-filters, .pend-strip, .sidebar, .topbar, .mtabs, .btn.ico { display: none !important; }
  .tbl-wrap { overflow: visible !important; }
  .tbl th, .tbl td { white-space: normal; font-size: 10.5px; }
}

/* Lunch countdown — same widget as the break timer, sits above it if both are somehow open,
   and keeps counting past zero so an overrun is visible rather than silently hidden. */
.lun-cd { bottom: 16px; }
.brk-cd + .lun-cd, .lun-cd + .brk-cd { bottom: 104px; }   /* no :has() — older browsers reject the whole rule */
@media (max-width: 767px) { .lun-cd { bottom: 84px; } }

/* ---- SMOPC / Greenwood Schedule: one-day duty planning ---- */
.dp-list { display: grid; gap: 2px; padding: 6px 10px 12px; }
.dp-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.dp-row:last-child { border-bottom: 0; }
.dp-nm { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; cursor: pointer; font-size: 13.5px; }
.dp-nm input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--navy); }
.dp-nm span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dp-nm small { color: var(--mut); font-size: 11.5px; }
.dp-as { flex: 0 0 auto; }
.dp-as select { min-width: 150px; width: auto; transition: opacity .12s ease; }
@media (max-width: 600px) {
  .dp-row { flex-wrap: wrap; gap: 8px; }
  .dp-as { width: 100%; }
  .dp-as select { width: 100%; min-width: 0; }
}

/* =====================================================================
   MY WORKSPACE — application look (approved mockup).
   Purely additive: re-themes existing selectors, adds no new markup
   requirements, so every behaviour above keeps working untouched.
   Navy #081a58 carries structure; amber marks what needs attention.
   ===================================================================== */

/* --- 1. Navy header band on every workspace page (dashboard already has one) --- */
.ws-band { background: var(--navy); color: #fff; border-radius: 0 0 18px 18px;
  margin: calc(-1 * var(--cpad, 16px)) calc(-1 * var(--cpad, 16px)) 14px;
  padding: calc(var(--cpad, 16px) + 2px) calc(var(--cpad, 16px) + 2px) 26px; }
.ws-band .pagetitle, .ws-band h1 { color: #fff; margin: 0; }
.ws-band .pagesub { color: rgba(255,255,255,.72); font-size: 12.5px; margin-top: 3px; }

/* --- 2. Cards: softer, app-like, consistent across the six pages --- */

/* --- 3. Attendance rows: colour-coded status bars instead of a dense grid --- */
.att-row { border-left: 3px solid var(--line); border-radius: 0; padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface, #fff); }
.att-row.ok   { border-left-color: #1D9E75; background: rgba(29,158,117,.06); }
.att-row.warn { border-left-color: #BA7517; background: rgba(186,117,23,.07); }
.att-row.bad  { border-left-color: #c0392b; background: rgba(192,57,43,.06); }
.att-row.off  { border-left-color: #888780; background: rgba(136,135,128,.07); }
.att-row .r1 { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.att-row .r2 { font-size: 12px; color: var(--mut); margin-top: 2px; }

/* --- 4. Request picker: tappable tiles --- */
.req-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.req-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px;
  text-align: center; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .12s ease; }
.req-tile:hover { border-color: var(--navy-2); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(8,26,88,.10); }

/* --- 5. Payslip hero --- */
.slip-hero { background: var(--navy); color: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; }
.slip-hero .lbl { font-size: 12px; opacity: .75; }
.slip-hero .amt { font-size: 27px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }
.slip-hero .sub { font-size: 11.5px; opacity: .7; margin-top: 3px; }

/* --- 6. Profile identity block --- */
.pf-id { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 14px; }
.pf-id .av { width: 62px; height: 62px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 700; }

/* Only pages with a .ws-band get the app treatment; every other page is untouched. */
.ws-band ~ .card { border-radius: 14px; box-shadow: 0 1px 2px rgba(8,26,88,.04); }

/* --- 7. Bigger, app-grade touch targets on phones --- */
@media (max-width: 767px) {
  .mtab { padding-top: 7px; }
  .req-tile { padding: 18px 12px; }
  .slip-hero .amt { font-size: 25px; }
}

/* --- 8. Tablet: two columns instead of a stretched single column --- */
@media (min-width: 768px) and (max-width: 1024px) {
  .g2, .req-tiles { grid-template-columns: 1fr 1fr; }
}

/* The attendance table stays for wide screens; the colour-coded cards take over on phones. */
.att-cards { display: none; }
@media (max-width: 767px) {
  .att-cards { display: block; margin-bottom: 12px; }
  .att-page .tbl-wrap { display: none; }   /* cards replace the table on phones — never both */
}

/* --- Period pills (This cutoff / Whole month) --- */
.pills { display: flex; gap: 8px; margin: 0 0 12px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px;
  font-size: 12.5px; cursor: pointer; color: var(--mut); }
.pill.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* --- Icons: sized and aligned wherever they appear --- */
.ti { font-size: 17px; vertical-align: -3px; line-height: 1; }
.req-ic .ti { font-size: 24px; color: var(--navy); }
.pf-row .ti { font-size: 15px; margin-right: 4px; color: var(--mut); }
.mtab .ti { font-size: 19px; display: block; margin: 0 auto 2px; }
.sb-item .ti { width: 20px; margin-right: 8px; }

/* --- Payslip rows on phones; the table stays on desktop (his choice) --- */
@media (max-width: 767px) {
  .slip-rows { display: block; }
  .pay-page .tbl-wrap { display: none; }
}
.slip-rows { display: none; }

/* --- Navigation icons: sidebar, drawer and bottom tabs --- */
.sb-item { display: flex; align-items: center; gap: 10px; }
.sb-item .sb-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-item .ti { font-size: 18px; flex: 0 0 20px; opacity: .9; }
.mtab .mtab-l { display: block; }

/* --- Back button: a real control, not a bare arrow glyph --- */
.iconbtn .ti { font-size: 20px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; }

/* --- My Attendance: make it FIT every screen --------------------------------
   The table carries 9 columns, which overflowed on laptops and tablets. Cards
   now cover phone AND tablet; the table appears only where it genuinely fits. */
@media (max-width: 1024px) {
  .att-cards { display: block; margin-bottom: 12px; }
  .att-page .tbl-wrap { display: none; }
}
@media (min-width: 1025px) {
  .att-cards { display: none; }
  .att-page .tbl-wrap { display: block; }
  .att-page .tbl { table-layout: auto; width: 100%; }
  .att-page .tbl th, .att-page .tbl td { padding: 9px 10px; font-size: 13px; white-space: nowrap; }
}
.att-row .r1 { gap: 10px; }
.att-row .r1 span:last-child { flex: 0 0 auto; font-weight: 700; }
.att-row .r2 { overflow-wrap: anywhere; }

/* Attendance header: title and Print sit on one row inside the band, never squeezed. */
.ws-band-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ws-band-row .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff;
  flex: 0 0 auto; }
.ws-band-row .btn:hover { background: rgba(255,255,255,.26); }
@media (max-width: 480px) {
  .ws-band-row { flex-direction: column; align-items: stretch; }
  .ws-band-row .btn { width: 100%; }
}

/* Supplied SVG menu icons sit on the same grid as the icon-font ones. */
.nav-svg { width: 19px; height: 19px; flex: 0 0 20px; display: block; }
.mtab .nav-svg { width: 19px; height: 19px; margin: 0 auto 2px; }
/* Payslip logo: fixed size on screen and in the dialog preview. */
.dlg-b .ps-logo { height: 34px; width: auto; max-width: 120px;
  object-fit: contain; margin-bottom: 4px; }

/* Notifications that carry a target are tappable; those without behave exactly as before. */
.notif-item.tappable { cursor: pointer; }
.notif-item.tappable:hover { background: rgba(8,26,88,.05); }
.notif-item.tappable::after { content: "\203A"; float: right; color: var(--mut); font-size: 17px; line-height: 1; }
/* Greenwood roster: branch divider rows inside the month grid */
.gw-div { background: var(--navy) !important; color: #fff !important; font-weight: 700;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 7px 10px !important; }
.gw-div .q { color: rgba(255,255,255,.7); }

/* End of day card: the cutoff Time Out lives here, behind a press-and-hold. Red outline so it
   reads as a different kind of action from the lunch buttons above it. */
.eod { margin-top: 12px; border: 1px solid var(--bad); border-radius: 12px; background: #fff; overflow: hidden; }
.eod-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.eod-head .ti-chevron-down { color: var(--mut); transition: transform .15s; }
.eod.open .eod-head .ti-chevron-down { transform: rotate(180deg); }
.eod-title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.eod-sub { font-size: 12px; color: var(--mut); }
.eod-body { display: none; padding: 0 14px 14px; }
.eod.open .eod-body { display: block; }
.eod-warn { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; }
.eod-meta { font-size: 12px; color: var(--mut); margin-bottom: 8px; }
.hold-btn { position: relative; overflow: hidden; height: 50px; background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hold-btn:hover { background: var(--bad); color: #fff; }
.hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: rgba(0,0,0,.22); pointer-events: none; }
.hold-txt { position: relative; }

/* ============================================================ mobile-first pass (Phase 2) ==== */
/* 100vh is taller than the visible area on phones while the browser bars are showing; dvh tracks
   the real viewport and the keyboard. The 100vh line above stays as the fallback. */
.shell { height: 100dvh; }
@media (max-width: 767px) {
  /* Safari zooms the whole page when a focused control's text is under 16px. Phones only. */
  input, select, textarea, .searchbox, .sb-f input, .sb-f select { font-size: 16px; }
  /* 44px touch targets for every tappable control (WCAG 2.5.8 / iOS HIG). */
  .btn, .btn-sm, .mtab, .d2-qa, .pend-chip, .iconbtn { min-height: 44px; }
  .btn-sm.ico { min-width: 44px; }
  /* Fixed widgets sit above the tab bar and clear the home indicator. */
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .brk-cd, .lun-cd { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; }
  /* Keyboard open: the fixed tab bar would cover the field being typed in. */
  .shell.kb-open .mtabs { display: none; }
  .shell.kb-open .content { padding-bottom: 12px; }
  /* Workspace tables: cards replace them on phones. */
  .att-cards ~ .tbl-wrap { display: none; }
  .slip-list { display: block; }
  .slip-list ~ .tbl-wrap { display: none; }
}
@media (min-width: 768px) { .slip-list { display: none; } }
.slip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 10px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.slip-row .q { font-size: 12px; color: var(--mut); font-weight: 400; }
/* Update toast: persistent, carries a button. */
.toast.update { display: flex; align-items: center; gap: 10px; }

/* ============================================================ installed-app safe areas ==== */
/* index.php declares viewport-fit=cover and a translucent status bar, so an installed iPhone/iPad
   app paints edge to edge: without these insets the top bar sits UNDER the clock and battery and
   its buttons cannot be tapped (iPhone 11, iOS 26). env() is 0 in a normal browser tab, so nothing
   changes there. */
.topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-left: calc(20px + env(safe-area-inset-left, 0px)); padding-right: calc(20px + env(safe-area-inset-right, 0px)); }
@media (max-width: 767px) {
  .topbar { padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px)); padding-right: calc(12px + env(safe-area-inset-right, 0px)); }
  .sidebar { padding-top: env(safe-area-inset-top, 0px); }                 /* the slide-in drawer starts at the very top */
  .content { padding-left: calc(12px + env(safe-area-inset-left, 0px)); padding-right: calc(12px + env(safe-area-inset-right, 0px)); }
  .mtabs { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .notif-pop { top: calc(52px + env(safe-area-inset-top, 0px)); }        /* below the taller top bar */
}
@media (max-width: 480px) {
  .topbar { padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px)); }
}
#splash { padding-top: env(safe-area-inset-top, 0px); }

/* The update toast carries two buttons now (Refresh / Later), so it needs room and wrapping. */
.toast.update { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toast.update .btn { flex: none; }
/* The hold button must own the press gesture: without this a drag scrolls the page and the
   browser cancels the hold, which is indistinguishable from a dead button. */
.hold-btn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* OT states in attendance cells. Approved is plain bold (it is money); the other two are muted
   chips so nobody reads them as an amount owed. */
.ot-chip { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ot-chip.pend { background: var(--warn-bg); color: var(--warn); }
.ot-chip.unfiled { background: var(--line-2); color: var(--mut); }

/* ============================================================ checkbox / radio sizing ==== */
/* `input { width: 100% }` above stretched every checkbox to the full card width, which pushed its
   label off the right edge and gave the whole page a horizontal scroll (Profile > Push
   notifications on a phone). Five checkboxes in the app were affected; this fixes all of them at
   the source rather than per call site. */
input[type="checkbox"], input[type="radio"] {
  width: auto; min-width: 0; flex: 0 0 auto; margin: 0;
  width: 20px; height: 20px; padding: 0; accent-color: var(--navy);
}
/* A checkbox row: box on the left, text wrapping in the space that is left. */
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { align-items: flex-start; }
label > input[type="checkbox"] + *, label > input[type="radio"] + * { min-width: 0; }

/* Nothing may scroll the page sideways: cards and their contents stay inside the viewport. */
html, body { overflow-x: hidden; }
.content, .card, .card-b { max-width: 100%; min-width: 0; }
@media (max-width: 767px) {
  .nset-row, .card-b label { flex-wrap: wrap; }
  .card-b label > span, .card-b label { overflow-wrap: anywhere; }
}
.cb-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; min-height: 44px; padding: 4px 0; cursor: pointer; }
.cb-row > input { margin-top: 2px; }
.cb-row > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }

/* Punch review panel (Monitor > Punch): two selfies left, details and actions right; stacks on phones. */
.prv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.prv { display: flex; flex-direction: column; gap: 10px; max-height: 65vh; overflow-y: auto; }
.prv-card { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.prv-shots { display: flex; gap: 8px; flex: none; }
.prv-shot { margin: 0; width: 96px; text-align: center; }
.prv-shot img { width: 96px; height: 128px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.prv-shot.none > div { width: 96px; height: 128px; border-radius: 8px; border: 1px dashed var(--line); display: grid; place-items: center; font-size: 11px; color: var(--mut); }
.prv-shot figcaption { font-size: 11px; color: var(--mut); margin-top: 4px; }
.prv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prv-name { font-weight: 600; font-size: 14px; }
.prv-meta { font-size: 12.5px; color: var(--mut); }
.prv-why { font-size: 12.5px; color: var(--warn); display: flex; align-items: center; gap: 4px; }
.prv-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.pend-chip.warm { border-color: var(--warn); color: var(--warn); }
@media (max-width: 560px) {
  .prv-card { flex-direction: column; }
  .prv-shots { justify-content: center; }
  .prv-shot, .prv-shot img, .prv-shot.none > div { width: 110px; }
  .prv-shot img, .prv-shot.none > div { height: 146px; }
  .prv-actions .btn { flex: 1; }
}

/* Bulk-approve bar in the punch review panel. */
.prv-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg-2, #f7f9fc); position: sticky; top: 0; z-index: 2; }
.prv-bar > span { flex: 1; min-width: 0; }
.prv-warn { color: var(--warn); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.prv-pick { flex: none; display: flex; align-items: flex-start; padding-top: 2px; }
@media (max-width: 560px) { .prv-bar { flex-wrap: wrap; } .prv-bar .btn { width: 100%; } }
/* ---- Overtime panel -------------------------------------------------------------------------
   The period filter is its own block that WRAPS onto a second row rather than scrolling, because
   scrolling clipped the last option mid-word. Wrapping here is safe - it can never push up over
   the dialog title the way four loose buttons did.
   Cards are three columns (checkbox, selfies, details) with the actions on their own row beneath:
   a fourth column starved the name and date down to one word per line at any real dialog width. */
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-2, #f7f9fc); }
.seg-b { flex: 1 1 auto; border: 0; background: none; padding: 8px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--mut); white-space: nowrap; cursor: pointer; }
.seg-b.on { background: var(--navy); color: #fff; }

.ot-figs { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 2px 2px; }
.ot-fig { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ot-fig b { font-size: 17px; font-weight: 700; }
.ot-fig span { font-size: 12px; color: var(--mut); }

.ot-card { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: start;
  gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ot-pick { display: flex; align-items: center; padding-top: 2px; }
.ot-card .prv-shots { display: flex; gap: 8px; }
.ot-card .prv-shot { width: 78px; margin: 0; text-align: center; }
.ot-card .prv-shot img, .ot-card .prv-shot.none > div { width: 78px; height: 104px; }
.ot-card .prv-shot figcaption { font-size: 10.5px; white-space: nowrap; }
.ot-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ot-who { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.ot-role { font-size: 12px; color: var(--mut); }
.ot-day { font-size: 12.5px; color: var(--mut); margin-top: 5px; }
.ot-beyond { font-size: 13.5px; margin-top: 5px; }
.ot-beyond b { font-size: 15px; }
.ot-side { grid-column: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding-top: 9px; border-top: 1px dashed var(--line-2); }
.ot-side .ot-chip { margin-right: auto; }
.ot-side .btn { white-space: nowrap; }

@media (max-width: 560px) {
  .ot-card { grid-template-columns: auto minmax(0, 1fr); }
  .ot-card .prv-shots, .ot-body { grid-column: 2; }
  .ot-side { grid-column: 1 / -1; }
}
.dlg-xwide { max-width: 1040px; }   /* review panels: photos, details and actions all need room */

/* ---- Lunch countdown (Time Clock, while on lunch) ---- */
.lunch-cd { margin-bottom: 12px; border: 1.5px solid var(--line); }
.lunch-cd-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--mut); }
.lunch-cd-num { font-size: 40px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.lunch-cd-sub { font-size: 12.5px; color: var(--mut); }
.lunch-cd-bar { height: 6px; border-radius: 999px; background: var(--line); margin-top: 10px; overflow: hidden; }
.lunch-cd-bar i { display: block; height: 100%; width: 0; background: var(--navy); transition: width 1s linear; }
.lunch-cd.warm { border-color: var(--warn); }
.lunch-cd.warm .lunch-cd-num, .lunch-cd.warm .lunch-cd-bar i { color: var(--warn); background-color: var(--warn); }
.lunch-cd.warm .lunch-cd-num { background: none; }
.lunch-cd.over { border-color: var(--bad); }
.lunch-cd.over .lunch-cd-num { color: var(--bad); }
.lunch-cd.over .lunch-cd-bar i { background: var(--bad); }

/* ---- Employee details (Monitor > avatar) ---- */
.ed { font-size: 13.5px; }
.ed-id { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ed-av { flex: 0 0 52px; width: 52px; height: 52px; font-size: 17px; }
.ed-who { min-width: 0; }
.ed-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.ed-sub { font-size: 12.5px; color: var(--mut); margin-top: 2px; }
.ed-dot { margin: 0 6px; }
.ed-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin: 14px 0 6px; }
.ed-grid { display: grid; grid-template-columns: 118px minmax(0, 1fr); row-gap: 0; }
.ed-row { display: contents; }
.ed-k, .ed-v { padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.ed-k { color: var(--mut); }
.ed-v { font-weight: 600; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 10px; }
.ed-row:last-child .ed-k, .ed-row:last-child .ed-v { border-bottom: 0; }
.ed-tel { font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.ed-em { background: var(--warn-bg); border-radius: 10px; padding: 11px 13px; }
.ed-em-name { font-weight: 700; }
.ed-em-tel { margin-top: 3px; display: flex; gap: 10px; align-items: baseline; }
.ed-none { font-size: 13px; color: var(--mut); }
@media (max-width: 420px) { .ed-grid { grid-template-columns: 96px minmax(0, 1fr); } }

.lunch-gap { font-size: 11px; color: var(--warn); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }

/* =============================================================================================
   Attendance Monitor (CEO, 10 Sep 2026) - one layout, three sizes.
   ≥1100px: filter bar inline, 7-8 summary cards in a row, full table, over-lunch panel beside it.
   760-1099px (tablet / iPad): summary cards wrap 4-up, table drops Branch / Department /
   Assignment / OT / Location (they stay in the row menu and the details dialog).
   <760px (phone): filters behind a button, 2-up summary cards + "View all", the table becomes
   expandable employee cards. Nothing is removed - every action is still reachable.
   ============================================================================================= */
.mon-page { max-width: 1400px; }
.mon-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); margin-bottom: 2px; }
.mon-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mon-head .pagetitle { margin: 0; font-size: 26px; }
.mon-head .pagesub { margin-top: 4px; }

/* ---- filter bar ---- */
.mon-filters { margin-bottom: 16px; }
.mon-fbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mon-fields { display: flex; gap: 12px; flex: 1 1 auto; flex-wrap: wrap; }
.mon-f { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 1 1 150px; }
.mon-f label { font-size: 12px; color: var(--mut); font-weight: 600; }
.mon-f input, .mon-f select { height: 40px; }
.mon-f-date { flex: 0 1 170px; }
.mon-f-find { flex: 2 1 220px; }
.mon-fact { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.mon-filtbtn { display: none; }
.mon-filtbtn .mon-fcount { display: none; margin-left: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.mon-filtbtn.has .mon-fcount { display: inline-block; }
.mon-export { height: 40px; white-space: nowrap; }

/* ---- summary cards ---- */
.mon-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.mon-sum { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 1.5px solid transparent; border-radius: 14px; background: var(--card); cursor: pointer; text-align: left; transition: transform .12s, border-color .12s; }
.mon-sum:hover { transform: translateY(-1px); border-color: var(--line-2); }
.mon-sum.on { border-color: var(--navy); }
.mon-sum-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.mon-sum-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mon-sum-t b { font-size: 24px; font-weight: 700; }
.mon-sum-t small { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-sum.tone-ok    { background: #f1faf3; } .mon-sum.tone-ok .mon-sum-ic { background: #d7f0dd; color: #1f7a3a; } .mon-sum.tone-ok b, .mon-sum.tone-ok small { color: #1f7a3a; }
.mon-sum.tone-bad   { background: #fdf2f2; } .mon-sum.tone-bad .mon-sum-ic { background: #f9d9d9; color: #b42323; } .mon-sum.tone-bad b, .mon-sum.tone-bad small { color: #b42323; }
.mon-sum.tone-warn  { background: #fff8ec; } .mon-sum.tone-warn .mon-sum-ic { background: #fde9c2; color: #a3640a; } .mon-sum.tone-warn b, .mon-sum.tone-warn small { color: #a3640a; }
.mon-sum.tone-info  { background: #eef4ff; } .mon-sum.tone-info .mon-sum-ic { background: #d9e6ff; color: #1d4ed8; } .mon-sum.tone-info b, .mon-sum.tone-info small { color: #1d4ed8; }
.mon-sum.tone-purple{ background: #f6f1fd; } .mon-sum.tone-purple .mon-sum-ic { background: #e6d9f8; color: #6b21a8; } .mon-sum.tone-purple b, .mon-sum.tone-purple small { color: #6b21a8; }
.mon-sum.tone-mut   { background: var(--card); } .mon-sum.tone-mut .mon-sum-ic { background: var(--bg); color: var(--ink); } .mon-sum.tone-mut small { color: var(--mut); }
.mon-sum.zero b { opacity: .55; }
.mon-more { display: none; width: 100%; margin: 4px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--navy); font-weight: 600; font-size: 13px; }

/* ---- layout: table + optional panel ---- */
.mon-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.mon-layout.with-panel { grid-template-columns: minmax(0, 1fr) 320px; }
.mon-tbl { overflow: visible; }
.mon-tbl-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.mon-tbl-h h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.mon-tsearch { max-width: 240px; height: 36px; }
.mon-tbl-wrap { overflow-x: auto; }
.mon-tbl table { width: 100%; min-width: 900px; }
.mon-tbl thead th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); font-weight: 700; background: #f6f8fb; }
.mon-tr td { padding: 11px 10px; vertical-align: middle; }
.mon-tr.r-late { background: #fffbf0; }
.mon-tr.r-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.mon-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 600; }
.mon-loc { color: var(--navy-2); text-decoration: underline; text-underline-offset: 2px; font-size: 12.5px; white-space: nowrap; }
.mon-loc .ti { font-size: 12px; }
.mon-st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; margin: 2px 4px 2px 0; }
.mon-st .st-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.mon-st.st-ok { background: #e6f6ea; color: #1f7a3a; } .mon-st.st-bad { background: #fde8e8; color: #b42323; } .mon-st.st-late { background: #fff3d6; color: #a3640a; }
.mon-st.st-half { background: #fde8e8; color: #b42323; } .mon-st.st-info { background: #e8f0ff; color: #1d4ed8; } .mon-st.st-mut { background: var(--bg); color: var(--mut); }
.mon-c-act { width: 44px; text-align: right; }
.mon-kwrap { position: relative; display: inline-block; }
.mon-kebab { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 16px; line-height: 1; cursor: pointer; color: var(--ink); }
.mon-kebab:hover { border-color: var(--navy-2); }
.mon-menu { display: none; position: absolute; right: 0; top: 36px; z-index: 30; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; text-align: left; }
.mon-kwrap.open .mon-menu { display: block; }
.mon-mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.mon-mi:hover { background: var(--bg); }
.mon-mi .ti { color: var(--mut); font-size: 15px; }

/* ---- mobile cards (hidden until the phone breakpoint) ---- */
.mon-cards { display: none; }
.mon-card { border-top: 1px solid var(--line); }
.mon-card.late { box-shadow: inset 3px 0 0 var(--warn); }
.mon-card-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; }
.mon-card-nm { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.mon-card-nm b { font-size: 14px; } .mon-card-nm small { font-size: 12px; color: var(--mut); }
.mon-card-st .mon-st { margin: 0; }
.mon-chev { color: var(--mut); transition: transform .15s; }
.mon-card.open .mon-chev { transform: rotate(180deg); }
.mon-card-b { display: none; padding: 0 14px 14px; }
.mon-card.open .mon-card-b { display: block; }
.mon-kvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 10px 0; border-top: 1px dashed var(--line-2); }
.mon-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mon-kv small { font-size: 11px; color: var(--mut); font-weight: 600; }
.mon-kv span { font-size: 13.5px; overflow-wrap: anywhere; }
.mon-card-tags { margin: 4px 0 8px; }
.mon-card-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.mon-card-acts .btn { flex: 1 1 auto; justify-content: center; }

/* ---- over-lunch panel ---- */
.mon-panel { padding: 14px 16px; position: sticky; top: 12px; }
.mon-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mon-ol-h { display: flex; flex-direction: column; gap: 2px; } .mon-ol-h b { font-size: 15px; } .mon-ol-h .muted { font-size: 12px; }
.mon-ol-x { width: 28px; height: 28px; border: 0; background: var(--bg); border-radius: 8px; font-size: 16px; cursor: pointer; color: var(--mut); }
.mon-ol-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fff3d6; color: #a3640a; font-size: 12.5px; line-height: 1.4; margin-bottom: 6px; }
.mon-ol-note .ti { flex: 0 0 auto; margin-top: 1px; }
.mon-ol-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.mon-ol-row:last-child { border-bottom: 0; }
.mon-ol-nm { font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; } .mon-ol-nm small { font-weight: 400; font-size: 12px; color: var(--mut); }
.mon-ol-when { font-size: 12.5px; margin-top: 6px; }
.mon-ol-over { font-size: 12.5px; font-weight: 700; color: #a3640a; margin-top: 2px; }
.mon-ol-acts { display: flex; gap: 6px; margin-top: 10px; }
.mon-ol-done { font-size: 12.5px; color: #1f7a3a; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.mon-ol-undo { border: 0; background: none; color: var(--mut); font-size: 12px; text-decoration: underline; cursor: pointer; margin-left: 4px; }
.mon-ol-row.done .mon-ol-over { color: var(--mut); font-weight: 600; }

/* ---- tablet / iPad ---- */
@media (max-width: 1099px) {
  .mon-tbl table { min-width: 0; }
  .mon-c-branch, .mon-c-dept, .mon-c-asg, .mon-c-ot, .mon-c-loc { display: none; }
  .mon-layout.with-panel { grid-template-columns: minmax(0, 1fr) 280px; }
  .mon-sums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ---- phone ---- */
@media (max-width: 760px) {
  .mon-head .pagetitle { font-size: 22px; }
  .mon-fbar { flex-direction: column; align-items: stretch; }
  .mon-fields { display: none; flex-direction: column; gap: 10px; }
  .mon-fields.open { display: flex; }
  .mon-f, .mon-f-date, .mon-f-find { flex: 1 1 auto; min-width: 0; }
  .mon-fact { margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mon-filtbtn { display: inline-flex; align-items: center; justify-content: center; height: 44px; border: 1.5px solid var(--navy); color: var(--navy); font-weight: 600; }
  .mon-export { height: 44px; justify-content: center; }
  .mon-fact .xwrap, .mon-fact .xwrap .btn { width: 100%; }
  .mon-sums { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mon-sums .mon-sum:nth-child(n+5) { display: none; }
  .mon-sums.all .mon-sum:nth-child(n+5) { display: flex; }
  .mon-more { display: block; }
  .mon-tbl-h { flex-wrap: wrap; } .mon-tsearch { max-width: none; width: 100%; }
  .mon-tbl-wrap { display: none; }
  .mon-cards { display: block; }
  .mon-layout.with-panel { grid-template-columns: minmax(0, 1fr); }
}

/* over-lunch panel: period filter, inline Lunch In correction */
.mon-ol-seg { margin: 10px 0 8px; }
.mon-ol-range { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--mut); }
.mon-ol-range input { flex: 1 1 0; min-width: 0; }
.mon-ol-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.mon-ol-f { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mut); }
.mon-ol-f input { width: 120px; }
.mon-ol-why { flex: 1 1 180px; min-width: 0; }
.mon-ol-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.mon-ol-chk input { width: auto; }
.mon-ol-row.done { opacity: .62; }

/* ---- Monitor table: eight grouped columns, no horizontal scroll on desktop ---- */
.mon-tbl table { table-layout: fixed; width: 100%; min-width: 0; }
.mon-c-emp { width: 21%; } .mon-c-org { width: 13%; } .mon-c-plan { width: 15%; }
.mon-c-att { width: 11%; } .mon-c-work { width: 10%; } .mon-c-loc { width: 14%; }
.mon-c-status { width: 12%; } .mon-c-act { width: 4%; text-align: right; }
.mon-tbl td { vertical-align: middle; padding-top: 10px; padding-bottom: 10px; }
.mon-stk { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; min-width: 0; }
.mon-stk > span { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mon-stk i { font-style: normal; font-size: 11px; color: var(--mut); flex: 0 0 22px; }
.mon-stk small { color: var(--mut); font-size: 12px; }
.mon-stk.tt { font-variant-numeric: tabular-nums; }
.mon-c-loc .mon-loc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.mon-c-status { white-space: normal; }
.mon-count { margin-left: 10px; font-size: 12.5px; }

/* pager */
.mon-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px 2px; }
.mon-pg-l, .mon-pg-r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.mon-per { width: auto; min-width: 72px; }
.mon-pg { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; cursor: pointer; }
.mon-pg.on { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.mon-pg:disabled { opacity: .4; cursor: default; }

/* Shed the optional columns one at a time as width runs out; Employee, Attendance, Worked, Status
   and the actions never leave, so nothing needs a horizontal swipe (CEO, 10 Sep 2026). */
@media (max-width: 1180px) { .mon-c-loc { display: none; } .mon-c-emp { width: 25%; } .mon-c-status { width: 15%; } }
@media (max-width: 980px)  { .mon-c-org { display: none; } .mon-c-emp { width: 30%; } .mon-c-plan { width: 18%; } .mon-c-status { width: 18%; } }
@media (max-width: 860px)  { .mon-c-plan { display: none; } .mon-c-emp { width: 38%; } .mon-c-att, .mon-c-work { width: 16%; } .mon-c-status { width: 22%; } }

/* ---- Over lunch review modal ---- */
.ol-dlg .dlg-b { max-height: min(72vh, 640px); overflow-y: auto; }
.ol-badge { margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 600; vertical-align: 2px; }
.ol-sub { font-size: 12.5px; font-weight: 400; color: var(--mut); margin-top: 3px; }
.ol-seg { margin-bottom: 10px; }
.ol-range { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--mut); }
.ol-range input { flex: 1 1 0; min-width: 0; }
.ol-note { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; line-height: 1.45; margin-bottom: 12px; }
.ol-nav { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ol-pos { font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.ol-pick { flex: 1 1 auto; min-width: 0; }
.ol-who { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ol-who b { font-size: 15px; }
.ol-facts { font-size: 13px; margin-bottom: 14px; }
.ol-over { display: block; color: var(--warn); margin-top: 3px; }
.ol-form { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; }
.ol-fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--mut); min-width: 0; }
.ol-chk { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 13px; }
.ol-chk input { width: auto; }
.ol-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.ol-skip { border: 0; background: none; color: var(--navy); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 0; }
.pill-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
body.no-scroll { overflow: hidden; }
@media (max-width: 620px) { .ol-form { grid-template-columns: minmax(0, 1fr); } .ol-acts .btn { flex: 1 1 auto; } }
.mon-chip.warn { background: var(--warn-bg); color: var(--warn); }

/* ---- Attendance Monitor overflow and touch repair (11 Sep 2026) ---- */
.mon-tbl .mon-c-status { white-space: normal; }
.mon-tbl .emp-cell { width: 100%; min-width: 0; text-align: left; }
.mon-tbl .emp-nm { white-space: normal; overflow-wrap: anywhere; }
.mon-tbl .mon-stk > span { flex-wrap: wrap; overflow-wrap: anywhere; }
.mon-c-act { width: 56px; min-width: 56px; }
.mon-kebab { width: 44px; height: 44px; }
.mon-action-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mon-action-sheet .btn { min-height: 44px; justify-content: flex-start; text-align: left; white-space: normal; }
.mon-sum { min-width: 0; }
.mon-sum-t small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.mon-card .mon-loc { white-space: normal; overflow-wrap: anywhere; }
.mon-count { margin-left: 0; }

/* The sidebar leaves much less room than the viewport width suggests. Use the card view on
   portrait tablets and compact laptops instead of squeezing or clipping eight table columns. */
@media (max-width: 900px) {
  .mon-head .pagetitle { font-size: 22px; }
  .mon-fbar { flex-direction: column; align-items: stretch; }
  .mon-fields { display: none; flex-direction: column; gap: 10px; }
  .mon-fields.open { display: flex; }
  .mon-f, .mon-f-date, .mon-f-find { flex: 1 1 auto; min-width: 0; }
  .mon-fact { margin-left: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .mon-filtbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid var(--navy); color: var(--navy); font-weight: 600; }
  .mon-export { min-height: 44px; justify-content: center; }
  .mon-fact .xwrap, .mon-fact .xwrap .btn { width: 100%; }
  .mon-fact .xmenu { left: 0; right: auto; width: 100%; max-width: calc(100vw - 24px); }
  .mon-sums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mon-sums .mon-sum:nth-child(n+5) { display: none; }
  .mon-sums.all .mon-sum:nth-child(n+5) { display: flex; }
  .mon-more { display: block; min-height: 44px; }
  .mon-tbl-h { flex-wrap: wrap; }
  .mon-tbl-h h3 { flex: 1 1 auto; }
  .mon-tsearch { max-width: none; width: 100%; }
  .mon-tbl-wrap { display: none; }
  .mon-cards { display: block; }
  .mon-layout.with-panel { grid-template-columns: minmax(0, 1fr); }
  .mon-card-h { display: grid; grid-template-columns: 36px minmax(0, 1fr) 24px; grid-template-rows: auto auto; column-gap: 10px; row-gap: 5px; align-items: center; }
  .mon-card-h > .emp-av { grid-column: 1; grid-row: 1 / span 2; }
  .mon-card-nm { grid-column: 2; grid-row: 1; }
  .mon-card-st { grid-column: 2; grid-row: 2; justify-self: start; min-width: 0; }
  .mon-card-st .mon-st { white-space: normal; line-height: 1.25; }
  .mon-chev { grid-column: 3; grid-row: 1 / span 2; }
  .mon-pager { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; padding: 12px 10px; }
  .mon-pg-l, .mon-pg-r { width: 100%; justify-content: center; flex-wrap: wrap; gap: 6px; }
  .mon-pg-r > .muted { flex: 1 0 100%; text-align: center; }
  .mon-pg { min-width: 44px; height: 44px; padding: 0 10px; }
}

@media (max-width: 420px) {
  .mon-sum { gap: 8px; padding: 11px 10px; }
  .mon-sum-ic { flex-basis: 34px; width: 34px; height: 34px; font-size: 18px; }
  .mon-sum-t b { font-size: 21px; }
  .mon-kvgrid { grid-template-columns: minmax(0, 1fr); }
  .mon-card-acts .btn { flex: 1 1 100%; min-height: 44px; }
  .mon-action-sheet { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 901px) and (max-width: 1050px) {
  .mon-c-org, .mon-c-plan, .mon-c-loc { display: none; }
  .mon-c-emp { width: 34%; }
  .mon-c-att, .mon-c-work { width: 16%; }
  .mon-c-status { width: 25%; }
  .mon-tbl-h { flex-wrap: wrap; }
  .mon-tsearch { flex: 1 1 190px; }
}
@media (min-width: 1051px) and (max-width: 1180px) {
  .mon-c-org, .mon-c-loc { display: none; }
  .mon-c-emp { width: 28%; }
  .mon-c-plan { width: 18%; }
  .mon-c-status { width: 20%; }
}
@media (min-width: 1181px) and (max-width: 1360px) {
  .mon-c-loc { display: none; }
  .mon-c-emp { width: 25%; }
  .mon-c-status { width: 17%; }
}

/* The global print rule is dialog-only. This opt-in class makes the Monitor's explicit
   “Print current view” action print its table instead of a blank sheet. */
@media print {
  body.print-monitor .mon-page, body.print-monitor .mon-page * { visibility: visible; }
  body.print-monitor, body.print-monitor .shell, body.print-monitor .main,
  body.print-monitor .content, body.print-monitor .mon-page {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important;
  }
  body.print-monitor .shell, body.print-monitor .main, body.print-monitor .content { display: block; }
  body.print-monitor .content { padding: 0 !important; }
  body.print-monitor .mon-page { position: static; inset: auto; width: 100%; max-width: none; }
  body.print-monitor .mon-filters, body.print-monitor .mon-more,
  body.print-monitor .mon-pager, body.print-monitor .mon-kebab,
  body.print-monitor .mon-cards { display: none !important; }
  body.print-monitor .mon-tbl-wrap { display: block !important; overflow: visible !important; }
  body.print-monitor .mon-c-org, body.print-monitor .mon-c-plan,
  body.print-monitor .mon-c-loc, body.print-monitor .mon-c-act { display: none !important; }
  body.print-monitor .mon-tbl table { table-layout: fixed; width: 100%; }
  body.print-monitor .mon-c-emp { width: 36%; }
  body.print-monitor .mon-c-att, body.print-monitor .mon-c-work { width: 18%; }
  body.print-monitor .mon-c-status { width: 28%; }
}

/* ============================================================
   REQUESTS + EMPLOYEES LIST REDESIGN (15 Sep 2026)
   Page-scoped presentation only. Existing dialogs, actions and
   authorization paths continue to use their original handlers.
   ============================================================ */

/* Shared search control */
.requests-page, .employees-page { min-width: 0; }
.list-search {
  min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: #5c6f98; cursor: text;
}
.list-search:focus-within { border-color: var(--navy-2); box-shadow: var(--focus); }
.list-search > i { flex: 0 0 auto; font-size: 19px; color: #395487; }
.list-search > input {
  min-width: 0; width: 100%; min-height: 42px; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--ink);
}
.list-search > input:focus { border: 0; background: transparent; box-shadow: none; outline: 0; }

/* Request & Approvals */
.requests-head { margin-bottom: 12px; }
.requests-head .pagesub { margin-bottom: 0; }
.requests-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.requests-tabs .btn { min-height: 40px; padding-inline: 18px; }
.requests-filter-card { margin-bottom: 14px; padding: 12px; }
.requests-filter-grid { display: grid; grid-template-columns: minmax(260px, 1.45fr) minmax(220px, .85fr); gap: 16px; align-items: end; }
.requests-status-filter { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-weight: 650; }
.requests-status-filter > span { font-size: 12px; }
.requests-status-filter select { width: 100%; min-height: 44px; background-color: #fff; }
.requests-list-card { padding: 0 12px 12px; overflow: hidden; }
.requests-count { padding: 12px 4px 10px; color: var(--ink); font-size: 15px; font-weight: 800; }
.requests-list-card .requests-desktop > .card {
  border-color: var(--line); border-radius: 8px; box-shadow: none; overflow-x: auto;
}
.requests-table { min-width: 860px; table-layout: fixed; }
.requests-table th:nth-child(1) { width: 15%; }
.requests-table th:nth-child(2) { width: 27%; }
.requests-table th:nth-child(3) { width: 22%; }
.requests-table th:nth-child(4) { width: 25%; }
.requests-table th:nth-child(5) { width: 11%; text-align: right; }
.requests-table td { white-space: normal; }
.request-person, .request-type { display: flex; align-items: center; gap: 10px; min-width: 0; }
.request-avatar, .employee-avatar {
  width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #dce9ff; color: #153b8f; font-size: 12px; font-weight: 800;
}
.requests-table tbody tr:nth-child(4n+2) .request-avatar,
.request-card:nth-child(4n+2) .request-avatar { background: #e9e2ff; color: #4936aa; }
.requests-table tbody tr:nth-child(4n+3) .request-avatar,
.request-card:nth-child(4n+3) .request-avatar { background: #d9f3e6; color: #17724e; }
.requests-table tbody tr:nth-child(4n) .request-avatar,
.request-card:nth-child(4n) .request-avatar { background: #f9dfee; color: #a52669; }
.request-person-copy { display: grid; min-width: 0; line-height: 1.25; }
.request-person-copy b { overflow-wrap: anywhere; }
.request-person-copy small { margin-top: 3px; color: var(--mut); font-size: 11.5px; }
.request-type > i { flex: 0 0 auto; color: #506b9d; font-size: 18px; }
.request-action { text-align: right; }
.request-open { min-width: 70px; color: var(--navy); border-color: #2b4d9b; background: #fff; }
.request-open:hover { background: #f2f5fc; }
.request-cards { display: none; }

/* Employees */
.employees-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.employees-head .pagesub { margin-bottom: 0; }
.employees-add { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.employees-add i { font-size: 18px; }
.employees-controls { padding: 12px; margin-bottom: 14px; }
.employees-filter-grid {
  display: grid; grid-template-columns: minmax(230px, 1.35fr) minmax(150px, .8fr) minmax(170px, .9fr) minmax(170px, 1fr);
  gap: 10px;
}
.employees-filter-grid > select { min-width: 0; width: 100%; min-height: 44px; background-color: #fff; }
.employees-results { min-width: 0; }
.employees-desktop > .card { overflow-x: auto; }
.employees-desktop .tbl { min-width: 1120px; table-layout: fixed; }
.employees-desktop .tbl th:nth-child(1) { width: 120px; }
.employees-desktop .tbl th:nth-child(2) { width: 185px; }
.employees-desktop .tbl th:nth-child(3) { width: 155px; }
.employees-desktop .tbl th:nth-child(4) { width: 150px; }
.employees-desktop .tbl th:nth-child(5) { width: 195px; }
.employees-desktop .tbl th:nth-child(6) { width: 105px; }
.employees-desktop .tbl th:nth-child(7) { width: 86px; }
.employees-desktop .tbl th:nth-child(8) { width: 278px; text-align: right; }
.employees-desktop .tbl td { white-space: normal; }
.employees-desktop .tbl td:first-child,
.employees-desktop .tbl td:nth-child(6) { white-space: nowrap; }
.employees-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.employees-person b { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.employees-desktop tbody tr:nth-child(5n+2) .employee-avatar,
.employee-card:nth-child(5n+2) .employee-avatar { background: #e9e2ff; color: #4936aa; }
.employees-desktop tbody tr:nth-child(5n+3) .employee-avatar,
.employee-card:nth-child(5n+3) .employee-avatar { background: #d9f3e6; color: #17724e; }
.employees-desktop tbody tr:nth-child(5n+4) .employee-avatar,
.employee-card:nth-child(5n+4) .employee-avatar { background: #ffe2d8; color: #a84221; }
.employees-desktop tbody tr:nth-child(5n) .employee-avatar,
.employee-card:nth-child(5n) .employee-avatar { background: #f9dfee; color: #a52669; }
.employee-row-actions { text-align: right; white-space: nowrap !important; }
.employee-row-actions .employee-action { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
.employee-row-actions .employee-action + .employee-action { margin-left: 4px; }
.employee-cards { display: none; }

@media (max-width: 1180px) and (min-width: 901px) {
  .employees-filter-grid { grid-template-columns: minmax(230px, 1.3fr) repeat(3, minmax(140px, 1fr)); }
  .employees-controls { overflow: hidden; }
}

/* Card layouts replace wide data tables on phones and portrait tablets. */
@media (max-width: 900px) {
  .requests-filter-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .requests-status-filter > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .requests-list-card { padding: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .requests-count, .requests-desktop { display: none; }
  .request-cards { display: grid; gap: 12px; }
  .request-card {
    min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
    box-shadow: 0 4px 16px rgba(13, 24, 66, .08);
  }
  .request-card-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
  .request-card .request-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 16px; }
  .request-card-person { min-width: 0; }
  .request-card-person h2 { margin: 0; color: var(--navy); font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
  .request-card-person p { margin: 3px 0 0; color: var(--mut); font-size: 13px; line-height: 1.35; }
  .request-card-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .85fr); margin: 14px 0 12px; }
  .request-card-meta > div { min-width: 0; }
  .request-card-meta > div + div { padding-left: 14px; border-left: 1px solid var(--line-2); }
  .request-card-meta span { display: block; margin-bottom: 5px; color: var(--mut); font-size: 10.5px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
  .request-card-meta b { display: block; color: var(--ink); font-size: 14px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
  .request-card-status { margin-bottom: 14px; }
  .request-card-open { width: 100%; min-height: 46px; color: var(--navy); border-color: #21469c; background: #fff; font-size: 15px; font-weight: 750; }
  .request-empty { border: 1px solid var(--line); border-radius: 12px; background: #fff; }

  .employees-filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .employees-search { grid-column: 1 / -1; }
  .employees-filter-grid > select:last-child { grid-column: 1 / -1; }
  .employees-desktop { display: none; }
  .employee-cards { display: grid; gap: 12px; }
  .employee-card { min-width: 0; padding: 16px; border-radius: 14px; box-shadow: 0 4px 16px rgba(13, 24, 66, .08); }
  .employee-card-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .employee-card-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 16px; }
  .employee-card-title { min-width: 0; }
  .employee-card-title h2 { margin: 0; color: var(--navy); font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
  .employee-card-title p { margin: 3px 0 0; color: var(--mut); font-size: 13px; }
  .employee-card-status { align-self: start; }
  .employee-card-details { display: grid; gap: 9px; margin: 16px 0 14px; padding: 0; }
  .employee-card-details > div { display: grid; grid-template-columns: minmax(118px, .8fr) minmax(0, 1.2fr); gap: 10px; align-items: start; }
  .employee-card-details dt, .employee-card-details dd { margin: 0; min-width: 0; font-size: 13px; line-height: 1.35; }
  .employee-card-details dt { display: flex; align-items: center; gap: 8px; color: var(--mut); }
  .employee-card-details dt i { width: 18px; color: var(--navy); font-size: 17px; }
  .employee-card-details dd { color: var(--ink); overflow-wrap: anywhere; }
  .employee-card-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
  .employee-card-action { min-width: 0; min-height: 66px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 3px; background: #fff; color: var(--navy); font-size: 11.5px; font-weight: 550; }
  .employee-card-action i { font-size: 21px; }
  .employee-card-action span { max-width: 100%; overflow-wrap: anywhere; }
  .employee-empty { padding: 24px 12px; }
}

@media (max-width: 640px) {
  .requests-head .pagetitle, .employees-head .pagetitle { font-size: 25px; }
  .requests-head .pagesub { font-size: 13px; }
  .requests-tabs .btn { flex: 0 1 auto; min-height: 44px; }
  .requests-filter-card, .employees-controls { padding: 0; border: 0; background: transparent; box-shadow: none; }
  .list-search, .requests-status-filter select, .employees-filter-grid > select { min-height: 46px; }
  .list-search > input, .requests-status-filter select, .employees-filter-grid > select { font-size: 16px; }
  .employees-head { align-items: center; }
  .employees-add { min-height: 46px; padding-inline: 14px; }
}

@media (max-width: 370px) {
  .employees-head { align-items: stretch; flex-direction: column; }
  .employees-add { width: 100%; justify-content: center; }
  .employee-card-head { grid-template-columns: 42px minmax(0, 1fr); }
  .employee-card-avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .employee-card-status { grid-column: 2; justify-self: start; }
  .employee-card-details > div { grid-template-columns: 106px minmax(0, 1fr); }
  .employee-card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-card-meta { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .request-card-meta > div + div { padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line-2); }
}

@media print {
  .request-cards, .employee-cards, .requests-filter-card, .requests-tabs, .employees-controls, .employees-add { display: none !important; }
  .requests-desktop, .employees-desktop { display: block !important; }
  .requests-list-card { padding: 0; border: 0; box-shadow: none; }
  .requests-list-card .card, .employees-desktop .card { overflow: visible; border: 1px solid #bbb; box-shadow: none; }
  .requests-table, .employees-desktop .tbl { min-width: 0; width: 100%; }
}
