/* ------------------------------------------------------------------
   Employee Salary Management — UI theme
   "current" = clean neutral light. "dark" = matching dark.
   Class names and DOM hooks are unchanged; this file only restyles.
   ------------------------------------------------------------------ */

:root,
html[data-theme="current"] {
  color-scheme: light;

  --ink: #1f2933;
  --ink-strong: #0b1220;
  --muted: #545c68;
  --muted-2: #545c68;

  --line: #e2e4e8;
  --line-strong: #d3d6db;
  --input-border: #c4c9d1;

  --paper: #e6e9f0;
  --card: #f7f8fb;

  --accent: #3d5d8a;
  --accent-2: #b4531f;
  --accent-hover: #334e75;
  --accent-glow: rgba(61, 93, 138, 0.2);
  --on-accent: #ffffff;

  --link: #3a5a86;
  --link-hover: #2c466c;

  --code-ink: #9a3412;
  --code-bg: #f3f4f6;

  --foot: #eef1f6;
  --foot-ink: #6b7280;

  --msg-bg: #eef3f9;
  --msg-line: #c5d4e6;
  --msg-ink: #2c466c;

  --grp-bg: #eef1f6;
  --thead: #eef1f6;
  --grid-row-on: color-mix(in srgb, var(--accent) 16%, var(--card));
  --row-hover: #e8edf4;

  --sidebar: #121a2b;
  --sidebar-ink: #e9edf1;
  --sidebar-muted: #7d8a99;
  --sidebar-link: #c3ccd6;
  --sidebar-hover: #1c2740;
  --sidebar-ico: transparent;

  --top: #ffffff;
  --search-bg: #eef1f6;
  --search-ink: #6b7482;
  --bc: #4b5563;
  --bc-sep: #b7bcc4;

  --cmdk-dim: rgba(15, 23, 41, 0.4);
  --cmdk-hover: #eef2f8;
  --sheet-line: #e2e5e9;

  --warn-bg: #fef6e7;
  --ok-bg: #eef3f9;
  --dim-bg: #eef1f6;
  --active-bg: #e5eefb;

  --kind-monthly: #3d5d8a;
  --kind-yak: #5b3d8a;
  --kind-wager: #8a5109;
}

/* Dark: matching neutral, low-glare. */
html.hr-night {
  color-scheme: dark;

  --ink: #d7dbe0;
  --ink-strong: #f3f5f7;
  --muted: #9aa4b0;
  --muted-2: #9aa4b0;

  --line: #262b34;
  --line-strong: #313742;
  --input-border: #3d4450;

  --paper: #0e1218;
  --card: #161b24;

  --accent: #7a9dc4;
  --accent-2: #e08a4c;
  --accent-hover: #8eafd0;
  --accent-glow: rgba(122, 157, 196, 0.28);
  --on-accent: #0e1218;

  --link: #9bb6d4;
  --link-hover: #c0d2e6;

  --code-ink: #f0c9a0;
  --code-bg: #23262d;

  --foot: #0e1218;
  --foot-ink: #9aa4b0;

  --msg-bg: #182230;
  --msg-line: #3a4e66;
  --msg-ink: #d5e3f0;

  --grp-bg: #1a202c;
  --thead: #1a202c;
  --row-hover: #1c2634;
  --grid-row-on: color-mix(in srgb, var(--accent) 26%, var(--card));

  --sidebar: #0c1018;
  --sidebar-ink: #eceef1;
  --sidebar-muted: #8b95a1;
  --sidebar-link: #c3ccd6;
  --sidebar-hover: #1a2233;
  --sidebar-ico: transparent;

  --top: #141820;
  --search-bg: #1a202c;
  --search-ink: #9aa4b0;
  --bc: #9aa4b0;
  --bc-sep: #4a515c;

  --cmdk-dim: rgba(0, 0, 0, 0.6);
  --cmdk-hover: #1c2634;
  --sheet-line: #313742;

  --warn-bg: #33291320;
  --ok-bg: #182230;
  --dim-bg: #1a202c;
  --active-bg: #1e2b40;

  --kind-monthly: #a8c4e0;
  --kind-yak: #cbb8ec;
  --kind-wager: #f0c48a;
}

/* ---------- base ---------- */

html {
  font-size: 16px;
  scrollbar-gutter: stable;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .h3, .h5 {
  color: var(--ink-strong);
  font-weight: 640;
  letter-spacing: -0.01em;
}
.page-head h1, h1.h3 { font-size: 1.5rem; }

a { color: var(--link); font-weight: 500; text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code {
  color: var(--code-ink);
  background: var(--code-bg);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.text-muted, .small, .form-text { color: var(--muted) !important; }

/* ---------- forms ---------- */

.form-label {
  color: var(--ink-strong) !important;
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 0.1rem;
}
.form-control, .form-select {
  color: var(--ink-strong);
  font-weight: 400;
  background: var(--card);
  border-color: var(--input-border);
  border-radius: 6px;
  min-height: 1.85rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.84rem;
  line-height: 1.25;
}
.form-select {
  padding-right: 1.6rem;
  background-size: 12px 10px;
}
.form-control[type="file"] {
  padding: 0.12rem 0.4rem;
}
.form-control:focus, .form-select:focus {
  color: var(--ink-strong);
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.18rem var(--accent-glow);
}
.form-check-label { color: var(--ink-strong); font-weight: 400; }

/* ---------- buttons ---------- */

.btn { font-weight: 500; border-radius: 7px; }
.btn-accent { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 550; }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-outline-secondary {
  --bs-btn-color: var(--ink-strong);
  --bs-btn-border-color: var(--input-border);
  --bs-btn-hover-color: var(--ink-strong);
  --bs-btn-hover-bg: var(--row-hover);
  --bs-btn-hover-border-color: var(--input-border);
  --bs-btn-active-color: var(--ink-strong);
  --bs-btn-active-bg: var(--row-hover);
  --bs-btn-disabled-color: var(--muted);
  color: var(--ink-strong);
  border-color: var(--input-border);
  font-weight: 500;
}

/* ---------- cards / panels ---------- */

.card-hr {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.msg {
  background: var(--msg-bg);
  border: 1px solid var(--msg-line);
  color: var(--msg-ink);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 500;
}

/* ---------- tables ---------- */

.table {
  color: var(--ink-strong);
  font-size: 0.95rem;
  --bs-table-bg: var(--card);
  --bs-table-color: var(--ink-strong);
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: var(--grp-bg);
  --bs-table-striped-color: var(--ink-strong);
  --bs-table-hover-bg: var(--row-hover);
  --bs-table-hover-color: var(--ink-strong);
  --bs-table-active-bg: var(--active-bg);
  --bs-table-active-color: var(--ink-strong);
}
/* main data cells: full-strength ink; headers stay lighter */
.table > tbody > tr > td { color: var(--ink-strong); }
.table > :not(caption) > * > * { padding: 0.55rem 0.7rem; }
.table thead th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}
.table tbody td { border-color: var(--line); }

.table-warning {
  --bs-table-bg: var(--warn-bg);
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: var(--warn-bg);
  --bs-table-hover-bg: var(--warn-bg);
}
#punchTable tr.punch-echo td { color: var(--muted); }
#punchTable tr.punch-echo td:nth-child(4) { font-style: italic; }
.table-success {
  --bs-table-bg: var(--ok-bg);
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: var(--ok-bg);
  --bs-table-hover-bg: var(--ok-bg);
}
.table-secondary {
  --bs-table-bg: var(--dim-bg);
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: var(--dim-bg);
  --bs-table-hover-bg: var(--row-hover);
}
.table-active {
  --bs-table-bg: var(--active-bg);
  --bs-table-color: var(--ink);
}

th.sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sort-th:hover { color: var(--accent); }
th.sort-th::after { content: " \25B4\25BE"; opacity: .3; font-size: .75em; }
th.sort-asc::after { content: " \25B2"; opacity: 1; }
th.sort-desc::after { content: " \25BC"; opacity: 1; }

.kind-Monthly { color: var(--kind-monthly); font-weight: 600; }
.kind-Yakshagana { color: var(--kind-yak); font-weight: 600; }
.kind-DailyWager { color: var(--kind-wager); font-weight: 600; }
.kind-Contract { color: var(--accent-2); font-weight: 600; }

/* fieldset-style groups */
.grp-ss {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem 0.55rem;
  margin-bottom: 0.65rem;
  background: var(--grp-bg);
}
.grp-ss legend {
  font-weight: 650;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.4rem;
  color: var(--muted);
  float: none;
  width: auto;
}

/* Zoho-style employee form: tabs + labelled field grid */
.emp-tabs {
  display: flex;
  align-items: stretch;
  gap: 0.05rem;
  overflow-x: auto;
  margin: 0 0 0.75rem;
  padding: 0 0.15rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 96px;
  z-index: 18;
  background: var(--paper);
}
.emp-tab {
  flex-shrink: 0;
  color: var(--muted) !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.84rem;
  padding: 0.45rem 0.7rem 0.4rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.emp-tab:hover { color: var(--ink-strong) !important; }
.emp-tab[aria-current="page"] {
  color: var(--accent) !important;
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.emp-sec { scroll-margin-top: 9.25rem; }
.emp-form .emp-panel { display: block; }
.emp-head {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.45rem 1rem;
  align-items: start;
}
.emp-head-fields {
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.emp-photo-lg {
  width: 12rem;
  max-width: 12rem;
  min-width: 12rem;
  grid-row: auto;
  overflow: hidden;
}
.emp-photo-frame {
  width: 12rem;
  cursor: pointer;
}
.emp-photo-lg img,
.emp-photo-empty {
  width: 12rem;
  max-width: 12rem;
  height: 14.25rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}
.emp-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.emp-photo-empty[hidden],
#empFacePreview[hidden] {
  display: none !important;
}
.emp-photo-pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.emp-photo-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr));
  gap: 0.45rem 0.7rem;
  align-items: start;
}
.emp-field {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.emp-field > .form-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted) !important;
}
.emp-field > .form-control,
.emp-field > .form-select {
  width: 100%;
  min-width: 0;
}
.emp-app-pwd {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.emp-app-pwd span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.emp-app-pwd .btn {
  width: auto;
  min-height: 1.55rem;
  height: 1.55rem;
  padding: 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1;
}
.emp-field-wide { grid-column: span 2; }
.emp-field-full { grid-column: 1 / -1; }
.emp-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  min-height: 1.8rem;
}
.emp-checks .form-check {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  padding-left: 1.4rem;
}
.emp-photo {
  grid-row: span 3;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 12rem;
  max-width: 12rem;
}
.emp-photo img {
  width: 12rem;
  height: 14.25rem;
  max-width: 12rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.emp-photo .form-label { margin: 0; font-size: 0.72rem; }
.emp-form .form-text { font-size: 0.72rem; }
.emp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0.35rem;
  position: sticky;
  bottom: 0.25rem;
  z-index: 8;
  padding: 0.3rem 0;
  background: var(--paper);
  align-items: center;
}
.emp-push-places {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.emp-push-places-label {
  font-size: 0.82rem;
  color: var(--muted, #5c6560);
}
.emp-push-tick {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  min-height: 1.5rem;
}
.emp-push-tick .form-check-input {
  margin-top: 0;
  float: none;
}
.emp-push-tick .form-check-label {
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.emp-page-head {
  margin-bottom: 0.25rem;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-width: 0;
}
.emp-page-head h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emp-walk {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}
.emp-walk-nav {
  max-width: 11.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emp-walk-list {
  flex: 0 0 auto;
}
.emp-lead {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}
.emp-form .form-control,
.emp-form .form-select {
  padding: 0.18rem 0.42rem;
  min-height: 1.82rem;
  font-size: 0.86rem;
}
.emp-form .form-control-sm {
  min-height: 1.7rem;
}
.emp-form .grp-ss {
  padding: 0.28rem 0.55rem 0.4rem;
  margin-bottom: 0.45rem;
}
.emp-grid {
  grid-template-columns: repeat(auto-fill, minmax(9.4rem, 1fr));
  gap: 0.28rem 0.55rem;
}
.emp-head-fields.emp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.emp-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.65rem;
  align-items: stretch;
}
.emp-pair > .emp-sec,
.emp-pair > .grp-ss {
  margin-bottom: 0;
}
.emp-span-2 {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .emp-pair { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
  .emp-field-wide { grid-column: span 1; }
  .emp-photo { grid-row: span 1; width: auto; max-width: none; min-width: 0; }
  .emp-head { grid-template-columns: 1fr; }
  .emp-head-fields.emp-grid { grid-template-columns: 1fr; }
  .emp-grid { grid-template-columns: 1fr; }
  .emp-photo-lg { width: auto; max-width: none; min-width: 0; }
  .emp-photo-frame { width: auto; }
  .emp-photo-lg img,
  .emp-photo-empty,
  .emp-photo img { width: 100%; max-width: none; height: 12rem; }
  .emp-tabs { top: 0; }
  .emp-sec { scroll-margin-top: 3rem; }
  .emp-page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .emp-walk {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }
  .emp-walk-nav { max-width: none; }
  .emp-form-actions {
    position: sticky;
    bottom: 0;
    padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom));
  }
  .emp-form-actions .btn { min-height: 2.5rem; }
}

.shift-tabs .btn { font-weight: 500; }
.table-shift td { vertical-align: middle; }
.shift-grid, .grid-fill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.shift-grid .table, .grid-fill .table { margin-bottom: 0; }
.shift-grid-fill, .grid-fill, .sheet-wrap[data-grid-fill] {
  overflow: auto;
  min-height: 12rem;
}
.shift-grid-fill .h6 { margin: 0.85rem 0.75rem 0.35rem; }
.shift-grid-fill .shift-sub { margin: 0 0.75rem 0.5rem; }
.shift-grid thead th, .grid-fill thead th {
  position: sticky;
  top: 0;
  background: var(--thead);
  z-index: 2;
  box-shadow: 0 1px 0 var(--line-strong);
}

/* ================================================================
   Three-zone shell: sidebar + top bar + main
   ================================================================ */

.hr-app {
  display: flex;
  min-height: 100vh;
  background: var(--paper);
}

/* ---- sidebar ---- */
.hr-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.8rem 0.6rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .18s ease;
}
.hr-app.rail .hr-sidebar { width: 60px; }

.hr-side-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--sidebar-ink) !important;
  text-decoration: none;
  font-weight: 620;
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem 1rem;
}
.hr-side-brand:hover { text-decoration: none; }
.hr-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.hr-nav-group {
  font-size: 0.66rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 600;
  padding: 1rem 0.65rem 0.3rem;
}

.hr-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--sidebar-link) !important;
  text-decoration: none;
  font-weight: 450;
  font-size: 0.9rem;
  padding: 0.44rem 0.6rem;
  border-radius: 7px;
  white-space: nowrap;
}
.hr-nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff !important;
  text-decoration: none;
}
.hr-nav-link.on {
  background: var(--accent);
  color: #fff !important;
  font-weight: 500;
}

/* inline stroke icons */
.hr-ico {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
  color: var(--sidebar-muted);
}
.hr-nav-link:hover .hr-ico { color: #fff; }
.hr-nav-link.on .hr-ico { color: #fff; }

.hr-app.rail .hr-nav-text,
.hr-app.rail .hr-nav-group { display: none; }
.hr-app.rail .hr-side-brand { padding-bottom: 0.5rem; justify-content: center; }
.hr-app.rail .hr-nav-link { justify-content: center; padding: 0.5rem; }
.hr-app.rail .hr-ico { width: 19px; height: 19px; }

.hr-side-foot {
  display: none;
}

/* ---- shell + top bar ---- */
.hr-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hr-top {
  min-height: 54px;
  background: var(--top);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
  overflow: hidden;
}
.hr-top-start,
.hr-top-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.hr-top-start { flex: 1 1 auto; }
.hr-top-end { flex: 0 0 auto; }
.hr-icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-strong);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}
.hr-icon-btn:hover { background: var(--row-hover); }

.hr-bc { color: var(--bc); font-weight: 400; white-space: nowrap; font-size: 0.92rem; }
.hr-bc .sep { color: var(--bc-sep); margin: 0 0.35rem; }
.hr-bc strong { color: var(--ink-strong); font-weight: 600; }

.hr-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 22rem;
  flex: 1 1 8rem;
  border: 1px solid var(--input-border);
  background: var(--search-bg);
  border-radius: 7px;
  padding: 0.34rem 0.7rem;
  color: var(--search-ink);
  font-weight: 400;
  font-size: 0.88rem;
}
.hr-search:hover { border-color: var(--line-strong); }
.hr-search span { flex: 1; text-align: left; }
.hr-search-narrow { display: none; }
.hr-search kbd {
  font-size: 0.68rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.3rem;
  font-weight: 500;
  color: var(--muted);
}
.hr-reset-screen {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 7px;
  height: 34px;
  padding: 0 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.hr-reset-screen[hidden] { display: none !important; }
.hr-reset-screen:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.hr-dev-hints-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-strong);
  border-radius: 7px;
  height: 34px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 550;
  white-space: nowrap;
  flex-shrink: 0;
}
.hr-dev-hints-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
body:not(.hr-dev-hints) .dev-hint,
body:not(.hr-dev-hints) [data-dev-only] { display: none !important; }
.dev-hint {
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 3px solid var(--line-strong);
  padding: 0.45rem 0.75rem;
  margin: 0 0 0.85rem;
  background: var(--thead);
}
.dev-hint > :last-child { margin-bottom: 0; }
.dev-hint code { font-size: 0.86em; }

.hr-theme {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-strong);
  border-radius: 7px;
  padding: 0.3rem 0.5rem;
  font-weight: 500;
  font-size: 0.8rem;
  max-width: 8rem;
}
.hr-avatar {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 550;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-size: 0.82rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hr-user-slot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.hr-sign-out {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-strong);
  border-radius: 7px;
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 550;
  text-decoration: none;
}
.hr-sign-out:hover { background: var(--row-hover); color: var(--ink-strong); }

.login-page { min-height: 100vh; flex-direction: column; background: var(--paper); }
.login-shell {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 28rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem 1.75rem 1.6rem;
  box-shadow: 0 16px 40px rgba(11, 18, 32, 0.08);
}
.login-head {
  text-align: center;
  margin-bottom: 1.45rem;
}
.login-logo {
  display: block;
  width: 7.5rem;
  height: auto;
  margin: 0 auto 0.85rem;
  background: transparent;
}
.login-temple {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.45;
  font-family: "Nirmala UI", "Noto Sans Kannada", "Tunga", system-ui, sans-serif;
}
.login-place {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  font-family: "Nirmala UI", "Noto Sans Kannada", "Tunga", system-ui, sans-serif;
}
.login-portal {
  margin: 0.7rem 0 0;
  color: var(--ink-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}
.login-brand strong { display: block; color: var(--ink-strong); font-size: 1.05rem; }
.login-brand span { color: var(--muted); font-size: 0.88rem; }
.login-msg {
  background: #fde8e8;
  color: #8a1f1f;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}
html.hr-night .login-msg {
  background: rgba(180, 60, 60, 0.22);
  color: #f3c4c4;
}

.hr-body {
  padding: 1.5rem 1.75rem 2.5rem;
  flex: 1;
  min-width: 0;
}
.hr-body:has(.emp-form) {
  padding-top: 1rem;
  padding-bottom: 1.1rem;
}
.hr-foot {
  border-top: 1px solid var(--line);
  background: var(--foot);
  padding: 0.75rem 1.75rem;
}
.hr-foot .small { color: var(--foot-ink) !important; font-weight: 400; }
.hr-scrim { display: none; }

/* ---- page header + toolbars ---- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.page-head + .text-muted { margin-top: -0.35rem; }
.page-head-plain {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.4rem;
}

/* ---- stat cards (KPI strip) ---- */
.kpi-strip {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.2rem;
}
.kpi-chip {
  flex: 1 1 8.5rem;
  max-width: 15rem;
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.8rem 1rem 0.85rem 1.1rem;
  overflow: hidden;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.kpi-chip::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.55;
}
a.kpi-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  text-decoration: none;
}
a.kpi-chip:hover::before { opacity: 1; }
.kpi-chip .lbl {
  font-size: .68rem;
  text-transform: uppercase;
  color: var(--muted) !important;
  font-weight: 600;
  letter-spacing: .06em;
}
.kpi-chip .val {
  font-size: 1.7rem;
  font-weight: 680;
  color: var(--ink-strong);
  line-height: 1.2;
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.kpi { font-size: 1.7rem; font-weight: 680; color: var(--ink-strong); }
.kpi-strip-sm {
  gap: 0.4rem;
  margin: 0.45rem 0 0.65rem;
}
.kpi-strip-sm .kpi-chip {
  flex: 0 1 7.2rem;
  max-width: 10.5rem;
  padding: 0.35rem 0.65rem 0.4rem 0.75rem;
  border-radius: 8px;
}
.kpi-strip-sm .kpi-chip .lbl { font-size: 0.58rem; }
.kpi-strip-sm .kpi-chip .val {
  font-size: 1.15rem;
  margin-top: 0;
  line-height: 1.15;
}
.kpi-strip-sm .kpi-chip-live {
  flex: 0 0 13.25rem;
  min-width: 13.25rem;
  max-width: 16rem;
}
.kpi-strip-sm .kpi-chip-live .val {
  white-space: nowrap;
}

/* ---- filter bar: one compact line, labels beside controls ---- */
.page-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  background: var(--grp-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.7rem;
  overflow-x: auto;
}
.page-toolbar.row,
.page-toolbar[class*="row"] {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
.page-toolbar > [class*="col-"] {
  flex: 0 1 auto;
  width: auto !important;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}
.page-toolbar .form-label {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted) !important;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}
.page-toolbar .form-control,
.page-toolbar .form-select {
  min-height: 1.8rem;
  height: 1.8rem;
  background: var(--card);
  font-size: 0.82rem;
  width: auto;
  min-width: 6.5rem;
  max-width: 16rem;
}
.page-toolbar .form-control[type="date"],
.page-toolbar .form-control[type="number"],
.page-toolbar .form-control[name="year"],
.page-toolbar .form-control[name="Year"] {
  width: 8rem;
  min-width: 7.5rem;
  max-width: 8.5rem;
}
.page-toolbar .form-control[type="search"],
.page-toolbar input[name="q"] {
  width: 11rem;
  max-width: 14rem;
}
.page-toolbar > [class*="col-"]:has(select[name="trust"]),
.page-toolbar > [class*="col-"]:has(select[name="personId"]),
.page-toolbar > [class*="col-"]:has(select[name="PersonId"]),
.page-toolbar > [class*="col-"]:has(select[name="id"]),
.page-toolbar > [class*="col-"]:has(select[name="kind"]),
.page-toolbar > [class*="col-"]:has(select[name="Kind"]) {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 20rem;
}
.page-toolbar > [class*="col-"]:has(select[name="trust"]) .form-select,
.page-toolbar > [class*="col-"]:has(select[name="personId"]) .form-select,
.page-toolbar > [class*="col-"]:has(select[name="PersonId"]) .form-select,
.page-toolbar > [class*="col-"]:has(select[name="id"]) .form-select,
.page-toolbar > [class*="col-"]:has(select[name="kind"]) .form-select,
.page-toolbar > [class*="col-"]:has(select[name="Kind"]) .form-select {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.page-toolbar > [class*="col-"]:has(.hr-person-pick) {
  flex: 1 1 16rem;
  min-width: 14rem;
  max-width: 28rem;
}
.page-toolbar .hr-person-pick {
  flex: 1;
  min-width: 14rem;
}
.page-toolbar .hr-person-pick .form-control {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.page-toolbar > .hr-grow,
.page-toolbar > .hr-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}
.page-toolbar .hr-grow {
  flex: 1 1 10rem;
  min-width: 8rem;
}
.page-toolbar .hr-grow .form-control {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.page-toolbar .hr-field .form-control {
  width: 10rem;
  max-width: 14rem;
}
.page-toolbar > .form-select {
  width: auto;
  min-width: 7.5rem;
}
.page-toolbar > [class*="col-"]:has(select[name="filter"]) {
  flex: 1 1 11rem;
  min-width: 10rem;
  max-width: 18rem;
}
.page-toolbar > [class*="col-"]:has(select[name="filter"]) .form-select {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.page-toolbar .btn {
  min-height: 1.8rem;
  height: 1.8rem;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.82rem;
}
.page-toolbar > [class*="text-md-end"],
.page-toolbar > [class*="align-self-end"] {
  margin-left: auto;
  flex: 0 0 auto;
}
.page-toolbar .form-check {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  padding-left: 1.4rem;
}
/* the form's own submit is the primary action */
.page-toolbar button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 550;
}
.page-toolbar button[type="submit"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

/* data-entry rows: label beside control so fields share a line */
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form),
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form),
.hr-app form.card-hr > .row,
fieldset.grp-ss .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form) > [class*="col-"],
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form) > [class*="col-"],
.hr-app form.card-hr > .row > [class*="col-"],
fieldset.grp-ss .row > [class*="col-"] {
  flex: 1 1 11rem;
  width: auto !important;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-label,
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-label,
.hr-app form.card-hr > .row > [class*="col-"] > .form-label,
fieldset.grp-ss .row > [class*="col-"] > .form-label {
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-control,
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-select,
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-control,
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-select,
.hr-app form.card-hr > .row > [class*="col-"] > .form-control,
.hr-app form.card-hr > .row > [class*="col-"] > .form-select,
fieldset.grp-ss .row > [class*="col-"] > .form-control,
fieldset.grp-ss .row > [class*="col-"] > .form-select {
  flex: 1 1 7rem;
  min-width: 6.25rem;
  width: auto;
}
.hr-app form.row.g-2:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-text,
.hr-app form.row.g-3:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .form-text,
fieldset.grp-ss .row > [class*="col-"] > .form-text {
  flex: 1 0 100%;
  margin-top: 0;
  font-size: 0.72rem;
}
.hr-app form.row:not(.page-toolbar):not(.shift-form) > .col-12,
.hr-app form.row:not(.page-toolbar):not(.shift-form) > [class*="col-12"] {
  flex: 1 0 100%;
  width: 100% !important;
  max-width: none;
}
.hr-app form.row:not(.page-toolbar):not(.shift-form) > [class*="col-"] > .d-flex {
  flex: 1 1 10rem;
  min-width: 11rem;
}
.hr-app .form-check.mt-4 {
  margin-top: 0 !important;
  min-height: 0;
  padding-top: 0;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}
.hr-app form.card-hr > .row > .form-check,
fieldset.grp-ss .row > .form-check {
  flex: 0 1 auto;
}
.hr-app form.row:not(.page-toolbar):not(.shift-form) > [class*="col-"]:not(.col-12):has(> .btn),
.hr-app form.row:not(.page-toolbar):not(.shift-form) > [class*="col-"]:not(.col-12):has(> button) {
  flex: 0 0 auto;
}

/* Shift hours: three IN/OUT windows on one row, presets/dates/save on the next */
.shift-form.row,
#shiftForm.row,
#bulkShiftForm.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.45rem;
}
.shift-form > [class*="col-"],
#shiftForm > [class*="col-"],
#bulkShiftForm > [class*="col-"] {
  display: block;
  width: auto;
}
.shift-form > .col-md-4,
#shiftForm > .col-md-4,
#bulkShiftForm > .col-md-4 {
  flex: 1 1 17.5rem;
  max-width: 24rem;
  min-width: 16.5rem;
}
.shift-form > .col-md-4 > .form-label,
#shiftForm > .col-md-4 > .form-label,
#bulkShiftForm > .col-md-4 > .form-label {
  display: block;
  margin-bottom: 0.15rem;
}
.shift-form > .col-md-4 > .d-flex,
#shiftForm > .col-md-4 > .d-flex,
#bulkShiftForm > .col-md-4 > .d-flex {
  width: 100%;
  min-width: 0;
}
.shift-form > .col-md-4 .form-control[type="time"],
#shiftForm > .col-md-4 .form-control[type="time"],
#bulkShiftForm > .col-md-4 .form-control[type="time"] {
  flex: 1 1 6.75rem;
  min-width: 6.75rem;
  width: auto;
  max-width: none;
}
.shift-form > .col-12,
.shift-form > [class*="col-12"],
#shiftForm > .col-12,
#bulkShiftForm > .col-12 {
  flex: 1 0 100%;
  width: 100% !important;
  max-width: none;
}
.shift-form > .col-md-3,
.shift-form > .col-md-5,
.shift-form > .col-md-6,
#shiftForm > .col-md-3,
#shiftForm > .col-md-6,
#bulkShiftForm > .col-md-3,
#bulkShiftForm > .col-md-5 {
  flex: 1 1 11rem;
  min-width: 10rem;
}
.shift-form > .col-md-3 > .form-label,
.shift-form > .col-md-5 > .form-label,
.shift-form > .col-md-6 > .form-label,
#shiftForm > .col-md-3 > .form-label,
#shiftForm > .col-md-6 > .form-label,
#bulkShiftForm > .col-md-3 > .form-label,
#bulkShiftForm > .col-md-5 > .form-label {
  display: inline-block;
  margin: 0 0.35rem 0 0;
  white-space: nowrap;
  vertical-align: middle;
}
.shift-form > .col-md-3 > .form-control,
.shift-form > .col-md-3 > .form-select,
.shift-form > .col-md-5 > .form-control,
.shift-form > .col-md-6 > .form-control,
#shiftForm > .col-md-3 > .form-control,
#shiftForm > .col-md-6 > .form-control,
#bulkShiftForm > .col-md-3 > .form-control,
#bulkShiftForm > .col-md-3 > .form-select,
#bulkShiftForm > .col-md-5 > .form-control {
  display: inline-block;
  width: auto;
  min-width: 8rem;
  vertical-align: middle;
}
.shift-form > .d-flex,
#shiftForm > .d-flex,
#bulkShiftForm > .d-flex {
  display: flex !important;
}
.shift-form > .form-check,
#bulkShiftForm > .form-check {
  display: flex;
  align-items: center;
  min-height: 0;
  margin-top: 0 !important;
}

.shift-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 0.65rem;
}
.shift-tabs::-webkit-scrollbar { display: none; }
.shift-tabs .btn {
  flex-shrink: 0;
  border-radius: 999px;
  min-height: 2.1rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 550;
}
.shift-entry {
  background: var(--grp-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.7rem 0.65rem;
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.shift-wins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
}
.shift-win {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 13.5rem;
  min-width: 0;
}
.shift-win-n {
  flex: 0 0 1.1rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
}
.shift-win-to { color: var(--muted); }
.shift-win .form-control[type="time"] {
  flex: 1 1 6.2rem;
  min-width: 0;
  width: auto;
  max-width: 8.5rem;
}
.shift-win-x {
  flex: 0 0 auto;
  min-width: 1.8rem;
  padding: 0 0.35rem;
}
.shift-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.shift-presets .btn { white-space: nowrap; }
.shift-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}
.shift-dates .form-label {
  margin: 0;
  white-space: nowrap;
}
.shift-dates .form-control[type="date"],
.shift-dates .form-select {
  width: 8.2rem;
  min-width: 7.5rem;
}
.shift-dates .shift-kind {
  flex: 1 1 8rem;
  min-width: 7rem;
  width: auto;
  max-width: 14rem;
}
.shift-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.shift-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.shift-who .form-control[type="search"] {
  flex: 1 1 8rem;
  min-width: 6rem;
}
.shift-walk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.hr-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  overflow-x: auto;
}
.hr-line .form-label {
  margin: 0;
  white-space: nowrap;
}
.hr-line .form-control,
.hr-line .form-select {
  width: 8rem;
  min-width: 7rem;
  max-width: 12rem;
}
.hr-line .btn {
  min-height: 1.8rem;
  padding: 0.15rem 0.7rem;
  white-space: nowrap;
  font-size: 0.82rem;
}

.punch-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.7rem;
  overflow-x: auto;
}
.punch-bar-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0;
  min-width: 0;
}
.punch-bar-field,
.punch-bar .col-md-3 {
  flex: 0 1 auto;
  width: auto;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}
.punch-bar .form-label {
  margin: 0;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.punch-bar .form-control {
  min-height: 1.8rem;
  height: 1.8rem;
  font-size: 0.82rem;
  width: 8.2rem;
}
.punch-bar .form-control[type="search"] {
  width: 11rem;
}
.punch-bar .btn,
.punch-bar button[type="submit"] {
  min-height: 1.8rem;
  height: 1.8rem;
  padding-inline: 0.7rem;
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.punch-bar .punch-bar-saved[type="submit"] {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink-strong);
}
.punch-bar .punch-bar-saved[type="submit"]:hover {
  background: var(--card);
  border-color: var(--accent);
  color: var(--ink-strong);
}

/* data panels read as elevated */
.grid-fill, .sheet-wrap, .shift-grid {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* Pooja settings: two panes, page stays in the viewport */
.hr-app:has(.pooja-set) {
  height: 100vh;
  overflow: hidden;
}
.hr-app:has(.pooja-set) .hr-shell {
  min-height: 0;
  overflow: hidden;
}
.hr-body:has(.pooja-set) {
  overflow: hidden;
  padding-bottom: 0.55rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pooja-set {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pooja-set .page-head {
  margin-bottom: 0;
  padding-bottom: 0.25rem;
}
.pooja-set-lead { line-height: 1.35; }
.pooja-set .h6 {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  font-weight: 620;
}
.pooja-set-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}
.pooja-set-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.pooja-set-add {
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
}
.pooja-set .form-label {
  font-size: 0.72rem;
  margin-bottom: 0.08rem;
}
.pooja-amt { width: 5.5rem; }
.pooja-set-pane .grid-fill {
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  height: auto !important;
}
@media (max-width: 1100px) {
  .pooja-set-cols {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.hr-app:has(.uw-coll) {
  height: 100%;
}
.hr-app:has(.uw-coll) .hr-shell {
  min-height: 0;
}
.hr-body:has(.uw-coll) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.uw-coll {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.uw-coll .page-head {
  margin-bottom: 0;
  padding-bottom: 0.25rem;
}
.uw-coll-lead { line-height: 1.35; }
.uw-coll-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.uw-coll-total strong { font-size: 1.15rem; }
.uw-coll-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}
.uw-coll-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
}
.uw-coll-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-strong);
}
.uw-coll-pane-head span {
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.uw-coll-pane-amts {
  display: flex;
  gap: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  font-size: 0.82rem;
}
.uw-coll-pane-amts .text-muted { font-weight: 450; }
.uw-coll-pane .grid-fill {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  margin-bottom: 0;
  height: auto !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.uw-coll-split {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.uw-coll-sub {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.uw-coll-sub + .uw-coll-sub {
  border-top: 1px solid var(--line);
}
.uw-coll-sub-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.uw-coll-pane td.text-end,
.uw-coll-pane th.text-end { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  .uw-coll-cols {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow: auto;
  }
  .uw-coll-pane { min-height: 12rem; }
}

.av-desk {
  width: 22rem;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  flex-shrink: 0;
}
.av-top,
.av-row,
.av-pair {
  display: grid;
  gap: 0.4rem;
  align-items: stretch;
}
.av-top { grid-template-columns: 1fr 5.5rem; }
.av-row { grid-template-columns: 1fr 5.5rem; }
.av-pair { grid-template-columns: 1fr 1fr; }
.av-row form,
.av-pair form { display: flex; min-width: 0; }
.av-row form .av-btn,
.av-pair form .av-btn { width: 100%; }
.av-drop { justify-content: center; }
.av-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--paper);
  color: var(--ink-strong) !important;
  text-decoration: none !important;
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}
.av-btn:hover { border-color: var(--accent); }
.av-btn.on { outline: 2px solid var(--accent); }
.av-check { color: #228b22 !important; background: #ffffe0; font-weight: 650; }
html.hr-night .av-check { background: #2a3a1a; color: #8fd18f !important; }
.av-stat { font-size: 0.78rem; color: var(--muted); font-weight: 450; }
.av-off { opacity: 0.45; cursor: not-allowed; }

tbody tr.hr-find-hide,
tbody tr[hidden] {
  display: none !important;
}

.uw-coll .page-toolbar { flex-shrink: 0; }
/* ---- Ledger book (Accounts → Ledger) ---- */
.lb-desk {
  --lb-dr: #1d5fa8;
  --lb-cr: #b0412e;
  --lb-gold: #b8860b;
  --lb-green: #2e7d4f;
  gap: 0.45rem;
}
html.hr-night .lb-desk {
  --lb-dr: #7fb4ee;
  --lb-cr: #f0927c;
  --lb-gold: #e2b84a;
  --lb-green: #7dce9a;
}
.lb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  flex-shrink: 0;
  padding: 0.4rem 0.6rem;
  background: var(--grp-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lb-bar-pick {
  display: flex;
  gap: 0.4rem;
  flex: 1 1 26rem;
  min-width: 18rem;
}
.lb-bar-pick .form-select {
  height: 1.95rem;
  min-height: 1.95rem;
  font-size: 0.85rem;
  flex: 1 1 0;
  min-width: 0;
}
.lb-bar-pick .lb-folio { flex: 1.3 1 0; font-weight: 600; }
.lb-bar-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}
.lb-bar-dates > label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.lb-bar-dates .form-control,
.lb-bar-dates .form-select {
  height: 1.95rem;
  min-height: 1.95rem;
  font-size: 0.85rem;
  width: auto;
}
.lb-bar-dates input[type="date"] { width: 8.4rem; }
.lb-bar-dates select { min-width: 6rem; }
.lb-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.lb-seg label {
  margin: 0;
  padding: 0.22rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.lb-seg label.on { background: var(--accent); color: var(--on-accent, #fff); }
.lb-seg input { position: absolute; opacity: 0; pointer-events: none; }

.lb-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.15rem 0.1rem 0;
}
.lb-title { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.lb-trust {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lb-gold);
}
.lb-title h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--ink-strong);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-code {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-period { font-size: 0.82rem; color: var(--muted); }
.lb-find { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; margin: 0; }
.lb-find .form-control { width: 20rem; height: 2rem; font-size: 0.86rem; }
.lb-found {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-found b { color: var(--ink-strong); }

.lb-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  flex-shrink: 0;
}
.lb-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--lb-c, var(--accent));
  border-radius: 8px;
  min-width: 0;
}
.lb-k {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.lb-v {
  font-size: 1.42rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--lb-c, var(--ink-strong));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-v small { font-size: 0.78rem; font-weight: 700; opacity: 0.8; }
.lb-n { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-c-open { --lb-c: var(--ink-strong); border-left-color: var(--muted); }
.lb-c-dr { --lb-c: var(--lb-dr); }
.lb-c-cr { --lb-c: var(--lb-cr); }
.lb-c-net { --lb-c: var(--lb-green); }
.lb-c-close {
  --lb-c: var(--lb-gold);
  background: color-mix(in srgb, var(--lb-gold) 10%, var(--card));
}

.lb-pane {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.lb-grid {
  table-layout: fixed;
  width: 100%;
  font-size: 0.9rem;
  border-collapse: separate;
  border-spacing: 0;
}
.lb-grid .lb-col-date { width: 6.5rem; }
.lb-grid .lb-col-led { width: 12rem; }
.lb-grid .lb-col-amt { width: 8.8rem; }
.lb-grid .lb-col-bal { width: 10.4rem; }
.lb-grid .lb-col-chq { width: 6rem; }
.lb-grid .lb-col-tds { width: 4.2rem; }
.lb-grid .lb-col-flg { width: 3.4rem; }
.lb-grid .lb-col-esi { width: 3.8rem; }
.lb-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e4f7a;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  border: 0;
}
.lb-grid thead th.lb-th-dr { box-shadow: inset 0 -3px 0 #7fb4ee; }
.lb-grid thead th.lb-th-cr { box-shadow: inset 0 -3px 0 #f0927c; }
.lb-grid td {
  vertical-align: top;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}
.lb-grid tbody tr[data-find]:nth-child(even) td { background: color-mix(in srgb, var(--grp-bg) 55%, var(--card)); }
.lb-grid tbody tr[data-find]:hover td { background: var(--grid-row-on); }
.lb-grid .text-end { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-part { color: var(--ink-strong); line-height: 1.35; }
.lb-tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.05rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.35;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}
.lb-grid td.lb-dr { color: var(--lb-dr); font-size: 1.06rem; font-weight: 650; }
.lb-grid td.lb-cr { color: var(--lb-cr); font-size: 1.06rem; font-weight: 650; }
.lb-grid td.lb-bal { font-size: 1rem; font-weight: 650; color: var(--ink-strong); }
.lb-grid td.lb-bal small, .lb-net small { font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.lb-grid td.lb-small { font-size: 0.8rem; color: var(--muted); }
.lb-muted { margin-left: 0.4rem; font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.lb-grid tr.lb-month td {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 750;
  font-size: 0.86rem;
  color: var(--ink-strong);
  border-top: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
}
.lb-grid tr.lb-month td.text-end { font-size: 0.92rem; }
.lb-grid tr.lb-bf td {
  background: color-mix(in srgb, var(--grp-bg) 80%, var(--card));
  font-weight: 700;
  font-size: 0.98rem;
}
.lb-grid tr.lb-cancel td { opacity: 0.55; text-decoration: line-through; }
.lb-grid .lb-empty { padding: 1.5rem; text-align: center; }
.lb-grid tfoot td {
  position: sticky;
  z-index: 2;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  border: 0;
}
.lb-grid tfoot tr.lb-total td {
  bottom: 2.35rem;
  background: color-mix(in srgb, var(--grp-bg) 85%, var(--card));
  border-top: 2px solid var(--line);
  font-size: 1.05rem;
  height: 2.35rem;
}
.lb-grid tfoot tr.lb-cf td {
  bottom: 0;
  background: color-mix(in srgb, var(--lb-gold) 18%, var(--card));
  font-size: 1.12rem;
  height: 2.35rem;
}
.lb-grid tfoot tr.lb-cf td.lb-bal { color: var(--lb-gold); font-size: 1.18rem; }
.lb-grid tfoot td.lb-net { color: var(--lb-green); }
.lb-pane.lb-finding tr.lb-month,
.lb-pane.lb-finding tr.lb-bf { display: none; }

@media (max-width: 1200px) {
  .lb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lb-find .form-control { width: 14rem; }
}
@media (max-width: 760px) {
  .lb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-head { flex-direction: column; align-items: stretch; }
  .lb-find { align-items: stretch; }
  .lb-find .form-control { width: 100%; }
}

/* ---- Collection books (User Wise / Date Wise) ---- */
.cb-desk {
  --cb-bank: #1d5fa8;
  --cb-cash: #2e7d4f;
  --cb-gold: #b8860b;
  gap: 0.45rem;
}
html.hr-night .cb-desk {
  --cb-bank: #7fb4ee;
  --cb-cash: #7dce9a;
  --cb-gold: #e2b84a;
}
.cb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  flex-shrink: 0;
  padding: 0.4rem 0.6rem;
  background: var(--grp-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cb-bar > label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.cb-bar .form-control,
.cb-bar .form-select {
  height: 1.95rem;
  min-height: 1.95rem;
  font-size: 0.85rem;
  width: auto;
}
.cb-bar input[type="date"] { width: 8.4rem; }
.cb-bar select { min-width: 6.2rem; }
.cb-grow { flex: 1 1 12rem; }
.cb-grow .form-select { flex: 1 1 auto; min-width: 8rem; font-weight: 650; }
.cb-find { margin-left: auto; }
.cb-find .form-control { width: 12rem; }
.cb-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.cb-seg label {
  margin: 0;
  padding: 0.22rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
}
.cb-seg label.on { background: var(--accent); color: var(--on-accent, #fff); }
.cb-seg input { position: absolute; opacity: 0; pointer-events: none; }

.cb-head { flex-shrink: 0; padding: 0.05rem 0.1rem 0; }
.cb-kicker {
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cb-gold);
}
.cb-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--ink-strong);
  line-height: 1.15;
}
.cb-period { font-size: 0.82rem; color: var(--muted); }

.cb-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  flex-shrink: 0;
}
.cb-desk:has(.cb-cards > .cb-card:nth-child(3):last-child) .cb-cards {
  grid-template-columns: 1.1fr 1.1fr 1.4fr;
}
.cb-card {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.42rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cb-c, var(--accent));
  border-radius: 8px;
}
.cb-k {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.cb-v {
  font-size: 1.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--cb-c, var(--ink-strong));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-n {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-t-1 { --cb-c: #b8860b; }
.cb-t-2 { --cb-c: #1565c0; }
.cb-t-3 { --cb-c: #2e7d32; }
.cb-t-4 { --cb-c: #b71c1c; }
html.hr-night .cb-t-1 { --cb-c: #e2b84a; }
html.hr-night .cb-t-2 { --cb-c: #7fb4ee; }
html.hr-night .cb-t-3 { --cb-c: #7dce9a; }
html.hr-night .cb-t-4 { --cb-c: #f0927c; }
.cb-c-bank { --cb-c: var(--cb-bank); }
.cb-c-cash { --cb-c: var(--cb-cash); }
.cb-c-total {
  --cb-c: var(--cb-gold);
  background: color-mix(in srgb, var(--cb-gold) 12%, var(--card));
}

.cb-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  flex: 1 1 0;
  min-height: 0;
}
.cb-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cb-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
  border-bottom: 3px solid var(--cb-c, var(--accent));
  background: color-mix(in srgb, var(--cb-c, var(--accent)) 10%, var(--card));
}
.cb-pane-head h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--cb-c, var(--ink-strong));
}
.cb-pane-head span {
  font-size: 1.45rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
}
.cb-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
.cb-grid {
  width: 100%;
  font-size: 0.84rem;
  border-collapse: separate;
  border-spacing: 0;
}
.cb-grid .cb-col-date { width: 6.2rem; }
.cb-grid .cb-col-amt { width: 7.4rem; }
.cb-grid .cb-col-cnt { width: 3.6rem; }
.cb-grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1e4f7a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 0;
}
.cb-grid thead th.cb-th-cash,
.cb-grid thead th.cb-th-bank { box-shadow: inset 0 -3px 0 #7dce9a; }
.cb-grid thead th.cb-th-bank { box-shadow: inset 0 -3px 0 #7fb4ee; }
.cb-grid td {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}
.cb-grid tbody tr[data-find]:nth-child(even) td { background: color-mix(in srgb, var(--grp-bg) 50%, var(--card)); }
.cb-grid tbody tr[data-find]:hover td { background: var(--grid-row-on); }
.cb-grid .text-end { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-grid td.cb-cash { color: var(--cb-cash); font-size: 1.22rem; font-weight: 750; }
.cb-grid td.cb-bank { color: var(--cb-bank); font-size: 1.22rem; font-weight: 750; }
.cb-grid td.cb-chq { color: var(--muted); font-size: 1.12rem; font-weight: 650; }
.cb-grid td.cb-line { font-weight: 750; font-size: 1.22rem; color: var(--ink-strong); }
.cb-grid td.cb-cnt, .cb-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.cb-date { white-space: nowrap; }
.cb-grid tr.cb-band td {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 750;
  font-size: 1.02rem;
  border-top: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.cb-muted { margin-left: 0.35rem; font-weight: 500; color: var(--muted); }
.cb-empty { text-align: center; padding: 1rem !important; }
.cb-grid tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--cb-gold) 16%, var(--card));
  font-weight: 750;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  border-top: 2px solid var(--line);
}
.cb-finding tr.cb-band { display: none; }
@media (max-width: 1280px) {
  .cb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-cols { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(14rem, 1fr) minmax(14rem, 1fr); }
}
@media (max-width: 760px) {
  .cb-cards, .cb-cols { grid-template-columns: 1fr; }
  .cb-find { margin-left: 0; }
  .cb-find .form-control { width: 100%; }
}

.tw-cards { grid-template-columns: 1.5fr 1fr 1fr; }
.tw-desk {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  flex: 1 1 0;
  min-height: 0;
}
.tw-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.tw-col .cb-pane-head span { font-size: 1.15rem; }
.tw-sec {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tw-sec-cash { flex: 0 1 auto; max-height: 38%; }
.tw-sec-bank { flex: 1 1 0; }
.tw-sec-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-shrink: 0;
  padding: 0.28rem 0.6rem 0.18rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
}
.tw-sec-cash .tw-sec-h {
  color: var(--cb-cash);
  border-bottom: 2px solid color-mix(in srgb, var(--cb-cash) 70%, transparent);
}
.tw-sec-bank .tw-sec-h {
  color: var(--cb-bank);
  border-bottom: 2px solid color-mix(in srgb, var(--cb-bank) 70%, transparent);
}
.tw-sec-h b { font-size: 0.85rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tw-lines { min-height: 0; overflow: auto; }
.tw-sec-bank .tw-lines { flex: 1 1 0; }
.tw-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.5rem 0.32rem 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-left: 3px solid transparent;
}
.tw-sec-cash .tw-line { border-left-color: color-mix(in srgb, var(--cb-cash) 75%, transparent); }
.tw-sec-bank .tw-line { border-left-color: color-mix(in srgb, var(--cb-bank) 75%, transparent); }
.tw-sec-cash .tw-line:nth-child(even) { background: color-mix(in srgb, var(--cb-cash) 8%, var(--card)); }
.tw-sec-bank .tw-line:nth-child(even) { background: color-mix(in srgb, var(--cb-bank) 8%, var(--card)); }
.tw-line:hover { background: var(--grid-row-on); }
.tw-line.hr-find-hide,
.tw-line[hidden] { display: none !important; }
.tw-name {
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}
.tw-name small {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tw-amt {
  flex-shrink: 0;
  font-size: 1.22rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tw-sec-cash .tw-amt { color: var(--cb-cash); }
.tw-sec-bank .tw-amt { color: var(--cb-bank); }
.tw-empty { margin: 0; padding: 0.6rem; text-align: center; color: var(--muted); font-size: 0.82rem; }
.tw-bar {
  flex-shrink: 0;
  padding: 0.32rem 0.55rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  font-size: 1.28rem;
  text-align: right;
  white-space: nowrap;
}
.tw-bar-cash {
  color: var(--cb-cash);
  background: color-mix(in srgb, var(--cb-cash) 16%, var(--card));
  border-top: 2px solid var(--cb-cash);
}
.tw-bar-bank {
  color: var(--cb-bank);
  background: color-mix(in srgb, var(--cb-bank) 16%, var(--card));
  border-top: 2px solid var(--cb-bank);
}
.tw-bar-trust {
  color: var(--cb-gold);
  background: color-mix(in srgb, var(--cb-gold) 20%, var(--card));
  border-top: 2px solid var(--cb-gold);
  font-size: 1.4rem;
}
@media (max-width: 1200px) {
  .tw-cards { grid-template-columns: 1fr; }
  .tw-desk {
    grid-template-columns: 1fr 1fr;
    overflow: auto;
  }
  .tw-col { min-height: 22rem; }
}
@media (max-width: 760px) {
  .tw-desk { grid-template-columns: 1fr; }
}

/* ---- Zoho-style module tabs under the top bar ---- */
.hr-mod-tabs {
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
  background: var(--top);
  border-bottom: 1px solid var(--line);
  padding: 0 1.1rem;
  position: sticky;
  top: 54px;
  z-index: 19;
  overflow-x: auto;
  flex-shrink: 0;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hr-mod-tabs::-webkit-scrollbar { display: none; }
.hr-mod-tab {
  flex-shrink: 0;
  color: var(--muted) !important;
  text-decoration: none !important;
  font-weight: 450;
  font-size: 0.9rem;
  padding: 0.62rem 0.85rem 0.55rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.hr-mod-tab:hover {
  color: var(--ink-strong) !important;
  border-bottom-color: var(--line-strong);
}
.hr-mod-tab.on {
  color: var(--accent) !important;
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---- sub-navs (Attendance / Leave): buttons -> quiet text tabs ---- */
.leave-sub {
  gap: 0 !important;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.15rem !important;
  padding-bottom: 0;
}
.leave-sub .btn {
  border: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-weight: 450;
  font-size: 0.9rem;
  border-radius: 0 !important;
  padding: 0.45rem 0.9rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent !important;
}
.leave-sub .btn:first-child { padding-left: 0; }
.leave-sub .btn:hover {
  color: var(--ink-strong) !important;
  border-bottom-color: var(--line-strong) !important;
}
.leave-sub .btn.active,
.leave-sub .btn[aria-current="page"] {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* ---- name button in tables ---- */
button.person-open {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
button.person-open:hover { color: var(--link-hover); text-decoration: underline; }

.table-hover-actions .row-actions { white-space: nowrap; }
.table-hover-actions td:last-child { min-width: 12rem; vertical-align: middle; }
.table-hover-actions > tbody > tr:hover > *,
.table-hover-actions > tbody > tr:focus-within > * {
  background-color: var(--row-hover);
}

/* ---- module grid (home) ---- */

/* ---- employee drawer ---- */
.hr-drawer {
  width: min(28rem, 100vw);
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  max-height: 100vh;
  background: var(--card);
  color: var(--ink);
}
.hr-drawer.offcanvas-end { right: 0; }
.hr-drawer .offcanvas-header,
.hr-drawer .offcanvas-body { background: var(--card); color: var(--ink); }
.hr-drawer .offcanvas-header { border-bottom: 1px solid var(--line); }
html.hr-night .btn-close { filter: invert(1) grayscale(1); opacity: .7; }
.drawer-dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.35rem 0.75rem; }
.drawer-dl dt { color: var(--muted); font-weight: 500; }
.drawer-dl dd { margin: 0; font-weight: 550; }

/* ---- command palette ---- */
.cmdk {
  position: fixed;
  inset: 0;
  background: var(--cmdk-dim);
  z-index: 1080;
  display: flex;
  justify-content: center;
  padding: 12vh 1rem 1rem;
}
.cmdk-panel {
  width: min(36rem, 100%);
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 44px rgba(15, 23, 41, 0.18);
  overflow: hidden;
  color: var(--ink);
}
.cmdk-panel input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
  font-weight: 500;
  font-size: 1rem;
  background: var(--card);
  color: var(--ink-strong);
}
.cmdk-panel input:focus { outline: none; }
.cmdk-panel ul { list-style: none; margin: 0; padding: 0.35rem 0; max-height: 22rem; overflow: auto; }
.cmdk-panel li button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 1rem;
  font-weight: 450;
  color: var(--ink);
}
.cmdk-panel li button:hover,
.cmdk-panel li button.on { background: var(--cmdk-hover); }
.cmdk-g {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0.4rem 1rem 0.15rem;
  font-weight: 650;
}
.cmdk-hint { margin: 0; padding: 0.45rem 1rem 0.7rem; color: var(--muted) !important; font-size: 0.82rem; }

.hr-person-pick { position: relative; width: 100%; }
.hr-person-pick-src {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hr-person-pick-list {
  position: fixed;
  z-index: 1085;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 16rem;
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 41, 0.16);
}
.hr-person-pick-list button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 450;
  color: var(--ink);
}
.hr-person-pick-list button:hover,
.hr-person-pick-list button.on { background: var(--cmdk-hover); }
.hr-person-pick-empty {
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---- responsive ---- */
@media (max-width: 991.98px) {
  .hr-sidebar {
    position: fixed;
    z-index: 1045;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(18.5rem, 86vw);
    transform: translateX(-100%);
    transition: transform .18s ease;
    padding: calc(0.7rem + env(safe-area-inset-top)) 0.7rem calc(1rem + env(safe-area-inset-bottom));
  }
  .hr-app.rail .hr-sidebar { width: min(18.5rem, 86vw); }
  .hr-app.rail .hr-nav-text,
  .hr-app.rail .hr-nav-group { display: block; }
  .hr-app.rail .hr-nav-link { justify-content: flex-start; padding: 0.7rem 0.75rem; }
  .hr-app.nav-open .hr-sidebar { transform: none; }
  .hr-app.nav-open { overflow: hidden; }
  .hr-app.nav-open .hr-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--cmdk-dim);
    z-index: 1040;
  }
  .hr-nav-link {
    min-height: 2.75rem;
    padding: 0.7rem 0.75rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }
  .hr-side-foot {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  .hr-side-foot .hr-theme {
    width: 100%;
    max-width: none;
    background: var(--sidebar-hover);
    color: var(--sidebar-ink);
    border-color: rgba(255,255,255,0.16);
  }
  .hr-side-who {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0 0.15rem 0.15rem;
    color: var(--sidebar-ink);
  }
  .hr-side-who strong { font-size: 0.9rem; font-weight: 650; }
  .hr-side-who span { font-size: 0.75rem; color: var(--sidebar-muted); }
  .hr-side-reset {
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: var(--sidebar-ink);
    border-radius: 8px;
    min-height: 2.5rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.86rem;
    font-weight: 550;
    text-align: left;
  }
  .hr-side-reset:hover { background: var(--sidebar-hover); color: #fff; }
  .hr-top {
    min-height: 48px;
    padding: 0 0.6rem;
    padding-top: env(safe-area-inset-top);
    min-height: calc(48px + env(safe-area-inset-top));
    gap: 0.4rem;
  }
  .hr-top-start { gap: 0.4rem; }
  .hr-top-end { gap: 0.35rem; }
  .hr-bc {
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hr-bc span:first-child,
  .hr-bc .sep { display: none; }
  .hr-bc strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hr-search {
    flex: 0 0 auto;
    max-width: none;
    margin-left: 0;
    padding: 0.4rem 0.7rem;
    min-height: 2.2rem;
  }
  .hr-search-wide { display: none; }
  .hr-search-narrow { display: inline; }
  .hr-search kbd { display: none; }
  .hr-reset-screen,
  .hr-top-end .hr-theme,
  .hr-top-end .hr-dev-hints-btn,
  .hr-avatar { display: none !important; }
  .hr-sign-out {
    min-height: 2.2rem;
    padding: 0.3rem 0.6rem;
  }
  .hr-mod-tabs {
    top: calc(48px + env(safe-area-inset-top));
    padding: 0.4rem 0.65rem 0.5rem;
    gap: 0.35rem;
    background: var(--paper);
    border-bottom-color: var(--line);
  }
  .hr-mod-tab {
    padding: 0.38rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: 0.8rem;
    font-weight: 550;
    scroll-snap-align: start;
    border-bottom: 1px solid var(--line);
  }
  .hr-mod-tab:hover {
    border-bottom-color: var(--line-strong);
  }
  .hr-mod-tab.on {
    background: var(--accent);
    color: var(--on-accent) !important;
    border-color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .hr-mod-tabs {
    scroll-snap-type: x mandatory;
  }
  .leave-sub {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem !important;
  }
  .leave-sub::-webkit-scrollbar { display: none; }
  .leave-sub .btn {
    flex-shrink: 0;
    padding: 0.38rem 0.8rem !important;
    border: 1px solid var(--line) !important;
    border-radius: 999px !important;
    border-bottom: 1px solid var(--line) !important;
    background: var(--card) !important;
    margin: 0 !important;
  }
  .leave-sub .btn.active,
  .leave-sub .btn[aria-current="page"] {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
    border-color: var(--accent) !important;
  }
  .hr-body { padding: 0.9rem 0.75rem 1.25rem; }
}

@media (max-width: 991.98px) {
  .hr-body {
    padding: 0.7rem 0.65rem calc(1.1rem + env(safe-area-inset-bottom));
  }
  .hr-body:has(.emp-form) { padding-top: 0.5rem; }
  .hr-body > .page-head,
  .hr-body > h1 { display: none; }
  .page-head { gap: 0.35rem; }
  .page-head h1, h1.h3 { font-size: 1.2rem; }
  .hr-body > p.text-muted:not(.small),
  .page-head + p.text-muted,
  .hr-body > h1 + p.text-muted,
  .emp-lead,
  .desk-note,
  .desk-wide { display: none !important; }
  .page-toolbar .form-label,
  .punch-bar .form-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .page-toolbar,
  .page-toolbar.row,
  .page-toolbar[class*="row"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.35rem;
    overflow: visible;
    padding: 0.3rem 0.4rem;
    margin-bottom: 0.45rem;
  }
  .page-toolbar > [class*="col-"],
  .page-toolbar > .hr-grow,
  .page-toolbar > .hr-field,
  .page-toolbar > .form-select,
  .page-toolbar > .form-check {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
  }
  .page-toolbar > [class*="col-"]:has(select[name="trust"]),
  .page-toolbar > [class*="col-"]:has(select[name="personId"]),
  .page-toolbar > [class*="col-"]:has(select[name="PersonId"]),
  .page-toolbar > [class*="col-"]:has(.hr-person-pick) {
    flex: 1 1 100%;
  }
  .page-toolbar > [class*="col-"]:has(select[name="trust"]) .form-select,
  .page-toolbar > [class*="col-"]:has(select[name="personId"]) .form-select,
  .page-toolbar > [class*="col-"]:has(select[name="PersonId"]) .form-select,
  .page-toolbar > [class*="col-"]:has(.hr-person-pick),
  .page-toolbar > [class*="col-"]:has(.hr-person-pick) .form-control {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .page-toolbar > .hr-grow { flex: 1 1 8rem; min-width: 7rem; }
  .page-toolbar .form-label { white-space: nowrap; }
  .page-toolbar .form-control,
  .page-toolbar .form-select,
  .page-toolbar .hr-grow .form-control,
  .page-toolbar .hr-field .form-control,
  .page-toolbar .hr-person-pick .form-control {
    min-width: 0;
    height: 2.2rem;
    min-height: 2.2rem;
    font-size: 16px;
  }
  .page-toolbar .form-control[type="date"] {
    width: 7rem;
    min-width: 6.5rem;
    max-width: 7.6rem;
  }
  .page-toolbar .form-control[type="number"],
  .page-toolbar .form-control[name="year"],
  .page-toolbar .form-control[name="Year"] {
    width: 3.4rem;
    min-width: 3.4rem;
    max-width: 3.6rem;
    padding-left: 0.3rem;
    padding-right: 0.2rem;
    appearance: textfield;
    -moz-appearance: textfield;
  }
  .page-toolbar .form-control[name="year"]::-webkit-inner-spin-button,
  .page-toolbar .form-control[name="year"]::-webkit-outer-spin-button,
  .page-toolbar .form-control[name="Year"]::-webkit-inner-spin-button,
  .page-toolbar .form-control[name="Year"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .page-toolbar > [class*="col-"]:has(select[name="month"]) {
    flex: 0 0 auto;
    width: auto !important;
  }
  .page-toolbar select[name="month"] {
    width: 5.1rem;
    min-width: 0;
    max-width: 5.2rem;
    padding-left: 0.35rem;
    padding-right: 1.15rem;
  }
  .page-toolbar .form-control[type="search"],
  .page-toolbar input[name="q"] {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .page-toolbar > [class*="col-"]:has(> input[data-att-find]),
  .page-toolbar > .col-md-3:has(> input[data-att-find]) {
    flex: 1 1 8.5rem;
    min-width: 6.5rem;
  }
  .page-toolbar > [class*="col-"]:has(select[name="filter"]) {
    flex: 1 1 7.5rem;
    min-width: 0;
  }
  .page-toolbar select[name="filter"] {
    width: 100%;
    min-width: 0;
  }
  .page-toolbar > [class*="col-"]:has(> .btn),
  .page-toolbar > [class*="col-"]:has(> button),
  .page-toolbar > [class*="col-"]:has(> a.btn),
  .page-toolbar > [class*="text-md-end"],
  .page-toolbar > button,
  .page-toolbar > .btn {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0;
    align-items: center;
  }
  .page-toolbar .btn,
  .page-toolbar button[type="submit"],
  .page-toolbar a.btn {
    height: 2.2rem;
    min-height: 2.2rem;
    width: auto !important;
    padding: 0 0.7rem;
    flex: 0 0 auto;
    align-self: center;
  }
  .page-toolbar a.btn[href*="Export"],
  .page-toolbar a.btn[href*="export"] { display: none !important; }
  .punch-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow: hidden;
    gap: 0.3rem;
    padding: 0.3rem 0.4rem;
    margin-bottom: 0.45rem;
  }
  .punch-bar-form {
    display: contents;
  }
  #pullForm .punch-bar-field,
  .punch-bar-saved { display: none !important; }
  .punch-bar-field,
  .punch-bar .col-md-3 {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    width: auto;
    min-width: 0;
  }
  .punch-bar .col-md-3 {
    flex: 1 1 6rem;
    min-width: 5rem;
  }
  .punch-bar .form-control,
  .punch-bar .form-control[type="search"] {
    height: 2.2rem;
    min-height: 2.2rem;
    font-size: 16px;
  }
  .punch-bar .form-control[type="date"] {
    width: 7.4rem;
    min-width: 6.8rem;
  }
  .punch-bar .form-control[type="search"] { width: 100%; }
  .punch-bar .btn,
  .punch-bar button[type="submit"] {
    flex: 0 0 auto;
    width: auto !important;
    height: 2.2rem;
    min-height: 2.2rem;
    align-self: center;
    grid-column: auto;
  }
  .form-control, .form-select, .emp-form .form-control, .emp-form .form-select {
    font-size: 16px;
    min-height: 2.35rem;
  }
  .card-hr { padding: 0.65rem 0.7rem; }
  .kpi-strip {
    gap: 0.35rem;
    margin: 0.2rem 0 0.45rem;
  }
  .kpi-chip {
    flex: 1 1 calc(33.33% - 0.35rem);
    max-width: none;
    padding: 0.3rem 0.45rem 0.3rem 0.55rem;
  }
  .kpi-chip .lbl { font-size: 0.58rem; }
  .kpi-chip .val { font-size: 1.05rem; margin-top: 0; }
  .kpi-strip-sm {
    gap: 0.7rem;
    margin: 0 0 0.3rem;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .kpi-strip-sm .kpi-chip,
  .kpi-strip-sm .kpi-chip-live {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
  }
  .kpi-strip-sm .kpi-chip::before { display: none; }
  .kpi-strip-sm .kpi-chip .lbl {
    display: inline;
    margin-right: 0.2rem;
  }
  .kpi-strip-sm .kpi-chip .val {
    display: inline;
    font-size: 0.95rem;
    white-space: nowrap;
  }
  .grid-fill, .shift-grid, .shift-grid-fill {
    min-height: 0;
  }
  .grid-fill:has(> table.hr-m-cards),
  .shift-grid:has(> table.hr-m-cards),
  .shift-grid-fill:has(> table.hr-m-cards),
  .sheet-wrap:has(> table.hr-m-cards) {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  table.hr-m-cards,
  table.hr-m-cards tbody,
  table.hr-m-cards tr {
    display: block;
    width: 100%;
  }
  table.hr-m-cards thead { display: none; }
  table.hr-m-cards tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.45rem;
    row-gap: 0.08rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    margin: 0;
    padding: 0.38rem 0.1rem 0.36rem;
  }
  table.hr-m-cards tbody td {
    display: inline;
    border: 0;
    padding: 0;
    white-space: normal;
    min-width: 0 !important;
    width: auto;
    text-align: left;
    color: var(--muted);
    font-size: 0.8rem;
  }
  table.hr-m-cards tbody td::before { display: none; }
  table.hr-m-cards tbody td.hr-m-title {
    flex: 1 1 7.5rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-strong);
    font-size: 0.92rem;
    font-weight: 650;
    padding: 0;
    margin: 0;
    border: 0;
  }
  table.hr-m-cards tbody td.hr-m-title .person-open {
    font-weight: inherit;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
  }
  table.hr-m-cards tbody td.hr-m-flag {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--ink-strong);
    font-size: 0.85rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
  }
  table.hr-m-cards tbody td.hr-m-qty {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  table.hr-m-cards tbody td.hr-m-qty::before {
    content: attr(data-label) " ";
    display: inline;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  table.hr-m-cards tbody td.hr-m-title::before,
  table.hr-m-cards tbody td.hr-m-actions::before,
  table.hr-m-cards tbody td.hr-m-skip::before,
  table.hr-m-cards tbody td.hr-m-flag::before,
  table.hr-m-cards tbody tr.hr-m-empty td::before { display: none; }
  table.hr-m-cards tbody td.hr-m-skip { display: none !important; }
  table.hr-m-cards tbody td.hr-m-actions,
  table.hr-m-cards tbody tr.hr-m-empty td {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    gap: 0.3rem;
    padding-top: 0.2rem;
    color: var(--ink-strong);
    font-size: 0.86rem;
  }
  table.hr-m-cards tbody td.hr-m-actions .btn,
  table.hr-m-cards tbody td.hr-m-actions .form-select {
    min-height: 2.1rem;
  }
  table.hr-m-cards tbody tr.hr-m-child {
    margin-left: 0.45rem;
    background: var(--grp-bg);
  }
  table.hr-m-cards.table-hover-actions td:last-child { min-width: 0; }
  #punchTable.hr-m-cards tbody tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    column-gap: 0.5rem !important;
    row-gap: 0 !important;
    flex-wrap: nowrap !important;
    padding: 0.34rem 0.08rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #punchTable.hr-m-cards tbody td[data-label="Time"] {
    grid-column: 2 !important;
    grid-row: 1 !important;
    color: var(--muted) !important;
    font-size: 0.82rem !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
  }
  #punchTable.hr-m-cards tbody td[data-label="In/Out"],
  #punchTable.hr-m-cards tbody td.hr-m-flag {
    grid-column: 3 !important;
    grid-row: 1 !important;
    margin-left: 0 !important;
  }
  #punchTable.hr-m-cards tbody td.hr-m-title {
    grid-column: 1 !important;
    grid-row: 1 !important;
    flex: none !important;
  }
  #punchTable.hr-m-cards tbody td[data-label="Device"],
  #punchTable.hr-m-cards tbody td[data-label="IP"] { display: none !important; }
  #punchTable.hr-m-cards tbody tr:not(.table-warning) td[data-label="Machine ID"] {
    display: none !important;
  }
  #punchTable.hr-m-cards tbody tr.table-warning td[data-label="Machine ID"] {
    grid-column: 1 / -1;
    grid-row: 2;
    color: var(--muted);
    font-size: 0.75rem;
  }
  #punchTable.hr-m-cards tbody tr.hr-m-empty td {
    grid-column: 1 / -1;
  }
  table.hr-m-cards tbody tr[hidden],
  table.hr-m-cards tbody tr.hr-find-hide,
  #punchTable.hr-m-cards tbody tr[hidden],
  #punchTable.hr-m-cards tbody tr.hr-find-hide {
    display: none !important;
  }
  table.hr-m-cards tbody td.hr-m-actions,
  table.hr-m-cards tbody tr.hr-m-empty td {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
    gap: 0.3rem;
    padding-top: 0.15rem;
    color: var(--ink-strong);
    font-size: 0.86rem;
  }
  table.hr-m-cards tbody td.hr-m-actions .btn,
  table.hr-m-cards tbody td.hr-m-actions .form-select {
    min-height: 2.1rem;
  }
  table.hr-m-cards tbody tr.hr-m-child {
    margin-left: 0.45rem;
    background: var(--grp-bg);
  }
  table.hr-m-cards.table-hover-actions td:last-child { min-width: 0; }
  .table-hover-actions td:last-child { min-width: 0; }
  .pay-sheet-wrap, .sheet-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .pay-sheet { font-size: 12px; }
  .pay-sheet .pay-cell {
    min-width: 3.6rem;
    width: 4.4rem;
  }
  .cmdk { padding: 8vh 0.55rem 0.55rem; align-items: flex-start; }
  .cmdk-panel input { font-size: 16px; }
  .login-shell { padding: 1rem 0.7rem; align-items: flex-start; padding-top: 12vh; }
  .login-card { padding: 1.2rem 1rem 1.1rem; }
  .drawer-dl { grid-template-columns: 6.2rem 1fr; }
  .hr-body > p.small.text-muted {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.35rem;
  }
  table.hr-m-cards tbody tr.table-warning {
    --bs-table-bg: transparent;
    background-color: transparent !important;
    box-shadow: inset 3px 0 0 #e6a23c;
  }
  table.sheet-table.hr-m-cards tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.4rem;
    row-gap: 0.08rem;
  }
  table.sheet-table.hr-m-cards tbody td.hr-m-title {
    flex: 1 1 7rem;
    max-width: calc(100% - 4.4rem);
    order: 1;
  }
  table.sheet-day-emp.hr-m-cards tbody td.hr-m-title {
    flex: 0 0 7.2rem;
    max-width: 7.2rem;
  }
  table.sheet-day-who.hr-m-cards tbody td.hr-m-title {
    flex: 1 1 calc(100% - 4.5rem);
    max-width: calc(100% - 4.5rem);
  }
  table.sheet-table.hr-m-cards tbody td.hr-m-flag {
    flex: 0 0 auto;
    margin-left: auto;
    order: 2;
  }
  table.sheet-day-emp.hr-m-cards tbody td.hr-m-flag { order: 3; }
  table.sheet-table.hr-m-cards tbody td.hr-m-times {
    flex: 0 0 auto;
    order: 3;
    display: inline;
    margin-right: 0.15rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: inherit;
    white-space: nowrap;
  }
  table.sheet-day-emp.hr-m-cards tbody td.hr-m-times { order: 2; }
  table.sheet-table.hr-m-cards tbody td.hr-m-breaks {
    flex: 1 1 100%;
    order: 4;
    font-size: 0.75rem;
    line-height: 1.3;
  }
  table.sheet-table.hr-m-cards tbody td.hr-m-breaks .brk-line {
    display: inline;
    margin-right: 0.4rem;
  }
  #dutyTable.hr-m-cards tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 0.4rem;
    row-gap: 0.12rem;
    padding: 0.42rem 0.15rem 0.4rem 0.45rem;
  }
  #dutyTable.hr-m-cards tbody td.hr-m-title {
    grid-column: 1;
    grid-row: 1;
    flex: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  #dutyTable.hr-m-cards tbody td.hr-m-title br { display: none; }
  #dutyTable.hr-m-cards tbody td.hr-m-title .small {
    display: inline;
    font-weight: 400;
    margin-left: 0.35rem;
  }
  #dutyTable.hr-m-cards tbody td[data-label="Sessions"] {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--ink-strong);
  }
  #dutyTable.hr-m-cards tbody td[data-label="Sessions"] > div { display: inline; margin-right: 0.5rem; }
  #dutyTable.hr-m-cards tbody td[data-label="Flags"] {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.76rem;
    color: #8a5a00;
    line-height: 1.3;
  }
  #dutyTable.hr-m-cards tbody td.hr-m-actions {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: auto;
    padding: 0;
    justify-content: flex-end;
  }
  #dutyTable.hr-m-cards tbody td.hr-m-actions .btn {
    min-height: 1.85rem;
    font-size: 0.75rem;
    padding: 0 0.55rem;
  }
  #dutyTable.hr-m-cards tbody tr.hr-m-child {
    margin-left: 0;
    padding-left: 0.7rem;
    background: transparent;
  }
  #dutyTable.hr-m-cards tbody tr.hr-m-child td {
    font-size: 0.78rem;
  }
  #dutyTable.hr-m-cards tbody tr.hr-m-child td.hr-m-actions {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    padding-top: 0;
    width: auto;
  }
  #dutyTable.hr-m-cards tbody tr.hr-m-child .form-select {
    min-height: 1.85rem;
    font-size: 0.78rem;
    width: auto;
  }
  .shift-win { flex: 1 1 100%; }
  .shift-win .form-control[type="time"] { max-width: none; }
  .shift-dates .form-control[type="date"],
  .shift-dates .form-select,
  .shift-dates .shift-kind {
    flex: 1 1 7rem;
    width: auto;
    max-width: none;
  }
  .shift-save {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--paper);
    padding: 0.4rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  }
  .shift-entry { padding: 0.5rem 0.55rem; gap: 0.4rem; }
  #shift-edit.card-hr { padding: 0.55rem 0.6rem; }
  .shift-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shift-presets::-webkit-scrollbar { display: none; }
}

/* ================================================================
   Wide attendance / salary sheets (unchanged structure)
   ================================================================ */

.sheet-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 14px;
  margin: 0;
}
.sheet-table th, .sheet-table td {
  border: 1px solid var(--sheet-line);
  padding: 4px 8px;
  white-space: nowrap;
  background: var(--card);
  color: var(--ink-strong);
}
.sheet-table thead th {
  background: var(--thead);
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
/* Punch-in vs scheduled start (rule 4) */
.sheet-table td.pi-early, span.pi-early { color: #1e7d32; font-weight: 600; }
.sheet-table td.pi-late,  span.pi-late  { color: #c25e00; font-weight: 600; }
.sheet-table td.pi-vlate, span.pi-vlate { color: #b00020; font-weight: 600; }
.sheet-table td.pi-admin, span.pi-admin { color: #6b21a8; font-weight: 600; }
html.hr-night .sheet-table td.pi-early, html.hr-night span.pi-early { color: #6cc47a; }
html.hr-night .sheet-table td.pi-late,  html.hr-night span.pi-late  { color: #e0913f; }
html.hr-night .sheet-table td.pi-vlate, html.hr-night span.pi-vlate { color: #e2686b; }
html.hr-night .sheet-table td.pi-admin, html.hr-night span.pi-admin { color: #c084fc; }
.sheet-table td.sheet-duty-ok, span.sheet-duty-ok {
  background: #e7f6ea;
  color: #1e7d32;
  font-weight: 600;
}
.sheet-table td.sheet-duty-wait, span.sheet-duty-wait {
  background: #fff4d6;
  color: #8a5a00;
  font-weight: 600;
}
.sheet-table td.sheet-duty-personal, span.sheet-duty-personal {
  background: #e8eef9;
  color: #1e3a8a;
  font-weight: 600;
}
.sheet-table td.sheet-leave, span.sheet-leave {
  background: #e6f4f1;
  color: #0f5c4c;
  font-weight: 600;
}
tr.duty-leave > td {
  background: #e6f4f1;
}
tr.duty-leave > td:first-child {
  box-shadow: inset 3px 0 0 #3d8a7a;
}
html.hr-night .sheet-table td.sheet-duty-ok, html.hr-night span.sheet-duty-ok {
  background: #1a3a22;
  color: #6cc47a;
}
html.hr-night .sheet-table td.sheet-duty-wait, html.hr-night span.sheet-duty-wait {
  background: #3a2e12;
  color: #e0913f;
}
html.hr-night .sheet-table td.sheet-duty-personal, html.hr-night span.sheet-duty-personal {
  background: #1c2744;
  color: #93c5fd;
}
html.hr-night .sheet-table td.sheet-leave, html.hr-night span.sheet-leave {
  background: #12352e;
  color: #5eead4;
}
html.hr-night tr.duty-leave > td {
  background: #12352e;
}
.sheet-month-wrap {
  --sheet-code-w: 9.75rem;
  --sheet-name-w: 14rem;
  --sheet-head-1: 2.125rem;
  display: flex;
  overflow: hidden;
}
.sheet-month-wrap[data-grid-fill] { overflow: hidden; }
.sheet-pin,
.sheet-days { min-height: 0; height: 100%; }
.sheet-pin {
  flex: 0 0 auto;
  overflow: hidden;
  z-index: 2;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.12);
}
.sheet-days {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
}
.sheet-month-pin,
.sheet-month-days {
  border-collapse: separate;
  border-spacing: 0;
}
.sheet-table.sheet-month-days {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}
.sheet-month-pin th,
.sheet-month-pin td,
.sheet-month-days th,
.sheet-month-days td { box-sizing: border-box; }
.sheet-table.sheet-month-pin thead tr:nth-child(2) th,
.sheet-table.sheet-month-days thead tr:nth-child(2) th {
  top: var(--sheet-head-1);
  z-index: 3;
}
.sheet-month-days td { text-align: center; }
.sheet-month-wrap .sheet-code,
.sheet-month-wrap .sheet-name {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-month-wrap .sheet-code {
  width: var(--sheet-code-w);
  min-width: var(--sheet-code-w);
  max-width: var(--sheet-code-w);
}
.sheet-month-wrap .sheet-name {
  width: var(--sheet-name-w);
  min-width: var(--sheet-name-w);
  max-width: var(--sheet-name-w);
}
.sheet-month-pin thead th,
.sheet-month-days thead th { background: var(--thead); }
.sheet-month-days thead tr:last-child th,
.sheet-month-days tbody td {
  min-width: 0;
  width: auto;
  padding: 2px 1px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 991.98px) {
  .sheet-month-wrap {
    --sheet-code-w: 0px;
    --sheet-name-w: 6.25rem;
  }
  .sheet-month-wrap .sheet-code { display: none !important; }
  .sheet-pin {
    flex: 0 0 var(--sheet-name-w);
    width: var(--sheet-name-w);
    max-width: 38vw;
  }
  .sheet-table.sheet-month-pin {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
  }
  .sheet-table.sheet-month-days {
    width: max-content;
    min-width: max-content;
    table-layout: fixed;
  }
  .sheet-month-days thead tr:last-child th,
  .sheet-month-days tbody td {
    min-width: 2.05rem;
    width: 2.05rem;
    padding: 2px 0;
    font-size: 11px;
  }
  .sheet-days {
    min-width: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.sheet-table td.sheet-breaks {
  text-align: left;
  min-width: 16rem;
  white-space: normal;
  vertical-align: top;
}
.sheet-table .brk-line {
  display: block;
  line-height: 1.35;
}

.pay-sheet-wrap { overflow: auto; }
.pay-sheet { --bs-table-bg: transparent; }
.pay-sheet th,
.pay-sheet td { vertical-align: middle; }
.pay-sheet .pay-cell {
  min-width: 4.6rem;
  width: 5.4rem;
  padding: 0.12rem 0.28rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pay-sheet input[type="date"].pay-cell,
.pay-sheet .pay-text {
  text-align: left;
  font-variant-numeric: normal;
}
.pay-sheet thead th {
  text-transform: none;
  letter-spacing: 0;
}
.pay-sheet thead th.num,
.pay-sheet tbody td.num,
.pay-sheet tbody td.text-end {
  text-align: right !important;
  white-space: nowrap;
  width: 1%;
}
.pay-sheet tbody td:has(> .pay-cell:not(.pay-text):not([type="date"])) {
  text-align: right !important;
  white-space: nowrap;
  width: 1%;
}
.pay-sheet thead th.pay-head-allow { min-width: 7.4rem; }
.pay-sheet .pay-cell:not(.pay-text):not([type="date"]) {
  display: block;
  margin-left: auto;
}
.num,
input.form-control.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pin, .tel,
input.form-control.pin,
input.form-control.tel { text-align: left; }
.pay-sheet input[type="date"].pay-cell {
  min-width: 8.6rem;
  width: 9.2rem;
}
.pay-sheet .pay-name {
  min-width: 11rem;
  max-width: 16rem;
  white-space: normal;
}
.pay-id { font-variant-numeric: tabular-nums; }
.pay-sheet .pay-cell[readonly] {
  background: var(--bs-secondary-bg, #f3f4f6);
  border-color: transparent;
  pointer-events: none;
}
tr.grid-row-on > td,
tr.grid-row-on > th {
  background: var(--grid-row-on) !important;
}
tr.grid-row-on > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
tr.grid-row-on .pay-name {
  font-weight: 700;
}
.pay-grid-form .emp-form-actions { margin-top: 0.75rem; }

.sal-sum-banner {
  background: #fff9c4;
  color: #3c3c3c;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  margin-bottom: 0.35rem;
  border-radius: 4px;
}
html.hr-night .sal-sum-banner {
  background: #4a4318;
  color: #fff6b0;
}
.sal-sum-layout {
  display: flex;
  min-height: 14rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.sal-sum-emps {
  width: 10rem;
  flex-shrink: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--card);
}
.sal-sum-emps .on td { background: var(--thead); font-weight: 600; }
.sal-sum-emp { color: inherit; text-decoration: none; display: block; }
.sal-sum-emp:hover { text-decoration: underline; }
.sal-sum-grid { flex: 1; min-width: 0; overflow: auto; }
.sal-sum-grid thead th { cursor: pointer; padding: 0; }
.sal-sum-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--thead); }
.sal-sum-grid td.sal-pin { position: sticky; z-index: 1; white-space: nowrap; }
.sal-sum-grid tr:not(.sal-sum-total) > td.sal-pin { background: var(--card); }
.sal-sum-grid thead th.sal-pin { z-index: 3; }
.sal-sum-split { position: sticky; left: 0; max-width: 100%; padding: 0 0.6rem 0.8rem; }
.sal-sum-grid .sal-pin-last { box-shadow: inset -2px 0 0 var(--line-strong); }
.sal-sum-grid thead th a.sal-sum-sort {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}
.sal-sum-grid thead th a.sal-sum-sort:hover { text-decoration: underline; }
.sal-sum-dir { font-size: 0.7em; }
.sal-sum-total td {
  font-weight: 700;
  background: #fff3b0;
  color: #1e3a8a;
}
html.hr-night .sal-sum-total td {
  background: #3d3510;
  color: #c7d2fe;
}
.sal-sum-col-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  max-width: 72rem;
}
.sal-sum-col-item {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.12rem 0.3rem 0.12rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}
.sal-sum-col-item .form-check { min-height: 0; }
.sal-sum-col-grip {
  cursor: grab;
  color: var(--muted);
  user-select: none;
  letter-spacing: -0.15em;
  padding: 0 0.15rem;
  font-size: 0.85rem;
  line-height: 1;
}
.sal-sum-col-item[data-fixed="1"] .sal-sum-col-grip { cursor: default; opacity: 0.35; }
.sal-sum-col-item.sal-sum-col-dragging { opacity: 0.55; }
.sal-sum-col-item.sal-sum-col-over { outline: 2px solid var(--accent); }
.sal-sum-col-move {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0.12rem;
  line-height: 1;
  cursor: pointer;
  font-size: 0.7rem;
}
.sal-sum-col-move:hover { color: var(--ink-strong); }
.sal-sum-cols details { margin-bottom: 0.35rem; }
.sal-sum-cols summary { cursor: pointer; font-weight: 600; }

.leave-approve {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 26rem);
  gap: 1rem;
  align-items: start;
}
.leave-approve .grid-fill { min-width: 0; }
.leave-approve tr.is-open > td { background: var(--msg-bg); }
.leave-open-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}
.leave-open-link:hover { color: var(--link-hover); text-decoration: underline; }
.leave-detail { min-width: 0; }
.leave-detail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem 1.1rem;
}
.leave-detail-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.2;
}
.leave-detail-code { color: var(--muted); margin-top: 0.1rem; }
.leave-trust-chip {
  display: inline-block;
  margin-top: 0.4rem;
  background: var(--msg-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.leave-detail-rule {
  height: 1px;
  background: var(--line);
  margin: 0.85rem 0 0.65rem;
}
.leave-detail-type-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.leave-detail-type {
  flex: 1;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
}
.leave-detail-days { font-weight: 700; }
.leave-detail-dates { margin-top: 0.25rem; }
.leave-festivals {
  margin-top: 0.75rem;
  background: var(--paper);
  border-radius: 8px;
  padding: 0.5rem 0.65rem 0.55rem;
}
.leave-kicker {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.leave-commitments {
  margin-top: 0.25rem;
  white-space: pre-line;
  line-height: 1.45;
}
.leave-block { margin-top: 0.75rem; }
.leave-remain {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  column-gap: 0.75rem;
  row-gap: 0.2rem;
  margin-top: 0.35rem;
}
.leave-remain span:nth-child(odd) { color: var(--muted); }
.leave-remain span:nth-child(even) { font-weight: 700; }
.leave-duty { margin-top: 0.65rem; color: var(--muted); font-size: 0.9rem; }
.leave-status-note { margin-top: 0.85rem; font-weight: 600; }
.leave-act { margin-top: 0.75rem; }
.leave-revise {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.7rem 0.55rem;
}
.leave-revise summary { cursor: pointer; font-weight: 600; }
.leave-revise-form { margin-top: 0.55rem; }
.leave-revise-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.leave-decline {
  width: 100%;
  color: #b42318 !important;
  font-weight: 700;
  text-decoration: none;
}
@media (max-width: 900px) {
  .leave-approve { grid-template-columns: 1fr; }
}

/* ---- home dashboard ---- */
.dash {
  --tone-ok: #2f7d4f;
  --tone-warn: #b26a00;
  --tone-bad: #b42318;
  --tone-info: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.4rem;
}
html.hr-night .dash {
  --tone-ok: #6fcf97;
  --tone-warn: #f2b25c;
  --tone-bad: #ff8a80;
}
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem 1.5rem;
  flex-wrap: wrap;
}
.dash-hello {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.dash-title {
  margin: 0.1rem 0 0;
  font-size: 1.5rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  line-height: 1.2;
}
.dash-filter { display: flex; gap: 0.55rem; align-items: flex-end; flex-wrap: wrap; }
.dash-filter label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; min-width: 11rem; }
.dash-filter label span,
.dash-sub,
.dash-kpi .lbl,
.dash-todo-item .k {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* needs attention */
.dash-todo {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
}
.dash-todo-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem 0.8rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone, var(--line-strong));
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.dash-todo-item:hover { background: var(--row-hover); text-decoration: none; color: inherit; }
.dash-todo-item.tone-ok { --tone: var(--tone-ok); }
.dash-todo-item.tone-warn { --tone: var(--tone-warn); }
.dash-todo-item.tone-bad { --tone: var(--tone-bad); }
.dash-todo-item.tone-info { --tone: var(--tone-info); }
.dash-todo-item .v {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.dash-todo-item.tone-warn .v,
.dash-todo-item.tone-bad .v { color: var(--tone); }
.dash-todo-item .n {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

/* key numbers */
.dash-kpis {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease;
}
.dash-kpi:hover { border-color: var(--accent); text-decoration: none; color: inherit; }
.dash-kpi .val {
  font-size: 1.45rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
}
.dash-kpi .val-muted { color: var(--muted); }
.dash-kpi .hint { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.dash-delta {
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dash-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.dash-kinds b { color: var(--ink-strong); font-weight: 700; font-variant-numeric: tabular-nums; }

/* panels */
.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
}
.dash-stack { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.dash-panel { padding: 1rem 1.1rem 1.1rem; border-radius: 12px; min-width: 0; }
.dash-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.dash-panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink-strong); }
.dash-panel-head span { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-align: right; }
.dash-note { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.dash-sub { margin: 0.9rem 0 0.35rem; }
.dash-sub:first-child { margin-top: 0; }

.dash-bar {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr 6.5rem;
  gap: 0.6rem;
  align-items: center;
  padding: 0.18rem 0;
}
.dash-bar-link { text-decoration: none; color: inherit; border-radius: 6px; padding: 0.22rem 0.2rem; }
.dash-bar-link:hover { text-decoration: none; color: inherit; background: var(--row-hover); }
.dash-bar-l {
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar-l em { font-style: normal; color: var(--muted); font-size: 0.74rem; margin-left: 0.25rem; }
.dash-bar-n {
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
  text-align: right;
  white-space: nowrap;
}
.dash-track {
  display: block;
  height: 0.4rem;
  background: var(--dim-bg);
  border-radius: 99px;
  overflow: hidden;
}
.dash-track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.dash-bar-cut .dash-track i { background: var(--accent-2); }
.dash-bar-cut .dash-bar-n { color: var(--accent-2); }
.dash-bar-stat .dash-track i { background: color-mix(in srgb, var(--accent) 50%, var(--muted)); }

.dash-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.45rem;
  padding: 0.5rem 0 0.1rem;
  border-top: 1px solid var(--line-strong);
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink-strong);
}
.dash-total strong { font-variant-numeric: tabular-nums; font-size: 1rem; }
.dash-total-strong strong { font-size: 1.15rem; color: var(--accent); }
.dash-gap {
  margin: 0.4rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone-warn) 12%, transparent);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.4;
}

.dash-trust {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.4rem;
  margin: 0 -0.4rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.dash-trust + .dash-trust { border-top: 1px solid var(--line); border-radius: 0; }
.dash-trust:hover { background: var(--row-hover); text-decoration: none; color: inherit; }
.dash-trust-top { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; }
.dash-trust-name { font-size: 0.86rem; color: var(--ink-strong); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-trust-top strong { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--ink-strong); white-space: nowrap; }
.dash-trust-sub { font-size: 0.74rem; color: var(--muted); }

.dash-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.7rem; }
.dash-compare div {
  background: var(--dim-bg);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dash-compare span { font-size: 0.72rem; color: var(--muted); }
.dash-compare strong { font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--ink-strong); }
.dash-compare strong.is-over { color: var(--tone-warn); }

.dash-people-list { list-style: none; margin: 0; padding: 0; }
.dash-people-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.84rem;
}
.dash-people-list li + li { border-top: 1px solid var(--line); }
.dash-people-list a { color: var(--ink-strong); font-weight: 600; }
.dash-people-list .why { color: var(--muted); font-size: 0.76rem; text-align: right; }

/* last 12 months */
.dash-trend {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  padding: 0.2rem 0.1rem 0;
}
.dash-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0 0.2rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.dash-col:hover { background: var(--row-hover); text-decoration: none; color: inherit; }
.dash-col.on { background: var(--active-bg); }
.dash-col-v { font-size: 0.7rem; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-col-bars {
  position: relative;
  width: 100%;
  max-width: 2.2rem;
  height: 7.5rem;
  border-bottom: 1px solid var(--line-strong);
}
.dash-col-bars i { position: absolute; bottom: 0; border-radius: 4px 4px 0 0; }
.dash-col-bars i.g { left: 8%; right: 8%; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.dash-col-bars i.n { left: 30%; right: 30%; background: var(--accent); }
.dash-col.on .dash-col-v { color: var(--accent); }
.dash-col-l { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.dash-col.on .dash-col-l { color: var(--ink-strong); font-weight: 650; }
.dash-legend {
  margin: 0.6rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dash-legend span { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; }
.dash-legend span.g { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.dash-legend span.n { background: var(--accent); }

@media (max-width: 1400px) {
  .dash-todo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .dash-title { font-size: 1.25rem; }
  .dash-todo, .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-kpi .val { font-size: 1.15rem; }
  .dash-bar { grid-template-columns: 1fr auto; gap: 0.25rem 0.6rem; }
  .dash-bar .dash-bar-l { grid-row: 1; grid-column: 1; }
  .dash-bar .dash-bar-n { grid-row: 1; grid-column: 2; }
  .dash-bar .dash-track { grid-row: 2; grid-column: 1 / -1; }
  .dash-trend { overflow-x: auto; }
  .dash-col { flex: 0 0 3.2rem; }
  .dash-col-v { font-size: 0.64rem; }
  .dash-people-list li { flex-direction: column; gap: 0.1rem; }
  .dash-people-list .why { text-align: left; }
}

@media print {
  html, html.hr-night {
    color-scheme: light;
    --ink: #111827;
    --ink-strong: #0f172a;
    --paper: #fff;
    --card: #fff;
    --thead: #f3f3f3;
  }
  .hr-sidebar, .hr-top, .hr-foot, .leave-sub, .hr-mod-tabs, .page-toolbar, .dev-hint, [data-dev-only], .hr-dev-hints-btn { display: none !important; }
  .sheet-wrap, .grid-fill, .shift-grid-fill { border: none; overflow: visible; height: auto !important; }
  .sheet-pin, .sheet-days { overflow: visible !important; height: auto !important; padding-bottom: 0 !important; }
}

/* Unsaved entry brought back on return to a data-entry screen */
.hr-draft-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

/* ---- People: Working / Deactivated / New person ---- */
.pp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.pp-head-title { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.pp-count { color: var(--muted); font-size: 0.86rem; }
.pp-head-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.pp-warn-text { color: var(--accent-2); font-weight: 600; }
.pp-ok-text { color: #2f7d4f; font-size: 0.82rem; }
html.hr-night .pp-ok-text { color: #6fcf97; }

.pp-kinds { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.pp-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.3rem;
  padding: 0 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.pp-kind span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pp-kind:hover { border-color: var(--accent); color: var(--ink-strong); text-decoration: none; }
.pp-kind.on { border-color: var(--accent); background: var(--active-bg); color: var(--ink-strong); font-weight: 650; }

.pp-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.8rem;
}
.pp-search {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0 0.7rem;
  min-height: 2.5rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
}
.pp-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink-strong); outline: none; font: inherit; }
.pp-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 0.18rem var(--accent-glow); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  text-decoration: none;
  cursor: pointer;
}
.pp-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-chip:hover { border-color: var(--accent); text-decoration: none; color: var(--ink-strong); }
.pp-chip.on { border-color: var(--accent); background: var(--active-bg); color: var(--ink-strong); font-weight: 600; }
.pp-chip-warn { border-style: dashed; border-color: var(--accent-2); color: var(--accent-2); }
.pp-chip-warn.on { border-style: solid; background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.pp-group { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--muted); font-size: 0.84rem; }
.pp-group label { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.pp-group .form-select { width: auto; min-width: 9rem; }

.pp-list { padding: 0.5rem 0.7rem 0.7rem; }
.pp-list-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.2rem 0.2rem 0.5rem; font-size: 0.82rem; }
.pp-table { margin: 0; }
.pp-table thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; white-space: nowrap; }
.pp-table tbody tr[data-pp-row], .pp-table tbody tr[data-lf-state] { cursor: pointer; }
.pp-table tbody tr[data-pp-row]:hover > td, .pp-table tbody tr[data-lf-state]:hover > td { background: var(--row-hover); }
.pp-table td { vertical-align: middle; }
.pp-tick { width: 2rem; }
.pp-tick .form-check-input { width: 1.05rem; height: 1.05rem; margin: 0; }
.pp-name { font-weight: 600; }
.pp-name-text { font-weight: 600; color: var(--ink-strong); }
.pp-kn { font-size: 0.78rem; color: var(--muted); line-height: 1.2; }
.pp-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-pill {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--dim-bg);
  color: var(--muted);
}
.pp-pill.ok { background: color-mix(in srgb, #2f7d4f 16%, transparent); color: #2f7d4f; }
.pp-pill.warn { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.pp-pill.bad { background: color-mix(in srgb, #b42318 14%, transparent); color: #b42318; }
html.hr-night .pp-pill.ok { color: #6fcf97; }
html.hr-night .pp-pill.bad { color: #ff8a80; }
.pp-chip-hide { display: none !important; }

.pp-bulk {
  position: sticky;
  bottom: 0.6rem;
  z-index: 20;
  width: fit-content;
  max-width: 100%;
  margin: 0.7rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.45rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.pp-bulk[hidden] { display: none; }

.pp-dialog {
  width: min(44rem, calc(100vw - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  background: var(--card);
  color: var(--ink);
}
.pp-dialog::backdrop { background: rgba(5, 8, 14, 0.6); }
.pp-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
html.hr-night .pp-dialog .btn-close { filter: invert(1); }
.pp-step { margin: 0.6rem 0 0.35rem; font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); display: block; }
.pp-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.pp-preset {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.pp-preset:has(input:checked) { border-color: var(--accent); background: var(--active-bg); }
.pp-preset input { margin-top: 0.2rem; accent-color: var(--accent); }
.pp-preset span { display: flex; flex-direction: column; gap: 0.1rem; }
.pp-preset strong { color: var(--ink-strong); }
.pp-preset small { color: var(--muted); font-size: 0.76rem; }
.pp-custom { margin-top: 0.6rem; }
.pp-custom summary { cursor: pointer; color: var(--link); }
.pp-custom-cols { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; padding: 0.6rem 0.1rem 0; }
.pp-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.3rem; }
.pp-dialog-grid label { margin: 0; }
.pp-dialog-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }

/* person side panel */
.dr-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin-bottom: 0.7rem; }
.dr-actions .btn { min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; }
.dr-missing {
  margin-bottom: 0.8rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  font-size: 0.86rem;
}
.dr-missing strong { color: var(--accent-2); }
.dr-foot { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.dr-foot-title { margin: 0; font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.dr-foot-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dr-deactivate { margin-top: 0.5rem; }

/* deactivated */
.pp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.8rem; }
.pp-tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  font: inherit;
}
button.pp-tile { cursor: pointer; }
button.pp-tile:hover { border-color: var(--accent); }
.pp-tile.warn { border-top: 3px solid var(--accent-2); }
.pp-tile .lbl { font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pp-tile .val { font-size: 1.35rem; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pp-tile.warn .val { color: var(--accent-2); }
.pp-tile .sub { font-size: 0.76rem; color: var(--muted); }
.lf-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; padding: 0.4rem 0.2rem; }
.lf-card-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 1rem; align-items: start; }
.lf-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.lf-form-grid label { margin: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.lf-wide { grid-column: 1 / -1; }
.lf-check-title { margin: 0.9rem 0 0.35rem; font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.lf-checks { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.lf-checks li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.38rem 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.lf-checks li:first-child { border-top: 0; }
.lf-rejoin { align-self: end; }
.lf-rejoin .btn { width: 100%; }

/* new person / edit */
.emp-layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.emp-index {
  position: sticky;
  top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.emp-index:empty { display: none; }
.emp-index a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
}
.emp-index a:hover { background: var(--row-hover); color: var(--ink-strong); text-decoration: none; }
.emp-index-n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.emp-index-n.full { color: #2f7d4f; }
html.hr-night .emp-index-n.full { color: #6fcf97; }
.emp-req { color: #b42318; font-weight: 700; }
html.hr-night .emp-req { color: #ff8a80; }
.emp-dup { border-color: var(--accent-2); }
.emp-dup strong { color: var(--accent-2); }

@media (max-width: 900px) {
  .emp-layout { grid-template-columns: 1fr; }
  .emp-index { position: static; flex-direction: row; flex-wrap: wrap; }
  .lf-card-body { grid-template-columns: 1fr; }
  .pp-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .pp-presets, .pp-dialog-grid, .lf-form-grid { grid-template-columns: 1fr; }
  .pp-tiles { grid-template-columns: 1fr; }
}
.dr-sub { margin: 0 0 0.4rem; font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

/* ---- Attendance screens ---- */
.at-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.6rem 1rem; margin-bottom: 0.5rem; }
.at-purpose { margin: 0.2rem 0 0; max-width: 60rem; color: var(--muted); font-size: 0.92rem; }
.at-head-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.at-dayline { font-weight: 650; color: var(--ink-strong); margin: 0 0 0.6rem; }
.at-step { display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.at-step .form-control, .at-step .form-select { width: auto; }
.at-year { width: 6rem !important; }
.at-month-now { font-weight: 650; min-width: 8rem; text-align: center; }
.at-chips { margin-bottom: 0.7rem; }
.at-legend { display: inline-flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.78rem; color: var(--muted); align-items: center; }
.at-legend > span { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
span.at-key { display: inline-flex; align-items: center; justify-content: center; width: 0.95rem; height: 0.95rem; border-radius: 3px; border: 1px solid var(--line-strong); font-size: 0.7rem; font-weight: 700; }
.at-health {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem;
  padding: 0.6rem 0.85rem; margin-bottom: 0.8rem;
  background: #fff4d6; color: #6b4600; border: 1px solid #f0d58c; border-radius: 10px;
}
html.hr-night .at-health { background: #3a2e12; color: #f2c27a; border-color: #5a4518; }
/* trust picker as one segmented strip */
.at-trusts { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 0.7rem; }
.at-trusts a { padding: 0.4rem 0.9rem; color: inherit; text-decoration: none; border-right: 1px solid var(--line); font-size: 0.9rem; }
.at-trusts a:last-child { border-right: 0; }
.at-trusts a:hover { background: var(--grid-row-on); }
.at-trusts a.on { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.dt-empty { padding: 1.2rem; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); }

/* ---------- Duty register: work list with day bars ---------- */
.dt-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.7rem; }
.dt-tile { display: flex; flex-direction: column; padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; text-decoration: none; }
.dt-tile:hover { border-color: var(--accent); }
.dt-tile .val { font-size: 1.5rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.dt-tile .lbl { font-size: 0.78rem; color: var(--muted); }
.dt-tile.warn { border-color: #e7b54a; background: #fff8e6; }
.dt-tile.warn .val { color: #a35f00; }
.dt-tile.bad .val { color: #b00020; }
.dt-tile.on { outline: 2px solid var(--accent); outline-offset: -1px; }
html.hr-night .dt-tile.warn { background: #33280f; border-color: #6b5320; }
html.hr-night .dt-tile.warn .val { color: #f0a54a; }
html.hr-night .dt-tile.bad .val { color: #f07a7c; }
.dt-tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 0.4rem; }
.dt-narrow { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.dt-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.76rem; color: var(--muted); margin-bottom: 0.5rem; }
.dt-legend > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.dt-legend .k { display: inline-block; width: 1.4rem; height: 0.6rem; border-radius: 3px; }
.dt-legend .k-tick { width: 2px; height: 0.8rem; border-radius: 0; background: var(--ink-strong); }
.k-shift, .tl-shift { background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); box-sizing: border-box; }
.k-work, .tl-work { background: #3d7a52; }
.k-open, .tl-open { background: repeating-linear-gradient(90deg, #3d7a52 0 6px, transparent 6px 10px); }
.k-gap, .tl-gap { background: repeating-linear-gradient(45deg, #e0a020 0 4px, #ffe2a0 4px 8px); }
.k-off, .tl-off { background: #2f9e57; }
.k-per, .tl-per { background: #4a72c8; }
.tl-patrol { background: #c8323a; }
html.hr-night .k-work, html.hr-night .tl-work { background: #5fae7a; }
html.hr-night .k-open, html.hr-night .tl-open { background: repeating-linear-gradient(90deg, #5fae7a 0 6px, transparent 6px 10px); }
.dt-list { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.dt-axis, .dt-main { display: grid; grid-template-columns: 15rem minmax(14rem, 1fr) 17rem 8.5rem; gap: 0 0.9rem; align-items: center; }
.dt-axis { position: sticky; top: 0; z-index: 3; background: var(--thead); border-bottom: 1px solid var(--line-strong); height: 1.9rem; padding: 0 0.8rem; }
.dt-axis .bar { position: relative; height: 100%; }
.dt-axis .tick { position: absolute; top: 0.45rem; transform: translateX(-50%); font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.dt-group > summary { position: sticky; top: 1.9rem; z-index: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; padding: 0.45rem 0.8rem; background: var(--card); border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
.dt-group > summary::-webkit-details-marker { display: none; }
.dt-group > summary::before { content: "▸"; color: var(--muted); }
.dt-group[open] > summary::before { content: "▾"; }
.dt-group > summary .t { font-weight: 700; }
.dt-group > summary .n { font-weight: 700; padding: 0 0.45rem; border-radius: 999px; background: var(--line); font-size: 0.8rem; }
.dt-group > summary .h { color: var(--muted); font-size: 0.8rem; }
.dt-group.g0 > summary { box-shadow: inset 4px 0 0 #e0a020; }
.dt-group.g0 > summary .n { background: #e0a020; color: #fff; }
.dt-group.g2 > summary { box-shadow: inset 4px 0 0 #c8323a; }
.dt-group.g3 > summary { box-shadow: inset 4px 0 0 var(--muted); }
.dt-group.g4 > summary { box-shadow: inset 4px 0 0 #3d8a7a; }
.dt-group.g5 > summary { box-shadow: inset 4px 0 0 #2f9e57; }
.dt-row { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); }
.dt-row:hover { background: var(--grid-row-on); }
.dt-main .who { min-width: 0; display: flex; flex-direction: column; }
.dt-main .who .person-open { text-align: left; font-weight: 650; }
.dt-main .who .sub { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl { position: relative; height: 1.15rem; border-radius: 4px; background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.tl > span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.tl .tl-shift { top: -2px; bottom: -2px; }
.tl .tl-work, .tl .tl-open { top: 3px; bottom: 3px; }
.tl .tl-gap, .tl .tl-off, .tl .tl-per, .tl .tl-patrol { top: 1px; bottom: 1px; }
.tl .tl-tick { top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 0; background: var(--ink-strong); opacity: 0.8; }
.tl-times { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; margin-top: 0.25rem; font-size: 0.78rem; }
.tl-times .ses { display: inline-flex; gap: 0.4rem; }
.dt-main .say { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.82rem; }
.say-line.ok { color: #2f7d47; }
.say-line.warn { color: #9a5a00; font-weight: 600; }
.say-line.bad { color: #b00020; font-weight: 600; }
.say-line.leave { color: #0f6b58; font-weight: 600; }
.say-line.dim { color: var(--muted); }
html.hr-night .say-line.ok { color: #6cc47a; }
html.hr-night .say-line.warn { color: #f0a54a; }
html.hr-night .say-line.bad { color: #f07a7c; }
html.hr-night .say-line.leave { color: #5eead4; }
.dt-main .act { text-align: right; }
.dt-main .act form { margin: 0; display: inline; }
.dt-breaks { margin: 0.4rem 0 0.1rem calc(15rem + 0.9rem); display: flex; flex-direction: column; gap: 0.3rem; }
.dt-break { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; margin: 0; padding: 0.3rem 0.6rem; border-radius: 8px; background: color-mix(in srgb, var(--muted) 8%, transparent); font-size: 0.84rem; }
.dt-break.open { background: #fff4d6; }
html.hr-night .dt-break.open { background: #3a2e12; }
.dt-break .q { font-weight: 650; color: #8a5a00; }
html.hr-night .dt-break .q { color: #f0a54a; }
.dt-seg { display: inline-flex; gap: 0.25rem; margin-left: auto; }
.dt-seg .on-off { background: #2f9e57; color: #fff; border: 0; }
.dt-seg .on-per { background: #4a72c8; color: #fff; border: 0; }
@media (max-width: 1200px) {
  .dt-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dt-axis, .dt-main { grid-template-columns: 12rem minmax(10rem, 1fr) 14rem 7.5rem; }
  .dt-breaks { margin-left: calc(12rem + 0.9rem); }
}
@media (max-width: 900px) {
  .dt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dt-axis { display: none; }
  .dt-main { grid-template-columns: 1fr auto; gap: 0.3rem 0.6rem; }
  .dt-main .bar-cell, .dt-main .say { grid-column: 1 / -1; }
  .dt-main .act { grid-column: 2; grid-row: 1; }
  .dt-group > summary { top: 0; }
  .dt-breaks { margin-left: 0; }
}

/* ---------- Date wise: printable day sheet ---------- */
.dw-sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.4rem 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--card); }
.dw-title strong { font-size: 1.05rem; margin-right: 0.6rem; }
.dw-title span { color: var(--muted); }
.dw-sum { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.86rem; color: var(--muted); }
.dw-sum b { color: var(--ink-strong); font-size: 1rem; }
.dw-sum .ok b { color: #2f7d47; }
.dw-sum .bad b { color: #b00020; }
.dw-sum .late b { color: #c25e00; }
.dw-sum a.warn { color: #9a5a00; font-weight: 600; text-decoration: none; }
.dw-sum a.warn b { color: inherit; }
.dw-tools { margin-top: 0.5rem; }
.dw-table { width: 100%; }
.dw-table th, .dw-table td { padding: 0.35rem 0.6rem; vertical-align: middle; }
.dw-table .c-code { width: 7.5rem; color: var(--muted); font-size: 0.82rem; }
.dw-table .c-name .person-open { text-align: left; font-weight: 600; }
.dw-table .c-shift { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.dw-table .c-in, .dw-table .c-out, .dw-table .c-hrs { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; width: 5.5rem; }
.dw-table .c-hrs { font-weight: 700; }
.dw-table .c-st { width: 9rem; }
.dw-st { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 650; white-space: nowrap; }
.dw-st.ok { background: #e7f6ea; color: #1e7d32; }
.dw-st.late { background: #fff0e0; color: #b25500; }
.dw-st.warn { background: #fff4d6; color: #8a5a00; }
.dw-st.bad { background: #fde8ea; color: #b00020; }
.dw-st.leave { background: #e6f4f1; color: #0f5c4c; }
.dw-st.dim { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
html.hr-night .dw-st.ok { background: #1a3a22; color: #6cc47a; }
html.hr-night .dw-st.late { background: #3a2a14; color: #f0a54a; }
html.hr-night .dw-st.warn { background: #3a2e12; color: #e0913f; }
html.hr-night .dw-st.bad { background: #3a1a1d; color: #f07a7c; }
html.hr-night .dw-st.leave { background: #12352e; color: #5eead4; }
tr.dw-bad > td.c-name .person-open { color: #b00020; }
html.hr-night tr.dw-bad > td.c-name .person-open { color: #f07a7c; }
@media print {
  .hr-side, .hr-top, .hr-mod-tabs, .at-head-actions, .at-trusts, .pp-tools, .at-health, .at-purpose, .hr-foot { display: none !important; }
  .dw-wrap, .sheet-wrap { height: auto !important; overflow: visible !important; }
  .dw-table .c-name .person-open { color: #000 !important; }
}

/* ---------- Month wise grid ---------- */
.mw-wrap { --sheet-code-w: 6.5rem; --sheet-name-w: 12.5rem; }
.sheet-month-pin .mw-n { width: 3.1rem; min-width: 3.1rem; max-width: 3.1rem; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.sheet-month-pin .mw-n-bad { color: #b00020; font-weight: 700; }
html.hr-night .sheet-month-pin .mw-n-bad { color: #f07a7c; }
.sheet-month-pin .sheet-name a { color: inherit; font-weight: 600; text-decoration: none; }
.sheet-month-pin .sheet-name a:hover { color: var(--accent); text-decoration: underline; }
.mw-fix { display: inline-block; margin-left: 0.25rem; padding: 0 0.35rem; border-radius: 999px; background: #e0a020; color: #fff; font-size: 0.68rem; font-weight: 700; vertical-align: 1px; }
.sheet-month-days th a { color: inherit; text-decoration: none; }
.sheet-month-days th a:hover { color: var(--accent); text-decoration: underline; }
.sheet-month-days .mw-sun { background-image: linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)); }
.sheet-month-days th.mw-today, .sheet-month-days td.mw-today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.sheet-table td.mw-abs { color: #b00020; font-weight: 700; background: #fde8ea; }
html.hr-night .sheet-table td.mw-abs { color: #f07a7c; background: #3a1a1d; }
.sheet-table td.mw-notime { color: var(--muted); }
.sheet-table td.mw-future { background: transparent; }
.mw-abs-key { color: #b00020; background: #fde8ea; }
.mw-notime-key { color: var(--muted); }
tr.mw-foot td { font-weight: 700; font-size: 0.75rem; color: var(--muted); border-top: 2px solid var(--line-strong); }
.mw-fixnote { font-size: 0.8rem; color: #9a5a00; font-weight: 600; }

/* ---------- Employee sheet calendar ---------- */
.es-pick { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.7rem; }
.es-who, .es-when { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.es-trust { width: auto; max-width: 14rem; }
.es-person { width: 20rem; max-width: 70vw; }
.es-when .form-select { width: auto; }
.es-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.2rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: 0.7rem; }
.es-id { display: flex; flex-direction: column; gap: 0.1rem; }
.es-name { font-size: 1.15rem; font-weight: 700; text-align: left; }
.es-shift { font-size: 0.85rem; }
.es-sum { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.es-sum > div { display: flex; flex-direction: column; min-width: 6.2rem; padding: 0.35rem 0.6rem; border-radius: 8px; background: color-mix(in srgb, var(--muted) 7%, transparent); }
.es-sum .val { font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
.es-sum .val small { font-size: 0.75rem; font-weight: 600; }
.es-sum .lbl { font-size: 0.74rem; color: var(--muted); }
.es-sum .bad .val { color: #b00020; }
.es-sum .late .val { color: #c25e00; }
.es-sum .leave .val { color: #0f6b58; }
.es-sum .warn { background: #fff4d6; }
.es-sum .warn .val { color: #8a5a00; }
html.hr-night .es-sum .bad .val { color: #f07a7c; }
html.hr-night .es-sum .warn { background: #3a2e12; }
html.hr-night .es-sum .warn .val { color: #f0a54a; }
.es-cal { padding: 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.es-cal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.6rem; }
.es-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.es-wd { font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: center; }
.es-day { min-height: 5.2rem; padding: 0.35rem 0.45rem; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.8rem; background: var(--card); }
.es-day.sun { background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.es-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.es-top { display: flex; justify-content: space-between; align-items: baseline; }
.es-top .n { color: var(--muted); font-weight: 650; }
.es-top .h { font-weight: 750; font-size: 1rem; font-variant-numeric: tabular-nums; }
.es-pun { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.es-word { font-size: 0.72rem; font-weight: 650; }
.es-go { font-size: 0.74rem; font-weight: 650; margin-top: auto; }
.es-day.es-in, .es-k-in { background: #f1f9f3; border-color: #cfe9d6; }
.es-day.es-ok { background: #e7f6ea; border-color: #b9e0c1; }
.es-day.es-abs, .es-k-abs { background: #fdf0f1; border-color: #f2c4c9; }
.es-day.es-abs .es-word { color: #b00020; }
.es-day.es-leave { background: #e6f4f1; border-color: #b6ddd4; }
.es-day.es-leave .es-word { color: #0f5c4c; }
.es-day.es-wait { background: #fff4d6; border-color: #f0d58c; }
.es-day.es-wait .es-word { color: #8a5a00; }
.es-day.es-per { background: #e8eef9; border-color: #c3d1ef; }
.es-day.es-per .es-word { color: #1e3a8a; }
.es-day.es-notime .es-word { color: var(--muted); }
.es-day.es-future { opacity: 0.5; }
html.hr-night .es-day.es-in, html.hr-night .es-k-in { background: #16261c; border-color: #24402d; }
html.hr-night .es-day.es-ok { background: #1a3a22; border-color: #2a5a35; }
html.hr-night .es-day.es-abs, html.hr-night .es-k-abs { background: #2e1619; border-color: #5a2a30; }
html.hr-night .es-day.es-abs .es-word { color: #f07a7c; }
html.hr-night .es-day.es-leave { background: #12352e; border-color: #1f5247; }
html.hr-night .es-day.es-leave .es-word { color: #5eead4; }
html.hr-night .es-day.es-wait { background: #3a2e12; border-color: #5a4518; }
html.hr-night .es-day.es-wait .es-word { color: #f0a54a; }
html.hr-night .es-day.es-per { background: #1c2744; border-color: #2c3c66; }
html.hr-night .es-day.es-per .es-word { color: #93c5fd; }
.es-table { margin-top: 0.8rem; }
.es-table > summary { cursor: pointer; font-weight: 600; margin-bottom: 0.4rem; }
@media (max-width: 760px) {
  .es-day { min-height: 3.6rem; font-size: 0.7rem; padding: 0.25rem; }
  .es-pun span:nth-child(n+2), .es-word { display: none; }
}

/* ---------- Punches: machine log ---------- */
.pu-machines { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.7rem; }
.pu-machine { position: relative; padding: 0.6rem 0.8rem 0.6rem 1.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.pu-machine .dot { position: absolute; left: 0.7rem; top: 0.95rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); }
.pu-machine.ok .dot { background: #2f9e57; box-shadow: 0 0 0 3px color-mix(in srgb, #2f9e57 25%, transparent); }
.pu-machine.slow .dot { background: #e0a020; }
.pu-machine.quiet .dot { background: #c8323a; }
.pu-machine .nm { font-weight: 700; }
.pu-machine .ct { font-size: 0.85rem; }
.pu-machine .ct b { font-size: 1.1rem; }
.pu-machine .ls { font-size: 0.76rem; color: var(--muted); }
.pu-sum, .pu-unk { padding-left: 0.8rem; }
.pu-unk.has { border-color: #e7b54a; background: #fff8e6; }
html.hr-night .pu-unk.has { background: #33280f; border-color: #6b5320; }
.pu-live::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.3rem; border-radius: 50%; background: #2f9e57; animation: pu-blink 2s infinite; }
@keyframes pu-blink { 50% { opacity: 0.25; } }
.pu-places { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.pu-places .pp-chip { cursor: pointer; font: inherit; font-size: 0.85rem; }
.pu-pull { margin-bottom: 0.6rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.45rem 0.8rem; background: var(--card); }
.pu-pull > summary { cursor: pointer; font-weight: 600; }
.pu-pull-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.8rem; margin-top: 0.5rem; }
.pu-pull-form p { flex-basis: 100%; }
.pu-pull-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--muted); }
.pu-result { margin: 0.5rem 0 0; padding: 0.5rem; font-size: 0.78rem; white-space: pre-wrap; background: color-mix(in srgb, var(--muted) 8%, transparent); border-radius: 6px; }
#punchTable tr.pu-hide { display: none; }
@media (max-width: 1000px) { .pu-machines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Daily wager month calendar ---------- */
.at-wager { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0.9rem; align-items: start; }
.at-cal, .at-wager-form { padding: 0.9rem; }
.at-cal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.6rem; }
.at-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.at-cal-wd { font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: center; }
.at-cal-day {
  position: relative; min-height: 3.4rem; padding: 0.3rem 0.4rem;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: inherit; font: inherit; cursor: pointer;
}
.at-cal-day:hover { border-color: var(--accent); }
.at-cal-day .n { font-size: 0.8rem; color: var(--muted); }
.at-cal-day .u { align-self: flex-end; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.at-cal-day.full { background: #e7f6ea; border-color: #b9e0c1; }
.at-cal-day.full .u { color: #1e7d32; }
.at-cal-day.half { background: #fff4d6; border-color: #f0d58c; }
.at-cal-day.half .u { color: #8a5a00; }
.at-cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.at-cal-day.picked { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.at-cal-day.future { opacity: 0.55; }
html.hr-night .at-cal-day.full { background: #1a3a22; border-color: #2a5a35; }
html.hr-night .at-cal-day.full .u { color: #6cc47a; }
html.hr-night .at-cal-day.half { background: #3a2e12; border-color: #5a4518; }
html.hr-night .at-cal-day.half .u { color: #e0913f; }
.at-units { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.at-units .btn { flex: 1 1 auto; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
@media (max-width: 900px) { .at-wager { grid-template-columns: 1fr; } }

/* ---------- Pay & designation ---------- */
.sl-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-start; }
.sl-wrap { display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.sl-list { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; position: sticky; top: 0.5rem; }
.sl-find { display: flex; margin: 0.5rem; }
.sl-head { display: flex; justify-content: space-between; padding: 0.25rem 0.75rem; font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.sl-rows { overflow: auto; max-height: 70vh; }
.sl-row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.sl-row:hover { background: var(--grid-row-on); }
.sl-row.on { background: var(--accent); color: var(--on-accent); }
.sl-row.on small { color: inherit; opacity: 0.85; }
.sl-row .nm { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 0.88rem; }
.sl-row .amt { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.sl-row small { font-weight: 400; font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-row.none .amt { color: #b00020; font-weight: 600; }
.sl-row.on.none .amt { color: inherit; }
.sl-main { min-width: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.sl-who { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.sl-who > div { display: flex; flex-direction: column; }
.sl-name { font-size: 1.25rem; font-weight: 750; text-align: left; }
.sl-warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.6rem 0.85rem; border-radius: 10px; background: #fff4d6; color: #6b4600; border: 1px solid #f0d58c; }
html.hr-night .sl-warn { background: #3a2e12; color: #f2c27a; border-color: #5a4518; }
.sl-now { display: grid; grid-template-columns: minmax(14rem, 18rem) 1fr; gap: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.sl-big { display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); padding-right: 1rem; }
.sl-big .lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
.sl-big .val { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-strong); line-height: 1.15; }
.sl-big .sub { font-size: 0.86rem; color: var(--muted); }
.sl-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.sl-facts > div { display: flex; flex-direction: column; }
.sl-facts dt { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.sl-facts dt small { font-weight: 400; }
.sl-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-edit { padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.sl-mode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; margin-bottom: 0.4rem; }
.sl-mode button { border: 0; background: transparent; padding: 0.35rem 0.9rem; font: inherit; font-size: 0.88rem; color: inherit; cursor: pointer; }
.sl-mode button + button { border-left: 1px solid var(--line); }
.sl-mode button.on { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.sl-hint { margin: 0 0 0.6rem; font-size: 0.82rem; color: var(--muted); }
.sl-form { display: grid; grid-template-columns: 10rem minmax(12rem, 1.4fr) repeat(3, minmax(8rem, 1fr)); gap: 0.6rem; align-items: end; margin: 0; }
.sl-form label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.sl-form .num { text-align: right; font-variant-numeric: tabular-nums; }
.sl-preview { grid-column: 1 / -2; font-size: 0.84rem; min-height: 1.3rem; }
.sl-actions { grid-column: -2 / -1; text-align: right; }
.sl-hist h2 { margin-bottom: 0.4rem; }
.sl-table td, .sl-table th { white-space: nowrap; }
.sl-table .num { font-variant-numeric: tabular-nums; }
.sl-table tr.sl-cur > td { background: color-mix(in srgb, #2f9e57 9%, transparent); }
.sl-table .pp-pill { margin-left: 0.35rem; }
@media (max-width: 1100px) {
  .sl-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sl-form .wide, .sl-preview, .sl-actions { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sl-wrap { grid-template-columns: 1fr; }
  .sl-list { position: static; }
  .sl-rows { max-height: 16rem; }
  .sl-now { grid-template-columns: 1fr; }
  .sl-big { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 0.6rem; }
  .sl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sl-soon { margin-top: 0.3rem; font-size: 0.8rem; font-weight: 600; color: #8a5a00; }
html.hr-night .sl-soon { color: #f0a54a; }

/* ---------- Arrears ---------- */
.ar-count { margin: 0 0 0.6rem; }
.ar-card { border: 1px solid var(--line); border-left: 4px solid #e0a020; border-radius: 10px; background: var(--card); padding: 0.8rem 1rem; margin-bottom: 0.8rem; }
.ar-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1rem; margin-bottom: 0.4rem; }
.ar-head > div:first-child { display: flex; flex-direction: column; }
.ar-name { font-size: 1.1rem; font-weight: 700; text-align: left; }
.ar-why { font-size: 0.9rem; }
.ar-table { margin-bottom: 0.5rem; }
.ar-table td, .ar-table th { font-variant-numeric: tabular-nums; }
.ar-table tfoot td { border-top: 2px solid var(--line-strong); font-weight: 600; }
.ar-act { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; }
.ar-approve { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0; }
.ar-q { font-weight: 650; }
.ar-opt { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.ar-opt small { color: var(--muted); }

/* ---------- User Wise Collection ---------- */
.uwc-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; flex-shrink: 0; }
.uwc-chip {
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  padding: 0.22rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-strong); font-size: 0.84rem; font-weight: 650; text-decoration: none;
}
.uwc-chip span { color: var(--cb-cash); font-variant-numeric: tabular-nums; }
.uwc-chip:hover { border-color: var(--accent); }
.uwc-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.uwc-chip.on span { color: inherit; }
.uwc .uwc-cards { grid-template-columns: repeat(var(--uwc-n, 2), minmax(0, 16rem)); }
.uwc .uwc-cols { grid-template-columns: repeat(var(--uwc-n, 1), minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.uwc .uwc-cols[style*="--uwc-n:1"] { grid-template-columns: minmax(0, 62rem); }
.uwc-stack { display: flex; flex-direction: column; gap: 0.45rem; min-height: 0; min-width: 0; }
.uwc-stack > .cb-pane { flex: 0 1 auto; }
.uwc-stack > .cb-pane.uwc-fix { flex-shrink: 0; }
.uwc-stack > .cb-pane .cb-scroll { flex: 1 1 auto; }
.uwc-grid td { padding-top: 0.18rem; padding-bottom: 0.18rem; vertical-align: middle; }
.uwc-grid td.cb-cash, .uwc-grid td.cb-chq { font-size: 1.05rem; }
.uwc-grid tfoot td { font-size: 1.08rem; }
.uwc .uwc-all { flex: 1 1 0; min-height: 0; }
.uwc-none { margin: 0; font-size: 0.82rem; color: var(--muted); }
.uwc .cb-pane-head small { color: var(--muted); font-size: 0.78rem; }
.uwc-grid td:first-child { font-weight: 600; }
.uwc-grid .uwc-rate { color: var(--muted); }
.uwc-sign { display: none; }
@media (max-width: 1280px) {
  .uwc .uwc-cols, .uwc .uwc-cols[style*="--uwc-n:1"] { grid-template-columns: 1fr; grid-template-rows: none; }
  .uwc .uwc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .uwc .cb-bar, .uwc .uwc-chips { display: none !important; }
  .uwc, .uwc .cb-cols, .uwc .cb-pane, .uwc .cb-scroll { overflow: visible !important; height: auto !important; flex: none !important; }
  .uwc .cb-grid thead th { background: #eee !important; color: #000 !important; }
  .uwc-sign { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.5rem; font-size: 0.9rem; }
  .uwc-sign > div { flex: 1; border-top: 1px solid #000; padding-top: 0.3rem; }
  .hr-app:has(.uw-coll), .hr-body:has(.uw-coll) { height: auto !important; display: block !important; }
}

/* ---------- Date Wise Collection ---------- */
.dwc .dw-pane tr.dw-line { display: none; }
.dwc .dw-pane tr.dw-line.open { display: table-row; }
.dwc.cb-finding .dw-pane tr.dw-line:not([hidden]) { display: table-row; }
.dwc tr.dw-band { cursor: pointer; }
.dwc tr.dw-band td { font-size: 0.92rem; }
.dw-caret { display: inline-block; width: 0.9rem; color: var(--muted); }
.dw-caret::before { content: "▸"; }
.dwc tr.dw-band.open .dw-caret::before { content: "▾"; }
.dwc td.dw-indent { padding-left: 1.4rem; }
.dw-sub { display: block; font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.dw-days .cb-pane-head h2 { color: var(--cb-gold); }
.dw-days td a { font-weight: 650; text-decoration: none; }
@media print {
  .dwc .cb-bar { display: none !important; }
  .dwc, .dwc .cb-cols, .dwc .cb-pane, .dwc .cb-scroll { overflow: visible !important; height: auto !important; flex: none !important; }
  .dwc .cb-grid thead th { background: #eee !important; color: #000 !important; }
  .dwc .dw-pane tr.dw-line { display: table-row; }
}
/* Date Wise: tables take their full height; the page scrolls, not each table. */
.dwc { display: flex; flex-direction: column; gap: 0.45rem; }
.dwc .uwc-cols { flex: none; grid-template-rows: none; align-items: start; }
.dwc .uwc-stack > .cb-pane { flex: none; }
.dwc .cb-pane, .dwc .cb-scroll { overflow: visible; flex: none; min-height: auto; }
.dwc .cb-grid thead th { top: 0; }
.dwc .cb-grid tfoot td { position: static; }
.dwc tr.dw-band td { white-space: nowrap; }

/* ---------- Total Worth ---------- */
.tww { display: flex; flex-direction: column; gap: 0.45rem; }
.tww .tw-all { gap: 0.35rem; cursor: pointer; }
.tw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; align-items: start; }
.tww .tw-trust { overflow: visible; }
.tw-part { border-top: 1px solid var(--line); }
.tw-part-h {
  padding: 0.25rem 0.6rem; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase;
}
.tw-cash .tw-part-h { color: var(--cb-cash); }
.tw-bank .tw-part-h { color: var(--cb-bank); }
.tw-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  padding: 0.28rem 0.6rem; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.tw-row:hover { background: var(--grid-row-on); }
.tw-row[hidden], .tw-row.hr-find-hide { display: none !important; }
.tw-nm { min-width: 0; font-weight: 600; font-size: 0.86rem; color: var(--ink-strong); }
.tw-nm small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--muted); }
.tw-amt { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1rem; }
.tw-cash .tw-amt { color: var(--cb-cash); }
.tw-bank .tw-amt { color: var(--cb-bank); }
.tw-row.tw-neg .tw-amt { color: #c62828; }
html.hr-night .tw-row.tw-neg .tw-amt { color: #ff8a80; }
.tw-row.tw-off { box-shadow: inset 3px 0 0 #e0a020; }
.tw-should { color: #b26a00 !important; font-weight: 650 !important; }
.tw-sub, .tw-tot { display: flex; justify-content: space-between; align-items: baseline; padding: 0.35rem 0.6rem; font-variant-numeric: tabular-nums; }
.tw-sub { font-size: 0.8rem; color: var(--muted); background: color-mix(in srgb, var(--grp-bg) 60%, var(--card)); }
.tw-sub b { font-size: 1.05rem; }
.tw-cash .tw-sub b { color: var(--cb-cash); }
.tw-bank .tw-sub b { color: var(--cb-bank); }
.tw-tot { border-top: 2px solid var(--line); background: color-mix(in srgb, var(--cb-gold) 16%, var(--card)); font-weight: 750; }
.tw-tot b { font-size: 1.2rem; color: var(--ink-strong); }
.tw-verify { margin: 0; padding: 0.5rem 0.8rem; border-radius: 8px; font-size: 0.88rem; }
.tw-verify ul { margin: 0.3rem 0; padding-left: 1.2rem; }
.tw-correct { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.3rem; }
.tw-ok { background: color-mix(in srgb, #2e7d32 16%, var(--card)); border: 1px solid color-mix(in srgb, #2e7d32 45%, transparent); }
.tw-bad { background: color-mix(in srgb, #e0a020 16%, var(--card)); border: 1px solid color-mix(in srgb, #e0a020 50%, transparent); }
@media (max-width: 1280px) { .tw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tw-grid { grid-template-columns: 1fr; } }
@media print {
  .tww .cb-bar { display: none !important; }
  .tw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tw-cards.tw-cards4 { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.tw-c-petty { --cb-c: #8a6d3b; }
html.hr-night .tw-c-petty { --cb-c: #d7b77a; }
.tw-petty .tw-part-h, .tw-petty .tw-amt, .tw-petty .tw-sub b { color: var(--tw-petty, #8a6d3b); }
html.hr-night .tw-petty { --tw-petty: #d7b77a; }
@media (max-width: 1280px) { .tw-cards.tw-cards4 { grid-template-columns: 1fr 1fr; } }

/* ---------- All Payments: checking how money goes out ---------- */
.apm { display: flex; flex-direction: column; gap: 0.5rem; --apm-petty: #8a6d3b; --apm-held: #6a4c93; }
html.hr-night .apm { --apm-petty: #d7b77a; --apm-held: #c3a6f0; }
.apm .apm-tick { gap: 0.35rem; cursor: pointer; }
.apm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.apm .apm-cards { grid-template-columns: 1.4fr 1fr 1fr 1fr 0.9fr; }
.apm-c-petty { --cb-c: var(--apm-petty); }
.apm-c-held { --cb-c: var(--apm-held); }
a.apm-c-check { text-decoration: none; color: inherit; }
.apm-c-check.apm-warn { --cb-c: #d08a00; background: color-mix(in srgb, #e0a020 12%, var(--card)); }
.apm-c-check.apm-clear { --cb-c: #2e7d32; }
.apm-c-check:hover { border-color: var(--cb-c); }

.apm-strip { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.7rem 0.3rem; }
.apm-strip-h { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.2rem 1rem; font-size: 0.82rem; }
.apm-strip-h strong { color: var(--ink-strong); }
.apm-strip-h span { color: var(--muted); }
.apm-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.35rem; margin-top: 0.25rem; }
.apm-bar { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; text-decoration: none; color: var(--muted); border-radius: 6px; padding: 0.15rem 0; }
.apm-bar:hover { background: var(--grid-row-on); }
.apm-bar.future { opacity: 0.35; pointer-events: none; }
.apm-bar-v { font-size: 0.72rem; font-weight: 650; font-variant-numeric: tabular-nums; min-height: 1rem; color: var(--ink); }
.apm-bar-col { display: flex; align-items: flex-end; width: 62%; height: 3.4rem; border-bottom: 1px solid var(--line-strong); }
.apm-bar-col i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--cb-gold) 45%, var(--card)); }
.apm-bar.on .apm-bar-col i { background: var(--cb-gold); }
.apm-bar.on .apm-bar-m { color: var(--ink-strong); font-weight: 750; }
.apm-bar-m { font-size: 0.74rem; }

.apm-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 2px solid var(--line); }
.apm-tabs button {
  border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--grp-bg);
  padding: 0.35rem 0.9rem; font-weight: 700; font-size: 0.88rem; color: var(--muted); margin-bottom: -2px;
}
.apm-tabs button small { font-weight: 500; margin-left: 0.25rem; }
.apm-tabs button.on { background: var(--card); color: var(--ink-strong); border-color: var(--line); box-shadow: inset 0 3px 0 var(--cb-gold); }
.apm-tabs button.apm-tab-warn small { color: #b26a00; font-weight: 700; }

.apm .apm-pane { overflow: visible; }
.apm .apm-pane[hidden] { display: none !important; }
.apm .cb-grid thead th { top: 0; }
.apm .cb-grid tfoot td { position: static; font-size: 1rem; }
.apm-grid td { vertical-align: top; }
.apm-grid.apm-narrow { max-width: 64rem; }
.apm-grid tr.apm-band td { background: color-mix(in srgb, var(--cb-gold) 12%, var(--card)); font-weight: 750; border-top: 2px solid var(--line); }
.apm-grid tr.apm-band a { color: var(--ink-strong); text-decoration: none; }
.apm-grid td.apm-indent { padding-left: 1.2rem; }
.apm-grid tbody tr[data-find] td:first-child { box-shadow: inset 3px 0 0 var(--cb-c, transparent); }
.apm-name { font-weight: 650; color: var(--ink-strong); text-decoration: none; }
a.apm-name:hover { text-decoration: underline; }
.apm-grid small, .apm-trust { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.apm-sub { font-size: 0.78rem; color: var(--muted); }
.apm-grid td.apm-paid { font-weight: 750; color: var(--ink-strong); }
.apm-grid .apm-mth { font-size: 0.8rem; }
.apm-bank { color: var(--cb-bank); }
.apm-petty { color: var(--apm-petty); }
.apm-other { color: var(--muted); }
.apm-grid tr.apm-on td { background: color-mix(in srgb, var(--accent) 14%, var(--card)) !important; }

.apm-vch td { font-size: 0.82rem; }
.apm-vch .apm-vno { white-space: nowrap; }
.apm-vch .apm-date { display: block; font-size: 0.72rem; color: var(--muted); }
.apm-vch .apm-party { font-weight: 600; max-width: 14rem; overflow-wrap: anywhere; }
.apm-vch .apm-detail { max-width: 28rem; overflow-wrap: anywhere; line-height: 1.3; }
.apm-vch td.apm-amt { font-size: 1rem; font-weight: 750; color: var(--ink-strong); white-space: nowrap; }
.apm-vch td.apm-amt small { font-weight: 500; }
.apm-vch .apm-by { white-space: nowrap; }
.apm-vch .apm-status { white-space: nowrap; }
.apm-vch .apm-status .dw-st { margin: 0 0.15rem 0.15rem 0; font-size: 0.7rem; }
.apm-vch tr.apm-flag td:first-child { box-shadow: inset 4px 0 0 #e0a020; }
.apm-vch tr.apm-flag td { background: color-mix(in srgb, #e0a020 7%, var(--card)); }
.apm-vch tr.apm-day td { font-size: 0.9rem; }
.cb-finding .apm-vch tr.apm-day { display: none; }
.dw-st.dim { white-space: nowrap; }

.apm-checks { display: flex; flex-direction: column; gap: 0.5rem; }
.apm-check-sum { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.apm-chip { display: inline-flex; gap: 0.35rem; align-items: baseline; padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 0.82rem; color: var(--ink); text-decoration: none; }
.apm-chip b { font-size: 0.95rem; }
.apm-chip.warn, .apm-chip.late { border-color: #e0a020; background: color-mix(in srgb, #e0a020 12%, var(--card)); }
.apm-chip.bad { border-color: #c62828; background: color-mix(in srgb, #c62828 10%, var(--card)); }
.apm-chip.zero { opacity: 0.55; }
.apm-check > summary { cursor: pointer; list-style: none; flex-wrap: wrap; }
.apm-check > summary::-webkit-details-marker { display: none; }
.apm-check > summary h2 { display: flex; align-items: center; gap: 0.4rem; }
.apm-check > summary small { color: var(--muted); font-size: 0.78rem; }
.apm-check[open] > summary h2::after { content: "▾"; color: var(--muted); }
.apm-check:not([open]) > summary h2::after { content: "▸"; color: var(--muted); }
.apm-ops { max-width: 64rem; }
.apm-sign { display: none; }

@media (max-width: 1280px) {
  .apm .apm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .apm .apm-cards { grid-template-columns: 1fr 1fr; }
  .apm-bar-v { font-size: 0.6rem; }
  .apm .apm-pane { overflow-x: auto; }
}
@media print {
  .apm .cb-bar, .apm .apm-tabs, .apm .apm-check-sum { display: none !important; }
  .apm .apm-pane[hidden] { display: none !important; }
  .apm details.apm-check { display: block; }
  .apm .cb-grid thead th { background: #eee !important; color: #000 !important; }
  .apm-sign { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.5rem; font-size: 0.9rem; }
  .apm-sign > div { flex: 1; border-top: 1px solid #000; padding-top: 0.3rem; }
}

/* ---------- Account Heads: the chart as a tree ---------- */
.ahc { display: flex; flex-direction: column; gap: 0.5rem; }
.ahc .apm-tick { gap: 0.35rem; cursor: pointer; }
.ahc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.ahc-with-panel .ahc-layout { grid-template-columns: minmax(0, 1fr) 23rem; }
.ahc-tree { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ahc .cb-pane { overflow: visible; }
.ahc .cb-grid thead th { top: 0; }
.ahc-s1 { --cb-c: #8e3b46; }
.ahc-s2 { --cb-c: var(--cb-bank); }
.ahc-s3 { --cb-c: #b25500; }
.ahc-s4 { --cb-c: var(--cb-cash); }
html.hr-night .ahc-s1 { --cb-c: #f0927c; }
html.hr-night .ahc-s3 { --cb-c: #f0a54a; }
.ahc-side > .cb-pane-head { align-items: center; }
.ahc-side > .cb-pane-head h2 { flex: 1; font-size: 1.05rem; }
.ahc-side > .cb-pane-head h2 small { font-weight: 500; color: var(--muted); font-size: 0.78rem; margin-left: 0.4rem; }
.ahc-side > .cb-pane-head .ahc-side-tot { font-size: 1.1rem; }
.ahc-grid { table-layout: fixed; }
.ahc-grid .ahc-c-code { width: 6.6rem; }
.ahc-grid .ahc-c-kind { width: 7.6rem; }
.ahc-grid .ahc-c-bank { width: 12rem; }
.ahc-grid .ahc-c-amt { width: 8.6rem; }
.ahc-grid .ahc-c-act { width: 9.5rem; }
.ahc-grid td { vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.ahc-grid td.text-end { font-variant-numeric: tabular-nums; }
.ahc-grid code { color: var(--muted); font-size: 0.78rem; background: none; padding: 0; }
.ahc-grp tr.ahc-in { display: none; }
.ahc-grp.open tr.ahc-in { display: table-row; }
.cb-finding .ahc-grp tr.ahc-in { display: table-row; }
.cb-finding .ahc-grp tr.ahc-sub { display: none; }
.ahc-grid tr.ahc-g { cursor: pointer; }
.ahc-grid tr.ahc-g td { background: color-mix(in srgb, var(--cb-c, var(--accent)) 9%, var(--card)); border-top: 2px solid var(--line); }
.ahc-grid tr.ahc-g small, .ahc-grid tr.ahc-sub small { color: var(--muted); font-weight: 500; margin-left: 0.35rem; }
.ahc-caret { display: inline-block; width: 0.9rem; color: var(--muted); }
.ahc-caret::before { content: "▸"; }
.ahc-grp.open .ahc-caret::before { content: "▾"; }
.ahc-grid tr.ahc-sub td { background: color-mix(in srgb, var(--grp-bg) 70%, var(--card)); }
.ahc-ind1 { padding-left: 1.3rem !important; }
.ahc-ind2 { padding-left: 2.4rem !important; }
.ahc-name { color: var(--ink-strong); font-weight: 600; text-decoration: none; }
a.ahc-name:hover { text-decoration: underline; }
.ahc-grid tr.ahc-unused td { color: var(--muted); }
.ahc-grid tr.ahc-unused .ahc-name { color: var(--muted); font-weight: 500; }
.ahc-grid tr.ahc-off td { opacity: 0.55; }
.ahc-grid tr.ahc-on td { background: color-mix(in srgb, var(--accent) 16%, var(--card)) !important; }
.ahc-grid td.ahc-close { font-weight: 700; color: var(--ink-strong); }
.ahc-kind { font-size: 0.78rem; }
.ahc-k-B { color: var(--cb-bank); font-weight: 650; }
.ahc-k-C { color: var(--cb-cash); font-weight: 650; }
.ahc-bank { font-size: 0.78rem; color: var(--muted); }
.ahc-act { text-align: right; white-space: nowrap; }
.ahc-act a { font-size: 0.76rem; font-weight: 650; margin-left: 0.45rem; text-decoration: none; }
.ahc-act a:hover { text-decoration: underline; }

.ahc-panel { position: sticky; top: 0.5rem; }
.ahc-panel .cb-pane-head h2 { flex: 1; }
.ahc-x { text-decoration: none; color: var(--muted); font-weight: 700; }
.ahc-form { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.75rem 0.75rem; }
.ahc-form .form-label { margin: 0.35rem 0 0; font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.ahc-code { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
.ahc-code span { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.ahc-code b { font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.ahc-code small { width: 100%; color: var(--muted); font-size: 0.72rem; }
.ahc-open { display: flex; align-items: center; gap: 0.6rem; }
.ahc-open .form-control { max-width: 9rem; }
.ahc-open label { display: flex; gap: 0.25rem; align-items: center; margin: 0; }
.ahc-btns { display: flex; gap: 0.45rem; margin-top: 0.6rem; }
.ahc-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.7rem; margin: 0; padding: 0.55rem 0.75rem 0.75rem; border-top: 1px solid var(--line); font-size: 0.82rem; }
.ahc-facts dt { color: var(--muted); font-weight: 600; }
.ahc-facts dd { margin: 0; }

.ahc-tidy > summary { cursor: pointer; list-style: none; }
.ahc-tidy > summary::-webkit-details-marker { display: none; }
.ahc-tidy { --cb-c: #d08a00; }
.ahc-tidy > summary h2::before { content: "▸ "; }
.ahc-tidy[open] > summary h2::before { content: "▾ "; }
.ahc-tidy > summary small { color: var(--muted); }
.ahc-tidy-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0.6rem 1.2rem; padding: 0.6rem 0.8rem; }
.ahc-tidy-body h3 { font-size: 0.88rem; font-weight: 750; margin: 0; }
.ahc-tidy-body h3 span { color: #b26a00; margin-left: 0.3rem; }
.ahc-tidy-body p { margin: 0.1rem 0 0.3rem; font-size: 0.76rem; color: var(--muted); }
.ahc-tidy-body ul { margin: 0; padding-left: 1rem; font-size: 0.8rem; max-height: 14rem; overflow: auto; }
.ahc-tidy-body code { font-size: 0.74rem; color: var(--muted); background: none; padding: 0; }
.ahc-note { margin: 0; font-size: 0.76rem; color: var(--muted); }

@media (max-width: 1280px) {
  .ahc-with-panel .ahc-layout { grid-template-columns: 1fr; }
  .ahc-panel { position: static; order: -1; }
  .ahc-grid .ahc-c-bank { width: 8rem; }
}
@media (max-width: 760px) {
  .ahc .cb-pane { overflow-x: auto; }
  .ahc-grid { table-layout: auto; min-width: 46rem; }
}
@media print {
  .ahc .cb-bar, .ahc-panel, .ahc-act, .ahc-tidy { display: none !important; }
  .ahc-with-panel .ahc-layout { grid-template-columns: 1fr; }
  .ahc-grp tr.ahc-in { display: table-row; }
  .ahc .cb-grid thead th { background: #eee !important; color: #000 !important; }
}

/* ---------- Project / Event ---------- */
.pev { display: flex; flex-direction: column; gap: 0.5rem; }
.pev .cb-pane { overflow: visible; }
.pev .cb-grid thead th { top: 0; }
.pev .cb-grid tfoot td { position: static; }
.pev .pev-tick { gap: 0.35rem; cursor: pointer; }
.pev .pev-cards { grid-template-columns: repeat(3, minmax(0, 16rem)); }
.pev .pev-cards4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pev-chips { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 0.4rem; }
.pev-chip {
  display: inline-block; width: 1.25rem; text-align: center; border-radius: 4px;
  font-size: 0.68rem; font-weight: 750; line-height: 1.25rem;
  color: var(--muted); background: color-mix(in srgb, var(--line) 50%, transparent); opacity: 0.45;
}
.pev-chip.on { color: #fff; background: var(--cb-c); opacity: 1; }
.pev-grid td { vertical-align: middle; }
.pev-grid small, .pev-lines small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.pev-name { font-weight: 650; color: var(--ink-strong); text-decoration: none; }
a.pev-name:hover { text-decoration: underline; }
.pev-grid tr.pev-closed .pev-name { color: var(--muted); }
.pev-grid tr.pev-empty td { color: var(--muted); }
.pev-in { color: var(--cb-cash); font-weight: 650; }
.pev-out { color: var(--cb-bank); font-weight: 650; }
.pev-bal { font-weight: 750; color: var(--ink-strong); }
.pev-bal.neg, .pev-neg { color: #c62828 !important; }
html.hr-night .pev-bal.neg, html.hr-night .pev-neg { color: #ff8a80 !important; }
.pev-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; align-items: start; }
.pev-year > summary, .pev-tidy > summary { cursor: pointer; list-style: none; flex-wrap: wrap; }
.pev-year > summary::-webkit-details-marker, .pev-tidy > summary::-webkit-details-marker { display: none; }
.pev-year > summary h2::before, .pev-tidy > summary h2::before { content: "▸ "; }
.pev-year[open] > summary h2::before, .pev-tidy[open] > summary h2::before { content: "▾ "; }
.pev-year > summary small, .pev-tidy > summary small { color: var(--muted); }
.pev-lines td { vertical-align: top; font-size: 0.82rem; }
.pev-lines .pev-narr { max-width: 26rem; overflow-wrap: anywhere; }
.pev-lines tr.pev-out-date td:first-child { box-shadow: inset 4px 0 0 #e0a020; }
.pev-lines tr.pev-out-date td { background: color-mix(in srgb, #e0a020 7%, var(--card)); }
.pev-lines + .pev-lines { border-top: 3px solid var(--line); }
.pev-tidy { --cb-c: #d08a00; }
.pev-tidy-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0.6rem 1.2rem; padding: 0.6rem 0.8rem; }
.pev-tidy-body h3 { font-size: 0.88rem; font-weight: 750; margin: 0; }
.pev-tidy-body h3 span { color: #b26a00; margin-left: 0.3rem; }
.pev-tidy-body p { margin: 0.1rem 0 0.3rem; font-size: 0.76rem; color: var(--muted); }
.pev-tidy-body ul { margin: 0; padding-left: 1rem; font-size: 0.8rem; max-height: 14rem; overflow: auto; }
.pev-note { margin: 0; font-size: 0.76rem; color: var(--muted); }
@media (max-width: 1000px) {
  .pev-two, .pev .pev-cards4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .pev-two, .pev .pev-cards, .pev .pev-cards4 { grid-template-columns: 1fr; }
  .pev .cb-pane { overflow-x: auto; }
}
@media print {
  .pev .cb-bar, .pev-tidy { display: none !important; }
}

/* ---------- Ledger Book: page scroll, month bands, picker ---------- */
.lbx { display: flex; flex-direction: column; gap: 0.5rem; }
.lbx .lb-pane { flex: none; overflow: visible; }
.lbx .lb-grid thead th { top: 0; }
.lbx .lb-grid tfoot td { position: static; }
.lbx .lb-bar-pick { flex-wrap: wrap; }
.lbx .lb-jump { flex: 1 1 14rem; max-width: 22rem; height: 1.95rem; font-size: 0.85rem; }
.lb-tools { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.lbx .lb-head { align-items: flex-end; flex-wrap: wrap; gap: 0.5rem; }
.lbx tbody.lb-mon tr.lb-row { display: none; }
.lbx tbody.lb-mon.open tr.lb-row { display: table-row; }
.lbx .lb-pane.lb-finding tbody.lb-mon tr.lb-row { display: table-row; }
.lbx tr.lb-month { cursor: pointer; }
.lb-caret { display: inline-block; width: 0.9rem; color: var(--muted); }
.lb-caret::before { content: "▸"; }
.lbx tbody.lb-mon.open .lb-caret::before { content: "▾"; }
.lb-months { max-width: 52rem; overflow: visible; --cb-c: var(--lb-gold); }
.lb-months .cb-grid thead th { top: 0; }
.lb-months .cb-pane-head small { color: var(--muted); }
.lb-months td a { font-weight: 650; text-decoration: none; }
.lb-months td.lb-dr { color: var(--lb-dr); }
.lb-months td.lb-cr { color: var(--lb-cr); }
.lb-months td.lb-bal { font-weight: 700; }
.lb-months td.lb-bal small { color: var(--muted); font-size: 0.7rem; }
a.lb-link, a.tw-link { color: inherit; text-decoration: none; }
a.lb-link:hover, a.tw-link:hover { text-decoration: underline; }
@media print {
  .lbx .lb-bar, .lbx .lb-tools, .lbx .lb-find { display: none !important; }
  .lbx tbody.lb-mon tr.lb-row { display: table-row; }
}

/* ---------- Daily Deposits ---------- */
.dep { display: flex; flex-direction: column; gap: 0.55rem; }
.dep .cb-pane { overflow: visible; }
.dep .cb-grid thead th { top: 0; }
.dep .cb-grid tfoot td { position: static; font-size: 1rem; }
.dep-trust { border: 1px solid var(--line); border-top: 3px solid var(--cb-c); border-radius: 8px; background: var(--card); padding: 0.45rem 0.6rem 0.55rem; }
.dep-trust-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem; margin-bottom: 0.4rem; }
.dep-trust-h h2 { margin: 0; font-size: 1rem; font-weight: 750; color: var(--cb-c); }
.dep-trust-h span { font-size: 0.82rem; color: var(--muted); }
.dep-trust-h b { color: var(--ink-strong); font-size: 0.95rem; }
.dep-ok { color: #2e7d32 !important; font-weight: 650; }
.dep-bad { color: #b26a00 !important; font-weight: 650; }
html.hr-night .dep-ok { color: #7dce9a !important; }
.dep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.4rem; }
.dep-card {
  display: flex; flex-direction: column; gap: 0.05rem; padding: 0.4rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong); background: var(--card);
  color: inherit; text-decoration: none;
}
.dep-card:hover { border-color: var(--accent); }
.dep-card.on { box-shadow: 0 0 0 2px var(--accent); }
.dep-card.due { border-left-color: var(--cb-cash); }
.dep-card.over { border-left-color: #e0a020; background: color-mix(in srgb, #e0a020 8%, var(--card)); }
.dep-card.clear { border-left-color: var(--line-strong); }
.dep-card.idle { opacity: 0.55; }
.dep-nm { font-weight: 700; font-size: 0.86rem; color: var(--ink-strong); }
.dep-nm small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--muted); }
.dep-k { font-size: 0.66rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 0.15rem; }
.dep-v { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.dep-card.over .dep-v { color: #b26a00; }
.dep-n { font-size: 0.72rem; color: var(--muted); }
.dep-note { margin: 0.3rem 0 0; font-size: 0.76rem; color: var(--muted); }
.dep-days .cb-pane-head h2 small { font-weight: 500; color: var(--muted); font-size: 0.78rem; margin-left: 0.3rem; }
.dep-days .cb-pane-head span { font-size: 0.9rem; }
.dep-grid td { font-variant-numeric: tabular-nums; }
.dep-grid td.dep-in { color: var(--cb-cash); font-weight: 650; }
.dep-grid td.dep-out { color: var(--cb-bank); font-weight: 650; }
.dep-grid tr.dep-bf td { background: color-mix(in srgb, var(--cb-gold) 10%, var(--card)); }
.dep-grid tr.dep-off td { background: color-mix(in srgb, #e0a020 9%, var(--card)); }
.dep-grid tr.dep-off td:first-child { box-shadow: inset 4px 0 0 #e0a020; }
@media print {
  .dep .cb-bar { display: none !important; }
  .dep-card { break-inside: avoid; }
}

/* ---------- Bank Recon ---------- */
.brx { display: flex; flex-direction: column; gap: 0.55rem; }
.brx .cb-pane { overflow: visible; }
.brx .cb-grid thead th { top: 0; }
.brx-upload, .brx-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  padding: 0.35rem 0.6rem; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--card);
}
.brx-upload input[type="file"] { width: auto; max-width: 22rem; }
.brx-upload small, .brx-actions small { color: var(--muted); font-size: 0.74rem; }
.brx-upload-k { font-size: 0.7rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.brx-ok-msg { border-color: #2e7d32 !important; color: #2e7d32; }
html.hr-night .brx-ok-msg { color: #7dce9a; }
.brx-sub { font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-left: 0.4rem; }
.brx-card .dep-ok, .brx-card .dep-bad { font-size: 0.74rem; }
.brx-stmts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.brx-stmts a {
  padding: 0.18rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 0.8rem; color: inherit; text-decoration: none;
}
.brx-stmts a.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); font-weight: 650; }
.brx-stmts a small { color: var(--muted); margin-left: 0.2rem; }
.brx-inline { display: inline; margin: 0; }
.brx-danger { color: #b71c1c; }
.brx-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.brx-cards .cb-v small { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.brx-agree { --cb-c: #2e7d32; }
.brx-differ { --cb-c: #b26a00; }
html.hr-night .brx-agree { --cb-c: #7dce9a; }
html.hr-night .brx-differ { --cb-c: #e0a020; }
.brx-pane .cb-pane-head h2 small { font-weight: 500; color: var(--muted); font-size: 0.76rem; margin-left: 0.35rem; }
.brx-pad { padding: 0.45rem 0.6rem; margin: 0; }
.brx-grid td { font-variant-numeric: tabular-nums; vertical-align: top; }
.brx-grid .brx-tick { width: 1.8rem; text-align: center; }
.brx-grid td.brx-in { color: var(--cb-cash); font-weight: 650; white-space: nowrap; }
.brx-grid td.brx-out { color: var(--cb-bank); font-weight: 650; white-space: nowrap; }
.brx-txt { font-size: 0.8rem; }
.brx-txt b { font-weight: 650; }
.brx-why { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.brx-why.brx-strong { color: #2e7d32; font-weight: 650; }
.brx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; padding: 0.4rem 0.6rem; }
.brx-check { font-size: 0.8rem; display: inline-flex; gap: 0.3rem; align-items: center; }
.brx-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0 0.4rem 0.5rem; }
.brx-sides h3 { font-size: 0.8rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0.2rem 0.2rem 0.3rem; }
.brx-hand tr.brx-done, .brx-hand tr.brx-before { display: none; }
.brx-hand.brx-all tr.brx-done { display: table-row; }
.brx-hand.brx-early tr.brx-before { display: table-row; }
.brx-tag { display: inline-block; margin-right: 0.3rem; padding: 0 0.35rem; border-radius: 999px; font-size: 0.68rem; font-weight: 650; background: color-mix(in srgb, var(--cb-gold) 20%, var(--card)); color: var(--ink-strong); }
.brx-hand tr.brx-done td { color: var(--muted); }
.brx-hand tr.brx-before td { background: color-mix(in srgb, var(--cb-gold) 7%, var(--card)); }
.brx-hand tr:has(input[name="pick"]:checked) td { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.brx-pair { display: block; color: #2e7d32; font-size: 0.72rem; }
.brx-maybe { display: block; color: #b26a00; font-size: 0.72rem; }
.brx-un { padding: 0 0.2rem; line-height: 1; color: #b71c1c; text-decoration: none; }
.brx-brs-grid { font-variant-numeric: tabular-nums; max-width: 60rem; }
.brx-brs-grid td { border-color: var(--line); }
.brx-brs-h td { font-weight: 700; }
.brx-brs-g td { font-weight: 650; padding-left: 1rem; color: var(--ink-strong); }
.brx-brs-i td { font-size: 0.8rem; color: var(--muted); padding-left: 1.6rem; }
.brx-brs-i td.cb-date { width: 7rem; }
.brx-brs-t td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.brx-brs-gap td { border: 0; height: 0.6rem; }
.brx-brs-diff td { font-weight: 750; font-size: 1.05rem; color: var(--cb-c); }
.brx-note { margin: 0.5rem 0.6rem; }
.brx-note select { width: auto; }
.brx-note input[type="number"] { width: 8rem; }
.brx-note .brx-note-text { flex: 1 1 16rem; width: auto; }
.brx-print-title { display: none; }
@media (max-width: 900px) {
  .brx-sides { grid-template-columns: 1fr; }
  .brx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .brx .cb-bar, .brx-upload, .brx-note, .brx-actions, .brx-stmts form { display: none !important; }
  body.brx-print-brs .brx > *:not(.brx-brs) { display: none !important; }
  body.brx-print-brs .brx-brs .cb-pane-head { display: none; }
  body.brx-print-brs .brx-print-title { display: block; margin-bottom: 0.5rem; }
  .brx-brs .brx-un { display: none; }
}

/* ---------- Takeover from Sahayaka ---------- */
.tko-steps { list-style: none; padding: 0; margin: 0 0 0.9rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; }
.tko-steps a {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--line); border-left: 4px solid #e0a020; background: var(--card); color: inherit; text-decoration: none;
}
.tko-steps li.done a { border-left-color: #2e7d32; }
.tko-steps a span { font-size: 0.8rem; color: var(--muted); }
.tko-steps li.done a span { color: #2e7d32; }
html.hr-night .tko-steps li.done a span, html.hr-night .tko-ok { color: #7dce9a; }
.tko-ok { color: #2e7d32; font-weight: 600; }
.tko-step h3 { color: var(--ink-strong); }
.tko-step small.text-muted { margin-left: 0.5rem; }
.tko-diff tr.tko-first td { border-top: 2px solid var(--line-strong); }
.tko-diff td:first-child { font-weight: 600; }
.tko-months td, .tko-months th { white-space: nowrap; }
.tko-again summary { color: var(--muted); font-size: 0.85rem; cursor: pointer; margin-bottom: 0.4rem; }
@media (max-width: 900px) { .tko-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Receipts & Payments ---------- */
.rpx { display: flex; flex-direction: column; gap: 0.55rem; }
.rpx .cb-pane { overflow: visible; }
.rpx-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rpx-in { --cb-c: var(--cb-cash); }
.rpx-out { --cb-c: #b26a00; }
.rpx-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; align-items: start; }
.rpx-side { border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.rpx-grid { font-variant-numeric: tabular-nums; }
.rpx-grid thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.rpx-grid tr.rpx-g td { font-weight: 700; color: var(--ink-strong); background: color-mix(in srgb, var(--line) 35%, var(--card)); }
.rpx-grid tr.rpx-l td:first-child { padding-left: 1.3rem; }
.rpx-grid tr.rpx-l td { font-size: 0.85rem; }
.rpx-grid tr.rpx-l small { color: var(--muted); margin-left: 0.25rem; }
.rpx-grid tr.rpx-l a, .rpx-acc a { color: inherit; text-decoration: none; }
.rpx-grid tr.rpx-l a:hover, .rpx-acc a:hover { text-decoration: underline; }
.rpx-grid tfoot td { font-weight: 750; font-size: 1rem; border-top: 2px solid var(--line-strong); }
.rpx-acc td { font-variant-numeric: tabular-nums; }
.rpx-acc tr.rpx-off td { background: color-mix(in srgb, #e0a020 10%, var(--card)); }
.rpx-notes td { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.rpx-pad { padding: 0.45rem 0.6rem; margin: 0; }
@media (max-width: 900px) { .rpx-sheet { grid-template-columns: 1fr; } .rpx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rpx .cb-grid thead th { top: 0; }
.rpx .cb-grid tfoot td { position: static; }
@media print {
  .rpx .cb-bar { display: none !important; }
  .rpx-sheet { grid-template-columns: 1fr 1fr; gap: 0.3rem; }
  /* Totals once at the end, not on every page; nothing sticky on paper. */
  .rpx tfoot { display: table-row-group; }
  .rpx .cb-grid thead th, .rpx .cb-grid tfoot td { position: static !important; }
  .rpx-grid td, .rpx-grid th, .rpx-acc td, .rpx-acc th, .rpx-notes td { padding: 1px 5px !important; font-size: 9pt !important; line-height: 1.25; }
  .rpx-grid tr.rpx-l td:first-child { padding-left: 12px !important; }
  .rpx-grid tr { break-inside: avoid; }
  .rpx-grid tfoot td { font-size: 10pt !important; }
  .rpx-cards { gap: 0.3rem; }
  .rpx-cards .cb-card { padding: 0.2rem 0.5rem; }
  .rpx-cards .cb-v { font-size: 13pt; }
  .rpx .cb-head h1 { font-size: 14pt; }
  .rpx-side, .rpx .cb-pane { border-radius: 0; }
}

/* ---------- Trial Balance ---------- */
.tbx { display: flex; flex-direction: column; gap: 0.55rem; }
.tbx .cb-pane { overflow: visible; }
.tbx-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tbx-ok { --cb-c: #2e7d32; }
.tbx-bad { --cb-c: #b26a00; }
html.hr-night .tbx-ok { --cb-c: #7dce9a; }
html.hr-night .tbx-bad { --cb-c: #e0a020; }
.tbx-check { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; white-space: nowrap; }
.tbx-grid { font-variant-numeric: tabular-nums; }
.tbx-grid thead th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.tbx-grid td:first-child { color: var(--muted); font-size: 0.76rem; white-space: nowrap; width: 6.5rem; }
.tbx-grid td.text-end { white-space: nowrap; width: 8.5rem; }
.tbx-grid tr.tbx-g td { font-weight: 750; color: var(--ink-strong); background: color-mix(in srgb, var(--line) 40%, var(--card)); border-top: 2px solid var(--line-strong); }
.tbx-grid tr.tbx-s td { font-weight: 650; font-size: 0.82rem; color: var(--ink-strong); padding-left: 0.9rem; }
.tbx-grid tr.tbx-r td { font-size: 0.84rem; }
.tbx-grid tr.tbx-r td:nth-child(2) { padding-left: 1.4rem; }
.tbx-grid tr.tbx-r a { color: inherit; text-decoration: none; }
.tbx-grid tr.tbx-r a:hover { text-decoration: underline; }
.tbx-grid tr.tbx-off td { background: color-mix(in srgb, #e0a020 10%, var(--card)); }
.tbx-stored { display: block; color: #b26a00; font-size: 0.72rem; }
.tbx-grid tfoot td { font-weight: 750; font-size: 1rem; border-top: 2px solid var(--line-strong); }
.tbx-why { border-color: #e0a020; }
.tbx-causes td { font-variant-numeric: tabular-nums; }
.tbx-causes tr.tbx-cause td { font-weight: 650; color: var(--ink-strong); background: color-mix(in srgb, #e0a020 8%, var(--card)); }
.tbx-causes tr.tbx-cause small { font-weight: 500; color: var(--muted); margin-left: 0.3rem; }
.tbx-causes tr.tbx-item td { font-size: 0.8rem; color: var(--muted); }
.tbx-causes tr.tbx-item td:first-child { padding-left: 1.3rem; }
.tbx-causes tfoot td { font-weight: 750; border-top: 2px solid var(--line-strong); }
.tbx-pad { padding: 0.45rem 0.6rem; margin: 0; }
@media (max-width: 900px) { .tbx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .tbx .cb-bar { display: none !important; }
  .tbx tfoot { display: table-row-group; }
  .tbx-grid td, .tbx-grid th, .tbx-causes td { padding: 1px 5px !important; font-size: 8.5pt !important; line-height: 1.25; }
  .tbx-grid tr { break-inside: avoid; }
  .tbx-grid tfoot td { font-size: 9.5pt !important; }
  .tbx-cards { gap: 0.3rem; }
  .tbx-cards .cb-card { padding: 0.2rem 0.5rem; }
  .tbx-cards .cb-v { font-size: 13pt; }
  .tbx .cb-head h1 { font-size: 14pt; }
  .tbx .cb-pane { border-radius: 0; }
  .tbx-why { break-after: page; }
}

/* ---------- Final Accounts (Income & Expenditure, Balance Sheet) ---------- */
.fax { display: flex; flex-direction: column; gap: 0.55rem; }
.fax .cb-pane { overflow: visible; }
.fax-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fax-in { --cb-c: var(--cb-cash); }
.fax-out { --cb-c: #b26a00; }
.fax-ok { --cb-c: #2e7d32; }
.fax-bad { --cb-c: #b26a00; }
html.hr-night .fax-ok { --cb-c: #7dce9a; }
html.hr-night .fax-bad { --cb-c: #e0a020; }
.fax-title { font-size: 1.02rem; font-weight: 750; color: var(--ink-strong); margin: 0.4rem 0 0; }
.fax-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; align-items: start; }
.fax-side { border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.fax-grid { font-variant-numeric: tabular-nums; }
.fax-grid thead th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.fax-grid td.text-end { white-space: nowrap; width: 8.5rem; }
.fax-grid td.text-end:last-child { color: var(--muted); }
.fax-grid td.text-end:nth-child(2) { color: var(--ink-strong); }
.fax-grid tr.fax-g td { font-weight: 700; color: var(--ink-strong); background: color-mix(in srgb, var(--line) 35%, var(--card)); }
.fax-grid tr.fax-s td { font-weight: 600; font-size: 0.86rem; }
.fax-grid tr.fax-s td:first-child { padding-left: 1rem; }
.fax-grid tr.fax-h td { font-size: 0.84rem; }
.fax-grid tr.fax-h td:first-child { padding-left: 1.8rem; }
.fax-grid tr.fax-x td { font-weight: 700; font-style: italic; border-top: 1px solid var(--line-strong); }
.fax-grid a { color: inherit; text-decoration: none; }
.fax-grid a:hover { text-decoration: underline; }
.fax-grid tfoot td { font-weight: 750; font-size: 1rem; border-top: 2px solid var(--line-strong); }
.fax-why { border-color: #e0a020; }
.fax-causes td { font-variant-numeric: tabular-nums; }
.fax-causes tr.fax-cause td { font-weight: 650; color: var(--ink-strong); background: color-mix(in srgb, #e0a020 8%, var(--card)); }
.fax-causes tr.fax-item td { font-size: 0.82rem; color: var(--muted); }
.fax-causes tr.fax-item td:first-child { padding-left: 1.3rem; }
.fax-causes small { margin-left: 0.3rem; }
.fax-pad { padding: 0.45rem 0.6rem; margin: 0; }
@media (max-width: 900px) { .fax-sheet { grid-template-columns: 1fr; } .fax-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .fax .cb-bar { display: none !important; }
  .fax-sheet { grid-template-columns: 1fr 1fr; gap: 0.3rem; }
  .fax tfoot { display: table-row-group; }
  .fax-grid td, .fax-grid th, .fax-causes td { padding: 1px 5px !important; font-size: 9pt !important; line-height: 1.25; }
  .fax-grid tr.fax-s td:first-child { padding-left: 8px !important; }
  .fax-grid tr.fax-h td:first-child { padding-left: 14px !important; }
  .fax-grid td.text-end { width: auto; }
  .fax-grid tr { break-inside: avoid; }
  .fax-grid tfoot td { font-size: 10pt !important; }
  .fax-cards { display: none !important; }
  .fax .cb-head h1 { font-size: 14pt; }
  .fax-title { font-size: 12pt; text-align: center; margin: 4pt 0 2pt; }
  .fax-bs { break-before: page; }
  .fax-side, .fax .cb-pane { border-radius: 0; }
}

/* ---------- Salary advance ---------- */
.adv { display: flex; flex-direction: column; gap: 0.55rem; }
.adv .cb-pane { overflow: visible; }
.adv .cb-seg a { padding: 0.22rem 0.85rem; font-size: 0.8rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.adv .cb-seg a.on { background: var(--accent); color: var(--on-accent, #fff); }
.adv-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adv-c-cut { --cb-c: var(--cb-cash); }
.adv-c-warn { --cb-c: #b26a00; }
.adv-c-ok { --cb-c: #2e7d32; }
html.hr-night .adv-c-warn { --cb-c: #e0a020; }
html.hr-night .adv-c-ok { --cb-c: #7dce9a; }
.adv-msg { margin: 0; padding: 0.4rem 0.7rem; border-radius: 8px; font-size: 0.88rem;
  background: color-mix(in srgb, #2e7d32 12%, var(--card)); border: 1px solid color-mix(in srgb, #2e7d32 35%, var(--line)); }
.adv-msg-bad { background: color-mix(in srgb, #b26a00 14%, var(--card)); border-color: color-mix(in srgb, #b26a00 45%, var(--line)); }
.adv-grid { font-variant-numeric: tabular-nums; }
.adv-grid thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; vertical-align: bottom; }
.adv-grid th.adv-th-plan { color: var(--cb-cash); }
.adv-grid td { vertical-align: top; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.adv-grid td.text-end { white-space: nowrap; }
.adv-name { font-weight: 650; color: var(--ink-strong); }
.adv-code { margin-left: 0.35rem; font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.adv-sub { font-size: 0.74rem; color: var(--muted); line-height: 1.3; margin-top: 0.1rem; }
.adv-taken { white-space: nowrap; }
.adv-open { font-weight: 700; color: var(--ink-strong); }
.adv-st { display: inline-block; padding: 0 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 650; }
.adv-st-open { background: color-mix(in srgb, var(--cb-cash) 16%, var(--card)); color: var(--cb-cash); }
.adv-st-warn { background: color-mix(in srgb, #e0a020 22%, var(--card)); color: #9a5a00; }
html.hr-night .adv-st-warn { color: #f0c060; }
.adv-st-hold { background: color-mix(in srgb, var(--cb-bank) 16%, var(--card)); color: var(--cb-bank); }
.adv-st-done { background: color-mix(in srgb, var(--line) 50%, var(--card)); color: var(--muted); }
.adv-plan { width: 8.5rem; }
.adv-plan .form-control { width: 7.5rem; text-align: right; }
.adv-plan .adv-set { border-color: var(--cb-cash); font-weight: 650; }
.adv-plan-total { font-weight: 750; color: var(--cb-cash); text-align: right; padding-right: 1.4rem !important; }
.adv-act { white-space: nowrap; text-align: right; }
.adv-act form { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0 0 0.2rem 0.2rem; }
.adv-start .form-control { width: 6.5rem; text-align: right; }
.adv-grid tr.adv-row-warn td { background: color-mix(in srgb, #e0a020 8%, var(--card)); }
.adv-grid tfoot td { font-weight: 750; border-top: 2px solid var(--line-strong); }
.adv-pad { padding: 0.45rem 0.7rem; margin: 0; }
.adv-more > summary { padding: 0.5rem 0.7rem; font-weight: 650; cursor: pointer; color: var(--ink-strong); }
.adv-more[open] > summary { border-bottom: 1px solid var(--line); }
.adv-add { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: flex-end; padding: 0.2rem 0.7rem 0.8rem; }
.adv-add > label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.adv-add .form-control, .adv-add .form-select { min-width: 8rem; }
.adv-add .num { width: 8rem; text-align: right; }
.adv-f-person { flex: 1 1 16rem; }
.adv-f-purpose { flex: 1 1 20rem; }
/* Salary advance ತಿದ್ದುಪಡಿ (trustee-approved corrections) */
.adv-corr-link { margin: 0; display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; }
.adv-corr-link a { color: var(--accent); font-weight: 650; }
.adv-st-corr { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); text-decoration: none; }
.adv-st + .adv-st { margin-left: 0.3rem; }
.adv-grid tr.adv-corr-row td { background: var(--grp-bg, color-mix(in srgb, var(--accent) 5%, var(--card))); border-top: 0; }
.adv-corr { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.35rem 0.2rem 0.5rem; }
.adv-corr-head { font-weight: 700; color: var(--ink-strong); }
.adv-corr-kinds { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
.adv-corr-kinds label { display: flex; gap: 0.35rem; align-items: baseline; margin: 0; font-weight: 600; color: var(--ink-strong); cursor: pointer; }
.adv-corr-kinds label:has(input:disabled) { opacity: 0.55; cursor: default; }
.adv-corr .adv-add { padding: 0; }
.adv-corr-todo { margin: 0; color: #9a5a00; }
html.hr-night .adv-corr-todo { color: #f0c060; }
.adv-corr-todo:empty { display: none; }
.adv-corr-btns { display: flex; gap: 0.4rem; }
.adv-corr-tools { margin-left: auto; display: inline-flex; gap: 0.4rem; }
.adv-corr-grid td.adv-corr-reason { max-width: 22rem; white-space: normal; }
.adv-corr-grid tr.adv-corr-undone td { opacity: 0.6; }
.adv-corr-v { display: inline-flex; gap: 0.3rem; align-items: center; }
.adv-corr-v .form-control { width: 8.5rem; }
.adv-grid tr[hidden], .adv-corr [hidden] { display: none !important; }
.adv-printonly { display: none; }
@media print {
  .adv-noprint, .adv-corr-row { display: none !important; }
  .adv-printonly { display: inline; }
}
@media (max-width: 1100px) { .adv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .adv-grid thead { display: none; }
  .adv-grid, .adv-grid tbody, .adv-grid tr, .adv-grid td { display: block; width: 100%; }
  .adv-grid tr { border-bottom: 1px solid var(--line); padding: 0.3rem 0; }
  .adv-grid td { border: 0; padding: 0.15rem 0.6rem; text-align: left !important; }
  .adv-grid tfoot { display: none; }
  .adv-act { text-align: left; }
}
/* Bank Recon: larger, easier-to-read text (operators asked for it) and full descriptions instead of cut ones. */
.brx .brx-grid td, .brx .brx-grid th { font-size: 1rem; }
.brx .brx-grid thead th { font-size: 0.92rem; }
.brx .brx-txt { font-size: 0.98rem; overflow-wrap: anywhere; }
.brx .brx-why { font-size: 0.9rem; white-space: normal; }
.brx .brx-pair, .brx .brx-maybe { font-size: 0.86rem; }
.brx .brx-tag { font-size: 0.8rem; }
.brx .brx-check, .brx-upload small, .brx-actions small { font-size: 0.9rem; }
.brx .brx-grid .brx-tick input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.brx-verdict { font-size: 1rem; font-weight: 650; }
.brx-hand tr.brx-before.brx-findshow { display: table-row; }
.brx-verdict.brx-v-ok { color: #2e7d32; }
.brx-verdict.brx-v-warn { color: #b26a00; }
.brx-verdict.brx-v-bad { color: #b71c1c; }
html.hr-night .brx-verdict.brx-v-ok { color: #7dce9a; }
html.hr-night .brx-verdict.brx-v-warn { color: #e0a020; }
html.hr-night .brx-verdict.brx-v-bad { color: #ff8a80; }
.brx-repeats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin: 0; padding: 0.45rem 0.7rem; border-radius: 8px;
  font-size: 0.85rem; background: color-mix(in srgb, #e0a020 12%, var(--card)); border: 1px solid color-mix(in srgb, #e0a020 45%, var(--line)); }

/* ---------- Practice site ---------- */
.hr-practice-band { display: block; flex-shrink: 0; padding: 0.3rem 0.8rem; text-align: center; font-weight: 750; font-size: 0.85rem;
  letter-spacing: 0.03em; color: #fff; background: repeating-linear-gradient(45deg, #b3261e, #b3261e 14px, #9c1f18 14px, #9c1f18 28px); text-decoration: none; }
.hr-practice-band:hover { color: #fff; text-decoration: underline; }
/* The band scrolls away with the page; the red line under the top bar stays. */
.hr-practice .hr-top { box-shadow: inset 0 -3px 0 #b3261e; }
.prx { display: flex; flex-direction: column; gap: 0.55rem; }
.prx .cb-pane { overflow: visible; }
.prx-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prx-pad { padding: 0.5rem 0.7rem; margin: 0; font-size: 0.9rem; }
.prx-pw { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: 0.02em; padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.prx-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: flex-end; padding: 0 0.7rem 0.7rem; }
.prx-form label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
@media (max-width: 760px) { .prx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phone tied to an employee app login; a new phone waiting for the office. */
.emp-app-pwd .emp-app-phone { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; white-space: normal; }
.emp-app-wait { color: #b26a00; font-weight: 650; }
.pl-wait { color: #b26a00; font-weight: 650; }

/* Setup → Users for logins other than kmp / admin: own name and a change-password form. */
.own-login { max-width: 34rem; }
.own-login-who { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.own-login-who dt { font-weight: 500; color: var(--muted); }
.own-login-who dd { margin: 0; }
.own-login-pwd { display: grid; gap: 0.6rem; margin-bottom: 0.5rem; }
.own-login-pwd .form-label { display: grid; gap: 0.25rem; margin: 0; }
.own-login-pwd .btn { justify-self: start; }

/* Setup → Usage: heading with its line under it, quick dates, people-per-day rows with a folded screen trail. */
.usg-head { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.usg-quick { display: inline-flex; gap: 0.3rem; margin-right: 0.3rem; }
.usg-kpi-bad::before { background: #b42318; opacity: 0.9; }
.usg-kpi-bad .val { color: #b42318; }
html.hr-night .usg-kpi-bad .val { color: #ff8a80; }
.usg-days td { vertical-align: top; }
.usg-status { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.82rem; background: var(--dim-bg); color: var(--muted); }
.usg-status.usg-on { background: color-mix(in srgb, #1b7f3b 14%, transparent); color: #1b7f3b; font-weight: 600; }
html.hr-night .usg-status.usg-on { color: #7dce9a; }
.usg-trail summary { cursor: pointer; color: var(--link); white-space: nowrap; }
.usg-trail ol { list-style: none; margin: 0.35rem 0 0.2rem; padding: 0 0 0 0.6rem; border-left: 2px solid var(--line); font-size: 0.85rem; }
.usg-trail li { padding: 0.08rem 0; }
.usg-trail li.usg-mark { font-weight: 600; }
.usg-at { display: inline-block; min-width: 6.6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.usg-old-app { color: #c2410c; font-weight: 600; }
.usg-tied { display: inline-block; margin-left: 0.35rem; font-size: 0.78rem; color: #1b7f3b; font-weight: 600; white-space: nowrap; }
html.hr-night .usg-tied { color: #7dce9a; }
.usg-reason { color: #b42318; font-weight: 600; }
html.hr-night .usg-reason { color: #ff8a80; }
.usg-all > summary { cursor: pointer; font-weight: 600; margin: 0.4rem 0 0.6rem; color: var(--link); }

/* Leave policy */
.lp-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-bottom: 0.6rem; }
.lp-sub { color: var(--muted); font-size: 0.9rem; }
.lp-rules { margin-bottom: 0.75rem; }
.lp-order { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.lp-order-k { color: var(--muted); font-size: 0.85rem; margin-right: 0.2rem; }
.lp-pill { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.1rem 0.6rem; font-weight: 600; font-size: 0.85rem; background: var(--grp-bg); }
.lp-pill-lop { color: #b42318; border-color: rgba(180, 35, 24, 0.35); }
html.hr-night .lp-pill-lop { color: #ff8a80; border-color: rgba(255, 138, 128, 0.35); }
.lp-arrow { color: var(--muted); }
.lp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.5rem; }
.lp-tile { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 0.45rem 0.65rem; background: var(--grp-bg); }
.lp-tile-h { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.lp-tile-v { font-size: 1.05rem; font-weight: 650; color: var(--ink-strong); }
.lp-tile-n { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.lp-edit { margin-top: 0.6rem; }
.lp-edit > summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 0.9rem; }
.lp-edit-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-top: 0.5rem; }
.lp-edit-row label { display: flex; flex-direction: column; font-size: 0.78rem; font-weight: 600; color: var(--muted); gap: 0.15rem; }
.lp-edit-row .lp-check { flex-direction: row; align-items: center; gap: 0.35rem; padding-bottom: 0.4rem; }
.lp-num { width: 5.5rem; }
.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.lp-step { border-top: 3px solid var(--line-strong); }
.lp-step.lp-done { border-top-color: #2e7d32; }
.lp-step.lp-due { border-top-color: #c77700; }
.lp-step-h { font-weight: 650; display: flex; align-items: center; gap: 0.45rem; }
.lp-step-no { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.78rem; }
.lp-step-state { font-size: 0.88rem; color: var(--ink); margin: 0.3rem 0 0.5rem; }
.lp-done .lp-step-state { color: #2e7d32; }
html.hr-night .lp-done .lp-step-state { color: #7dce9a; }
.lp-step-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.lp-step-form .form-control { width: auto; flex: 1 1 8rem; min-width: 0; }
.lp-step-form .lp-num { flex: 0 0 5.5rem; }
.lp-alt { padding-left: 0; }
.lp-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0.75rem; align-items: start; }
.leave-restricted { margin-top: 0.6rem; padding: 0.45rem 0.6rem; border-radius: 8px; border: 1px solid rgba(199, 119, 0, 0.45); background: rgba(199, 119, 0, 0.1); color: #8a5300; font-weight: 600; }
html.hr-night .leave-restricted { color: #f0b860; }
.mw-period { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-left: 0.4rem; }
.mw-view { display: inline-flex; gap: 0.25rem; margin-right: 0.4rem; }
.sheet-month-days th.mw-newmonth, .sheet-month-days td.mw-newmonth { border-left: 2px solid var(--accent) !important; }


/* ---------- Seva timings (temporary counter hours) ---------- */
.st-head { flex-wrap: wrap; align-items: flex-end; }
.st-kn { font-size: 1rem; font-weight: 500; color: var(--muted); margin-left: 0.4rem; }
.st-pick { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.st-pick .form-control, .st-pick .form-select { width: auto; }
.msg-bad { background: color-mix(in srgb, #b26a00 14%, var(--card)); border-color: color-mix(in srgb, #b26a00 45%, var(--line)); }
.st-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0.9rem; align-items: start; }
.st-day-h { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; align-items: baseline; margin-bottom: 0.5rem; }
.st-panch { color: var(--accent); font-weight: 500; }
.st-table td, .st-table th { vertical-align: top; }
.st-tick { width: 2rem; }
.st-group th, .st-group td { background: var(--grp-bg) !important; color: var(--ink); font-weight: 600; }
.st-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-changed td { background: var(--warn-bg) !important; }
.st-remark { display: block; color: var(--muted); font-size: 0.85rem; white-space: normal; }
.st-edit { display: inline-block; margin-top: 0.15rem; font-size: 0.85rem; }
.st-form { position: sticky; top: 0.75rem; }
.st-row { display: flex; gap: 0.5rem; }
.st-row label { flex: 1; }
.st-modes { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.4rem 0 0.5rem; }
.st-modes label { display: flex; gap: 0.4rem; align-items: center; }
.st-slot { display: grid; grid-template-columns: 5.5rem 1fr auto 1fr; gap: 0.35rem; align-items: center; margin-bottom: 0.35rem; }
.st-off { opacity: 0.45; }
.st-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.st-dev { display: block; color: var(--muted); font-size: 0.82rem; }
.st-past > summary { cursor: pointer; font-weight: 600; }
.st-past[open] > summary { margin-bottom: 0.5rem; }
@media (max-width: 991.98px) {
  .st-wrap { grid-template-columns: 1fr; }
  .st-form { position: static; }
}

/* ---------- Seva menu: Parivara Devaru, Sevas ---------- */
.sv-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0.9rem; align-items: start; }
.sv-form { position: sticky; top: 0.75rem; }
.sv-caps { text-transform: uppercase; }
.sv-num { max-width: 7rem; }
.sv-on td { background: var(--ok-bg) !important; }
.sv-off td { color: var(--muted); }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.5rem 0.75rem; }
.sv-grid-3 { grid-template-columns: repeat(auto-fill, minmax(9rem, 12rem)); }
.sv-grid-wide { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.sv-sub { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin: 0.9rem 0 0.35rem; }
.sv-kinds { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-bottom: 0.4rem; }
.sv-kinds label { display: flex; gap: 0.4rem; align-items: center; }
.sv-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.6rem; }
.sv-filter .form-select, .sv-filter .form-control { width: auto; }
.sv-filter input[type=search] { min-width: 14rem; }
@media (max-width: 991.98px) {
  .sv-wrap { grid-template-columns: 1fr; }
  .sv-form { position: static; }
}

/* ---------- Accounts → Bank Statement ---------- */
.bs-head { gap: 0.6rem; }
.bs-form { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: flex-end; }
.bs-bank { display: grid; gap: 0.25rem; min-width: 18rem; flex: 1 1 18rem; }
.bs-period { border: 0; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.bs-period legend { font-size: 0.85rem; color: var(--muted); margin: 0; float: none; width: auto; }
.bs-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bs-seg label { padding: 0.3rem 0.75rem; cursor: pointer; margin: 0; white-space: nowrap; }
.bs-seg label + label { border-left: 1px solid var(--line); }
.bs-seg label.on { background: var(--accent); color: #fff; }
.bs-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bs-when { display: flex; gap: 0.4rem; align-items: center; }
.bs-when .form-control, .bs-when .form-select { width: auto; }
.bs-range { display: inline-flex; gap: 0.4rem; align-items: center; }
.bs-range[hidden], .bs-when [hidden] { display: none !important; }
.bs-result-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.bs-sub { display: block; color: var(--muted); font-size: 0.9rem; }
.bs-actions { display: flex; gap: 0.4rem; align-items: flex-start; }
.bs-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin-bottom: 0.7rem; }
.bs-tiles .lbl { display: block; font-size: 0.8rem; color: var(--muted); }
.bs-tiles .val { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bs-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.bs-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bs-desc { min-width: 16rem; }
.bs-table tfoot th { border-top: 2px solid var(--line); }
@media print {
  .bs-form, .bs-actions, .bs-head .btn { display: none !important; }
  .bs-result { border: 0; padding: 0; }
}

/* Users → screens given to a login (kmp / admin tick them) */
.usr-trusts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-bottom: 0.4rem; }
.usr-trusts label { display: inline-flex; align-items: center; gap: 0.35rem; }
.usr-grant-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem 1rem; margin-bottom: 0.5rem; }
.usr-grant-group { border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.6rem 0.5rem; margin: 0; background: var(--card); }
.usr-grant-group legend { float: none; width: auto; font-size: 0.9rem; font-weight: 600; margin: 0; padding: 0 0.25rem; }
.usr-grant-group > label { display: flex; gap: 0.4rem; align-items: center; font-size: 0.88rem; margin: 0.1rem 0; }
.usr-grant-group legend label { display: flex; gap: 0.4rem; align-items: center; margin: 0; }

/* Users: both tables at full height, the page scrolls (no inner scroll boxes) */
.grid-fill.usr-full { overflow: visible; min-height: 0; height: auto; margin-bottom: 1rem; }

/* Users: one tidy line per login; changes in the edit panel */
.usr-table td, .usr-table th { vertical-align: middle; }
.usr-login { display: block; font-size: 0.82rem; color: var(--muted); }
h2 .usr-login { display: inline; margin-left: 0.4rem; font-weight: 400; }
.usr-role { display: inline-block; font-size: 0.8rem; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.usr-role-prog { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.usr-role-admin { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.usr-role-office { background: var(--grp-bg); }
.usr-role-op { background: var(--warn-bg); }
.usr-off-row td { color: var(--muted); }
.usr-on td { background: var(--ok-bg) !important; }
.usr-panel { border-color: var(--accent); }
.usr-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem 0.9rem; margin-bottom: 0.8rem; }
.usr-fields label { display: grid; gap: 0.25rem; margin: 0; font-size: 0.9rem; }
.usr-screens-h { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; align-items: baseline; margin: 0.4rem 0 0.5rem; }
.usr-screens-h span { color: var(--muted); font-size: 0.9rem; }
.usr-note { color: var(--muted); margin: 0.2rem 0 0.4rem; }
.usr-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.usr-off { margin-top: 0.9rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.usr-acts form { margin-left: 0.25rem; }

/* Seva → ನಿರ್ವಹಿಸಿದ ಶಾಂತಿ ಹೋಮಾದಿಗಳು */
.sh-table th { white-space: nowrap; }
/* Filters on one line: month type, month, dates, job, archaka, show (wraps only on a narrow screen) */
.sh-form { gap: 0.6rem 1.2rem; }
.sh-form .sh-month { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.sh-form .sh-month .bs-sub { white-space: nowrap; }
.sh-form .form-select { width: auto; min-width: 9rem; }
.sh-none td, .sh-none td a { color: var(--muted); }
.sh-table tr.sh-day td { border-top: 2px solid var(--line); }
.sh-table tfoot th { border-top: 2px solid var(--line); }
/* Date wise: day buttons, one row per day, the day's list opens under it (grouped by archaka) */
.sh-daybar { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 0.3rem; margin: 0.2rem 0 0.6rem; }
.sh-dbtn { display: flex; flex-direction: column; align-items: center; padding: 0.2rem 0; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--card); line-height: 1.15; }
.sh-dbtn b { font-size: 0.95rem; }
.sh-dbtn small { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
a.sh-dbtn:hover, a.sh-dbtn:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.sh-dbtn.off { opacity: 0.45; }
.sh-daytools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-bottom: 0.5rem; }
.sh-daytools .bs-sub { margin-right: auto; }
.sh-daysum .sh-drow { cursor: pointer; }
.sh-daysum .sh-drow:hover td { background: var(--row-hover); }
.sh-daysum .sh-dblk + .sh-dblk .sh-drow td { border-top: 2px solid var(--line); }
.sh-daysum .sh-dblk.open .sh-drow td { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.sh-caret { display: inline-block; width: 0.9em; color: var(--muted); transition: transform 0.15s; }
.sh-dblk.open .sh-caret { transform: rotate(90deg); }
.sh-wd { font-size: 0.8rem; color: var(--muted); }
.sh-who { font-size: 0.85rem; color: var(--muted); min-width: 12rem; }
.sh-dlist > td { padding: 0.2rem 0 0.6rem 1.6rem; }
.sh-inner th, .sh-inner td { font-size: 0.9rem; }
.sh-inner tr.sh-arch th { background: var(--grp-bg); padding-top: 0.35rem; }
.sh-top { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 20; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); font-size: 0.9rem; }
.sh-top:hover { background: var(--accent-hover); color: var(--on-accent); }
@media print {
    .sh-form, .sh-acts, .sh-daybar, .sh-daytools, .sh-top { display: none !important; }
    .sh-daysum .sh-dlist[hidden] { display: table-row !important; }
    .sh-caret { display: none; }
}

/* ಕಾರ್ಯಕ್ರಮಗಳು → ಹೊರಗಿನ ಕಾರ್ಯಕ್ರಮ, ಯಕ್ಷಗಾನಕ್ಕೆ ಹೋದವರು (read only) */
.kk-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1100px) { .kk-split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }
.kk-paid td, .kk-paid td a { color: var(--muted); }
.kk-paid td { background: var(--grp-bg); }
.kk-paid-txt { color: var(--muted); }
.kk-on td { background: color-mix(in srgb, var(--accent) 12%, var(--card)) !important; }
.kk-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.kk-tag-warn { background: var(--warn-bg); }
.kk-detail-h { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
@media print { .kk-detail-h .btn { display: none !important; } }
/* ಹೊರಗಿನ ಕಾರ್ಯಕ್ರಮ board: tiles, purohitas on the left, programmes on the right; each pane scrolls on its own */
.kk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.kk-tile { display: flex; flex-direction: column; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); border-top: 3px solid var(--accent); }
.kk-tile .lbl { font-size: 0.78rem; color: var(--muted); }
.kk-tile .val { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kk-tile .sub { font-size: 0.75rem; color: var(--muted); }
.kk-tile-warn { border-top-color: #b26a00; }
.kk-acts { margin-left: auto; align-self: center; }
.kk-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1100px) { .kk-board { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }
.kk-pane { padding: 0.6rem 0.7rem; }
.kk-pane-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; margin-bottom: 0.5rem; }
.kk-find { width: auto; min-width: 14rem; margin-left: auto; }
.kk-scroll { max-height: calc(100vh - 330px); min-height: 12rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.kk-table { margin: 0; }
.kk-table thead th { position: sticky; top: 0; z-index: 2; background: var(--thead); white-space: nowrap; }
.kk-table tfoot th { position: sticky; bottom: 0; z-index: 2; background: var(--thead); border-top: 2px solid var(--line); }
.kk-table tbody tr { cursor: default; }
.kk-table tbody tr:hover td { background: var(--row-hover) !important; }
.kk-table tbody tr.kk-sel td { background: color-mix(in srgb, var(--accent) 22%, var(--card)) !important; box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.kk-table tbody tr.kk-day td { border-top: 2px solid var(--line); }
.kk-table .kk-same { color: transparent; }
.kk-table tbody tr:hover .kk-same, .kk-table tbody tr.kk-sel .kk-same { color: var(--muted); }
.kk-people tbody tr.kk-link { cursor: pointer; }
.kk-pay { font-size: 0.85rem; color: var(--muted); }
@media print {
    .kk-scroll { max-height: none; overflow: visible; border: 0; }
    .kk-table thead th, .kk-table tfoot th { position: static; }
    .kk-find, .kk-acts { display: none !important; }
    .kk-table .kk-same { color: inherit; }
}

/* Pay → Pooja split */
.ps-ok { background: color-mix(in srgb, #2e7d32 14%, var(--card)); color: #2e7d32; border-color: #2e7d32; }
html.hr-night .ps-ok { color: #7dce9a; border-color: #7dce9a; }
.ps-okmark { color: #2e7d32; font-weight: 700; }
html.hr-night .ps-okmark { color: #7dce9a; }
.ps-total { border-top-color: #2e7d32; }
.ps-dates { line-height: 1.9; }
.ps-day { display: inline-block; margin: 0 0.25rem 0.15rem 0; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: 6px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.ps-skip { color: var(--muted); text-decoration: line-through; border-style: dashed; }
.pay-split-link { margin-left: 0.3rem; font-size: 0.8rem; text-decoration: none; opacity: 0.7; }
.pay-split-link:hover { opacity: 1; }
@media print { .pay-split-link { display: none; } }

/* Setup → Sahayaka usage */
.sau-acts { display: inline-flex; gap: 0.3rem; margin-left: auto; }
.sau-mac { display: block; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sau-print-only { display: none; }
@media print {
  .sau-form { display: none !important; }
  .sau-print-only { display: block; font-weight: 600; }
  .usg-trail summary, .usg-all > summary { color: inherit; }
}

/* Seva → ಇಂದಿನ ಸೇವಾ ಕಾರ್ಯಕ್ರಮಗಳು / ಶಾಂತಿ ಹೋಮಗಳು (view only): one calm centred column */
.sv-page { max-width: 1000px; margin: 0 auto; }
.hm-page { max-width: 880px; }
.sv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 0.6rem 1rem; margin: 0.4rem 0 0.8rem; }
.sv-title { font-size: 1.55rem; font-weight: 700; margin: 0; }
.sv-date { color: var(--muted); font-size: 1rem; margin-top: 0.1rem; }
.sv-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.sv-bar input[type="date"] { width: 9.2rem; }
.sv-counts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.sv-counts span { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.9rem; color: var(--muted); background: var(--card); }
.sv-counts b { color: var(--ink-strong); font-size: 1.02rem; margin-right: 0.2rem; font-variant-numeric: tabular-nums; }
.sv-counts .sv-pending b, .sv-counts .hm-pending b { color: inherit; }
.sv-counts .hm-done b { color: inherit; }
.sv-notice { border-left: 4px solid var(--accent); background: var(--card); border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; display: grid; gap: 0.2rem; }
.sv-fest { font-weight: 700; color: var(--accent); }
.sv-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 0.9rem; }
.sv-card h2 { font-size: 1.08rem; font-weight: 700; margin: 0 0 0.5rem; }
.sv-n { display: inline-block; min-width: 1.6rem; padding: 0 0.45rem; margin-left: 0.3rem; border-radius: 999px; background: var(--grp-bg); color: var(--muted); font-size: 0.85rem; text-align: center; }
.sv-slot { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); margin: 0.6rem 0 0.2rem; }
.sv-slot:first-of-type { margin-top: 0; }
.sv-list { list-style: none; margin: 0; padding: 0; }
.sv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.4rem 0.2rem 0.4rem 0.7rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.sv-list li:last-child { border-bottom: 0; }
.sv-list li.sv-pending { border-left-color: #d9534f; }
.sv-list li.sv-done { border-left-color: #2f9a54; }
.sv-what { display: flex; flex-direction: column; min-width: 0; }
.sv-seva { font-weight: 600; }
.sv-place { font-size: 0.84rem; color: var(--muted); }
.sv-who { font-weight: 600; text-align: right; }
.sv-pending .sv-who, span.sv-pending, .sv-counts .sv-pending, .hm-pending .hm-who, span.hm-pending, .sv-counts .hm-pending { color: #b42318; }
.sv-done .sv-who, span.sv-done, .hm-done .hm-who, span.hm-done, .sv-counts .hm-done { color: #1b7f3b; }
html.hr-night .sv-pending .sv-who, html.hr-night span.sv-pending, html.hr-night .sv-counts .sv-pending,
html.hr-night .hm-pending .hm-who, html.hr-night span.hm-pending, html.hr-night .sv-counts .hm-pending { color: #ff8a80; }
html.hr-night .sv-done .sv-who, html.hr-night span.sv-done, html.hr-night .hm-done .hm-who,
html.hr-night span.hm-done, html.hr-night .sv-counts .hm-done { color: #7dce9a; }
.sv-key { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--muted); }
.sv-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 0.9rem; align-items: start; }
.sv-grid > .sv-side:only-child { grid-column: 1 / -1; }
.sv-pudu { padding: 0.2rem 0 0.2rem 0.7rem; line-height: 1.55; }
.sv-tokens { list-style: none; margin: 0; padding: 0; columns: 2; }
.sv-tokens li { padding: 0.15rem 0; break-inside: avoid; }
.sv-tokens b { display: inline-block; min-width: 2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sv-days { list-style: none; margin: 0; padding: 0; }
.sv-days li { display: flex; gap: 0.7rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.sv-days li:last-child { border-bottom: 0; }
.sv-days span { min-width: 6.2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sv-days small { display: block; font-size: 0.78rem; }
@media (max-width: 820px) { .sv-grid { grid-template-columns: 1fr; } }
.hm-banner { text-align: center; margin: 0 0 0.9rem; padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--grp-bg); }
.hm-main { font-size: 1.15rem; font-weight: 700; }
.hm-sub { color: var(--muted); font-size: 0.95rem; }
.hm-page .sv-counts { justify-content: center; }
.hm-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hm-c-sl { width: 2.8rem; }
.hm-c-who { width: 40%; }
.hm-c-tok { width: 4.5rem; }
.hm-table th { font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); }
.hm-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.hm-table tbody tr:last-child td { border-bottom: 0; }
.hm-table td.num { color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-who { font-weight: 600; }
.hm-prog div + div { margin-top: 0.15rem; }
.hm-table tr.hm-fam-a > td { background: color-mix(in srgb, #8e6bd6 14%, var(--card)); }
.hm-table tr.hm-fam-b > td { background: color-mix(in srgb, #e3b341 18%, var(--card)); }
.hm-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; vertical-align: middle; margin-right: 0.2rem; }
.hm-swatch.hm-fam-a { background: color-mix(in srgb, #8e6bd6 30%, var(--card)); }
.hm-swatch.hm-fam-b { background: color-mix(in srgb, #e3b341 35%, var(--card)); }
@media (max-width: 600px) { .hm-c-who { width: 45%; } .sv-tokens { columns: 1; } }
@media print {
  .sv-bar, .sv-key, .sv-counts { display: none !important; }
  .sv-page { max-width: none; }
  .sv-card { border: 0; padding: 0; }
  .hm-banner { background: none; }
  /* Printed from the Dark theme too: paper colours, dark ink. */
  html .sv-page { --muted: #555; --line: #ccc; --grp-bg: #f3f3f3; --accent: #1f4e8c; }
  .sv-page .sv-pending .sv-who, .sv-page .hm-pending .hm-who { color: #b42318 !important; }
  .sv-page .sv-done .sv-who, .sv-page .hm-done .hm-who { color: #1b7f3b !important; }
  .hm-table tr { break-inside: avoid; }
  .hm-table tr.hm-fam-a > td, .hm-table tr.hm-fam-b > td, .hm-who { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Home → Dashboard (cards for the screens a login has) and Setup → My settings */
.db-page { max-width: 1100px; }
.db-alerts { border: 1px solid var(--line); border-left: 4px solid #d9822b; background: var(--card); border-radius: 12px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; display: grid; gap: 0.25rem; }
.db-alerts-h { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.db-alert { display: block; text-decoration: none; color: var(--ink-strong); padding: 0.15rem 0; }
.db-alert:hover { text-decoration: underline; }
.db-alert.db-bad { color: #b42318; }
.db-alert.db-warn { color: #a15c07; }
html.hr-night .db-alert.db-bad { color: #ff8a80; }
html.hr-night .db-alert.db-warn { color: #f5c26b; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.9rem; align-items: start; }
.db-card { margin-bottom: 0; }
.db-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.db-card-h h2 { margin: 0; }
.db-open { font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.db-figs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.2rem 0 0.5rem; }
.db-fig { display: flex; flex-direction: column; }
.db-val { font-size: 1.35rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.db-lbl { font-size: 0.78rem; color: var(--muted); }
.db-fig.db-bad .db-val { color: #b42318; }
.db-fig.db-warn .db-val { color: #a15c07; }
.db-fig.db-ok .db-val { color: #1b7f3b; }
html.hr-night .db-fig.db-bad .db-val { color: #ff8a80; }
html.hr-night .db-fig.db-warn .db-val { color: #f5c26b; }
html.hr-night .db-fig.db-ok .db-val { color: #7dce9a; }
.db-bar { height: 0.5rem; border-radius: 999px; background: var(--grp-bg); overflow: hidden; margin: 0.1rem 0 0.6rem; }
.db-bar span { display: block; height: 100%; background: #2f9a54; border-radius: 999px; }
.db-lines { list-style: none; margin: 0; padding: 0; }
.db-lines li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.db-lines li:last-child { border-bottom: 0; }
.db-lines li span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.db-lines li.db-accent span:last-child { color: var(--accent); font-weight: 600; }
.db-note { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }
.me-page { max-width: 640px; }
.me-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.me-form .form-select { width: auto; min-width: 16rem; }

/* Side menu stays in place on computer screens while a long page scrolls (phones keep the slide-out menu). */
@media (min-width: 992px) {
  .hr-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; align-self: flex-start; }
}
@media print { .hr-sidebar { position: static; height: auto; } }

/* Back to the Dashboard, on a screen opened from a Dashboard card */
.hr-back-dash { white-space: nowrap; text-decoration: none; font-size: 0.88rem; font-weight: 600; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-strong); }
.hr-back-dash:hover { background: var(--grp-bg); }

/* Whole Dashboard card is clickable */
.db-card { position: relative; transition: border-color .15s ease, box-shadow .15s ease; }
.db-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }
.db-open::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }

/* Pay → This month: earlier salary of the person being keyed (right-hand panel) */
.pay-hist { position: fixed; top: 4.5rem; right: 0.75rem; bottom: 0.75rem; width: 330px; z-index: 30; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pay-hist[hidden] { display: none; }
body.pay-hist-open .pay-grid-form, body.pay-hist-open .page-toolbar { margin-right: 345px; }
.pay-hist-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.pay-hist-name { font-weight: 700; color: var(--ink-strong); line-height: 1.25; }
.pay-hist-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.pay-hist-table { width: 100%; font-size: 0.8rem; font-variant-numeric: tabular-nums; border-collapse: collapse; }
.pay-hist-table th, .pay-hist-table td { padding: 0.22rem 0.3rem; border-bottom: 1px solid var(--line); }
.pay-hist-table thead th { text-align: right; font-weight: 700; color: var(--ink-strong); white-space: nowrap; vertical-align: bottom; }
.pay-hist-table thead th span { display: block; font-weight: 500; font-size: 0.68rem; color: var(--muted); }
.pay-hist-table tbody th { text-align: left; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pay-hist-table td { text-align: right; white-space: nowrap; color: var(--ink-strong); }
.pay-hist-table tr.pay-hist-total th, .pay-hist-table tr.pay-hist-total td { font-weight: 750; color: var(--ink-strong); }
.pay-hist-table td.pay-hist-chg { background: color-mix(in srgb, #e0a020 22%, var(--card)); border-radius: 4px; }
.pay-hist-none { margin: 0.3rem 0; font-size: 0.84rem; color: var(--muted); }
.pay-hist-link { font-size: 0.8rem; color: var(--accent); margin-top: auto; }
.pay-sheet tr.pay-hist-row > td { background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
@media (max-width: 991px) {
  .pay-hist { top: auto; left: 0.5rem; right: 0.5rem; width: auto; max-height: 48vh; }
  body.pay-hist-open .pay-grid-form, body.pay-hist-open .page-toolbar { margin-right: 0; margin-bottom: 50vh; }
}
@media print { .pay-hist { display: none !important; } }

/* This month: green columns add to salary, red columns are taken off it (also in the earlier-salary panel). */
:root { --pay-add-bg: #e8f5ea; --pay-add-ink: #1e6b34; --pay-ded-bg: #fbe8e6; --pay-ded-ink: #a3291c; }
html.hr-night { --pay-add-bg: rgba(84, 190, 120, .13); --pay-add-ink: #8fdcaa; --pay-ded-bg: rgba(230, 100, 90, .14); --pay-ded-ink: #f2a59b; }
/* Header tint laid over the header colour, so the sticky header stays solid when rows scroll under it (night tints are see-through). */
.pay-sheet th.pay-add { background: linear-gradient(var(--pay-add-bg), var(--pay-add-bg)), var(--thead); color: var(--pay-add-ink); }
.pay-sheet th.pay-ded { background: linear-gradient(var(--pay-ded-bg), var(--pay-ded-bg)), var(--thead); color: var(--pay-ded-ink); }
.pay-sheet td.pay-add { background: color-mix(in srgb, var(--pay-add-bg) 55%, transparent); }
.pay-sheet td.pay-ded { background: color-mix(in srgb, var(--pay-ded-bg) 55%, transparent); }
.pay-sheet td.pay-add .pay-cell { border-color: color-mix(in srgb, var(--pay-add-ink) 35%, var(--line)); }
.pay-sheet td.pay-ded .pay-cell { border-color: color-mix(in srgb, var(--pay-ded-ink) 35%, var(--line)); }
.pay-hist-table tr.pay-hist-add th, .pay-hist-table tr.pay-hist-add td { color: var(--pay-add-ink); }
.pay-hist-table tr.pay-hist-ded th, .pay-hist-table tr.pay-hist-ded td { color: var(--pay-ded-ink); }
.pay-hist-table tr.pay-hist-note th, .pay-hist-table tr.pay-hist-note td { color: var(--muted); font-style: italic; }
.pay-hist-pkg { font-size: 0.78rem; color: var(--ink-strong); background: var(--grp-bg, color-mix(in srgb, var(--accent) 7%, var(--card)));
  border-radius: 8px; padding: 0.35rem 0.5rem; }
.pay-hist-season { margin-bottom: 0.4rem; }
.pay-hist-season thead th { text-align: left !important; }

/* Salary advance: the row being worked on */
.adv-grid tr.adv-row-on > td { background: color-mix(in srgb, var(--accent) 12%, var(--card)) !important; }
.adv-grid tr.adv-row-on > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* This month, Aata by hand: a pay slab / PF / ESI / PT typed over the worked-out figure. */
.pay-sheet .pay-cell.pay-typed { font-weight: 700; color: var(--accent); }

/* People → edit: everyone of the same kind on the right; a click opens that person here. */
.emp-layout.emp-layout-roster { grid-template-columns: 13.5rem minmax(0, 1fr) 15rem; }
.emp-roster {
  position: sticky; top: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem;
  max-height: calc(100vh - 1.5rem); padding: 0.45rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.emp-roster-list { overflow-y: auto; display: flex; flex-direction: column; gap: 0.05rem; }
.emp-roster-list a {
  display: flex; justify-content: space-between; gap: 0.4rem; padding: 0.32rem 0.5rem; border-radius: 7px;
  color: var(--ink); text-decoration: none; font-size: 0.84rem;
}
.emp-roster-list a:hover { background: var(--row-hover); color: var(--ink-strong); text-decoration: none; }
.emp-roster-list a.on { background: var(--accent); color: #fff; font-weight: 700; }
.emp-roster-code { color: var(--muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.emp-roster-list a.on .emp-roster-code { color: rgba(255, 255, 255, 0.85); }
@media (max-width: 1200px) {
  .emp-layout.emp-layout-roster { grid-template-columns: 13.5rem minmax(0, 1fr); }
  .emp-roster { display: none; }
}
/* People list: the name opens the edit screen; ⓘ opens the quick-look card. */
.pp-card { margin-left: 0.35rem; font-size: 0.85rem; opacity: 0.6; }
.pp-card:hover { opacity: 1; }

/* This month: Id, Name and Package stay at the left on sideways scroll (left offsets set by the page); figures at the right. */
.pay-sheet .pay-stick { position: sticky; z-index: 1; background: var(--card); }
.pay-sheet thead th.pay-stick { z-index: 3; background: var(--thead); }
.pay-sheet .pay-stick-end { box-shadow: inset -1px 0 0 var(--line-strong); }
.pay-sheet thead th.pay-stick-end { box-shadow: inset -1px 0 0 var(--line-strong), 0 1px 0 var(--line-strong); }
.pay-sheet th.pay-sum { background: linear-gradient(color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent) 10%, transparent)), var(--thead); }
.pay-sheet td.pay-sum { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pay-sheet tr.pay-fig-wait [data-fig] { opacity: 0.45; }
/* This month: Nett no longer equals the generated run (changed after Generate). */
.pay-sheet td.pay-stale { background: var(--warn-bg) !important; color: #b45309; outline: 1px solid #f59e0b; outline-offset: -1px; }
.pay-stale-note { border-left: 3px solid #f59e0b; padding-left: 8px; }
/* This month: Gross above the ESI wage limit (ESI number). Red: not eligible this period. Amber: ESI continues to the period's end. */
.pay-sheet tr.pay-esi-out > td { background: color-mix(in srgb, #dc2626 22%, var(--card)) !important; }
.pay-sheet tr.pay-esi-over > td { background: color-mix(in srgb, #f59e0b 22%, var(--card)) !important; }
.pay-esi-note { border-left: 3px solid #dc2626; padding-left: 8px; }

/* Row highlighter for read-only grids (data-row-hl): the row under the pointer, and the row last clicked stays marked. */
table[data-row-hl] > tbody > tr:hover > td { background: var(--grid-row-on) !important; }
table[data-row-hl] > tbody > tr { cursor: default; }

/* Work places (Setup → Work places, Attendance → Work places) */
.wp-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wp-inline label { display: flex; gap: 4px; align-items: center; margin: 0; font-size: 0.85rem; }
.wp-inline .form-control, .wp-inline .form-select { width: auto; }
.wp-num { width: 70px !important; }
.wp-hours { width: 120px !important; }
.wp-pick { min-width: 240px; }
.wp-type { width: 150px !important; }
.wp-check { gap: 6px; }
.wp-setup { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.3fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .wp-setup { grid-template-columns: 1fr; } }
.wp-list { padding: 12px; }
.wp-list tr.wp-on > td { background: var(--grid-row-on); }
.wp-list tr.wp-off > td { color: var(--foot-ink); }
.wp-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 0.75rem; background: var(--dim-bg); color: var(--foot-ink); }
.wp-tag-normal { background: color-mix(in srgb, #16a34a 20%, var(--card)); color: inherit; }
.wp-planname { white-space: nowrap; font-weight: 500; }
.wp-label { width: 70px !important; }
.wp-timing { width: auto; max-width: 280px; }
.wp-people .wp-no { width: 2em; color: var(--foot-ink); }
.wp-acts { white-space: nowrap; }
.wp-acts form { display: inline; }
.wp-plantext { font-size: 0.85rem; }
.wp-plan { border-top: 1px solid var(--line); padding-top: 8px; }
.wp-plan-h { font-weight: 600; margin-bottom: 6px; }
.wp-plan input[type=time], .wp-edit input[type=time] { width: 110px; }
.wp-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.wp-head .wp-inline .form-control { width: 150px; }
.wp-sub { color: var(--foot-ink); }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.wp-card { padding: 10px 12px; border-left: 4px solid var(--line-strong); }
.wp-card.wp-ok { border-left-color: #16a34a; }
.wp-card.wp-low, .wp-card.wp-over { border-left-color: #f59e0b; }
.wp-card.wp-short { border-left-color: #dc2626; }
.wp-card.wp-hand { border-left-color: var(--accent); }
.wp-card-h { display: flex; justify-content: space-between; align-items: baseline; }
.wp-name { font-weight: 600; }
.wp-count { font-variant-numeric: tabular-nums; }
.wp-state { font-size: 0.85rem; color: var(--foot-ink); margin-bottom: 4px; }
.wp-card.wp-short .wp-state { color: #dc2626; }
.wp-day .wp-pos { width: 2em; font-weight: 600; }
.wp-day .wp-hrs { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wp-day .wp-note { font-size: 0.8rem; color: var(--foot-ink); }
.wp-day .wp-note span + span { margin-left: 6px; }
.wp-day tr.wp-leave > td { color: var(--foot-ink); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.wp-day tr.wp-leave > td.wp-note { text-decoration: none; }
.wp-day tr.wp-dep > td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wp-day tr.wp-empty > td { color: #dc2626; }
.wp-ask { color: #b45309; }
.wp-card .wp-acts { margin-top: 4px; }
.wp-arrange select.wp-pick { min-width: 280px; }
.wp-arrange input[readonly] { background: var(--dim-bg); }
.wp-who { font-size: 0.85rem; }
.wp-rot summary { cursor: pointer; font-size: 0.8rem; color: var(--link); }
.wp-scheds td { vertical-align: top; }
.wp-dep-row td { border-top: 1px dashed var(--line); }
.wp-edit summary { cursor: pointer; font-size: 0.85rem; color: var(--link); }
.wp-ename { font-weight: 500; white-space: nowrap; }
.leave-duty-ask { color: #b45309; border-left: 3px solid #f59e0b; padding-left: 8px; }
.leave-duty-ask a { margin-left: 6px; }

/* Duty register: the day's punches with Ignore / Restore */
.dt-punches { margin-top: 2px; font-size: 0.78rem; }
.dt-punches summary { cursor: pointer; color: var(--link); }
.dt-punch { display: flex; align-items: center; gap: 6px; }
.dt-punch .t { font-variant-numeric: tabular-nums; }
.dt-punch .btn-link { padding: 0 4px; font-size: 0.78rem; }
.dt-punch.ignored .t { text-decoration: line-through; color: var(--foot-ink); }

/* Leave approvals: a change waiting on an approved leave */
.leave-change-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 8px; font-size: 0.75rem;
  background: color-mix(in srgb, #f59e0b 25%, var(--card)); }
.leave-change-box { border-left: 3px solid #f59e0b; padding: 6px 10px; margin: 8px 0; background: color-mix(in srgb, #f59e0b 8%, var(--card)); }
.usg-blocked-app { color: #dc2626; font-weight: 700; }
.pp-allow { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pp-allow-btn { padding: 0 8px; font-size: 0.75rem; line-height: 1.5; }

/* Setup → Users: tabs, phone login board */
.usr-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 0.75rem; }
.usr-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.45rem 0.9rem; color: var(--muted); font-weight: 600; }
.usr-tab.on { color: var(--ink-strong); border-bottom-color: var(--accent); }
.usr-tab:hover { color: var(--ink-strong); }
.usr-count { display: inline-block; min-width: 1.5rem; padding: 0 0.4rem; margin-left: 0.3rem; border-radius: 999px; background: var(--grp-bg); font-size: 0.78rem; text-align: center; }
.usr-count-warn { background: var(--warn-bg); color: #b26a00; }
.usr-tiles { margin-bottom: 0.6rem; }
.usr-tiles .kk-tile { text-align: left; align-items: flex-start; cursor: pointer; font: inherit; color: inherit; }
.usr-tile-warn .val { color: #b26a00; }
html.hr-night .usr-tile-warn .val, html.hr-night .usr-count-warn, html.hr-night .usr-st-warn { color: #f0b350; }
.usr-phone-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.usr-phone-bar input[type=search] { width: 16rem; max-width: 100%; }
.usr-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.usr-chip { border: 1px solid var(--line-strong); background: var(--card); color: inherit; border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.85rem; }
.usr-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.usr-phone-box { padding: 0; overflow: auto; }
.usr-phone-table { margin: 0; }
.usr-phone-table thead th { position: sticky; top: 0; z-index: 2; background: var(--thead); }
.usr-sub { display: block; font-size: 0.78rem; color: var(--muted); }
.usr-st-warn { color: #b26a00; }
.usr-wait-row > td { background: color-mix(in srgb, #f0b350 12%, transparent); }
.usr-ver { display: inline-block; padding: 0 0.5rem; border-radius: 999px; font-size: 0.82rem; border: 1px solid var(--line); }
.usr-ver-ok { background: color-mix(in srgb, #2e9d5b 18%, var(--card)); }
.usr-ver-old { background: var(--warn-bg); color: #b26a00; }
.usr-ver-blocked { background: color-mix(in srgb, #d64545 20%, var(--card)); color: #b42318; }
html.hr-night .usr-ver-old { color: #f0b350; }
html.hr-night .usr-ver-blocked { color: #ff8a80; }
.emp-app-code { padding: 0.1rem 0.6rem; border-radius: 6px; background: var(--warn-bg); border: 1px solid var(--line); }
.emp-app-code strong { font-size: 1.05rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
/* Horagina: purohitas of the clicked programme */
.kk-table tbody tr.kk-hit > td { background: color-mix(in srgb, #f0b350 30%, var(--card)) !important; }
.kk-table tbody tr.kk-hit > td:first-child { box-shadow: inset 4px 0 0 #e08a00; font-weight: 700; }
.kk-share { margin-left: 0.4rem; font-size: 0.78rem; font-weight: 600; color: #b26a00; font-variant-numeric: tabular-nums; }
html.hr-night .kk-share { color: #f0b350; }
/* Bank Recon: the head's alias (ac_accountheads.alias) */
.brx-alias { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-top: -0.1rem; }
h1 .brx-alias { display: inline; margin-left: 0.5rem; font-size: 0.85rem; }
