:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #d9e0ea;
  --line-soft: #e9eef5;
  --text: #152033;
  --muted: #667085;
  --blue: #0b6fdc;
  --blue-soft: #e9f2ff;
  --green: #12805c;
  --green-soft: #dff6ea;
  --amber: #aa6500;
  --amber-soft: #fff1d6;
  --red: #c72f3d;
  --red-soft: #ffe5e8;
  --gray-soft: #eef1f5;
  --shadow: none;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

/* Installer mobile workspace: compact, single-hand hierarchy. */
@media (max-width: 850px) {
  html[data-theme="light"] .installer-mode .app-shell {
    padding: 8px;
  }

  html[data-theme="light"] .installer-mode .register-top {
    position: relative;
    display: block;
    padding: 12px;
    border-radius: 18px;
  }

  html[data-theme="light"] .installer-mode .register-top .brand {
    min-height: 44px;
    padding: 0 90px 0 0;
    border: 0;
  }

  html[data-theme="light"] .installer-mode .register-top .brand-mark {
    display: none;
  }

  html[data-theme="light"] .installer-mode .register-search {
    display: block;
    margin-top: 10px;
  }

  html[data-theme="light"] .installer-mode .register-search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 62px;
    gap: 6px;
    width: 100%;
  }

  html[data-theme="light"] .installer-mode .register-search-control input[type="search"],
  html[data-theme="light"] .installer-mode .register-search-control button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin: 0;
  }

  html[data-theme="light"] .installer-mode .register-search-control input[type="search"] {
    padding-inline: 14px;
  }

  html[data-theme="light"] .installer-mode .search-submit-btn,
  html[data-theme="light"] .installer-mode #resetBtn {
    padding-inline: 10px;
    white-space: nowrap;
  }

  html[data-theme="light"] .installer-mode #logoutBtn {
    position: absolute;
    top: 14px;
    right: 12px;
    min-height: 40px;
    margin: 0;
    padding-inline: 14px;
  }

  html[data-theme="light"] .installer-mode .register-body {
    gap: 10px;
    padding-top: 10px;
  }

  html[data-theme="light"] .installer-mode .app-sidebar {
    display: none;
  }

  html[data-theme="light"] .installer-mode .app-sidebar button {
    min-height: 44px;
    padding-inline: 16px;
  }

  html[data-theme="light"] .installer-mode .register-page {
    padding-inline: 2px;
  }

  .installer-mode .installer-dashboard-head {
    gap: 6px;
    margin: 6px 4px 12px;
  }

  .installer-mode .installer-dashboard-head h2 {
    margin-top: 3px;
    font-size: 24px;
  }

  .installer-mode .installer-dashboard-head p {
    font-size: 12px;
  }

  .installer-mode .installer-month-picker {
    gap: 7px;
    margin: 0 -8px 12px 0;
    padding: 0 8px 5px 0;
  }

  .installer-mode .installer-month-card {
    flex-basis: 72px;
    min-height: 44px;
  }

  .installer-mode .installer-kpis {
    gap: 10px;
    margin-bottom: 12px;
  }

  html[data-theme="light"] .installer-mode .dashboard-kpi {
    min-height: 0;
    padding: 16px;
    border-radius: 20px;
  }

  .installer-mode .installer-order-summary-card {
    min-height: 0;
  }

  .installer-mode .installer-daily-pivot {
    min-height: 260px;
    padding: 14px;
    border-radius: 20px;
  }

  .installer-mode .installer-empty {
    padding: 52px 16px;
  }
}


* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.topbar {
  height: 58px;
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 22px;
  height: 100%;
  border-right: 1px solid var(--line-soft);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e6f4f1;
  color: #08735f;
  font-weight: 800;
}

.brand span, .usertext span, .page-head p {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  overflow: hidden;
}

.topnav button {
  height: 100%;
  padding: 0 14px;
  color: #26364c;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.topnav .active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: #f8fbff;
  font-weight: 700;
}

.userbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px;
}

.icon-btn {
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
}

.icon-btn:hover, .secondary:hover {
  border-color: var(--line);
  background: #f9fbfd;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e3e9f2;
  font-weight: 800;
}

.page {
  padding: 20px 16px 18px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 0 0 14px;
}

h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0;
}

.head-actions, .tool-row, .modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary, .secondary {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary {
  background: white;
  border: 1px solid var(--line);
}

.danger {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
  background: var(--red);
  color: white;
}

.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.delete-record-btn {
  min-width: 68px;
}

.wide {
  width: 100%;
}

.tabs {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 0 12px;
}

.tabs button {
  height: 46px;
  padding: 0 6px;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  color: #3d4c63;
}

.tabs .active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: 0;
}

.metric {
  background: var(--surface);
  padding: 13px 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.workbench {
  display: grid;
  grid-template-columns: 190px minmax(620px, 1fr) 300px;
  gap: 8px;
  min-height: calc(100vh - 205px);
}

.filters, .table-area, .details {
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.filters {
  padding: 14px;
  border-radius: 0 0 8px 8px;
}

.panel-title, .label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title button, .label-row span:last-child {
  color: var(--blue);
  font-size: 12px;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

input, select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: white;
  color: var(--text);
  font-weight: 500;
}

.status-box {
  margin: 16px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.status-box label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-weight: 500;
  font-size: 12px;
}

.status-box input {
  width: 14px;
  height: 14px;
}

.filters .secondary {
  margin-top: 10px;
}

.table-area {
  min-width: 0;
  border-radius: 0 0 8px 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.table-tools, .table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.table-foot {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
  color: var(--muted);
}

.table-tools input {
  width: 270px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
  color: #26364c;
  font-size: 12px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f7fbff;
}

tbody tr.selected {
  background: var(--blue-soft);
  outline: 1px solid #a9d0ff;
}

td:first-child, th:first-child {
  width: 36px;
}

th:nth-child(2), td:nth-child(2) { width: 145px; }
th:nth-child(3), td:nth-child(3) { width: 105px; }
th:nth-child(4), td:nth-child(4) { width: 115px; }
th:nth-child(5), td:nth-child(5) { width: 90px; }
th:nth-child(6), td:nth-child(6),
th:nth-child(7), td:nth-child(7),
th:nth-child(8), td:nth-child(8) { width: 100px; }
th:nth-child(9), td:nth-child(9) { width: 82px; }

td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.num {
  text-align: right;
}

#claimTable .combined-hidden-column {
  display: none;
}

.staff-mode .app-sidebar button:not([data-view="claim-form"]),
.installer-mode .app-sidebar button:not([data-view="claim-form"]):not([data-view="dashboard"]),
.installer-mode .record-actions,
.installer-mode [data-claim-sheet="update"],
.staff-mode .record-actions button:not(#openAddBtn),
.staff-mode .field-maincon_amount,
.staff-mode .field-subcon_amount,
.staff-mode .field-pricing_price,
.staff-mode .field-pricing_fee_percent,
.staff-mode .field-pricing_margin,
.staff-mode .section-maincon-payment,
.staff-mode #subconShareSummary,
.staff-mode #partnerShareSummary {
  display: none !important;
}

.staff-mode .app-sidebar {
  align-content: start;
}

.staff-mode .register-table-panel {
  min-height: 150px;
}

.staff-mode .register-table-panel .table-tools {
  border-bottom: 1px solid var(--line-soft);
}

.installer-dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.installer-dashboard-head span,
.installer-dashboard-head p {
  color: var(--muted);
  font-size: 13px;
}

.installer-dashboard-head h2 {
  margin: 5px 0 0;
  font-size: 26px;
  font-weight: 500;
}

.installer-dashboard-head p {
  margin: 0;
}

.installer-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.installer-order-summary-card {
  min-height: 150px;
}

.installer-kpi-order-types {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.installer-kpi-order-types button {
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: #5f5054;
  background: #f8edf0;
  font-size: 12px;
  cursor: pointer;
}

.installer-kpi-order-types button:hover {
  color: #fff;
  background: #a94f65;
}

.installer-kpi-order-types b {
  font-weight: 500;
}

.installer-kpi-order-types em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.installer-month-picker {
  display: grid;
  grid-template-columns: repeat(12, minmax(64px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.installer-month-card {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--muted);
  background: #fffdfb;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.installer-month-card:hover {
  border-color: #a94f65;
  color: #7f3448;
  background: #fbedf1;
}

.installer-month-card.active {
  border-color: #963c54;
  color: #fff;
  background: #a94f65;
  box-shadow: 0 7px 16px rgba(169, 79, 101, 0.3);
}

.installer-month-card.active:hover {
  color: #fff;
  background: #963c54;
}

.installer-daily-pivot {
  min-height: 360px;
  padding: 18px;
}

.installer-pivot-wrap {
  max-height: 520px;
  overflow: auto;
}

.installer-day-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 2px;
}

.installer-day-card {
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fffdfb;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.installer-day-card:hover {
  border-color: rgba(169, 79, 101, 0.4);
  box-shadow: 0 10px 24px rgba(102, 68, 77, 0.08);
}

.installer-day-card:focus-visible {
  border-color: #a94f65;
  outline: 2px solid rgba(169, 79, 101, 0.35);
  outline-offset: 2px;
}

.installer-day-card.is-confirmed {
  border-color: rgba(79, 107, 69, 0.28);
  background: #fcfdf9;
}

.installer-day-card-head,
.installer-day-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.installer-day-card-head strong {
  font-size: 15px;
  font-weight: 500;
}

.installer-day-card-head span,
.installer-day-total span {
  color: var(--muted);
  font-size: 12px;
}

.installer-order-types {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.installer-order-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
}

.installer-order-confirm-row .installer-order-types {
  flex: 1 1 auto;
  margin: 0;
}

.installer-confirm-button {
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 10px;
  color: #fff;
  background: #a94f65;
  font-size: 12px;
  font-weight: 500;
}

.installer-confirm-button:hover:not(:disabled) {
  background: #963c54;
}

.installer-confirm-button:disabled {
  color: #4f6b45;
  background: #e8f0df;
  cursor: default;
}

.installer-order-types span {
  padding: 7px 9px;
  border-radius: 8px;
  color: #5f5054;
  background: #f8edf0;
  font-size: 12px;
}

.installer-order-types b {
  font-weight: 500;
}

.installer-day-total {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.installer-day-total strong {
  color: #a94f65;
  font-size: 17px;
  font-weight: 500;
}

.installer-day-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.installer-day-confirm > span {
  color: var(--muted);
  font-size: 11px;
}

.installer-day-confirm button {
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 10px;
  color: #fff;
  background: #a94f65;
  font-size: 12px;
  font-weight: 500;
}

.installer-day-confirm button:hover:not(:disabled) {
  background: #963c54;
}

.installer-day-confirm button:disabled {
  color: #4f6b45;
  background: #e8f0df;
  cursor: default;
}

.installer-pivot-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.installer-pivot-table th,
.installer-pivot-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 400;
}

.installer-pivot-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #faf7f4;
}

.installer-pivot-table .paid-value {
  color: var(--green);
}

.installer-empty {
  padding: 64px 20px;
  color: var(--muted);
  text-align: center;
}

dialog.installer-orders-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.installer-orders-modal {
  max-height: calc(100dvh - 44px);
  overflow: hidden;
}

.installer-orders-modal .modal-head p {
  margin: 4px 0 0;
  font-size: 12px;
}

.installer-orders-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 70dvh;
  padding: 2px;
  overflow-y: auto;
}

.installer-order-detail-card {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fffdfb;
}

.installer-order-detail-card > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.installer-order-detail-card > div span,
.installer-order-detail-card dt {
  color: var(--muted);
  font-size: 11px;
}

.installer-order-detail-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.installer-order-detail-card dt,
.installer-order-detail-card dd {
  margin: 0;
}

.installer-order-detail-card dd {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 850px) {
  .installer-dashboard-head {
    align-items: start;
    flex-direction: column;
  }

  .installer-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .installer-month-picker {
    display: flex;
    margin-right: -14px;
    padding-right: 14px;
  }

  .installer-month-card {
    flex: 0 0 76px;
    min-height: 46px;
  }

  .installer-daily-pivot {
    padding: 14px;
  }

  .installer-day-grid {
    grid-template-columns: 1fr;
  }

  .installer-day-card {
    min-height: 158px;
  }

  .installer-pivot-table {
    min-width: 620px;
  }
}

@media (max-width: 560px) {
  .installer-kpis {
    grid-template-columns: 1fr;
  }

  dialog.installer-orders-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .installer-orders-modal {
    height: 100dvh;
    max-height: 100dvh;
    padding: 14px;
  }

  .installer-orders-list {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 88px);
  }
}

.claim-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 9px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.claim-pagination > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.claim-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.claim-pagination strong {
  min-width: 92px;
  text-align: center;
  font-size: 12px;
}

.claim-pagination button {
  min-height: 34px;
  padding: 7px 12px;
}

.claim-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

html #claimTable.combined-claim-table {
  width: 100%;
  min-width: 1500px;
  table-layout: fixed;
}

html #claimTable.combined-claim-table th,
html #claimTable.combined-claim-table td {
  padding-left: 9px;
  padding-right: 9px;
}

html #claimTable.combined-claim-table th:nth-child(1),
html #claimTable.combined-claim-table td:nth-child(1) { width: 5.5%; }
html #claimTable.combined-claim-table th:nth-child(2),
html #claimTable.combined-claim-table td:nth-child(2) { width: 7.4%; }
html #claimTable.combined-claim-table th:nth-child(3),
html #claimTable.combined-claim-table td:nth-child(3) { width: 6.6%; }
html #claimTable.combined-claim-table th:nth-child(4),
html #claimTable.combined-claim-table td:nth-child(4) { width: 15.8%; }
html #claimTable.combined-claim-table th:nth-child(5),
html #claimTable.combined-claim-table td:nth-child(5) { width: 3.2%; }
html #claimTable.combined-claim-table th:nth-child(6),
html #claimTable.combined-claim-table td:nth-child(6) { width: 5.3%; }
html #claimTable.combined-claim-table th:nth-child(8),
html #claimTable.combined-claim-table td:nth-child(8) { width: 5.3%; }
html #claimTable.combined-claim-table th:nth-child(9),
html #claimTable.combined-claim-table td:nth-child(9) { width: 5.3%; }
html #claimTable.combined-claim-table th:nth-child(10),
html #claimTable.combined-claim-table td:nth-child(10) { width: 5.5%; }
html #claimTable.combined-claim-table th:nth-child(11),
html #claimTable.combined-claim-table td:nth-child(11) { width: 7.4%; }
html #claimTable.combined-claim-table th:nth-child(12),
html #claimTable.combined-claim-table td:nth-child(12) { width: 6.3%; }
html #claimTable.combined-claim-table th:nth-child(13),
html #claimTable.combined-claim-table td:nth-child(13) { width: 5.8%; }
html #claimTable.combined-claim-table th:nth-child(15),
html #claimTable.combined-claim-table td:nth-child(15) { width: 4.8%; }
html #claimTable.combined-claim-table th:nth-child(16),
html #claimTable.combined-claim-table td:nth-child(16) { width: 5.3%; }
html #claimTable.combined-claim-table th:nth-child(17),
html #claimTable.combined-claim-table td:nth-child(17) { width: 6.3%; }
html #claimTable.combined-claim-table th:nth-child(18),
html #claimTable.combined-claim-table td:nth-child(18) { width: 4.2%; }

html #claimTable.combined-claim-table th:nth-child(5),
html #claimTable.combined-claim-table td:nth-child(5),
html #claimTable.combined-claim-table th:nth-child(15),
html #claimTable.combined-claim-table td:nth-child(15) {
  text-align: center;
}

.claim-link {
  color: var(--blue);
  font-weight: 800;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.scope {
  background: #edf4f7;
  color: #27465a;
}

.Draft { background: var(--gray-soft); color: #596579; }
.Submitted { background: var(--amber-soft); color: var(--amber); }
.UnderReview { background: var(--blue-soft); color: var(--blue); }
.Approved { background: var(--green-soft); color: var(--green); }
.PartiallyPaid { background: var(--blue-soft); color: var(--blue); }
.Paid { background: var(--green-soft); color: var(--green); }
.Rejected { background: var(--red-soft); color: var(--red); }
.Cancelled { background: var(--gray-soft); color: #596579; }

.pager {
  display: flex;
  gap: 5px;
}

.pager button {
  min-width: 31px;
  height: 31px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pager .active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #b8d8ff;
}

.details {
  border-radius: 0 0 8px 8px;
  overflow: auto;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin: 8px 0 0;
  font-size: 22px;
}

.detail-section {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.kv span, .mini-row span, .timeline span {
  color: var(--muted);
  font-size: 12px;
}

.kv strong {
  display: block;
  margin-top: 4px;
}

.money-red {
  color: var(--red);
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
}

.dot.pending {
  background: white;
  border: 2px solid var(--line);
}

.detail-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 64px 64px 1fr;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.detail-actions button {
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.approve {
  background: var(--green);
}

.reject {
  background: var(--red);
}

.empty-detail {
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: 390px;
}

dialog.claim-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

dialog.selection-dialog {
  width: min(500px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(21, 32, 51, 0.38);
}

.modal {
  padding: 10px;
}

.modal h2 {
  margin: 0 0 10px;
}

.modal p {
  color: var(--muted);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
}

.add-modal {
  padding: 14px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.add-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.combined-form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.combined-form-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.combined-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.combined-form-grid label,
.combined-form-grid .card-select-field,
.combined-form-grid .multi-card-select-field,
.combined-form-grid .popup-select-field {
  margin-top: 0;
}

.combined-form-grid .field-maincon_order_type {
  grid-column: 1 / span 2;
}

.field-maincon_amount,
.field-subcon_amount {
  grid-column: 3;
  align-self: end;
}

.combined-form-grid .field-subcon_order_type {
  grid-column: 1 / span 2;
  align-self: end;
}

.section-subcon-claim .combined-form-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 12px;
  align-items: end;
}

.section-subcon-claim .field-qid { grid-column: 1 / 4; grid-row: 1; }
.section-subcon-claim .field-subcon_order_type { grid-column: 4 / 7; grid-row: 1; }
.section-subcon-claim .field-job_scope { grid-column: 1 / 3; grid-row: 2; }
.section-subcon-claim .field-subcon_name { grid-column: 3 / 5; grid-row: 2; }
.section-subcon-claim .field-partner_names { grid-column: 5 / 7; grid-row: 2; }
.section-subcon-claim .field-status_claim { grid-column: 1 / 4; grid-row: 3; }
.section-subcon-claim .field-claim_date { grid-column: 4 / 7; grid-row: 3; }
.section-subcon-claim .field-subcon_amount { grid-column: 1 / 7; grid-row: 4; }

.section-subcon-claim .field-partner_names .popup-select-trigger {
  width: 100%;
}

@media (max-width: 850px) {
  .section-subcon-claim .combined-form-grid {
    grid-template-columns: 1fr;
  }

  .section-subcon-claim .field-qid,
  .section-subcon-claim .field-job_scope,
  .section-subcon-claim .field-subcon_order_type,
  .section-subcon-claim .field-status_claim,
  .section-subcon-claim .field-claim_date,
  .section-subcon-claim .field-subcon_amount,
  .section-subcon-claim .field-subcon_name,
  .section-subcon-claim .field-partner_names {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Mobile input workspace: tuned for ~1280 x 2772 px at 447 dpi
   (roughly a 430-480 CSS-pixel viewport on high-density Android screens). */
@media (max-width: 600px) {
  dialog.claim-dialog {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
  }

  dialog.claim-dialog .add-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #fffdfb;
  }

  dialog.claim-dialog .modal-head {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    min-height: 68px;
    margin: 0;
    padding: max(14px, env(safe-area-inset-top)) 18px 12px;
    border-bottom: 1px solid var(--line-soft);
    background: rgb(255 253 251 / 0.98);
  }

  dialog.claim-dialog .modal-head h2 {
    font-size: 21px;
    line-height: 1.2;
    font-weight: 500;
  }

  dialog.claim-dialog .modal-head .secondary {
    min-width: 72px;
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
  }

  dialog.claim-dialog .add-form-grid {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 14px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  dialog.claim-dialog .combined-form-section {
    margin: 0 0 14px;
    padding: 16px 14px;
    border-radius: 16px;
    background: #fff;
  }

  dialog.claim-dialog .combined-form-section h3 {
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 500;
  }

  dialog.claim-dialog .combined-form-grid,
  dialog.claim-dialog .section-subcon-claim .combined-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-grid > *,
  html[data-theme="light"] dialog.claim-dialog .section-subcon-claim .combined-form-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100%;
    min-width: 0;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-grid label,
  html[data-theme="light"] dialog.claim-dialog .combined-form-grid .field-label {
    font-size: 13px !important;
    line-height: 1.3;
    font-weight: 400;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-grid input,
  html[data-theme="light"] dialog.claim-dialog .combined-form-grid select,
  html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger,
  html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control {
    width: 100%;
    height: 52px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 16px !important;
    line-height: 1.25;
  }

  dialog.claim-dialog .modal-actions {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: rgb(255 253 251 / 0.98);
    box-shadow: 0 -10px 28px rgb(74 48 56 / 0.07);
  }

  dialog.claim-dialog .modal-actions button {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    font-size: 15px;
  }

  dialog.selection-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }

  dialog.selection-dialog .selection-options {
    max-height: min(62dvh, 620px);
    overflow-y: auto;
  }

  dialog.selection-dialog button,
  dialog.selection-dialog input {
    min-height: 48px;
    font-size: 15px;
  }
}

.installer-search-detail {
  display: grid;
  gap: 12px;
}

.installer-search-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.installer-search-detail-grid > div {
  min-width: 0;
}

.installer-search-detail-grid span,
.installer-claim-amount-panel > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.installer-search-detail-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.installer-claim-amount-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.installer-claim-amount-panel > strong {
  color: #a94f65;
  font-size: 20px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .installer-search-detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .installer-search-detail .record-modal-section {
    padding: 14px;
    border-radius: 18px;
  }
}

/* The Subcon total is already represented by Claim Amount. */
html[data-theme="light"] #subconShareSummary {
  display: none;
}

html[data-theme="light"] .section-subcon-claim .field-subcon_name input[readonly]:not(:placeholder-shown) {
  border-color: var(--rose-strong);
  background: var(--rose-strong);
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(169, 79, 101, 0.16);
  text-align: center;
  font-weight: 400;
}

/* Uniform typography: one family and regular weight throughout the application. */
html[data-theme="light"] body,
html[data-theme="light"] body * {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400 !important;
}

/* Partner allocation is retained internally for historical records, but hidden from the claim form. */
html[data-theme="light"] .section-subcon-claim .field-partner_names {
  display: none;
}

html[data-theme="light"] .section-subcon-claim .field-partner_amount {
  display: none;
}

html[data-theme="light"] dialog.editing-claim .section-subcon-claim .field-partner_names {
  display: block;
  grid-column: 1 / 4;
  grid-row: 3;
}

html[data-theme="light"] dialog.editing-claim .section-subcon-claim .field-partner_amount {
  display: block;
  grid-column: 4 / 7;
  grid-row: 3;
}

html[data-theme="light"] dialog.editing-claim .section-subcon-claim .field-status_claim {
  grid-column: 1 / 4;
  grid-row: 4;
}

html[data-theme="light"] dialog.editing-claim .section-subcon-claim .field-claim_date {
  grid-column: 4 / 7;
  grid-row: 4;
}

html[data-theme="light"] dialog:not(.editing-claim) .section-subcon-claim .field-status_claim,
html[data-theme="light"] dialog:not(.editing-claim) .section-subcon-claim .field-claim_date {
  display: none;
}

html[data-theme="light"] dialog:not(.editing-claim) .section-maincon-payment {
  display: none;
}

.pdf-column {
  width: 96px !important;
  min-width: 96px;
  text-align: center !important;
}

.pdf-action-btn {
  min-width: 72px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.pdf-action-btn.view {
  border-color: var(--rose-strong);
  background: var(--rose-strong);
  color: #ffffff;
}

.pdf-action-btn:hover {
  border-color: var(--rose-strong);
  background: var(--blue-soft);
  color: var(--rose-strong);
}

.pdf-action-btn.view:hover {
  background: #943f54;
  color: #ffffff;
}

/* Compact 21-column Admin record table including Price, Fee %, and Net Get. */
html[data-theme="light"] #claimTable.combined-claim-table {
  width: 100%;
  min-width: 1810px;
  table-layout: fixed;
  font-size: 11px;
}

html[data-theme="light"] #claimTable.combined-claim-table th,
html[data-theme="light"] #claimTable.combined-claim-table td {
  padding: 9px 6px;
}

html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(1),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(1) { width: 90px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(2),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(2) { width: 118px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(3),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(3) { width: 104px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(4),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(4) { width: 180px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(5),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5) { width: 48px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(6),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(6) { width: 82px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(7),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(7) { width: 68px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(8),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(8) { width: 86px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(9),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(9) { width: 86px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(10),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(10) { width: 84px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(11),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(11) { width: 84px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(12),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(12) { width: 94px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(13),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(13) { width: 82px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(14),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(14) { width: 68px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(15),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(15) { width: 96px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(16),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(16) { width: 76px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(17),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(17) { width: 78px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(18),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(18) { width: 92px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(19),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(19) { width: 78px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(20),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(20) { width: 92px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(21),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(21) { width: 70px; text-align: center; }

html[data-theme="light"] #claimTable.combined-claim-table .delete-record-btn {
  min-width: 58px;
  padding-inline: 8px;
}

html[data-theme="light"] .claimed-filter-toggle.active {
  border-color: var(--rose-strong);
  background: var(--rose-strong);
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(169, 79, 101, 0.18);
}

html[data-theme="light"] .order-detail-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
}

html[data-theme="light"] .order-detail-modal {
  width: 100%;
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 20px;
  overflow: hidden;
}

html[data-theme="light"] .modal-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

html[data-theme="light"] .order-detail-dialog-body {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 190px);
  padding: 2px;
  overflow: auto;
}

html[data-theme="light"] .record-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme="light"] .record-modal-section {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fffdfb;
}

html[data-theme="light"] .record-modal-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 400;
}

@media (max-width: 720px) {
  html[data-theme="light"] .record-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Monthly Total must fill the full dashboard card. */
html[data-theme="light"] .monthly-total-wrap {
  width: 100%;
}

html[data-theme="light"] .monthly-total-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

html[data-theme="light"] .monthly-total-table th:first-child,
html[data-theme="light"] .monthly-total-table td:first-child,
html[data-theme="light"] .monthly-total-table th:not(:first-child),
html[data-theme="light"] .monthly-total-table td:not(:first-child) {
  width: 25%;
  min-width: 0;
  max-width: none;
}

/* Keep every dashboard pivot card aligned to one consistent height. */
@media (min-width: 851px) {
  html[data-theme="light"] .dashboard-grid {
    align-items: stretch;
  }

  html[data-theme="light"] .dashboard-grid > .viz-panel,
  html[data-theme="light"] .dashboard-grid > .viz-panel:nth-child(2) {
    height: 340px;
    min-height: 340px;
  }

  html[data-theme="light"] .dashboard-grid .pivot-table-wrap,
  html[data-theme="light"] .dashboard-grid .monthly-total-wrap {
    height: calc(100% - 36px);
    max-height: none;
  }
}

/* Paint the whole Daily Margin header as one surface, including its sticky Date cell. */
html[data-theme="light"] .daily-order-type-pivot .pivot-table thead th {
  background: #faf7f4 !important;
}


/* Add Claim controls share one shape regardless of input type or selection state. */
html[data-theme="light"] dialog.claim-dialog .combined-form-grid input,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid select,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control {
  height: 40px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px !important;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid label,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .field-label {
  font-size: 12px !important;
}

html[data-theme="light"] dialog.claim-dialog .popup-select-trigger.selected,
html[data-theme="light"] dialog.claim-dialog .section-subcon-claim .field-subcon_name input[readonly]:not(:placeholder-shown) {
  box-shadow: none;
}

.field-maincon_amount input[readonly],
.field-pricing_price input[readonly],
.field-pricing_fee_percent input[readonly],
.field-pricing_margin input[readonly],
.field-maincon_order_type input[readonly],
.field-subcon_name input[readonly],
.field-subcon_amount input[readonly],
.field-subcon_order_type input[readonly] {
  background: #f1f4f8;
  color: var(--ink);
  cursor: not-allowed;
  font-weight: 800;
}

.field-help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.add-form-grid label {
  margin-top: 0;
}

.form-spacer {
  min-height: 1px;
}

.card-select-field {
  grid-column: 1 / -1;
}

.multi-card-select-field {
  grid-column: 1 / -1;
}

.popup-select-field {
  min-width: 0;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-label small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.popup-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.popup-select-trigger:hover {
  border-color: var(--blue);
  background: #f8fbff;
}

.popup-select-trigger.selected {
  justify-content: center;
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  text-align: center;
}

.popup-select-trigger.selected:hover {
  background: #0f6edb;
  color: white;
}

.formatted-date-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.formatted-date-control:focus-within,
.formatted-date-control:focus-visible,
.formatted-date-control:hover {
  border-color: var(--blue);
}

.date-picker-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.date-picker-popover {
  position: fixed;
  z-index: 10000;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(87, 61, 28, 0.2);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-picker-header strong {
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.date-picker-header button,
.date-picker-days button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.date-picker-header button:hover,
.date-picker-days button:hover,
.date-picker-days button.selected {
  border-color: var(--gold);
  background: var(--gold);
  color: #5b3b13;
}

.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.date-picker-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.date-picker-empty {
  min-height: 32px;
}

.popup-select-trigger span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popup-select-trigger small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.selection-modal {
  padding: 14px;
}

.selection-modal .modal-head {
  align-items: flex-start;
}

.selection-modal .modal-head p {
  margin: 5px 0 0;
  font-size: 12px;
}

.selection-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.selection-option {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.selection-option:hover {
  border-color: var(--blue);
  background: #f8fbff;
}

.selection-option.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.card-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.multi-card-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.partner-share-summary {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.subcon-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.select-card {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.select-card.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.simple .simple-topbar {
  grid-template-columns: 230px 1fr 180px;
}

.simple .simple-nav {
  gap: 0;
}

.simple .simple-nav button {
  padding: 0 20px;
}

.simple .simple-page {
  padding: 18px;
}

.simple .page-head {
  margin-bottom: 14px;
}

.simple-metrics {
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.simple-workbench {
  display: grid;
  grid-template-columns: 210px minmax(690px, 1fr) 300px;
  gap: 10px;
  min-height: calc(100vh - 190px);
}

.simple-filters,
.simple-table-area,
.simple-details {
  border-radius: 8px;
}

.simple-filters {
  padding: 14px;
}

.simple-filters label {
  margin-top: 14px;
}

.simple-table-area {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.helper-text {
  color: var(--muted);
  font-size: 12px;
}

.simple-table {
  min-width: 780px;
}

.simple-table th,
.simple-table td {
  padding: 13px 10px;
}

.simple-table th:nth-child(1),
.simple-table td:nth-child(1) { width: 175px; }
.simple-table th:nth-child(2),
.simple-table td:nth-child(2) { width: 160px; }
.simple-table th:nth-child(3),
.simple-table td:nth-child(3) { width: 92px; }
.simple-table th:nth-child(4),
.simple-table td:nth-child(4),
.simple-table th:nth-child(5),
.simple-table td:nth-child(5),
.simple-table th:nth-child(6),
.simple-table td:nth-child(6),
.simple-table th:nth-child(7),
.simple-table td:nth-child(7) { width: 96px; }
.simple-table th:nth-child(8),
.simple-table td:nth-child(8) { width: 95px; }

.simple-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance {
  color: var(--red);
  font-weight: 800;
}

.simple-detail-head {
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.simple-detail-head h2 {
  margin: 12px 0 4px;
  font-size: 22px;
}

.simple-detail-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.simple-total {
  padding: 16px;
  background: #fff8ed;
  border-bottom: 1px solid var(--line-soft);
}

.simple-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.simple-total strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  color: var(--red);
}

.simple-list {
  display: grid;
  gap: 10px;
}

.simple-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.simple-list span {
  color: var(--muted);
}

.simple-list strong {
  text-align: right;
}

.simple-provider h3 {
  margin-top: 0;
}

.simple-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.simple-actions button {
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.register {
  background: var(--bg);
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
}

.login-card {
  width: min(390px, 100%);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0;
  border: 0;
  height: auto;
  margin-bottom: 18px;
}

.login-card label {
  margin-top: 12px;
}

.login-error {
  min-height: 18px;
  margin: 10px 0;
  color: var(--red);
  font-weight: 700;
}

.login-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.register-top {
  height: 62px;
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.register-search {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.register-search input[type="month"] {
  width: 150px;
}

.register-search select {
  width: 112px;
}

.register-search input[type="search"] {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.register-search-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(720px, 64vw);
}

.search-submit-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
  border-radius: 999px;
}

.register-search .theme-toggle {
  margin-left: auto;
}

.theme-toggle {
  min-width: 68px;
  white-space: nowrap;
}

.qid-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.qid-link:hover,
.qid-link:focus-visible {
  border-color: var(--blue);
  outline: 0;
}

.qid-slider {
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.qid-slider-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
}

.qid-slider-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(520px, 100vw);
  height: 100%;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.18);
}

.qid-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.qid-slider-head span,
.qid-profile span,
.qid-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qid-slider-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.qid-slider-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.qid-profile,
.qid-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.qid-profile div,
.qid-summary-grid div,
.qid-status-list div,
.qid-order-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.qid-profile div:first-child {
  grid-column: 1 / -1;
}

.qid-profile strong,
.qid-summary-grid strong {
  display: block;
  margin-top: 5px;
}

.qid-slider-section h3 {
  margin: 4px 0 10px;
  font-size: 14px;
}

.qid-status-list,
.qid-order-list {
  display: grid;
  gap: 9px;
}

.qid-status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.qid-order-card {
  display: grid;
  gap: 4px;
  width: 100%;
  color: inherit;
  text-align: left;
}

.qid-order-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.qid-order-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.qid-order-card em {
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.register-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: calc(100vh - 62px);
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 62px);
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.app-sidebar button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: #334155;
  font-weight: 800;
  text-align: left;
}

.app-sidebar button:hover {
  background: #f6f9fd;
}

.app-sidebar button.active {
  background: var(--blue);
  color: white;
}

.register-page {
  min-width: 0;
  padding: 18px;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.settings-panel h2 {
  margin: 0;
  font-size: 18px;
}

.settings-intro {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.settings-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-menu-card {
  display: grid;
  gap: 5px;
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.settings-menu-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.settings-menu-card span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.settings-menu-card strong {
  font-size: 16px;
}

.settings-menu-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--red-soft);
  border-radius: 8px;
  background: #fff7f8;
}

.settings-danger-zone div {
  display: grid;
  gap: 4px;
}

.settings-danger-zone strong {
  color: var(--red);
  font-size: 14px;
}

.settings-danger-zone span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.role-management-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.user-management-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 20px;
}

.role-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.user-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.user-management-head h2 {
  margin: 0;
  font-size: 18px;
}

.user-management-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-management-section {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.user-create-section {
  padding: 16px;
  margin-bottom: 16px;
}

.user-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.user-section-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.user-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.user-list-heading {
  padding: 16px 16px 0;
}

.user-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(160px, .9fr) minmax(180px, 1fr) minmax(190px, 1fr) 108px 150px;
  gap: 12px;
  align-items: end;
}

.user-create-form label {
  margin: 0;
}

.user-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.user-active-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--rose-strong, #b24e68);
}

.user-management-table input,
.user-management-table select {
  width: 100%;
  min-width: 0;
}

.user-management-table-wrap {
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 16px 16px;
}

.user-management-table {
  min-width: 1080px;
  table-layout: fixed;
}

.user-management-table .user-col-username { width: 19%; }
.user-management-table .user-col-role { width: 17%; }
.user-management-table .user-col-qid { width: 16%; }
.user-management-table .user-col-password { width: 20%; }
.user-management-table .user-col-status { width: 12%; }
.user-management-table .user-col-action { width: 16%; }

.user-management-table th,
.user-management-table td {
  padding-left: 12px;
  padding-right: 12px;
}

.user-management-table td:first-child input {
  overflow: visible;
  text-overflow: clip;
}

.user-management-table .user-active-toggle.inline {
  width: 100%;
  justify-content: flex-start;
  padding: 0 4px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.role-management-head h2 {
  margin: 0;
  font-size: 18px;
}

.role-management-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.role-management-table input {
  width: 100%;
  min-width: 140px;
}

.role-management-table th:last-child,
.role-management-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.role-mapping-remove {
  height: 34px;
}

.price-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.price-settings-head h2 {
  margin: 0;
  font-size: 18px;
}

.price-settings-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.price-rule-note {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.price-rule-note strong {
  font-size: 13px;
}

.price-rule-note span {
  font-size: 12px;
  line-height: 1.5;
}

.price-settings-table th {
  white-space: nowrap;
}

.price-settings-table td:first-child {
  width: 130px;
  overflow: visible;
  text-overflow: clip;
}

.price-settings-table {
  min-width: 1000px;
  table-layout: fixed;
}

.price-settings-table th:nth-child(1),
.price-settings-table td:nth-child(1) { width: 130px; }
.price-settings-table th:nth-child(2),
.price-settings-table td:nth-child(2) { width: 180px; }
.price-settings-table th:nth-child(3),
.price-settings-table td:nth-child(3) { width: 120px; }
.price-settings-table th:nth-child(4),
.price-settings-table td:nth-child(4) { width: 180px; }
.price-settings-table th:nth-child(5),
.price-settings-table td:nth-child(5) { width: 210px; }
.price-settings-table th:nth-child(6),
.price-settings-table td:nth-child(6) { width: 180px; }

.price-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}

.price-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-input input {
  width: 100%;
  min-width: 0;
}

.percent-input {
  grid-template-columns: minmax(0, 1fr) auto;
}

.calculated-input input[readonly] {
  color: var(--ink);
  font-weight: 900;
  background: color-mix(in srgb, var(--panel) 80%, var(--line));
  cursor: default;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.settings-grid div {
  padding: 14px;
  background: #fbfcfe;
}

.settings-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-grid strong {
  display: block;
  margin-top: 6px;
}

.register-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.register-summary div {
  padding: 14px;
  background: var(--surface);
}

.register-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.register-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.register-summary em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.claimed-summary-card strong {
  color: var(--green);
}

.dashboard-board {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-kpi,
.viz-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-kpi {
  padding: 14px;
}

.dashboard-kpi span,
.dashboard-kpi em,
.panel-head span,
.bar-row span,
.recent-list span,
.recent-list em,
.mind-node span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dashboard-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.dashboard-kpi.good strong {
  color: var(--green);
}

.dashboard-kpi.bad strong {
  color: var(--red);
}

.dashboard-kpi em {
  display: block;
  margin-top: 6px;
}

.claim-sheet-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.claim-sheet-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.claim-sheet-tabs button.active {
  border-bottom-color: var(--rose-strong);
  color: var(--text);
}

.claim-sheet {
  display: none;
}

.claim-sheet.active {
  display: block;
}

[data-claim-sheet-panel="record"] .table-tools {
  justify-content: flex-end;
}

.staff-mode [data-claim-sheet="update"] {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.dashboard-grid .viz-panel:nth-child(2) {
  min-height: 0;
  height: fit-content;
}

.viz-panel {
  min-height: 230px;
  padding: 12px;
  overflow: hidden;
}

.viz-panel.wide {
  grid-column: span 2;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(70px, 1.2fr) minmax(86px, auto);
  gap: 8px;
  align-items: center;
}

.bar-row div {
  display: grid;
  gap: 2px;
}

.bar-row strong,
.bar-row b {
  font-size: 12px;
}

.bar-row b {
  min-width: 86px;
  text-align: right;
}

.bar-track,
.mini-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
}

.bar-track i,
.mini-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.trend-chart {
  display: grid;
  gap: 8px;
  color: var(--blue);
}

.trend-chart svg {
  width: 100%;
  height: 150px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(#fbfcfe, #ffffff);
}

.trend-axis {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  color: var(--muted);
  font-size: 12px;
}

.trend-axis strong {
  color: var(--ink);
}

.trend-axis span:last-child {
  text-align: right;
}

.dashboard-month-slider {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.dashboard-month-slider button {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.dashboard-month-slider button:hover,
.dashboard-month-slider button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.monthly-total-wrap {
  max-height: 260px;
  overflow: auto;
}

.monthly-total-table {
  width: max-content;
  min-width: 640px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.monthly-total-table th,
.monthly-total-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.monthly-total-table th {
  color: var(--muted);
  text-align: left;
}

.monthly-total-table th:first-child,
.monthly-total-table td:first-child {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  overflow: visible;
  text-overflow: clip;
}

.monthly-total-table th:not(:first-child),
.monthly-total-table td:not(:first-child) {
  width: 152px;
  min-width: 152px;
}

.monthly-total-table tfoot th {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  color: var(--ink);
}

.monthly-total-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-qid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-qid-card {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
}

.dashboard-qid-card:hover,
.dashboard-qid-card:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: 0;
}

.dashboard-qid-card strong {
  color: var(--blue);
  font-size: 15px;
}

.dashboard-qid-card span,
.dashboard-qid-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.maincon-status-pivot {
  display: grid;
  gap: 14px;
}

.maincon-status-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.9fr) minmax(110px, 1.3fr) minmax(92px, auto);
  align-items: center;
  gap: 12px;
}

.maincon-status-row strong,
.maincon-status-row span {
  display: block;
}

.maincon-status-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.maincon-status-row b {
  text-align: right;
}

.maincon-status-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-soft);
}

.maincon-status-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.maincon-status-row.claimed .maincon-status-track i {
  background: var(--green);
}

.status-donut {
  width: 156px;
  height: 156px;
  display: grid;
  place-items: center;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 var(--paid), var(--blue) var(--paid) var(--submitted), var(--amber) var(--submitted) 100%);
}

.status-donut div {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: var(--surface);
}

.status-donut strong {
  font-size: 24px;
}

.donut-legend,
.margin-buckets,
.recent-list {
  display: grid;
  gap: 8px;
}

.donut-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.paid-dot {
  background: var(--green);
}

.submitted-dot {
  background: var(--blue);
}

.pending-dot {
  background: var(--amber);
}

.margin-buckets div,
.recent-list div {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
}

.margin-buckets strong,
.recent-list strong {
  display: block;
  margin: 4px 0 6px;
}

.pivot-table-wrap {
  max-height: 230px;
  overflow: auto;
}

.pivot-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.pivot-table th,
.pivot-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.pivot-table th {
  color: var(--muted);
}

.daily-order-type-pivot {
  max-height: 260px;
}

.daily-order-type-pivot .pivot-table {
  table-layout: fixed;
  min-width: 720px;
}

.daily-order-type-pivot th:first-child,
.daily-order-type-pivot td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  padding-left: 10px;
  padding-right: 10px;
  background: var(--surface);
  overflow: visible;
  text-overflow: clip;
}

.daily-order-type-pivot th:first-child {
  z-index: 2;
}

.daily-order-type-pivot th:not(:first-child),
.daily-order-type-pivot td:not(:first-child) {
  width: 78px;
  padding-left: 6px;
  padding-right: 6px;
}

.daily-order-type-pivot td:first-child strong {
  display: inline-block;
  min-width: 84px;
  font-variant-numeric: tabular-nums;
}

.daily-subcon-order-type-pivot {
  max-height: 360px;
}

.daily-subcon-order-type-pivot .pivot-table {
  min-width: 900px;
  table-layout: auto;
}

.daily-subcon-order-type-pivot th:first-child,
.daily-subcon-order-type-pivot td:first-child {
  width: 108px;
  min-width: 108px;
}

.daily-subcon-order-type-pivot th:nth-child(2),
.daily-subcon-order-type-pivot td:nth-child(2) {
  width: 105px;
  min-width: 105px;
}

.daily-subcon-order-type-pivot th:not(:first-child),
.daily-subcon-order-type-pivot td:not(:first-child) {
  padding-inline: 9px;
}

.mindmap-panel {
  grid-column: span 2;
}

.mind-map {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 4px 0;
}

.mind-branch {
  display: grid;
  gap: 10px;
}

.mind-branch.top {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mind-branch.bottom {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mind-node {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  text-align: center;
}

.mind-node.root {
  width: min(260px, 100%);
  margin: 0 auto;
  border-color: rgba(21, 101, 192, 0.25);
  background: #eef6ff;
}

.mind-node strong,
.mind-node span {
  display: block;
}

.register-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.records-area {
  min-width: 0;
}

.order-lookup {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.order-lookup-search {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.order-lookup-search label {
  margin: 0;
}

.order-lookup-search input {
  margin-top: 6px;
}

.order-lookup-result {
  padding: 12px;
}

.lookup-head,
.lookup-grid,
.lookup-card {
  display: grid;
  gap: 10px;
}

.lookup-head {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.lookup-head span,
.lookup-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lookup-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.lookup-total {
  text-align: right;
}

.lookup-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.lookup-head-actions .primary {
  min-width: 96px;
}

.lookup-head-actions .primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lookup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.lookup-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.lookup-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.order-detail-panel {
  grid-column: 1 / -1;
}

.order-detail-card {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lookup-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.lookup-card + .lookup-card {
  margin-top: 8px;
}

.maincon-lookup-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.maincon-lookup-card .lookup-inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.maincon-lookup-card .lookup-inline strong {
  margin-top: 0;
  min-height: 0;
}

.subcon-lookup-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.subcon-lookup-card .lookup-status-row {
  grid-column: 1 / 3;
}

.subcon-lookup-card .subcon-pay-date {
  grid-column: 3;
}

.subcon-lookup-card .subcon-qid {
  grid-column: 1;
}

.subcon-lookup-card .subcon-name {
  grid-column: 2;
}

.subcon-lookup-card .subcon-job-scope {
  grid-column: 3;
}

.subcon-lookup-card .subcon-order-type {
  grid-column: 1 / 3;
}

.subcon-lookup-card .subcon-claim-amount {
  grid-column: 3;
}

.subcon-lookup-card .partner-detail {
  grid-column: 1 / 4;
}

.subcon-lookup-card .lookup-status-cell {
  justify-self: end;
  text-align: right;
  min-width: 140px;
}

.subcon-lookup-card .lookup-status-cell strong {
  margin-left: auto;
}

.lookup-card strong {
  display: block;
  margin-top: 4px;
  min-height: 18px;
}

.lookup-detail-line {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px dashed rgba(156, 107, 47, 0.28);
}

.lookup-detail-line strong {
  color: var(--text);
}


.lookup-status-row {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 28px;
  padding: 4px 6px 4px 0;
}

.lookup-status-row strong {
  margin-top: 0;
  min-height: 0;
}
.lookup-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.lookup-status.paid {
  background: #dff8f6;
  color: #007c78;
}

@media (max-width: 720px) {
  .subcon-lookup-card {
    grid-template-columns: 1fr;
  }

  .subcon-lookup-card .lookup-status-row,
  .subcon-lookup-card .subcon-pay-date,
  .subcon-lookup-card .subcon-qid,
  .subcon-lookup-card .subcon-name,
  .subcon-lookup-card .subcon-job-scope,
  .subcon-lookup-card .subcon-order-type,
  .subcon-lookup-card .subcon-claim-amount,
  .subcon-lookup-card .partner-detail {
    grid-column: 1;
  }
}

.lookup-status.submitted {
  background: var(--amber-soft);
  color: var(--amber);
}

.lookup-status.pending {
  background: var(--blue-soft);
  color: var(--blue);
}

.lookup-empty {
  margin: 0;
  color: var(--muted);
}

.register-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}

.register-tabs button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-weight: 800;
}

.register-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.register-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.register-layout.records-only {
  grid-template-columns: 1fr;
}

.entry-panel,
.register-table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-panel {
  padding: 14px;
}

.entry-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.entry-panel form {
  display: grid;
  gap: 8px;
}

.entry-panel label {
  margin-top: 0;
}

.register-table-panel {
  min-width: 0;
  overflow: hidden;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td,
.clickable-row:focus td {
  background: #eff6ff;
}

.clickable-row:focus {
  outline: none;
}

.record-actions {
  display: flex;
  gap: 8px;
}

.panel-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.claim-update-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.claim-match-head,
.claim-match-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.claim-match-head h2 {
  margin: 0;
  font-size: 18px;
}

.claim-match-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.claim-match-input {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.claim-match-input label {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.claim-match-input textarea {
  width: 100%;
  min-height: 132px;
  margin-top: 6px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.claim-match-input textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(21, 113, 239, 0.12);
}

.claim-match-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.claim-match-input-footer span {
  color: var(--muted);
  font-size: 12px;
}

.claim-match-results-head {
  align-items: center;
}

.claim-match-apply-fields {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.claim-match-apply-fields label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.claim-match-apply-fields input {
  width: 160px;
  height: 40px;
  margin-top: 5px;
}

#claimUpdateTable {
  min-width: 1320px;
}

#claimUpdateTable th:nth-child(1),
#claimUpdateTable td:nth-child(1),
#claimUpdateTable th:nth-child(2),
#claimUpdateTable td:nth-child(2) {
  width: 190px;
  min-width: 190px;
  overflow: visible;
  text-overflow: clip;
}

#claimUpdateTable .claim-match-total-row td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 2px solid var(--line);
  background: #faf7f4;
  font-weight: 400;
}

#claimUpdateTable .claim-match-total-row td:first-child {
  text-align: right;
}

#claimUpdateTable .claim-update-order-row {
  cursor: pointer;
}

#claimUpdateTable .claim-update-order-row:hover td,
#claimUpdateTable .claim-update-order-row:focus td {
  background: #fff3f6;
}

.claim-match-results-head button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.claim-update-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.claim-update-summary div {
  padding: 12px;
  background: #fbfcfe;
}

.claim-update-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.claim-update-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.match-result {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.match-result.matched {
  background: var(--green-soft);
  color: var(--green);
}

.match-result.already {
  background: #e0e7ff;
  color: #3730a3;
}

.match-result.not-found {
  background: var(--red-soft);
  color: var(--red);
}

.match-result.duplicate {
  background: var(--amber-soft);
  color: var(--amber);
}

.match-result.closest {
  background: #fff1c7;
  color: #8a5a00;
}

.use-closest-id {
  display: block;
  margin-top: 5px;
  padding: 4px 8px;
  border: 1px solid #d5a83d;
  border-radius: 7px;
  background: #fffaf0;
  color: #765000;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.empty-table-cell {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.row-action {
  height: 28px;
  padding: 0 10px;
}

.batch-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.register-table-panel .table-wrap {
  max-height: calc(100vh - 230px);
}

#claimTable {
  min-width: 880px;
  table-layout: auto;
}

#claimTable th,
#claimTable td {
  padding: 11px 10px;
}

#claimTable tbody tr:nth-child(even) {
  background: #fbfcfe;
}

#claimTable .num {
  text-align: right;
  font-weight: 800;
}

#claimTable caption {
  caption-side: top;
  text-align: left;
  padding: 0;
}

.batch-insight {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 1px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.batch-insight div {
  padding: 12px;
  background: #fbfcfe;
}


.batch-insight span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.batch-insight strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.claimed-ok,
.margin-ok {
  color: var(--green);
}

.unclaimed-warn {
  color: var(--amber);
}

.margin-bad {
  color: var(--red);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.claimed {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.unclaimed {
  background: var(--amber-soft);
  color: var(--amber);
}


@media (max-width: 850px) {
  .register-top,
  .register-body,
  .register-layout,
  .register-summary,
  .settings-menu-grid,
  .settings-grid,
  .order-lookup-search,
  .lookup-head,
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    display: flex;
    gap: 8px;
    height: auto;
    padding: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-sidebar button {
    flex: 0 0 auto;
    width: auto;
  }

  .price-settings-head {
    align-items: stretch;
    flex-direction: column;
  }

  .role-management-head {
    align-items: stretch;
    flex-direction: column;
  }

  .claim-match-head,
  .claim-match-results-head,
  .claim-match-input-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-options {
    grid-template-columns: 1fr;
  }

  .lookup-total {
    text-align: left;
  }

  .register-search {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .register-search input[type="search"],
  .register-search input[type="month"] {
    width: 100%;
  }

  .dashboard-kpis,
  .dashboard-grid,
  .claim-update-summary,
  .mind-branch.top,
  .mind-branch.bottom {
    grid-template-columns: 1fr;
  }

  .viz-panel.wide,
  .mindmap-panel {
    grid-column: auto;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-row b {
    text-align: left;
  }

  .add-form-grid {
    grid-template-columns: 1fr;
  }

  .combined-form-grid {
    grid-template-columns: 1fr;
  }

  .combined-form-grid .field-maincon_order_type {
    grid-column: 1 / -1;
  }

  .combined-form-grid .field-maincon_amount {
    grid-column: 1 / -1;
  }

  .combined-form-grid .field-subcon_order_type,
  .combined-form-grid .field-subcon_amount {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1150px) {
  .topbar {
    grid-template-columns: 230px 1fr 210px;
  }
  .topnav button {
    padding: 0 9px;
  }
  .workbench {
    grid-template-columns: 180px 1fr;
  }
  .details {
    grid-column: 1 / -1;
    max-height: 470px;
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .simple-workbench {
    grid-template-columns: 190px 1fr;
  }
  .simple-details {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
  }
  .brand, .userbar {
    border: 0;
    padding: 12px;
  }
  .topnav {
    overflow-x: auto;
    border-top: 1px solid var(--line-soft);
  }
  .page-head {
    align-items: start;
    gap: 12px;
    flex-direction: column;
  }
  .metrics, .workbench {
    grid-template-columns: 1fr;
  }
  .simple-metrics,
  .simple-workbench {
    grid-template-columns: 1fr;
  }
  .filters {
    order: 2;
  }
  .table-area {
    order: 1;
  }
  .details {
    order: 3;
  }
}

@media (min-width: 701px) {
  .register-content {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  }

  .order-lookup {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
  }

  .order-lookup-result {
    max-height: calc(100vh - 120px);
  }
}


@media (max-width: 1200px) {
  .user-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-create-form .user-active-toggle,
  .user-create-form > button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .user-management-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .user-create-form {
    grid-template-columns: 1fr;
  }

  .user-list-heading,
  .user-create-section {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Hover contrast fixes for dashboard and management pages. */
.app-sidebar button:hover,
.secondary:hover,
.icon-btn:hover,
.role-management-table tbody tr:hover td,
.user-management-table tbody tr:hover td,
.price-settings-table tbody tr:hover td {
  background: #eaf3ff;
  color: var(--text);
}

.dashboard-kpi:hover,
.viz-panel:hover,
.theme-card:hover,
.role-management-panel:hover,
.user-management-panel:hover,
.price-settings-panel:hover {
  color: var(--text);
}


/* Admin Combined Claim table: complete 18-column layout. */
html #claimTable.combined-claim-table th:nth-child(1), html #claimTable.combined-claim-table td:nth-child(1) { width: 5.5%; }
html #claimTable.combined-claim-table th:nth-child(2), html #claimTable.combined-claim-table td:nth-child(2) { width: 7%; }
html #claimTable.combined-claim-table th:nth-child(3), html #claimTable.combined-claim-table td:nth-child(3) { width: 6.2%; }
html #claimTable.combined-claim-table th:nth-child(4), html #claimTable.combined-claim-table td:nth-child(4) { width: 9.5%; }
html #claimTable.combined-claim-table th:nth-child(5), html #claimTable.combined-claim-table td:nth-child(5) { width: 3.2%; text-align: center; }
html #claimTable.combined-claim-table th:nth-child(6), html #claimTable.combined-claim-table td:nth-child(6) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(7), html #claimTable.combined-claim-table td:nth-child(7) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(8), html #claimTable.combined-claim-table td:nth-child(8) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(9), html #claimTable.combined-claim-table td:nth-child(9) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(10), html #claimTable.combined-claim-table td:nth-child(10) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(11), html #claimTable.combined-claim-table td:nth-child(11) { width: 5.5%; }
html #claimTable.combined-claim-table th:nth-child(12), html #claimTable.combined-claim-table td:nth-child(12) { width: 6%; }
html #claimTable.combined-claim-table th:nth-child(13), html #claimTable.combined-claim-table td:nth-child(13) { width: 5.5%; }
html #claimTable.combined-claim-table th:nth-child(14), html #claimTable.combined-claim-table td:nth-child(14) { width: 5.2%; }
html #claimTable.combined-claim-table th:nth-child(15), html #claimTable.combined-claim-table td:nth-child(15) { width: 4.8%; text-align: center; }
html #claimTable.combined-claim-table th:nth-child(16), html #claimTable.combined-claim-table td:nth-child(16) { width: 5%; }
html #claimTable.combined-claim-table th:nth-child(17), html #claimTable.combined-claim-table td:nth-child(17) { width: 6%; }
html #claimTable.combined-claim-table th:nth-child(18), html #claimTable.combined-claim-table td:nth-child(18) { width: 4.6%; }

/* Single white theme: no decorative, translucent, blurred, or pseudo-element layers. */
html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] body.register,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .register-page,
html[data-theme="light"] .dashboard-board {
  background: #ffffff;
  background-image: none;
}

html[data-theme="light"] .register-top,
html[data-theme="light"] .register-body,
html[data-theme="light"] .app-sidebar,
html[data-theme="light"] .dashboard-kpi,
html[data-theme="light"] .viz-panel,
html[data-theme="light"] .register-table-panel,
html[data-theme="light"] .claim-update-panel,
html[data-theme="light"] .order-lookup,
html[data-theme="light"] .lookup-panel,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .price-settings-panel,
html[data-theme="light"] .role-management-panel,
html[data-theme="light"] .user-management-panel,
html[data-theme="light"] .combined-form-section,
html[data-theme="light"] dialog,
html[data-theme="light"] .modal {
  background: #ffffff;
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-theme="light"] body::before,
html[data-theme="light"] body::after,
html[data-theme="light"] .register-page::before,
html[data-theme="light"] .register-page::after,
html[data-theme="light"] .dashboard-board::before,
html[data-theme="light"] .dashboard-board::after,
html[data-theme="light"] .dashboard-kpi::before,
html[data-theme="light"] .dashboard-kpi::after,
html[data-theme="light"] .viz-panel::before,
html[data-theme="light"] .viz-panel::after,
html[data-theme="light"] .app-sidebar::before,
html[data-theme="light"] .app-sidebar::after {
  display: none;
  content: none;
}

/* Spring Luxe Glass — the application's single, light-only visual system. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf8f4;
  --surface: #fffdfb;
  --surface-glass: rgba(255, 253, 251, 0.82);
  --surface-muted: #f8f3ee;
  --line: #e9e2dc;
  --line-soft: #f0ebe6;
  --text: #45413f;
  --ink: #45413f;
  --muted: #77716d;
  --blue: #a94f65;
  --blue-soft: #fce8ed;
  --green: #4f6b45;
  --green-soft: #e8f0df;
  --amber: #856719;
  --amber-soft: #fff2c9;
  --red: #a74350;
  --red-soft: #fbe5e8;
  --gray-soft: #f0ece8;
  --rose: #f5b8c6;
  --rose-strong: #a94f65;
  --peach: #f3c7a6;
  --sage: #b8cc9a;
  --yellow: #f6df8b;
  --card-radius: 24px;
  --control-radius: 16px;
  --shadow: 0 14px 34px rgba(105, 80, 68, 0.07), 0 2px 8px rgba(105, 80, 68, 0.035);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] body,
html[data-theme="light"] body.register,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .register-page,
html[data-theme="light"] .dashboard-board {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 4% 1%, rgba(245, 184, 198, 0.18), transparent 27rem),
    radial-gradient(circle at 96% 8%, rgba(184, 204, 154, 0.15), transparent 30rem),
    radial-gradient(circle at 82% 92%, rgba(243, 199, 166, 0.12), transparent 26rem);
}

html[data-theme="light"] body {
  min-height: 100dvh;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="light"] body::before {
  content: "";
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image: repeating-linear-gradient(112deg, rgba(121, 102, 91, 0.028) 0 1px, transparent 1px 5px);
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] strong,
html[data-theme="light"] button {
  letter-spacing: -0.015em;
}

html[data-theme="light"] .app-shell {
  min-height: 100dvh;
  padding: 20px 24px 24px;
}

html[data-theme="light"] .register-top {
  position: sticky;
  top: 14px;
  z-index: 100;
  height: 72px;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--card-radius);
  background: rgba(255, 253, 251, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

html[data-theme="light"] .brand {
  gap: 12px;
  padding: 0 4px;
  border-right: 0;
}

html[data-theme="light"] .brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(169, 79, 101, 0.16);
  border-radius: 14px;
  background: linear-gradient(145deg, #f9ced8, var(--rose));
  color: #623642;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 5px 14px rgba(169,79,101,0.12);
  font-weight: 700;
}

html[data-theme="light"] .brand strong {
  color: #3f3b39;
  font-size: 14px;
  font-weight: 600;
}

html[data-theme="light"] .brand span {
  color: var(--muted);
  font-size: 11px;
}

html[data-theme="light"] .register-search {
  justify-content: flex-start;
  gap: 10px;
}

html[data-theme="light"] .register-search #resetBtn {
  order: 0;
  margin-left: 0;
}

html[data-theme="light"] .register-search #logoutBtn {
  margin-left: auto;
}

html[data-theme="light"] .register-search input[type="search"] {
  width: 100%;
  flex: 1 1 auto;
  max-width: none;
  border-radius: 999px;
  padding-inline: 18px;
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .register-body {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100dvh - 116px);
  padding-top: 24px;
  background: transparent;
}

html[data-theme="light"] .app-sidebar {
  top: 110px;
  height: calc(100dvh - 134px);
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: var(--card-radius);
  background: rgba(255, 253, 251, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

html[data-theme="light"] .app-sidebar button {
  height: 46px;
  margin-bottom: 6px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #625d59;
  font-weight: 600;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

html[data-theme="light"] .app-sidebar button:hover {
  border-color: rgba(245,184,198,0.26);
  background: #fff3f6;
  color: #713a48;
}

html[data-theme="light"] .app-sidebar button.active {
  border-color: rgba(169,79,101,0.14);
  background: linear-gradient(135deg, #f8c8d3, var(--rose));
  color: #5d303b;
  box-shadow: 0 7px 18px rgba(169,79,101,0.14), inset 0 1px 0 rgba(255,255,255,0.58);
}

html[data-theme="light"] .register-page {
  padding: 0;
  background: transparent;
}

html[data-theme="light"] .register-top,
html[data-theme="light"] .register-body,
html[data-theme="light"] .app-sidebar,
html[data-theme="light"] .dashboard-kpi,
html[data-theme="light"] .viz-panel,
html[data-theme="light"] .register-table-panel,
html[data-theme="light"] .claim-update-panel,
html[data-theme="light"] .order-lookup,
html[data-theme="light"] .lookup-panel,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .price-settings-panel,
html[data-theme="light"] .role-management-panel,
html[data-theme="light"] .user-management-panel,
html[data-theme="light"] .combined-form-section,
html[data-theme="light"] dialog,
html[data-theme="light"] .modal {
  background-image: none;
}

html[data-theme="light"] .dashboard-kpi,
html[data-theme="light"] .viz-panel,
html[data-theme="light"] .register-table-panel,
html[data-theme="light"] .claim-update-panel,
html[data-theme="light"] .order-lookup,
html[data-theme="light"] .lookup-panel,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .price-settings-panel,
html[data-theme="light"] .role-management-panel,
html[data-theme="light"] .user-management-panel,
html[data-theme="light"] .combined-form-section,
html[data-theme="light"] dialog,
html[data-theme="light"] .modal {
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--card-radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.06);
  -webkit-backdrop-filter: blur(24px) saturate(1.06);
}

html[data-theme="light"] .dashboard-board {
  gap: 16px;
  background: transparent;
}

html[data-theme="light"] .dashboard-kpis {
  gap: 14px;
}

html[data-theme="light"] .dashboard-kpi {
  min-height: 116px;
  padding: 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html[data-theme="light"] .dashboard-kpi:hover,
html[data-theme="light"] .viz-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(245,184,198,0.48);
  background: rgba(255,253,251,0.94) !important;
  box-shadow: 0 18px 38px rgba(105,80,68,0.09);
}

html[data-theme="light"] .dashboard-kpi strong {
  color: #413d3a;
  font-size: 24px;
  font-weight: 600;
}

html[data-theme="light"] .dashboard-grid {
  gap: 16px;
}

html[data-theme="light"] .viz-panel {
  padding: 18px;
}

html[data-theme="light"] .primary,
html[data-theme="light"] .secondary,
html[data-theme="light"] .danger,
html[data-theme="light"] .icon-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

html[data-theme="light"] .primary {
  border: 1px solid var(--rose-strong);
  background: var(--rose-strong);
  color: #fff;
  box-shadow: 0 7px 16px rgba(169,79,101,0.18);
}

html[data-theme="light"] .primary:hover {
  border-color: #943f54;
  background: #943f54;
}

html[data-theme="light"] .secondary,
html[data-theme="light"] .icon-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  color: #5f5955;
}

html[data-theme="light"] .secondary:hover,
html[data-theme="light"] .icon-btn:hover {
  border-color: #e7bdc7;
  background: #fff3f6;
  color: #713a48;
}

html[data-theme="light"] .danger {
  background: var(--red);
  color: #fff;
}

html[data-theme="light"] button:active {
  transform: translateY(1px) scale(0.985);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  min-height: 42px;
  border: 1px solid #e7dfd8;
  border-radius: var(--control-radius);
  background: rgba(255,255,255,0.82);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(96,73,62,0.045);
  font-weight: 500;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] .claim-match-input textarea:focus {
  border-color: #d98fa0;
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(245,184,198,0.25), inset 0 1px 2px rgba(96,73,62,0.035);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #8b8580;
}

html[data-theme="light"] label {
  color: #5e5854;
  font-weight: 600;
}

html[data-theme="light"] .table-tools,
html[data-theme="light"] .claim-match-head,
html[data-theme="light"] .claim-match-results-head {
  min-height: 66px;
  padding: 12px 16px;
  border-color: var(--line-soft);
}

html[data-theme="light"] .table-wrap {
  scrollbar-color: #d9b8c0 transparent;
  scrollbar-width: thin;
}

html[data-theme="light"] table {
  border-collapse: separate;
  border-spacing: 0;
}

html[data-theme="light"] th {
  background: rgba(250,246,242,0.96);
  color: #655f5b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

html[data-theme="light"] th,
html[data-theme="light"] td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

html[data-theme="light"] tbody tr,
html[data-theme="light"] tbody tr td {
  background: transparent;
  transition: background-color 140ms ease;
}

html[data-theme="light"] #claimTable tbody tr:nth-child(even) {
  background: rgba(250,247,244,0.42);
}

html[data-theme="light"] tbody tr:hover,
html[data-theme="light"] tbody tr:hover td,
html[data-theme="light"] .clickable-row:hover td,
html[data-theme="light"] .role-management-table tbody tr:hover td,
html[data-theme="light"] .user-management-table tbody tr:hover td,
html[data-theme="light"] .price-settings-table tbody tr:hover td {
  background: #fff2f5 !important;
  color: var(--text);
}

html[data-theme="light"] .qid-link {
  border-color: #edc6cf;
  border-radius: 10px;
  background: #fff0f4;
  color: #874456;
  font-weight: 600;
}

html[data-theme="light"] .status-pill,
html[data-theme="light"] .match-result {
  border-radius: 999px;
  font-weight: 600;
}

html[data-theme="light"] .claim-match-input,
html[data-theme="light"] .claim-update-summary div {
  background: rgba(250,246,242,0.72);
}

html[data-theme="light"] .settings-menu-grid {
  gap: 14px;
}

html[data-theme="light"] .settings-menu-card {
  min-height: 132px;
  border-color: var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  transition: transform 170ms ease, border-color 170ms ease, background-color 170ms ease;
}

html[data-theme="light"] .settings-menu-card:hover {
  transform: translateY(-2px);
  border-color: #e5b4c0;
  background: #fff5f7;
}

html[data-theme="light"] dialog::backdrop {
  background: rgba(73,61,56,0.28);
  backdrop-filter: blur(6px);
}

html[data-theme="light"] .login-screen {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 14% 10%, rgba(245,184,198,0.34), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(184,204,154,0.28), transparent 32rem),
    radial-gradient(circle at 72% 92%, rgba(243,199,166,0.24), transparent 28rem),
    var(--bg);
}

html[data-theme="light"] .login-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,0.92);
  border-radius: 30px;
  background: rgba(255,253,251,0.78);
  box-shadow: 0 24px 70px rgba(105,80,68,0.12);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

html[data-theme="light"] .login-card .primary {
  height: 46px;
  margin-top: 4px;
  border-radius: 16px;
}

html[data-theme="light"] .qid-slider-backdrop {
  background: rgba(73,61,56,0.26);
  backdrop-filter: blur(4px);
}

html[data-theme="light"] .qid-slider-panel {
  border-color: rgba(255,255,255,0.88);
  background: rgba(255,253,251,0.94);
  box-shadow: -22px 0 52px rgba(105,80,68,0.13);
  backdrop-filter: blur(24px);
}

@media (prefers-reduced-transparency: reduce) {
  html[data-theme="light"] .register-top,
  html[data-theme="light"] .app-sidebar,
  html[data-theme="light"] .dashboard-kpi,
  html[data-theme="light"] .viz-panel,
  html[data-theme="light"] .register-table-panel,
  html[data-theme="light"] .claim-update-panel,
  html[data-theme="light"] .settings-panel,
  html[data-theme="light"] dialog,
  html[data-theme="light"] .modal,
  html[data-theme="light"] .login-card {
    background: #fffdfb;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] *,
  html[data-theme="light"] *::before,
  html[data-theme="light"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1200px) {
  html[data-theme="light"] .register-top,
  html[data-theme="light"] .register-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  html[data-theme="light"] .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html[data-theme="light"] .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  html[data-theme="light"] .app-shell {
    padding: 10px;
  }

  html[data-theme="light"] .register-top {
    position: relative;
    top: 0;
    height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
  }

  html[data-theme="light"] .register-search {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  html[data-theme="light"] .register-search input[type="search"] {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  html[data-theme="light"] .register-search-control {
    width: 100%;
  }

  html[data-theme="light"] .search-submit-btn {
    min-height: 42px;
    padding-inline: 15px;
  }

  html[data-theme="light"] .register-body {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
  }

  html[data-theme="light"] .app-sidebar {
    position: relative;
    top: 0;
    display: flex;
    gap: 6px;
    height: auto;
    padding: 8px;
    overflow-x: auto;
    border-radius: 20px;
  }

  html[data-theme="light"] .app-sidebar button {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
  }

  html[data-theme="light"] .dashboard-kpis,
  html[data-theme="light"] .dashboard-grid,
  html[data-theme="light"] .settings-menu-grid {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .viz-panel.wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  html[data-theme="light"] .login-screen {
    padding: 14px;
  }

  html[data-theme="light"] .login-card {
    padding: 22px;
    border-radius: 24px;
  }

  html[data-theme="light"] .record-actions,
  html[data-theme="light"] .table-tools,
  html[data-theme="light"] .claim-match-head,
  html[data-theme="light"] .claim-match-input-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Restore the normal application width and keep Role Management actions visible. */
html[data-theme="light"] .register-top,
html[data-theme="light"] .register-body {
  grid-template-columns: 190px minmax(0, 1fr);
}

html[data-theme="light"] .role-management-panel {
  max-width: 100%;
  overflow: hidden;
}

html[data-theme="light"] .role-management-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

html[data-theme="light"] .role-management-table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
}

html[data-theme="light"] .role-management-table th:nth-child(1),
html[data-theme="light"] .role-management-table td:nth-child(1) {
  width: 13%;
}

html[data-theme="light"] .role-management-table th:nth-child(2),
html[data-theme="light"] .role-management-table td:nth-child(2) {
  width: 31%;
}

html[data-theme="light"] .role-management-table th:nth-child(3),
html[data-theme="light"] .role-management-table td:nth-child(3) {
  width: 23%;
}

html[data-theme="light"] .role-management-table th:nth-child(4),
html[data-theme="light"] .role-management-table td:nth-child(4) {
  width: 27%;
}

html[data-theme="light"] .role-management-table th:nth-child(5),
html[data-theme="light"] .role-management-table td:nth-child(5) {
  width: 96px;
  min-width: 96px;
  text-align: right;
}

html[data-theme="light"] .role-management-table input {
  width: 100%;
  min-width: 0;
}

html[data-theme="light"] .role-mapping-remove {
  width: 82px;
  min-width: 82px;
  padding-inline: 10px;
}

@media (max-width: 1200px) and (min-width: 851px) {
  html[data-theme="light"] .register-top,
  html[data-theme="light"] .register-body {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 850px) {
  html[data-theme="light"] .register-top,
  html[data-theme="light"] .register-body {
    grid-template-columns: 1fr;
  }
}

/* Add Claim — requested Subcon Claim field order. */
html[data-theme="light"] .section-subcon-claim .field-qid {
  grid-column: 1 / 3;
  grid-row: 1;
}

html[data-theme="light"] .section-subcon-claim .field-subcon_name {
  grid-column: 3 / 5;
  grid-row: 1;
}

html[data-theme="light"] .section-subcon-claim .field-job_scope {
  grid-column: 5 / 7;
  grid-row: 1;
}

html[data-theme="light"] .section-subcon-claim .field-subcon_order_type {
  grid-column: 1 / 4;
  grid-row: 2;
}

html[data-theme="light"] .section-subcon-claim .field-subcon_amount {
  grid-column: 4 / 7;
  grid-row: 2;
}

html[data-theme="light"] .section-subcon-claim .field-status_claim {
  grid-column: 1 / 4;
  grid-row: 3;
}

html[data-theme="light"] .section-subcon-claim .field-claim_date {
  grid-column: 4 / 7;
  grid-row: 3;
}

html[data-theme="light"] .section-subcon-claim .field-partner_names {
  grid-column: 1 / 7;
  grid-row: 4;
}

@media (max-width: 850px) {
  html[data-theme="light"] .section-subcon-claim .field-qid,
  html[data-theme="light"] .section-subcon-claim .field-subcon_name,
  html[data-theme="light"] .section-subcon-claim .field-job_scope,
  html[data-theme="light"] .section-subcon-claim .field-subcon_order_type,
  html[data-theme="light"] .section-subcon-claim .field-subcon_amount,
  html[data-theme="light"] .section-subcon-claim .field-status_claim,
  html[data-theme="light"] .section-subcon-claim .field-claim_date,
  html[data-theme="light"] .section-subcon-claim .field-partner_names {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Final mobile precedence lock. Keep this block last so legacy desktop rules
   cannot restore multi-column input sizing on high-density phones. */
@media (max-width: 600px) {
  html[data-theme="light"] dialog.claim-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  html[data-theme="light"] dialog.claim-dialog .add-modal {
    height: 100dvh;
    max-height: 100dvh;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-grid,
  html[data-theme="light"] dialog.claim-dialog .section-subcon-claim .combined-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

/* Installer order detail: one surface, separators instead of nested cards. */
html[data-theme="light"] .installer-mode #orderDetailDialog .order-detail-modal {
  padding: 20px 22px;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .order-detail-dialog-body {
  gap: 0;
  padding: 0;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail {
  gap: 0;
  border-top: 1px solid var(--line-soft);
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail .record-modal-section {
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail .record-modal-section h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail-grid.lookup-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail-grid span {
  font-weight: 400;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .installer-claim-amount-panel {
  padding: 18px 0 4px;
  border-bottom: 0;
}

html[data-theme="light"] .installer-mode #orderDetailDialog .modal-actions {
  display: none;
}

html[data-theme="light"] .installer-mode #orderDetailDialog #closeOrderDetailBtn:focus-visible {
  border-color: #a94f65;
  outline: 2px solid rgba(169, 79, 101, 0.42);
  outline-offset: 2px;
}

/* Add/Edit Claim: one clean form surface with section dividers, not nested cards. */
html[data-theme="light"] dialog.claim-dialog {
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  background: #fffdfb;
  box-shadow: 0 22px 60px rgba(75, 61, 55, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] dialog.claim-dialog .add-modal {
  padding: 22px 28px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] dialog.claim-dialog .modal-head {
  margin: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

html[data-theme="light"] dialog.claim-dialog .modal-head h2 {
  font-size: 21px;
  font-weight: 500;
}

html[data-theme="light"] dialog.claim-dialog .add-form-grid {
  display: block;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-section {
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-section h3 {
  margin: 0 0 15px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid {
  gap: 14px 12px;
}

html[data-theme="light"] dialog.claim-dialog .modal-actions {
  gap: 10px;
  margin: 0;
  padding-top: 18px;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid input,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid select,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control > [data-date-display] {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1.25;
  transform: translateY(5px);
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control.selected,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control.selected:hover,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .formatted-date-control.selected:focus-within {
  border-color: var(--rose-strong);
  background: var(--rose-strong);
  color: #ffffff;
  box-shadow: none;
}

/* Card selectors turn rose only after an option has been selected. */
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger.selected,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger.selected:hover,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger.selected:focus-visible {
  justify-content: center;
  border-color: var(--rose-strong);
  background: var(--rose-strong);
  color: #ffffff;
  text-align: center;
  box-shadow: none;
}

html[data-theme="light"] dialog.claim-dialog .section-order-detail {
  padding-top: 14px;
}

html[data-theme="light"] dialog.claim-dialog .combined-form-grid input:focus,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid select:focus,
html[data-theme="light"] dialog.claim-dialog .combined-form-grid .popup-select-trigger:focus-visible {
  border-color: #d98fa0;
  box-shadow: 0 0 0 3px rgba(245, 184, 198, 0.22);
}

/* Claim Record: readable 22-column desktop layout after adding Order No. */
html[data-theme="light"] .register-table-panel .table-wrap {
  overflow: auto;
  scrollbar-gutter: stable;
}

html[data-theme="light"] #claimTable.combined-claim-table {
  width: 2550px;
  min-width: 100%;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.35;
}

html[data-theme="light"] #claimTable.combined-claim-table th {
  height: 46px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

html[data-theme="light"] #claimTable.combined-claim-table td {
  height: 54px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(1),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(1) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(2),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(2) { width: 150px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(3),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(3) { width: 170px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(4),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(4) { width: 130px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(5),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5) { width: 220px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(6),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(6) { width: 90px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(7),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(7) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(8),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(8) { width: 90px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(9),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(9) { width: 80px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(10),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(10) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(11),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(11) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(12),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(12) { width: 110px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(13),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(13) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(14),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(14) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(15),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(15) { width: 130px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(16),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(16) { width: 110px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(17),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(17) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(18),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(18) { width: 105px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(19),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(19) { width: 165px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(20),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(20) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(21),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(21) { width: 120px; }

html[data-theme="light"] #claimTable.combined-claim-table .status-action-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Claim Record now shows 18 operational columns; partner detail remains in data/export. */
html[data-theme="light"] #claimTable.combined-claim-table {
  width: 2180px;
}

html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(1),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(1) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(2),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(2) { width: 150px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(3),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(3) { width: 170px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(4),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(4) { width: 130px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(5),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5) { width: 220px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(6),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(6) { width: 90px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(7),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(7) { width: 120px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(8),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(8) { width: 90px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(9),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(9) { width: 80px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(10),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(10) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(11),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(11) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(12),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(12) { width: 110px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(13),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(13) { width: 110px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(14),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(14) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(15),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(15) { width: 105px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(16),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(16) { width: 165px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(17),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(17) { width: 100px; }
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(18),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(18) { width: 120px; }

html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(2),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(3),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(4),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(5),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5) {
  text-align: left;
}

html[data-theme="light"] #claimTable.combined-claim-table .qid-link,
html[data-theme="light"] #claimTable.combined-claim-table .status-pill,
html[data-theme="light"] #claimTable.combined-claim-table .pdf-action-btn,
html[data-theme="light"] #claimTable.combined-claim-table .delete-record-btn {
  min-height: 34px;
  font-size: 12px;
}

/* Staff has a single workspace, so remove the redundant sidebar. */
html[data-theme="light"] body.staff-mode .app-sidebar {
  display: none !important;
}

html[data-theme="light"] body.staff-mode .register-body {
  grid-template-columns: minmax(0, 1fr) !important;
}

html[data-theme="light"] body.staff-mode .claim-sheet-tabs {
  display: none !important;
}

/* Admin navigation lives above the workspace instead of occupying a side rail. */
html[data-theme="light"] body:not(.staff-mode):not(.installer-mode) .register-body {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px;
}

html[data-theme="light"] body:not(.staff-mode):not(.installer-mode) .app-sidebar {
  position: relative !important;
  top: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: auto !important;
  padding: 10px 14px;
  overflow-x: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 20px;
}

html[data-theme="light"] body:not(.staff-mode):not(.installer-mode) .app-sidebar button {
  flex: 0 0 auto;
  width: auto;
  min-width: 112px;
  margin: 0;
  justify-content: center;
  text-align: center;
}

/* Header navigation: keep the workspace links immediately before Logout. */
html[data-theme="light"] .register-search > .app-sidebar {
  position: static !important;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  width: auto !important;
  height: auto !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] .register-search > .app-sidebar button {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 96px !important;
  height: 44px;
  margin: 0 !important;
  padding: 0 14px;
  justify-content: center;
  text-align: center;
}

html[data-theme="light"] .register-search > #logoutBtn {
  margin-left: 4px;
}

html[data-theme="light"] body.installer-mode .register-body {
  grid-template-columns: minmax(0, 1fr) !important;
}

html[data-theme="light"] .field-customer_name input,
html[data-theme="light"] #claimTable.combined-claim-table th:nth-child(5),
html[data-theme="light"] #claimTable.combined-claim-table td:nth-child(5),
html[data-theme="light"] body.staff-mode #claimTable th:nth-child(5),
html[data-theme="light"] body.staff-mode #claimTable td:nth-child(5) {
  text-transform: uppercase;
}

@media (max-width: 600px) {
  html[data-theme="light"] dialog.claim-dialog .add-modal {
    padding: 0;
  }

  html[data-theme="light"] dialog.claim-dialog .modal-head {
    padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  }

  html[data-theme="light"] dialog.claim-dialog .add-form-grid {
    display: block;
    padding: 0 18px 20px;
  }

  html[data-theme="light"] dialog.claim-dialog .combined-form-section {
    margin: 0;
    padding: 18px 0;
    border-radius: 0;
    background: transparent;
  }

  html[data-theme="light"] dialog.claim-dialog .modal-actions {
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
  }
}

@media (max-width: 600px) {
  html[data-theme="light"] .installer-mode #orderDetailDialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  html[data-theme="light"] .installer-mode #orderDetailDialog .order-detail-modal {
    padding: 18px;
  }

  html[data-theme="light"] .installer-mode #orderDetailDialog .installer-search-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }
}
