:root {
  --ink: #17212b;
  --muted: #667085;
  --line: #d7dde5;
  --brand: #0f7a5c;
  --accent: #f5a524;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 78px auto 0 0;
  z-index: 19;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, .98);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(23, 33, 43, .06);
  overflow-y: auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 65px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(23, 33, 43, .06);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--ink);
}
.brand-logo { width: 142px; height: auto; display: block; }
.brand-title {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  font-size: 15px;
}
.login-logo { width: 180px; height: auto; display: block; margin: 0 auto 16px; }
.login-logo-divider { margin: 0 0 20px; border: 0; border-top: 1px solid var(--line); }
.nav {
  display: grid;
  gap: 4px;
  align-content: start;
}
.nav a {
  display: flex;
  align-items: center;
  color: var(--ink);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  min-height: 38px;
  padding: 9px 12px;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: #edf7f3; color: var(--brand); }
.nav a.active {
  background: var(--brand);
  color: #fff;
}
.nav-group {
  display: grid;
  gap: 4px;
}
.nav-submenu {
  display: grid;
  gap: 2px;
  margin: 0 0 6px 12px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.nav-submenu a {
  border-radius: 6px;
  min-height: 32px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}
.nav-submenu a.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff7e6;
  color: #b54708;
  font-weight: 800;
}
.account-text { display: grid; gap: 1px; line-height: 1.1; }
.account-text strong { font-size: 13px; }
.account-text small { color: var(--muted); font-size: 11px; letter-spacing: .05em; }
.account-dropdown {
  position: relative;
}
.account-dropdown summary {
  cursor: pointer;
  list-style: none;
}
.account-dropdown summary::-webkit-details-marker {
  display: none;
}
.account-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 33, 43, .14);
}
.account-dropdown-menu button {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.account-dropdown-menu button:hover {
  background: #edf7f3;
  color: var(--brand);
}
.logout-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
}
.logout-btn:hover {
  border-color: #f5c2c0;
  background: #fff1f0;
  color: var(--danger);
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.has-sidebar .wrap {
  max-width: none;
  margin-left: 248px;
  padding: 32px 28px 24px;
}
.auth-wrap { max-width: 1040px; margin: 8vh auto; padding: 24px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 18px; align-items: stretch; }
.login-layout > .panel { margin-bottom: 0; }
.latest-wins-panel { min-width: 0; display: flex; flex-direction: column; }
.latest-wins-panel h2, .login-panel h1 { margin-top: 0; }
.login-rooftop-image { display: block; width: 100%; flex: 1; min-height: 260px; object-fit: cover; border-radius: 6px; }
.latest-wins-list { display: grid; gap: 10px; }
.latest-win-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 7px; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; font-size: 14px; white-space: nowrap; overflow-x: auto; }
.latest-win-separator { color: #98a2b3; }
.latest-win-status { display: inline-flex; align-items: center; gap: 5px; color: #15803d; font-weight: 700; white-space: nowrap; }
.latest-win-check { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #15803d; color: #fff; font-size: 12px; }
.latest-win-check::before { content: "\2713"; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.collapsible-panel {
  padding: 0;
}
.collapsible-panel > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}
.collapsible-panel > summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand);
  font-weight: 800;
}
.collapsible-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}
.collapsible-panel[open] > summary::before {
  content: "-";
}
.collapsible-panel > form,
.collapsible-panel > table,
.collapsible-panel > nav,
.collapsible-panel > .grid,
.collapsible-panel > .grid-2,
.collapsible-panel > .actions,
.collapsible-panel > .muted,
.collapsible-panel > .pagination {
  margin: 18px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 18px 0 0;
  font-size: 12pt;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.pagination-bar .pagination {
  justify-content: flex-start;
  margin: 0;
}
.pagination-summary {
  color: var(--muted);
  font-size: 12pt;
  white-space: nowrap;
}
.pagination ul {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pagination li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  font-size: 13px;
}
.pagination a:hover,
.pagination li.active span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.pagination li.disabled span {
  color: var(--muted);
  background: #f5f7f8;
}
.bank-description {
  width: 220px;
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.bank-date {
  white-space: nowrap;
}
.bank-reference {
  width: 160px;
  max-width: 160px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.bank-classify-form > div {
  margin-top: 10px;
}
.purchase-allocation-list {
  display: grid;
  gap: 8px;
}
.purchase-allocation-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(110px, .8fr) minmax(130px, 1fr) minmax(190px, 1.4fr);
  gap: 8px;
  align-items: center;
}
.purchase-allocation-row input,
.purchase-allocation-row select {
  min-width: 0;
}
.partner-credit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.partner-credit-row label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.partner-credit-row input[type="checkbox"],
.checkbox-label input {
  width: auto;
  min-height: auto;
}
.compact-actions {
  gap: 6px;
  margin: 0;
}
.bank-stats-section-title {
  margin-top: 24px;
  margin-bottom: 10px;
}
.bank-processed-stats {
  grid-template-columns: repeat(2, minmax(180px, 260px));
}
.bank-statement-upload-row { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 14px; }
.bank-statement-upload-row .btn { white-space: nowrap; }
.collapsible-panel > table {
  width: calc(100% - 36px);
}
.bom-material-table { min-width: 980px; }
.material-group-row th {
  background: #f8fbfa;
  color: var(--brand);
  font-weight: 700;
  text-align: left;
}
.material-child-name { padding-left: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-payment-stat-door .metric,
.metric.project-payment-stat-door { background: #e0f2fe; }
.project-payment-stat-door.is-stats-open .metric,
.metric.project-payment-stat-door.is-stats-open { background: #dcfce7; }
.project-payment-stat-door .project-stat-value { font-size: 20px; }
.project-admin-stat-door .metric,
.metric.project-admin-stat-door { background: #e0f2fe; }
.project-admin-stat-door.is-stats-open .metric,
.metric.project-admin-stat-door.is-stats-open { background: #dcfce7; }
.project-admin-stat-door .project-stat-value { font-size: 20px; }
.project-type-table { table-layout: fixed; }
.project-type-table th:nth-child(1), .project-type-table td:nth-child(1) { width: 24%; }
.project-type-table th:nth-child(2), .project-type-table td:nth-child(2) { width: 22%; }
.project-type-table th:nth-child(3), .project-type-table td:nth-child(3) { width: 54%; }
.project-type-detail > td { padding: 18px; background: #f8fbfa; }
.project-type-stats { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; line-height: 1.4; }
.project-type-stat-badge { display: inline-block; padding: 4px 8px; border-radius: 6px; color: #fff; font-weight: 700; white-space: nowrap; }
.project-type-stat-badge.is-active { background: #15803d; }
.project-type-stat-badge.is-inactive { background: #d97706; }
.project-type-config-stack { display: flex; flex-direction: column; gap: 18px; }
.project-type-config-stack .panel-heading-actions .actions { margin-top: 0; justify-content: flex-end; }
.project-stage-table { width: 100%; table-layout: fixed; }
.project-stage-table th:nth-child(1), .project-stage-table td:nth-child(1) { width: 8%; }
.project-stage-table th:nth-child(2), .project-stage-table td:nth-child(2) { width: 38%; }
.project-stage-table th:nth-child(3), .project-stage-table td:nth-child(3) { width: 16%; }
.project-stage-table th:nth-child(4), .project-stage-table td:nth-child(4) { width: 20%; }
.project-stage-table th:nth-child(5), .project-stage-table td:nth-child(5) { width: 18%; }
.project-stage-table td, .project-stage-table th { vertical-align: top; }
.project-stage-table td:nth-child(1), .project-stage-table td:nth-child(3), .project-stage-table td:nth-child(4), .project-stage-table td:nth-child(5) { white-space: nowrap; }
.project-stage-table td:nth-child(2) { overflow-wrap: anywhere; }
.project-consumable-config-table { width: 100%; table-layout: fixed; }
.project-consumable-config-table th:nth-child(1), .project-consumable-config-table td:nth-child(1) { width: 49%; }
.project-consumable-config-table th:nth-child(2), .project-consumable-config-table td:nth-child(2) { width: 13%; }
.project-consumable-config-table th:nth-child(3), .project-consumable-config-table td:nth-child(3) { width: 23%; }
.project-consumable-config-table th:nth-child(4), .project-consumable-config-table td:nth-child(4) { width: 15%; }
.project-consumable-config-table th, .project-consumable-config-table td { vertical-align: middle; overflow-wrap: anywhere; }
.project-consumable-config-table td:nth-child(2), .project-consumable-config-table td:nth-child(3), .project-consumable-config-table td:nth-child(4) { white-space: nowrap; }
.project-consumable-config-table td form { margin: 0; }
.project-type-expand { display: inline-flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-weight: 700; }
.project-type-expand-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); font-weight: 800; line-height: 1; flex: 0 0 24px; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.text-button:hover { color: var(--brand); }
.sub-panel { min-width: 0; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.sub-panel h2 { margin-bottom: 0; }
.sub-panel table { table-layout: fixed; }
.sub-panel td, .sub-panel th { overflow-wrap: anywhere; }
.project-summary-grid { margin-bottom: 14px; }
.bank-template-option-row { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(600px, 1.5fr); gap: 14px; }
.inline-checkbox-options { display: flex; align-items: center; flex-wrap: nowrap; gap: 12px 18px; min-height: 40px; overflow-x: auto; }
.inline-checkbox-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); white-space: nowrap; }
.inline-checkbox-options input[type="checkbox"] { width: auto; min-height: auto; margin: 0; flex: 0 0 auto; }
.purchase-line-row {
  display: grid;
  grid-template-columns: 56px minmax(260px, 2fr) repeat(3, minmax(120px, 1fr)) 42px;
  gap: 14px;
  margin-bottom: 14px;
}
.purchase-line-serial { display: block; }
.purchase-line-remove { display: flex; align-items: flex-end; padding-bottom: 0; }
.purchase-line-delete { margin-bottom: 0; }
.purchase-line-number {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.invoice-material-lines-section.count-mismatch {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.invoice-count-warning { margin-top: 8px; margin-bottom: 0; }
.invoice-item-count-mismatch > td { background: #fffaf0; }
.purchase-invoice-field-row { margin-top: 14px; }
.invoice-page-help { display: block; margin-top: 5px; font-size: 12px; }
.dashboard-stats { margin-bottom: 24px; }
.purchase-check-panels { align-items: start; margin-bottom: 6px; }
.purchase-check-panels > .panel { min-width: 0; }
.purchase-check-panels table { table-layout: fixed; }
.purchase-check-panels th, .purchase-check-panels td { overflow-wrap: anywhere; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.metric strong { display: block; font-size: 26px; margin-top: 6px; }
h1 { font-size: 28px; margin: 0 0 16px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-top: 5px;
  color: var(--ink);
  cursor: pointer;
}
.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-control {
  position: relative;
  width: 46px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d7dde5;
  transition: background .15s ease;
}
.toggle-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 33, 43, .25);
  transition: transform .15s ease;
}
.toggle-row input:checked + .toggle-control {
  background: var(--brand);
}
.toggle-row input:checked + .toggle-control::after {
  transform: translateX(22px);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--brand); }
.btn.warn { background: var(--danger); border-color: var(--danger); }
.btn.good { background: #067647; border-color: #067647; }
.expense-review-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.expense-review-actions[hidden] { display: none; }
.expense-review-reject { background: #b42318; border-color: #b42318; }
.expense-review-clarify { background: #d97706; border-color: #d97706; }
.expense-review-remark-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.expense-review-remark-editor[hidden] { display: none; }
.expense-review-remark-editor input { flex: 1 1 180px; min-width: 0; }
.pm-expense-review-table { min-width: 1260px; }
.pm-expense-review-table th, .pm-expense-review-table td { vertical-align: top; }
.pm-expense-review-table input, .pm-expense-review-table select, .pm-expense-review-table textarea { min-width: 120px; }
.pm-expense-review-table td:nth-child(3) textarea { min-width: 180px; }
.pm-expense-row-toggle-column { width: 42px; min-width: 42px; padding-right: 0; }
.pm-expense-row-toggle { width: 28px; height: 28px; min-height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--brand); font-size: 18px; line-height: 1; cursor: pointer; }
.pm-expense-row-toggle:hover { border-color: var(--brand); background: #f0faf6; }
.pm-expense-detail-row[hidden] { display: none; }
.pm-expense-detail-row > td { padding: 16px; background: #f8fafb; }
.pm-expense-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.pm-expense-detail-wide { grid-column: 1 / -1; }
.pm-expense-detail-form .actions { margin-top: 12px; }
.pm-expense-existing-proof { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pm-expense-existing-proof a { color: var(--brand); }
.pm-expense-readonly-detail input, .pm-expense-readonly-detail textarea { background: #fff; color: var(--ink); }
.pm-expense-gst-toggle { margin: 0; white-space: nowrap; }
.btn-ai {
  border-color: #1769aa;
  background: linear-gradient(135deg, #0f7a5c, #1769aa);
  box-shadow: 0 5px 14px rgba(23, 105, 170, .22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-ai:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(23, 105, 170, .3);
}
.btn-ai:focus-visible {
  outline: 3px solid rgba(23, 105, 170, .25);
  outline-offset: 2px;
}
.btn-ai:disabled,
.btn-ai[disabled] {
  border-color: #cbd5e1;
  background: #e5e7eb;
  color: #94a3b8;
}
.btn:disabled,
.btn[disabled] {
  border-color: #cbd5e1;
  background: #e5e7eb;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
.btn.is-loading .btn-spinner {
  display: inline-block;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.btn-small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.additional-field-actions { flex-wrap: nowrap; }
.additional-field-actions select { flex: 1 1 auto; min-width: 0; }
.additional-field-actions button { flex: 0 0 auto; white-space: nowrap; }
.choice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.choice-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.choice-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.detail-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.inline-assign-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 360px);
}
.inline-assign-form select {
  min-width: 190px;
}
.inline-action-menu {
  position: relative;
}
.inline-action-menu summary {
  list-style: none;
  cursor: pointer;
}
.inline-action-menu summary::-webkit-details-marker {
  display: none;
}
.inline-action-form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(420px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 33, 43, .14);
}
.service-status-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 230px;
}
.service-update-menu {
  position: relative;
}
.service-update-form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 33, 43, .14);
}
.service-update-form label,
.service-update-form input,
.service-update-form textarea { display: block; width: 100%; }
.service-update-form label { margin-top: 8px; }
.service-update-form label:first-child { margin-top: 0; }
.service-update-form input,
.service-update-form textarea { margin-top: 4px; }
.service-update-form .actions { margin-top: 12px; }
.inline-action-form.bank-classify-form {
  width: min(900px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
}
.purchase-allocation-row > div { min-width: 0; }
.purchase-allocation-row label { display: block; margin-bottom: 4px; font-size: 12px; }
.purchase-allocation-help { margin: 8px 0; font-size: 12px; }
.purchase-invoice-fields { display: block; }
.bank-general-invoice-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.bank-general-invoice-fields label { margin-bottom: -4px; }
.bank-general-evidence-file,
.purchase-evidence-file { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 10px; }
.bank-general-evidence-file label,
.purchase-evidence-file label { margin: 0; white-space: nowrap; }
.inline-form {
  display: inline-flex;
  margin: 0;
}
.user-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, max-content) minmax(170px, max-content) max-content max-content max-content;
  gap: 12px;
  align-items: center;
}
.user-filter-form { display: contents; }
.user-row-status-toggle { margin: 0; }
.labour-section[hidden] {
  display: none !important;
}
.status { padding: 10px 12px; background: #e8f6ef; border: 1px solid #b7e3cd; border-radius: 6px; margin-bottom: 16px; }
.flash-status {
  transition: opacity .2s ease, transform .2s ease, margin .2s ease, padding .2s ease;
}
.flash-status.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.errors { padding: 10px 12px; background: #fff1f0; border: 1px solid #ffccc7; border-radius: 6px; margin-bottom: 16px; color: var(--danger); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; background: #edf2f7; color: #344054; font-size: 12px; }
.badge.good { background: #e8f6ef; color: #067647; }
.badge.warn { background: #fff7e6; color: #b54708; }
.badge.danger { background: #fff1f0; color: var(--danger); }
.bank-narration { max-width: 360px; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.bank-transactions-merged-panel { padding: 0; }
.bank-transactions-merged-panel > h2 { margin: 0; padding: 18px; border-bottom: 1px solid var(--line); }
.bank-transactions-merged-panel .bank-inline-search { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.bank-transactions-merged-panel .bank-inline-search > summary { display: none; }
.bank-transactions-merged-panel .bank-inline-search > form { padding: 18px; border-bottom: 1px solid var(--line); }
.bank-transactions-merged-panel #bank_transactions { padding: 0 18px 18px; }
.approval-note { margin-top: 4px; font-size: 11px; }
.approval-statuses { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.approval-statuses .badge { font-size: 11px; line-height: 1.2; }
.expense-review-remarks { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.expense-review-remarks strong { color: #344054; }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #17212b;
  font-size: 12px;
  font-weight: 800;
}
.muted { color: var(--muted); }
.soft-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
.money { white-space: nowrap; }
.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 8px 0 14px;
}

.progress-site-block { border-top: 1px solid var(--line, #e5e7eb); padding-top: 1rem; margin-top: 1rem; }
.progress-site-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.progress-site-heading h3 { margin: 0 0 .2rem; }
.progress-workflow { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); gap: 1.5rem; align-items: start; }
.progress-submit-panel { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; }
.progress-submit-panel h3 { margin-top: 0; }
.progress-stepper { position: relative; padding: .25rem 0 .25rem 1rem; }
.progress-stepper::before { content: ''; position: absolute; left: 1.05rem; top: 1rem; bottom: 1rem; width: 2px; background: #dbe3ec; }
.progress-step { position: relative; display: flex; gap: .8rem; padding: .45rem 0 .85rem; }
.progress-step-icon { z-index: 1; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 700; border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.progress-step-content { display: grid; gap: .18rem; padding-top: .15rem; }
.progress-step-content strong { font-weight: 650; }
.progress-step-content span { color: #64748b; font-size: .85rem; }
.progress-step-state { text-transform: capitalize; font-size: .76rem !important; }
.progress-step.completed .progress-step-icon { background: #15803d; color: #fff; box-shadow: 0 0 0 1px #15803d; }
.progress-step.completed .progress-step-state { color: #15803d; }
.progress-step.current .progress-step-icon { background: #2563eb; color: #fff; box-shadow: 0 0 0 3px #bfdbfe; }
.progress-step.current .progress-step-content strong { color: #1d4ed8; }
.progress-step.reopened .progress-step-icon { background: #d97706; color: #fff; box-shadow: 0 0 0 1px #d97706; }
.progress-step.reopened .progress-step-state { color: #b45309; }
.progress-step.inactive { opacity: .55; }
.progress-step.inactive .progress-step-state { color: #64748b; }
.progress-step.upcoming { opacity: .7; }
.reopen-details { margin-top: .35rem; }
.reopen-details summary { color: #b45309; cursor: pointer; font-size: .82rem; }
.reopen-details form { margin-top: .4rem; }
.subtle-form { border-top: 1px solid var(--line, #e5e7eb); margin-top: 1.25rem; padding-top: 1rem; }
.subtle-form h3 { margin-top: 0; }
.muted-badge { background: #e2e8f0; color: #475569; }
.checklist-type-filter { margin: 1rem 0; }
.checklist-type-filter, #create-template { scroll-margin-top: 90px; }
.purchase-material-line { scroll-margin-top: 24px; }
.project-material-section-heading { margin: 22px 0 8px; }
.project-material-section-heading:first-child { margin-top: 0; }
.project-cost-subsection { margin-top: 22px; }
.project-cost-subsection > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; font-size: 18px; font-weight: 700; list-style: none; }
.project-cost-subsection > summary::-webkit-details-marker { display: none; }
.project-cost-subsection > summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--brand); border-radius: 50%; color: var(--brand); font-size: 18px; line-height: 1; flex: 0 0 22px; }
.project-cost-subsection > summary > span { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.project-cost-subsection > summary > strong { white-space: nowrap; }
.project-cost-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.project-cost-total strong { font-size: 20px; }
.project-cost-summary-actions { display: inline-flex !important; align-items: center; gap: 12px; margin-right: 0 !important; }
.project-cost-subsection-actions { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.other-expense-status { padding: 10px 12px; margin: 0 0 10px; color: #127b59; background: #e8f6ef; border: 1px solid #b7e3cd; border-radius: 6px; }
.project-consumables-heading { margin: 0; align-items: flex-start; justify-content: space-between; }
.project-consumables-heading h2 { margin: 0; }
.project-consumables-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.project-consumables-content { margin-top: 12px; }
.project-consumable-status { padding: 10px 12px; margin: 0 0 12px; color: #127b59; background: #e8f6ef; border: 1px solid #b7e3cd; border-radius: 6px; }
.project-consumables-table { table-layout: fixed; }
.project-consumables-table th:nth-child(1), .project-consumables-table td:nth-child(1) { width: 32%; }
.project-consumables-table th:nth-child(2), .project-consumables-table td:nth-child(2) { width: 17%; }
.project-consumables-table th:nth-child(3), .project-consumables-table td:nth-child(3) { width: 12%; }
.project-consumables-table th:nth-child(4), .project-consumables-table td:nth-child(4) { width: 15%; }
.project-consumables-table th:nth-child(5), .project-consumables-table td:nth-child(5) { width: 16%; }
.project-consumables-table th:nth-child(6), .project-consumables-table td:nth-child(6) { width: 8%; }
.project-consumables-table th, .project-consumables-table td { overflow-wrap: anywhere; vertical-align: middle; }
.project-consumables-table input { margin: 0; min-height: 36px; }
.project-consumable-entry-table th:nth-child(1), .project-consumable-entry-table td:nth-child(1) { width: 30%; }
.project-consumable-entry-table th:nth-child(2), .project-consumable-entry-table td:nth-child(2) { width: 35%; }
.project-consumable-entry-table th:nth-child(3), .project-consumable-entry-table td:nth-child(3) { width: 20%; }
.project-consumable-entry-table th:nth-child(4), .project-consumable-entry-table td:nth-child(4) { width: 15%; }
.project-consumable-summary-table th:nth-child(1), .project-consumable-summary-table td:nth-child(1) { width: 16%; }
.project-consumable-summary-table th:nth-child(2), .project-consumable-summary-table td:nth-child(2) { width: 26%; }
.project-consumable-summary-table th:nth-child(3), .project-consumable-summary-table td:nth-child(3) { width: 15%; }
.project-consumable-summary-table th:nth-child(4), .project-consumable-summary-table td:nth-child(4) { width: 11%; }
.project-consumable-summary-table th:nth-child(5), .project-consumable-summary-table td:nth-child(5) { width: 8%; }
.project-consumable-summary-table th:nth-child(6), .project-consumable-summary-table td:nth-child(6) { width: 10%; }
.project-consumable-summary-table th:nth-child(7), .project-consumable-summary-table td:nth-child(7) { width: 9%; }
.project-consumable-summary-table th:nth-child(8), .project-consumable-summary-table td:nth-child(8) { width: 5%; }
.project-consumable-summary-table output { white-space: nowrap; }
.project-consumable-edit-row td { background: #f8fafc; }
.project-consumable-subheading { margin: 20px 0 10px; }
.project-consumable-subheading h3 { margin: 0; }
.project-reserve-entry-table th:nth-child(1), .project-reserve-entry-table td:nth-child(1) { width: 30%; }
.project-reserve-entry-table th:nth-child(2), .project-reserve-entry-table td:nth-child(2) { width: 38%; }
.project-reserve-entry-table th:nth-child(3), .project-reserve-entry-table td:nth-child(3) { width: 22%; }
.project-reserve-entry-table th:nth-child(4), .project-reserve-entry-table td:nth-child(4) { width: 10%; }
.project-other-expense-actions { flex-wrap: nowrap; margin: 0; }
.project-other-expense-edit-row td { background: #f8fafc; vertical-align: middle; }
.project-other-expenses-table input { margin: 0; min-height: 36px; }
.project-cost-subsection[open] > summary::before { content: '-'; }
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) { table-layout: fixed; }
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) th:nth-child(1),
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) td:nth-child(1) { width: 56%; }
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) th:nth-child(2),
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) td:nth-child(2) { width: 20%; }
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) th:nth-child(3),
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) td:nth-child(3) { width: 24%; }
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) th,
.project-cost-subsection > table:not(.project-other-expenses-table):not(.project-workforce-cost-table) td { overflow-wrap: anywhere; }
.project-cost-subsection > table.project-workforce-cost-table { table-layout: fixed; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(1),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(1) { width: 20%; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(2),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(2) { width: 34%; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(3),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(3) { width: 18%; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(4),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(4) { width: 16%; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(5),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(5) { width: 12%; }
.project-cost-subsection > table.project-workforce-cost-table th,
.project-cost-subsection > table.project-workforce-cost-table td { overflow-wrap: anywhere; vertical-align: top; }
.project-cost-subsection > table.project-workforce-cost-table th:nth-child(n+3),
.project-cost-subsection > table.project-workforce-cost-table td:nth-child(n+3) { white-space: nowrap; overflow-wrap: normal; }
.project-other-expenses-table { table-layout: fixed; }
.project-other-expenses-table th:nth-child(1), .project-other-expenses-table td:nth-child(1) { width: 48%; }
.project-other-expenses-table th:nth-child(2), .project-other-expenses-table td:nth-child(2) { width: 22%; }
.project-other-expenses-table th:nth-child(3), .project-other-expenses-table td:nth-child(3) { width: 18%; }
.project-other-expenses-table th:nth-child(4), .project-other-expenses-table td:nth-child(4) { width: 12%; }
.project-other-expenses-table th, .project-other-expenses-table td { overflow-wrap: anywhere; }
.project-material-parent-row > td { vertical-align: top; }
.project-material-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.project-material-toggle:hover { color: var(--brand); }
.project-material-toggle-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); font-weight: 800; line-height: 1; flex: 0 0 20px; }
.project-material-children-row > td { padding: 0 10px 12px; background: #f8fafc; }
.project-material-children-row[hidden] { display: none; }
.project-material-invoice-scroll { overflow-x: auto; }
.project-material-invoice-table { width: 100%; min-width: 900px; table-layout: fixed; margin: 10px 0 0; }
.project-material-invoice-table th:nth-child(1), .project-material-invoice-table td:nth-child(1) { width: 48%; }
.project-material-invoice-table th:nth-child(2), .project-material-invoice-table td:nth-child(2) { width: 12%; }
.project-material-invoice-table th:nth-child(3), .project-material-invoice-table td:nth-child(3) { width: 12%; }
.project-material-invoice-table th:nth-child(4), .project-material-invoice-table td:nth-child(4) { width: 14%; }
.project-material-invoice-table th:nth-child(5), .project-material-invoice-table td:nth-child(5) { width: 14%; }
.project-material-invoice-table th, .project-material-invoice-table td { overflow-wrap: anywhere; vertical-align: top; }
.project-material-invoice-table th:nth-child(n+2), .project-material-invoice-table td:nth-child(n+2) { white-space: nowrap; overflow-wrap: normal; }
.project-material-invoice-table th { font-size: 11px; }
.project-material-invoice-table td { font-size: 13px; }
.project-expense-detail-table { width: 100%; min-width: 780px; table-layout: fixed; margin: 10px 0 0; }
.project-expense-detail-table th:nth-child(1), .project-expense-detail-table td:nth-child(1) { width: 45%; text-align: left; }
.project-expense-detail-table th:nth-child(2), .project-expense-detail-table td:nth-child(2) { width: 17%; }
.project-expense-detail-table th:nth-child(3), .project-expense-detail-table td:nth-child(3) { width: 15%; }
.project-expense-detail-table th:nth-child(4), .project-expense-detail-table td:nth-child(4) { width: 18%; }
.project-expense-detail-table th:nth-child(5), .project-expense-detail-table td:nth-child(5) { width: 10%; }
.project-expense-detail-table th, .project-expense-detail-table td { overflow-wrap: anywhere; vertical-align: top; }
.project-expense-detail-table th:nth-child(n+2), .project-expense-detail-table td:nth-child(n+2) { white-space: nowrap; overflow-wrap: normal; }
.project-expense-detail-table th { font-size: 11px; }
.project-expense-detail-table td { font-size: 13px; }
.checklist-type-filter .btn { min-width: 120px; }
.checklist-admin-template[hidden] { display: none; }
.template-summary-row { padding: .65rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.template-summary-row:last-child { border-bottom: 0; }
.template-summary-row strong { color: #15803d; font-weight: 650; }
.template-filters { margin-bottom: 1rem; }
.template-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.template-detail-grid div { display: grid; gap: .2rem; }
.template-detail-grid strong { font-size: .75rem; color: #64748b; text-transform: uppercase; }
.template-detail-grid span { font-weight: 600; }
.template-view-details > td { background: #f8fafc; }
.icon-actions { display: flex; align-items: center; gap: .35rem; }
.icon-actions form { margin: 0; }
.icon-btn { width: 2rem; height: 2rem; padding: 0; display: inline-grid; place-items: center; border: 1px solid #0f766e; border-radius: 5px; background: #fff; color: #0f766e; cursor: pointer; font-size: 1rem; line-height: 1; }
.icon-btn:hover { background: #ecfdf5; }
.icon-btn.danger { border-color: #b91c1c; color: #b91c1c; }
.icon-btn.danger:hover { background: #fef2f2; }
.icon-btn:disabled { border-color: #cbd5e1; color: #94a3b8; background: #f1f5f9; cursor: not-allowed; }
.template-edit-form { border-top: 1px solid #e2e8f0; padding-top: .8rem; margin-bottom: 1rem; }
.status-toggle { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: #64748b; cursor: pointer; padding: .15rem 0; font-size: .82rem; }
.status-toggle-knob { width: 2rem; height: 1.1rem; border-radius: 999px; background: #cbd5e1; position: relative; }
.status-toggle-knob::after { content: ''; position: absolute; width: .82rem; height: .82rem; top: .14rem; left: .14rem; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.status-toggle.is-active { color: #15803d; }
.status-toggle.is-active .status-toggle-knob { background: #16a34a; }
.status-toggle.is-active .status-toggle-knob::after { transform: translateX(.9rem); }
.material-assignment-table { min-width: 640px; }
.materials-admin-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.table-scroll { overflow-x: auto; }
.material-assignment-cell { width: 1%; text-align: center; vertical-align: middle; }
.material-assignment-cell form { display: inline-flex; justify-content: center; margin: 0; }
.material-assignment-cell input[type="checkbox"] { width: 1.1rem; height: 1.1rem; min-height: 1.1rem; margin: 0; accent-color: #15805f; cursor: pointer; }
.material-assignment-cell input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .45; }
.panel-heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-heading-actions h2 { margin: 0; }
.category-panel-actions { justify-content: flex-end; }
.project-type-dialog { width: min(420px, calc(100vw - 32px)); }
.project-type-dialog .actions { margin-bottom: 0; }
.category-dialog { width: min(420px, calc(100vw - 32px)); }
.settings-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.settings-heading h2 { margin: 0; }
.settings-section-list { display: grid; gap: 12px; }
.settings-section { border: 1px solid var(--line); border-radius: 6px; overflow: visible; }
.settings-section > summary { display: flex; align-items: center; gap: 10px; padding: 15px 16px; color: var(--ink); cursor: pointer; font-size: 1.15rem; font-weight: 800; list-style: none; }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--brand); border-radius: 50%; color: var(--brand); font-size: 18px; line-height: 1; }
.settings-section[open] > summary::before { content: '-'; }
.settings-section-content { padding: 0 16px 14px; }
.settings-section-content table { margin: 0; }
.settings-table { table-layout: fixed; }
.settings-table th:nth-child(1), .settings-table td:nth-child(1) { width: 22%; }
.settings-table th:nth-child(2), .settings-table td:nth-child(2) { width: 18%; }
.settings-table th:nth-child(3), .settings-table td:nth-child(3) { width: 22%; }
.settings-table th, .settings-table td { vertical-align: middle; }
.settings-days-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.settings-days-input { width: 68px; min-width: 68px; margin: 0; }
.settings-days-form .btn { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.settings-info { position: relative; }
.settings-info > summary { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--brand); border-radius: 50%; color: var(--brand); background: #fff; cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.settings-info > summary::-webkit-details-marker { display: none; }
.settings-info > summary:hover, .settings-info > summary:focus-visible { background: #edf7f3; outline: 2px solid rgba(15, 122, 92, .18); outline-offset: 2px; }
.settings-info-cell { width: 42%; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.settings-info-popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 12; width: min(340px, calc(100vw - 64px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgba(23, 33, 43, .16); }
.settings-info-popover p { margin: 0; line-height: 1.45; }
.settings-info-popover p + p { margin-top: 8px; }
@media (max-width: 850px) { .progress-workflow { grid-template-columns: 1fr; } }
@media (max-width: 850px) { .template-detail-grid { grid-template-columns: repeat(2, 1fr); } }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.check-row input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  flex: 0 0 auto;
}
.cable-length-field {
  display: grid;
  grid-template-columns: minmax(90px, max-content) minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.cable-length-field input {
  min-height: 32px;
  padding: 5px 8px;
}
.project-report-list { display: grid; gap: 12px; }
.report-project-header {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(130px, .7fr);
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.report-project {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.report-project summary {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(130px, .7fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}
.report-project summary:hover { background: #f8fbfa; }
.report-project[open] summary {
  border-bottom: 1px solid var(--line);
  background: #edf7f3;
}
.report-project-id { color: var(--brand); }
.report-project table { margin: 10px 0 18px; }
.report-table-scroll { margin: 0 14px 18px; overflow-x: auto; }
.report-table-scroll table { min-width: 980px; margin: 10px 0 0; }
.report-site-progress { margin: 0 14px 18px; border-top: 1px solid var(--line); }
.report-site-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.report-site-progress .report-table-scroll { margin-left: 0; margin-right: 0; }
.expense-project-list { display: grid; gap: 12px; }
.expense-project-summary-table {
  table-layout: fixed;
  margin: 0;
}
.expense-project-summary-table th,
.expense-project-summary-table td {
  width: 25%;
}
.expense-project-summary-table th {
  border: 1px solid var(--line);
  background: #f8fafc;
}
.expense-project-summary-table th:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.expense-project-summary-table th:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.expense-project-summary-table th:nth-child(1),
.expense-project-summary-table td:nth-child(1) { width: 24%; }
.expense-project-summary-table th:nth-child(2),
.expense-project-summary-table td:nth-child(2) { width: 34%; }
.expense-project-summary-table th:nth-child(3),
.expense-project-summary-table td:nth-child(3) { width: 24%; }
.expense-project-summary-table th:nth-child(4),
.expense-project-summary-table td:nth-child(4) { width: 18%; }
.expense-project-summary-table-finance th:nth-child(1),
.expense-project-summary-table-finance td:nth-child(1) { width: 18%; }
.expense-project-summary-table-finance th:nth-child(2),
.expense-project-summary-table-finance td:nth-child(2) { width: 18%; }
.expense-project-summary-table-finance th:nth-child(3),
.expense-project-summary-table-finance td:nth-child(3) { width: 24%; }
.expense-project-summary-table-finance th:nth-child(4),
.expense-project-summary-table-finance td:nth-child(4) { width: 14%; }
.expense-project-summary-table-finance th:nth-child(5),
.expense-project-summary-table-finance td:nth-child(5) { width: 12%; }
.expense-project-summary-table-finance th:nth-child(6),
.expense-project-summary-table-finance td:nth-child(6) { width: 14%; }
.expense-project-summary-table td {
  border-bottom: 0;
  font-weight: 400;
}
.expense-project {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.expense-project summary {
  display: block;
  padding: 0;
  cursor: pointer;
  font-weight: 400;
}
.expense-project summary::marker { content: ""; }
.expense-project summary::-webkit-details-marker { display: none; }
.expense-project-plain summary::before,
.expense-project-plain summary::after {
  display: none;
  content: none;
}
.expense-project summary:hover { background: #f8fbfa; }
.expense-project[open] summary {
  border-bottom: 1px solid var(--line);
  background: #edf7f3;
}
.expense-project table {
  margin: 10px 14px 16px;
  width: calc(100% - 28px);
}
.direct-payment-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr);
  gap: 14px;
  padding: 14px;
}
.direct-payment-detail.pm-proof-detail { grid-template-columns: 1fr; }
.proof-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.proof-form-row > div { min-width: 0; }
.proof-request-table-wrap { overflow-x: auto; }
.proof-request-table { min-width: 780px; }
.finance-proof-request-table { min-width: 1100px; table-layout: fixed; }
.finance-proof-request-table th:nth-child(1), .finance-proof-request-table td:nth-child(1) { width: 130px; }
.finance-proof-request-table th:nth-child(2), .finance-proof-request-table td:nth-child(2) { width: 330px; }
.finance-proof-request-table th:nth-child(3), .finance-proof-request-table td:nth-child(3) { width: 180px; }
.finance-proof-request-table th:nth-child(4), .finance-proof-request-table td:nth-child(4) { width: 150px; }
.finance-proof-request-table th:nth-child(5), .finance-proof-request-table td:nth-child(5) { width: 160px; }
.finance-proof-request-table th:nth-child(6), .finance-proof-request-table td:nth-child(6) { width: 220px; }
.proof-request-table .bank-narration { min-width: 240px; max-width: 420px; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.finance-proof-request-table th:last-child,
.finance-proof-request-table td:last-child { width: 220px; white-space: nowrap; }
.finance-proof-request-table .compact-actions { flex-wrap: nowrap; }
.proof-upload-dialog { width: min(760px, calc(100vw - 32px)); }
.direct-payment-detail table {
  margin: 0;
  width: 100%;
}
.app-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  box-shadow: 0 20px 48px rgba(23, 33, 43, .24);
}
.app-dialog::backdrop {
  background: rgba(23, 33, 43, .35);
}
.app-dialog form {
  margin: 0;
}
.labour-modify-list {
  display: grid;
  gap: 12px;
}
.labour-modify-header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) minmax(110px, .6fr) minmax(100px, .5fr);
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.labour-modify-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.labour-modify-item summary {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) minmax(110px, .6fr) minmax(100px, .5fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 400;
}
.labour-modify-item summary:hover { background: #f8fbfa; }
.labour-modify-item[open] summary {
  border-bottom: 1px solid var(--line);
  background: #edf7f3;
}
.labour-modify-item form {
  padding: 14px;
}
.attendance-calendar-filters { margin-bottom: 14px; }
.attendance-calendar-filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  white-space: nowrap;
}
.attendance-calendar-filter-actions { margin-top: 12px; }
.attendance-calendar-panel > h2 { margin-top: 0; }
.attendance-view-tabs { display: flex; gap: 8px; margin: 0 0 14px; }
.attendance-search-results { display: grid; gap: 8px; margin-top: 18px; }
.attendance-search-results h3 { margin: 0; }
.attendance-timeline-panel { margin: 14px 0 0; }
.attendance-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.attendance-calendar-toolbar > strong { margin-right: auto; font-size: 18px; }
.segmented-control { display: flex; gap: 6px; }
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.attendance-calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}
.attendance-day-cell {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.attendance-day-cell:hover { border-color: var(--brand); background: #f8fbfa; }
.attendance-day-cell.empty { color: var(--muted); cursor: default; }
.attendance-day-cell.outside-month { min-height: 112px; border-color: transparent; background: #f8fafc; cursor: default; }
.attendance-day-cell.sunday { background: #CAD3C8; }
.attendance-day-cell.yesterday { background: #f7b731; color: #17212b; }
.attendance-day-cell.today { background: #26de81; color: #17212b; }
.attendance-day-cell > strong { font-size: 16px; }
.attendance-day-cell > span { font-size: 12px; }
.attendance-cell-breakdown { display: flex; align-items: center; gap: 4px; }
.attendance-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.attendance-dot.project { background: #3277c8; }
.attendance-dot.non-project { background: #d88932; }
.attendance-dot.service { background: #2c9b70; }
.attendance-dot.leave { background: #9aa4ad; }
.attendance-dot.uninformed { background: #c84b4b; }
.attendance-dot.overtime { background: #8b5ec7; }
.attendance-leave { color: #69737c; }
.attendance-uninformed { color: #b33f3f; }
.attendance-overtime { color: #7542a7; font-weight: 700; }
.attendance-calendar-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.attendance-calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.attendance-day-details { display: grid; gap: 8px; }
.attendance-day-details[hidden] { display: none !important; }
.attendance-day-detail, .attendance-detail-row { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.attendance-day-detail > summary { display: flex; justify-content: space-between; padding: 11px 14px; cursor: pointer; font-weight: 700; }
.attendance-day-detail > summary span { color: var(--muted); font-weight: 400; }
.attendance-day-detail > p { padding: 0 14px 12px; }
.attendance-detail-list { display: grid; gap: 6px; padding: 0 10px 10px; }
.attendance-detail-header { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(100px, .7fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr); gap: 10px; padding: 4px 10px 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.attendance-search-results .attendance-detail-header { grid-template-columns: minmax(105px, .8fr) minmax(135px, 1fr) minmax(110px, .8fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr); }
.attendance-search-results .attendance-detail-row > summary { grid-template-columns: minmax(105px, .8fr) minmax(135px, 1fr) minmax(110px, .8fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr); }
.attendance-detail-row > summary { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(100px, .7fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr); gap: 10px; padding: 10px; cursor: pointer; }
.attendance-detail-row[open] > summary { background: #edf7f3; border-bottom: 1px solid var(--line); }
.attendance-detail-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; padding: 10px 14px; }
.attendance-detail-content p { margin: 0; }
.attendance-timeline-wrap { max-width: 100%; overflow-x: auto; }
.attendance-timeline { min-width: 1500px; table-layout: auto; }
.attendance-timeline th, .attendance-timeline td { min-width: 42px; padding: 7px 5px; text-align: center; white-space: nowrap; line-height: 1.35; }
.attendance-timeline th:first-child, .attendance-timeline td:first-child { min-width: 180px; width: 180px; text-align: left; white-space: normal; }
.attendance-timeline th:nth-last-child(-n+6), .attendance-timeline td:nth-last-child(-n+6) { min-width: 82px; }
.attendance-timeline-cell { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 800; padding: 2px; }
.attendance-timeline-cell:hover { text-decoration: underline; }
.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.report-project > .grid-2,
.report-project > h3,
.report-project > table {
  margin-left: 14px;
  margin-right: 14px;
}
@media (max-width: 780px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  .sidebar {
    position: static;
    width: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(23, 33, 43, .06);
  }
  .nav { grid-template-columns: 1fr; }
  .nav-submenu { margin-bottom: 10px; }
  .account-menu {
    align-self: stretch;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
  .grid, .grid-2, .grid-3, .bank-template-option-row, .purchase-line-row { grid-template-columns: 1fr; }
  .attendance-calendar-filter-fields { grid-template-columns: repeat(4, minmax(150px, 1fr)); overflow-x: auto; }
  .purchase-allocation-row, .partner-credit-row, .bank-statement-upload-row { grid-template-columns: 1fr; }
  .direct-payment-detail { grid-template-columns: 1fr; }
  .proof-form-row { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .report-project-header,
  .report-project summary,
  .expense-project summary,
  .labour-modify-header,
  .labour-modify-item summary,
  .report-detail-grid,
  .user-filter-row { grid-template-columns: 1fr; }
  .wrap,
  .has-sidebar .wrap {
    margin-left: 0;
    padding: 16px;
  }
  table { display: block; overflow-x: auto; }
  .pagination-bar { align-items: flex-start; flex-wrap: wrap; }
  .brand-logo { width: 128px; }
}

@media (max-width: 620px) {
  .login-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  /* Keep the two high-frequency PM workflows comfortable for touch input. */
  .pm-expense-form,
  .pm-attendance-form {
    padding: 14px;
  }
  .pm-expense-form input,
  .pm-expense-form select,
  .pm-expense-form textarea,
  .pm-attendance-form input,
  .pm-attendance-form select,
  .pm-attendance-form textarea {
    min-height: 46px;
    font-size: 16px;
  }
  .pm-expense-form textarea,
  .pm-attendance-form textarea {
    min-height: 104px;
  }
  .pm-expense-form .actions,
  .pm-attendance-form .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .pm-expense-form .actions .btn,
  .pm-attendance-form .actions .btn {
    width: 100%;
    min-height: 46px;
  }
  .pm-expense-form .toggle-row {
    align-items: flex-start;
    min-height: 46px;
    line-height: 1.35;
  }
  .pm-expense-detail-grid { grid-template-columns: 1fr; }
  .pm-attendance-form > label,
  .pm-attendance-form > .tracker-fields,
  .pm-attendance-form > #attendance_tracker_fields,
  .pm-attendance-form > #attendance_work_fields,
  .pm-attendance-form > #attendance_wage_fields,
  .pm-attendance-form > #attendance_proof_fields {
    margin-top: 14px;
  }
}
