﻿:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --panel: #ffffff;
  --page: #f3f6f8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --danger: #b42318;
  --soft: #e8f4f2;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --font-main: "Segoe UI", "Tahoma", "Arial", sans-serif;
  --font-number: "Segoe UI", "Arial", sans-serif;
  --boundary-font-size: clamp(15px, 1.45vw, 24px);
  --boundary-font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

.invoice-panel {
  margin-top: 16px;
}

.shipment-panel {
  border: 1px solid #bfe7df;
  background: linear-gradient(180deg, #fbfffe 0%, #ffffff 100%);
}

.shipment-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) repeat(4, minmax(130px, 0.8fr)) max-content;
  gap: 12px;
  align-items: end;
}

.shipment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.shipment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shipment-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(240px, 2fr) max-content max-content max-content max-content;
  gap: 10px;
  align-items: center;
}

.shipment-chip span,
.shipment-chip em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

.shipment-route-manager {
  border: 1px solid #99f6e4;
  border-inline-start: 5px solid var(--accent);
  border-radius: 10px;
  background: #f8fffd;
  padding: 12px;
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.shipment-route-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.shipment-route-head h3 {
  margin: 0;
  font-size: 18px;
}

.shipment-route-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.shipment-route-head strong {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  padding: 6px 10px;
}

.shipment-route-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 0.9fr) minmax(180px, 1fr) max-content;
  gap: 10px;
  align-items: end;
}

.shipment-route-list {
  display: grid;
  gap: 8px;
}

.shipment-route-event {
  display: grid;
  grid-template-columns: 36px minmax(130px, 0.8fr) minmax(180px, 1.2fr) minmax(140px, 0.8fr) minmax(120px, 1fr) max-content;
  gap: 8px;
  align-items: center;
  border: 1px solid #d7dee8;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.shipment-route-event b {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #fff;
}

.shipment-route-event strong {
  color: #0f172a;
}

.shipment-route-event em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

button.compact {
  min-height: 32px;
  padding: 5px 10px;
}

.invoice-toolbar,
.invoice-meta-grid,
.invoice-party-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.invoice-toolbar {
  grid-template-columns: minmax(170px, 1fr) minmax(132px, 150px) minmax(210px, 1fr) minmax(160px, 0.9fr) minmax(140px, 0.8fr) minmax(132px, 150px);
  margin-bottom: 12px;
  overflow: hidden;
}

.invoice-toolbar button {
  min-width: 0;
}

.invoice-active-context {
  border: 1px solid #99f6e4;
  border-inline-start: 6px solid var(--accent);
  border-radius: 8px;
  background: #f0fdfa;
  padding: 12px 14px;
  margin: 10px 0 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr);
  gap: 12px;
  align-items: center;
}

.invoice-active-context strong {
  display: block;
  font-size: 17px;
}

.invoice-active-context span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.invoice-context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.invoice-context-tags b {
  border: 1px solid #14b8a6;
  border-radius: 999px;
  background: #fff;
  color: #0f766e;
  padding: 6px 10px;
  font-size: 12px;
}

.invoice-toolbar button:nth-last-child(-n + 4) {
  grid-row: 2;
  justify-self: start;
}

.invoice-toolbar button:nth-last-child(4) {
  grid-column: 1;
}

.invoice-toolbar button:nth-last-child(3) {
  grid-column: 2;
}

.invoice-toolbar button:nth-last-child(2) {
  grid-column: 3;
}

.invoice-toolbar button:nth-last-child(1) {
  grid-column: 4;
}

.invoice-party-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  margin: 14px 0;
}

.invoice-settings-panel {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #fbfffe;
  padding: 14px;
  margin: 12px 0 0;
}

.invoice-options-panel {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f6fffd;
  padding: 12px;
  margin: 12px 0 14px;
}

.invoice-options-panel summary {
  cursor: pointer;
  color: #0f766e;
  font-size: 17px;
  font-weight: 950;
  list-style-position: inside;
}

.invoice-options-panel:not([open]) {
  background: #fff;
}
}

.invoice-settings-grid,
.invoice-bl-settings,
.invoice-group-settings {
  display: grid;
  gap: 10px;
  align-items: end;
}

.invoice-settings-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.invoice-bl-settings {
  margin-top: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(260px, 2fr) max-content;
}

.invoice-group-settings {
  margin-top: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) max-content;
}

.invoice-audit-card,
.invoice-stamp-card {
  border: 1px solid #c7e8ff;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  margin-top: 12px;
}

.invoice-audit-grid,
.invoice-stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.invoice-audit-grid .wide-field {
  grid-column: span 3;
}

.invoice-audit-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.invoice-bol-audit-panel {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.bol-file-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #ecfeff;
  color: #075985;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.bol-file-pill.muted {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.bol-ocr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bol-ocr-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.bol-ocr-status.ready {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #047857;
}

.bol-ocr-status.off {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.bol-ocr-message {
  margin: 0;
  color: #334155;
  font-weight: 850;
}

.bol-openai-setup {
  width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
}

.bol-openai-setup summary {
  cursor: pointer;
  color: #075985;
  font-weight: 950;
}

.bol-openai-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.bol-openai-grid label {
  margin: 0;
}

.bol-openai-note {
  margin: 8px 0 0;
  color: #475569;
  font-weight: 800;
  line-height: 1.6;
}

.invoice-stamp-preview {
  min-height: 84px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
}

.invoice-stamp-preview img {
  max-height: 110px;
  max-width: 240px;
  object-fit: contain;
}

.invoice-stamp-preview span {
  color: var(--muted);
  font-weight: 850;
}

.checkbox-line {
  min-height: 42px;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font-weight: 850;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.wide-field {
  grid-column: span 1;
}

.invoice-party-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  display: grid;
  gap: 10px;
}

.invoice-party-card h3 {
  margin: 0;
  font-size: 17px;
}

.invoice-party-fields {
  display: grid;
  gap: 8px;
}

.invoice-meta-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.invoice-containers-host {
  display: grid;
  gap: 14px;
}

.invoice-container-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.invoice-container-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.invoice-container-total-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.invoice-container-total-edit label {
  min-width: 145px;
}

.invoice-container-total-edit input {
  min-height: 34px;
  padding: 6px 8px;
}

.invoice-container-card header strong {
  display: block;
  font-size: 17px;
}

.invoice-container-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-edit-table {
  min-width: 1360px;
}

.invoice-edit-table input {
  min-width: 120px;
}

.invoice-edit-table td:nth-child(2) input {
  min-width: 230px;
}

.invoice-totals-bar {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f0fdfa;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-weight: 900;
}

.invoice-saved-panel,
.invoice-preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  margin: 12px 0 14px;
}

.invoice-saved-rows {
  display: grid;
  gap: 10px;
}

.invoice-saved-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) minmax(430px, 1.6fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.invoice-saved-row.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 6px 0 0 #0f766e;
}

.invoice-work-card.locked,
.bol-work-card.locked,
.saved-work-card.locked {
  background: #f8fafc;
  border-color: #d7e3f0;
  opacity: .9;
}

.invoice-work-card.expanded,
.bol-work-card.expanded,
.saved-work-card.expanded {
  border-width: 2px;
  box-shadow: 0 14px 30px rgba(15, 118, 110, .10), inset 5px 0 0 #0f766e;
}

.invoice-work-card.locked .danger,
.invoice-work-card.locked [data-save-invoice-doc],
.bol-work-card.locked .danger,
.bol-work-card.locked [data-save-bol-record] {
  display: none;
}

.invoice-work-card.locked .invoice-saved-metrics,
.bol-work-card.locked .invoice-saved-metrics {
  opacity: .78;
}

.invoice-saved-row strong,
.invoice-saved-row span {
  display: block;
}

.invoice-saved-row strong {
  font-size: 17px;
}

.invoice-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-saved-row em {
  display: block;
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.invoice-saved-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-saved-metrics span {
  color: var(--ink);
  background: #eef6ff;
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  padding: 4px 8px;
}

.invoice-saved-actions,
.invoice-preview-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.invoice-preview-tools {
  margin-bottom: 12px;
}

.invoice-preview-tools label {
  min-width: 150px;
}

.invoice-preview-stamp-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.invoice-preview-stamp-tools .stamp-tool-heading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.invoice-preview-stamp-tools .stamp-tool-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.invoice-preview-stamp-tools input[type="range"] {
  width: 100%;
  min-height: 34px;
}

.invoice-preview-host {
  min-height: 180px;
  max-height: 760px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
  padding: 16px;
}

.invoice-preview-host .customs-page {
  display: block;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 16px;
  padding: 8mm;
  box-shadow: var(--shadow);
}

.invoice-print {
  display: none;
}

.cost-view .section-title {
  align-items: start;
}

.cost-actions,
.cost-toolbar {
  display: grid;
  gap: 12px;
  align-items: end;
}

.cost-actions {
  grid-template-columns: repeat(3, max-content);
  margin-bottom: 14px;
}

.cost-toolbar {
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) minmax(260px, 1fr);
  margin-bottom: 12px;
}

.cost-status {
  color: #0f766e;
  font-weight: 950;
  min-height: 24px;
}

.cost-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.cost-search-results span {
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef6ff;
  color: #123a63;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.cost-saved-rows {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.cost-saved-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  border: 1px solid #cddff2;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.cost-work-card.locked {
  background: #f8fafc;
  border-color: #d7e3f0;
}

.cost-active-work-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid #d7e3f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.cost-active-work-banner strong {
  color: #0f172a;
}

.cost-active-work-banner.active {
  border-color: #5eead4;
  background: #ecfdf5;
  color: #0f766e;
  box-shadow: inset 5px 0 0 #0f766e;
}

.cost-work-card.locked .invoice-saved-metrics {
  opacity: .78;
}

.cost-saved-row.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 #0f766e;
}

.cost-work-card.expanded {
  border-width: 2px;
  box-shadow: 0 14px 30px rgba(15, 118, 110, .12), inset 5px 0 0 #0f766e;
}

.cost-saved-row strong,
.cost-saved-row span {
  display: block;
}

.cost-saved-row strong {
  font-size: 17px;
}

.cost-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-card-title {
  display: grid;
  gap: 3px;
}

.cost-card-state {
  justify-self: start;
  width: fit-content;
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef6ff;
  color: #123a63 !important;
  padding: 3px 8px;
  font-size: 11px !important;
  font-weight: 950 !important;
}

.cost-work-card.active .cost-card-state {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e !important;
}

.cost-card-actions {
  justify-content: flex-end;
}

.cost-card-lock-note {
  flex-basis: 100%;
  max-width: 360px;
  color: #64748b !important;
  font-size: 11px !important;
  line-height: 1.45;
}

.cost-work-card.locked .danger,
.cost-work-card.locked [data-save-cost-row] {
  display: none;
}

.cost-settings-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) max-content repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.cost-expense-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.cost-expense-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #99d9cf;
  border-radius: 8px;
  background: linear-gradient(180deg, #ecfdf8 0%, #f8fffd 100%);
  padding: 10px 12px;
}

.cost-expense-header strong,
.cost-expense-header span {
  display: block;
}

.cost-expense-header strong {
  color: #0f766e;
  font-size: 17px;
}

.cost-expense-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-expense-card {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: 8px;
  align-items: end;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.cost-expense-save {
  margin-top: 12px;
}

.cost-column-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.cost-summary div {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #f0fdfa;
  padding: 10px 12px;
}

.cost-summary strong,
.cost-summary span {
  display: block;
}

.cost-summary strong {
  color: #0f172a;
  font-size: 18px;
}

.cost-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cost-table {
  min-width: 1780px;
}

.operations-panel {
  display: grid;
  gap: 16px;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.operations-card {
  border: 1px solid #c9e8e2;
  border-radius: 8px;
  background: #fbfffe;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.operations-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.operations-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.operations-form-grid.two {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.operations-discount-grid {
  grid-template-columns: minmax(0, 1fr);
}

.operations-containers-field {
  grid-column: span 2;
}

.operations-containers-field input {
  min-width: min(100%, 520px);
}

.operations-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.operations-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.operations-summary article,
.operations-report-card {
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: linear-gradient(180deg, #eefcf8 0%, #ffffff 100%);
  padding: 12px;
}

.operations-summary article {
  display: grid;
  gap: 4px;
}

.operations-summary-card.factory-due,
.operations-report-card.factory-due {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
}

.operations-summary-card.our-credit,
.operations-report-card.our-credit {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.operations-summary strong,
.operations-summary b {
  color: #0f172a;
  font-size: 16px;
}

.operations-summary span,
.operations-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.operations-report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.operations-report-metrics span {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  color: #0f766e;
  font-weight: 950;
}

.operations-report-metrics b {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.operations-report-metrics .strong {
  border-color: #0f766e;
  background: #e7faf5;
}

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

.operations-year-card {
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.operations-year-card h4 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.operations-year-card .year-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.operations-year-card .year-meta span,
.operations-year-card .year-line {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.operations-year-card .year-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.operations-year-card .year-line strong {
  color: #0f172a;
  font-size: 14px;
  white-space: nowrap;
}

.operations-year-card .year-balance {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 3px;
}

.operations-year-card .year-balance strong {
  font-size: 18px;
}

.operations-year-card.factory-due .year-balance {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
}

.operations-year-card.our-credit .year-balance {
  border-color: #86efac;
  background: #f0fdf4;
  color: #047857;
}

.operations-ledger-sections {
  display: grid;
  gap: 14px;
}

.operations-ledger-card {
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.operations-ledger-card.invoices-ledger {
  border-inline-start: 5px solid #0f766e;
}

.operations-ledger-card.payments-ledger {
  border-inline-start: 5px solid #2563eb;
}

.operations-ledger-card.settlements-ledger,
.operations-settlement-card {
  border-inline-start: 5px solid #7c3aed;
}

.ledger-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #d7e2ee;
}

.ledger-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.ledger-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.operations-balance {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  color: #334155;
  font-weight: 950;
  display: block;
}

.operations-balance b {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.operations-balance.factory-due {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
}

.operations-balance.our-credit {
  border-color: #86efac;
  background: #f0fdf4;
  color: #047857;
}

.operations-balance.mixed {
  border-color: #facc15;
  background: #fffbeb;
  color: #92400e;
}

.operations-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.operations-row-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.operation-attachments {
  min-width: 260px;
  display: grid;
  gap: 8px;
}

.operation-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tiny-button {
  min-height: 30px !important;
  padding: 5px 8px !important;
  font-size: 12px;
}

.operation-file-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 6px;
  align-items: stretch;
}

.operation-file-open {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f172a;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 8px;
  text-align: start;
  min-height: 44px;
  cursor: pointer;
}

.operation-file-open span {
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.operation-file-open b,
.operation-file-open small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-file-open b {
  color: #0f172a;
  font-size: 12px;
}

.operation-file-open small,
.operation-file-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.operation-file-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.72);
  padding: 24px;
  display: grid;
  place-items: center;
}

.operation-file-viewer[hidden] {
  display: none;
}

.operation-file-viewer-card {
  width: min(1100px, 100%);
  height: min(86vh, 840px);
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d7e2ee;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.operation-file-viewer-card header {
  padding: 12px 14px;
  border-bottom: 1px solid #d7e2ee;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.operation-file-viewer-card header strong,
.operation-file-viewer-card header span {
  display: block;
}

.operation-file-viewer-card header strong {
  font-size: 18px;
  color: #0f172a;
}

.operation-file-viewer-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.operation-file-viewer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.operation-file-viewer-actions a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.operation-file-viewer-body {
  min-height: 0;
  background: #e5e7eb;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 12px;
}

.operation-file-viewer-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.operation-file-viewer-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border: 1px solid #cbd5e1;
}

.operation-file-download-card {
  width: min(480px, 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  padding: 22px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.operation-file-download-card b {
  margin: auto;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 42px;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.operation-file-download-card a {
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}

.operation-file-print-page {
  width: 190mm;
  min-height: 270mm;
  margin: 0 auto;
  padding: 8mm;
  background: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.operation-file-print-page header {
  border: 2px solid #0f172a;
  padding: 8px;
  text-align: center;
}

.operation-file-print-page h1,
.operation-file-print-page p {
  margin: 0;
}

.operation-file-print-page img {
  max-width: 100%;
  max-height: 250mm;
  object-fit: contain;
  margin: auto;
}

.employee-documents-table td {
  vertical-align: middle;
}

.employee-document-size {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  font-weight: 800;
}

.employee-document-viewer {
  direction: rtl;
}

.employee-document-print-page {
  direction: rtl;
  font-family: Arial, Tahoma, sans-serif;
}

.settlement-due-row {
  background: #fff7ed;
}

.settlement-credit-row {
  background: #f0fdf4;
}

.catalog-color-row {
  --catalog-accent: #0f766e;
  --catalog-bg: #f8fafc;
  background: linear-gradient(90deg, var(--catalog-bg), #fff 62%);
  box-shadow: inset 5px 0 0 var(--catalog-accent);
}

[dir="rtl"] .catalog-color-row {
  box-shadow: inset -5px 0 0 var(--catalog-accent);
}

.catalog-color-row td:first-child {
  color: var(--catalog-accent);
  font-weight: 950;
}

.catalog-select,
.line-catalog-item {
  min-width: 340px;
  max-width: 520px;
  background: var(--catalog-bg, #fff);
  color: var(--catalog-accent, #0f172a);
  border-inline-start: 5px solid var(--catalog-accent, #cbd5e1);
  font-weight: 850;
}

.line-catalog-item option,
.bol-item-input option {
  font-size: 14px;
}

.catalog-tone-1 { --catalog-accent: #0f766e; --catalog-bg: #ecfdf5; }
.catalog-tone-2 { --catalog-accent: #2563eb; --catalog-bg: #eff6ff; }
.catalog-tone-3 { --catalog-accent: #7c3aed; --catalog-bg: #f5f3ff; }
.catalog-tone-4 { --catalog-accent: #be123c; --catalog-bg: #fff1f2; }
.catalog-tone-5 { --catalog-accent: #b45309; --catalog-bg: #fffbeb; }
.catalog-tone-6 { --catalog-accent: #047857; --catalog-bg: #f0fdf4; }
.catalog-tone-7 { --catalog-accent: #0369a1; --catalog-bg: #f0f9ff; }
.catalog-tone-8 { --catalog-accent: #a21caf; --catalog-bg: #fdf4ff; }
.catalog-tone-9 { --catalog-accent: #c2410c; --catalog-bg: #fff7ed; }
.catalog-tone-10 { --catalog-accent: #334155; --catalog-bg: #f8fafc; }

.partners-panel {
  display: grid;
  gap: 18px;
}

.partners-view .section-title {
  align-items: flex-start;
  border: 1px solid #c7d2fe;
  border-inline-start: 6px solid #0f766e;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #ecfeff 100%);
  padding: 16px;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.partners-card {
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.partner-bulk-card {
  grid-column: 1 / -1;
  border-top: 4px solid #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.partner-bulk-card .section-hint {
  margin: -4px 0 14px;
  color: #64748b;
  font-weight: 700;
}

.partner-bulk-list {
  margin: 14px 0;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.partner-bulk-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe6f2;
  color: #0f172a;
}

.partner-bulk-list-head span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.partner-bulk-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 980px;
}

.partner-bulk-table th,
.partner-bulk-table td {
  border-bottom: 1px solid #dbe6f2;
  padding: 9px 8px;
  text-align: center;
  vertical-align: middle;
}

.partner-bulk-table th {
  background: #eef5fb;
  color: #334155;
  font-size: 0.78rem;
}

.partner-bulk-table td {
  font-family: var(--font-number);
  font-size: 0.86rem;
}

.partner-bulk-actions {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.partner-bulk-controls {
  border-top: 1px dashed #cbd5e1;
  padding-top: 12px;
}

.compact {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.78rem;
}

.muted-row {
  color: #64748b;
  font-weight: 700;
}

.employees-view {
  max-width: 1760px;
  margin: 0 auto;
}

.employees-panel {
  display: grid;
  gap: 18px;
}

.employee-side-nav {
  position: sticky;
  top: 8px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.employee-side-nav a {
  text-decoration: none;
  border: 1px solid #b7d9e8;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  padding: 8px 12px;
  font-weight: 900;
  text-align: center;
}

.employee-side-nav a:hover {
  border-color: #0f766e;
  background: #ecfeff;
  color: #0f766e;
}

.employees-hero {
  border: 1px solid #b9d7e6;
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #123c4b 100%);
  color: #fff;
}

.employees-hero h2,
.employees-hero span,
.employees-hero .eyebrow {
  color: #fff;
}

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

.employees-workspace > .employees-card {
  min-width: 0;
}

.employee-master-card,
.employee-attendance-card,
.employee-payroll-card,
.employee-voucher-card,
.employee-documents-card {
  grid-column: 1 / -1;
}

.employee-warehouse-card,
.employee-shift-card,
.employee-salary-items-card,
.employee-leave-card {
  grid-column: span 6;
}

.employees-command-center {
  border: 1px solid #b7d9e8;
  border-right: 5px solid #0f766e;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #ecfeff 100%);
  padding: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

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

.employee-command-title strong {
  display: block;
  color: #0f172a;
  font-size: 1.2rem;
}

.employee-command-title span {
  color: #526177;
  font-weight: 800;
}

.employee-command-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.employee-command-badges span,
.employee-pill {
  border: 1px solid #b7d9e8;
  border-radius: 999px;
  background: #fff;
  color: #0f766e;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 900;
}

.employees-command-grid {
  display: grid;
  grid-template-columns: 170px minmax(260px, 1fr) 180px 160px;
  gap: 10px;
  align-items: end;
}

.employees-process-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.employees-process-map article {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.employees-process-map b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.78rem;
}

.employees-process-map strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
}

.employees-process-map span {
  display: block;
  color: #64748b;
  font-weight: 700;
  line-height: 1.5;
}

.employees-card,
.employees-ledger {
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.employee-master-card { border-top: 4px solid #0f766e; }
.employee-warehouse-card { border-top: 4px solid #0891b2; }
.employee-shift-card { border-top: 4px solid #2563eb; }
.employee-attendance-card { border-top: 4px solid #b45309; }
.employee-attendance-connector-card { background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%); }
.employee-payroll-card { border-top: 4px solid #7c3aed; }
.employee-salary-items-card { border-top: 4px solid #0f766e; }
.employee-leave-card { border-top: 4px solid #dc2626; }
.employee-voucher-card { border-top: 4px solid #334155; }
.employee-documents-card { border-top: 4px solid #0891b2; }
.employee-ai-assistant-card {
  border-top: 4px solid #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f7fffc 100%);
}

.employee-ai-assistant-card .employee-card-head b {
  background: #0f766e;
  color: #fff;
}

.employee-ai-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.employee-ai-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfe0ef;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
}

.employee-ai-status-openai {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #047857;
}

.employee-ai-status-local {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.employee-ai-status-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.employee-ai-assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.employee-ai-question-panel,
.employee-ai-answer {
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.employee-ai-question-panel textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.7;
}

.employee-ai-privacy-note {
  margin: 8px 0 0;
  color: #64748b;
  font-weight: 800;
  line-height: 1.6;
}

.employee-ai-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 190px;
  background: #f8fafc;
}

.employee-ai-answer strong {
  color: #0f172a;
  font-size: 1rem;
}

.employee-ai-answer span,
.employee-ai-answer p {
  margin: 0;
  color: #475569;
  font-weight: 800;
  line-height: 1.7;
}

.employee-ai-answer .employee-ai-warning {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 8px 10px;
}

.employee-ai-answer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #dbe7f0;
  padding-bottom: 8px;
}

.employee-ai-answer-head small {
  color: #0f766e;
  font-weight: 900;
}

.employee-ai-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.employee-ai-result-box {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.employee-ai-result-box h4 {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.92rem;
}

.employee-ai-result-box ul {
  margin: 0;
  padding-inline-start: 18px;
  color: #334155;
  font-weight: 800;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .employee-ai-assistant-layout,
  .employee-ai-result-grid {
    grid-template-columns: 1fr;
  }
}

.employee-hr-split,
.employee-ledger-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.employee-holidays-card {
  grid-column: 1 / -1;
  border-top-color: #0f766e;
  background: linear-gradient(180deg, #f8fffc 0%, #fff 100%);
}

.employee-holidays-card summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 900;
  color: #0f172a;
  min-height: 44px;
}

.employee-holidays-card summary span,
.employee-holiday-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.employee-card-head.compact {
  margin-top: 12px;
}

.employee-holiday-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.employee-holiday-note {
  border: 1px dashed #5eead4;
  background: #ecfdf5;
  color: #0f766e;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}

.official-holiday-workspace {
  margin-top: 12px;
  border: 1px solid #b7efe4;
  background: #fbfffd;
  border-radius: 8px;
  padding: 12px;
}

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

.official-holiday-workspace-head strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
}

.official-holiday-workspace-head span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.official-holiday-workspace-head b {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #075985;
  border-radius: 999px;
  padding: 6px 10px;
}

.official-holiday-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.official-holiday-workspace .table-wrap {
  overflow-x: visible;
}

.official-holidays-manage-table,
.official-holidays-table {
  table-layout: fixed;
  min-width: 0;
}

.official-holidays-manage-table th,
.official-holidays-manage-table td,
.official-holidays-table th,
.official-holidays-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.official-holiday-date-input {
  min-width: 118px;
  width: 100%;
  height: 38px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font: inherit;
}

.official-holiday-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-width: 190px;
}

.official-holiday-row-actions .compact {
  padding: 7px 9px;
  min-height: 34px;
}

.official-holiday-pending-row {
  background: #fff7ed;
}

.official-holiday-approved-row {
  background: #f0fdf4;
}

.official-holidays-table td,
.unauthorized-departures-table td {
  vertical-align: middle;
}

.attendance-row-holiday-work {
  background: #f0fdf4;
}

.employee-mini-panel {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.employee-mini-panel h4 {
  margin: 0 0 6px;
  color: #0f172a;
}

.employee-mini-panel p {
  margin: 0;
  color: #64748b;
  font-weight: 800;
  line-height: 1.6;
}

.employee-connector-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.employee-connector-panel {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.employee-connector-panel h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 17px;
}

.employee-connector-sessions {
  margin-top: 12px;
}

.employee-bridge-status-ok {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #065f46;
}

.employee-bridge-status-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.employee-bridge-status-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.employee-session-ok {
  color: #047857;
  font-weight: 800;
}

.employee-session-warning {
  color: #b45309;
  font-weight: 800;
}

@media (max-width: 900px) {
  .shipment-route-form,
  .shipment-route-event {
    grid-template-columns: 1fr;
  }

  .employee-connector-layout {
    grid-template-columns: 1fr;
  }
}

.employee-positive-panel {
  border-right: 5px solid #0f766e;
  background: #f0fdfa;
}

.employee-negative-panel {
  border-right: 5px solid #dc2626;
  background: #fff1f2;
}

.employee-credit-row {
  border-right: 4px solid #0f766e;
}

.employee-debit-row {
  border-right: 4px solid #dc2626;
}

.employee-leave-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

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

.employee-card-head h3 {
  margin: 0;
}

.employee-card-head span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  margin-top: 4px;
}

.employee-card-head b {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef5fb;
  color: #0f766e;
}

.employees-card h3,
.employees-ledger h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.employee-list-title {
  color: #0f766e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-list-title::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: #0f766e;
}

.employees-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.employees-form-grid .wide-field {
  grid-column: 1 / -1;
}

.employee-template-library {
  border: 1px solid #bfdbfe;
  border-right: 4px solid #0f766e;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px;
}

.employee-template-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.employee-template-library-head strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.employee-template-library-head span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
}

.employee-template-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.employee-template-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  text-align: right;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.employee-template-card.active {
  border-color: #0f766e;
  background: #ecfdf5;
}

.employee-template-card b,
.employee-template-card small {
  display: block;
}

.employee-template-card b {
  color: #0f172a;
  line-height: 1.45;
}

.employee-template-card small {
  color: #0f766e;
  font-weight: 900;
  margin-top: 4px;
}

.employee-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.employee-template-chip {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  text-align: right;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.employee-template-chip:hover,
.employee-template-chip.active {
  border-color: #0f766e;
  background: #ecfdf5;
  transform: translateY(-1px);
}

.employee-template-chip b,
.employee-template-chip small {
  display: block;
}

.employee-template-chip b {
  color: #0f172a;
  line-height: 1.45;
}

.employee-template-chip small {
  color: #0f766e;
  font-weight: 900;
  margin-top: 4px;
}

.hr-event-saved-head {
  margin-top: 14px;
}

.hr-event-inline-wrap {
  margin-top: 10px;
  border: 1px solid #cfe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.hr-events-inline-table th,
.hr-events-inline-table td {
  vertical-align: middle;
}

.hr-event-kind-warning {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 900;
  display: inline-block;
}

.hr-event-kind-penalty {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 900;
  display: inline-block;
}

.employee-profile-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.employee-profile-admin-panel {
  border: 1px solid #cfe3ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
  padding: 12px;
}

.employee-payroll-policy-panel {
  margin-top: 14px;
  border-color: #c7d2fe;
  border-top: 4px solid #4f46e5;
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
}

.employee-policy-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.employee-policy-note {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 800;
  line-height: 1.6;
}

.employee-policy-preview {
  border-color: #c7d2fe;
  border-right-color: #4f46e5;
  background: #f8fafc;
  color: #1e293b;
}

.employee-profile-admin-panel h4,
.voucher-line-editor h4 {
  margin: 0 0 10px;
  color: #0f766e;
  font-size: 1rem;
}

.voucher-line-editor {
  border: 1px solid #cfe3ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.voucher-lines-table td:first-child {
  min-width: 260px;
}

.voucher-total-row th {
  background: #ecfdf5;
  color: #065f46;
  border-top: 2px solid #0f766e;
}

.employee-voucher-print {
  direction: rtl;
  font-family: Arial, Tahoma, sans-serif;
  color: #0f172a;
  border: 2px solid #0f172a;
  padding: 18px;
}

.voucher-print-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #111827;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.voucher-print-header h1 {
  margin: 4px 0;
  font-size: 26px;
}

.voucher-print-header small {
  color: #64748b;
  font-weight: 800;
}

.voucher-print-header > strong {
  border: 1px solid #0f766e;
  background: #ecfdf5;
  color: #065f46;
  padding: 8px 14px;
  min-width: 150px;
  text-align: center;
}

.voucher-print-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.voucher-print-meta span {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 8px;
  min-height: 42px;
}

.voucher-print-meta b {
  display: block;
  color: #475569;
  font-size: 12px;
}

.voucher-print-total {
  border: 1px solid #0f766e;
  background: #ecfdf5;
  color: #065f46;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  margin: 10px 0 12px;
  font-weight: 900;
}

.voucher-print-total strong {
  font-size: 22px;
}

.voucher-print-table th,
.voucher-print-table td {
  border: 1px solid #111827;
  padding: 10px;
  font-size: 14px;
}

.voucher-print-table th {
  background: #eaf2f8;
}

.voucher-line-no {
  width: 44px;
  text-align: center;
  font-weight: 900;
}

.voucher-print-table td:last-child,
.voucher-print-table th:last-child {
  width: 150px;
  text-align: center;
  white-space: nowrap;
}

.voucher-print-note {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 8px;
  min-height: 38px;
}

.voucher-print-note b {
  display: block;
  color: #475569;
  margin-bottom: 4px;
}

.voucher-print-note p {
  margin: 0;
}

.voucher-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 34px;
}

.voucher-signatures span {
  border-top: 1px solid #111827;
  padding-top: 8px;
  text-align: center;
}

.shift-days-grid,
.attendance-column-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #f8fafc;
}

.shift-day-pill,
.attendance-column-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbddeb;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.shift-day-pill input,
.attendance-column-pill input {
  accent-color: #0f766e;
}

.employee-attendance-tools {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.95fr) minmax(260px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.employee-attendance-tool-panel {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fffd 100%);
  padding: 12px;
  min-width: 0;
}

.employee-attendance-editor-card {
  grid-column: 1 / -1;
  border-top: 4px solid #0f766e;
}

.employee-attendance-editor-card .employee-card-head {
  border-bottom: 1px solid #e2edf5;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.employee-attendance-tool-panel .employees-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-attendance-tool-panel .operations-actions {
  justify-content: flex-start;
}

.employee-attendance-tool-panel h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #0f172a;
}

.employee-attendance-print-panel p {
  margin: 0 0 10px;
  color: #64748b;
  font-weight: 700;
}

.employee-attendance-print-panel .attendance-column-picker {
  max-height: 210px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.attendance-workbench {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid #bde7df;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fffd 0%, #ffffff 100%);
}

.attendance-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 0.9fr) repeat(4, minmax(130px, 0.72fr)) auto;
  gap: 8px;
  align-items: end;
}

.attendance-filter-bar label,
.attendance-edit-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-weight: 800;
  color: #64748b;
}

.attendance-filter-bar input,
.attendance-filter-bar select,
.attendance-edit-grid input,
.attendance-edit-grid select {
  width: 100%;
  min-width: 0;
}

.attendance-inline-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.attendance-inline-drawer {
  border: 1px solid #d7e6f0;
  border-radius: 9px;
  background: #ffffff;
  overflow: hidden;
}

.attendance-inline-drawer summary {
  min-height: 44px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 900;
  color: #0f766e;
  background: #ecfdf5;
  border-bottom: 1px solid #d7e6f0;
}

.attendance-inline-drawer:not([open]) summary {
  border-bottom: 0;
}

.attendance-edit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px;
}

.attendance-edit-grid .wide-field {
  grid-column: span 2;
}

.attendance-inline-drawer .operations-actions {
  padding: 0 12px 12px;
  justify-content: flex-start;
}

.attendance-columns-drawer p {
  margin: 10px 12px;
  color: #64748b;
  font-weight: 800;
}

.attendance-columns-drawer .attendance-column-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 0 12px 12px;
  border: 0;
  background: transparent;
}

.attendance-columns-drawer .attendance-column-picker label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-height: 42px;
  width: 100%;
  margin: 0;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: normal;
  line-height: 1.35;
}

.attendance-columns-drawer .attendance-column-picker input {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 1280px) {
  .attendance-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .attendance-inline-actions {
    grid-template-columns: 1fr;
  }
  .attendance-edit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .attendance-filter-bar,
  .attendance-edit-grid {
    grid-template-columns: 1fr;
  }
  .attendance-edit-grid .wide-field {
    grid-column: auto;
  }
}

.attendance-ledger-table {
  min-width: 0;
  table-layout: fixed;
}

.attendance-ledger-table td {
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 0.78rem;
  padding: 9px 7px;
}

.attendance-ledger-table th {
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 0.76rem;
  padding: 9px 7px;
}

.attendance-ledger-table th:nth-child(1),
.attendance-ledger-table td:nth-child(1) {
  width: 15%;
}

.attendance-ledger-table th:nth-child(2),
.attendance-ledger-table td:nth-child(2) {
  width: 14%;
}

.attendance-ledger-table th:nth-child(3),
.attendance-ledger-table td:nth-child(3),
.attendance-ledger-table th:nth-child(4),
.attendance-ledger-table td:nth-child(4) {
  width: 12%;
}

.attendance-ledger-table th:nth-child(5),
.attendance-ledger-table td:nth-child(5),
.attendance-ledger-table th:nth-child(6),
.attendance-ledger-table td:nth-child(6) {
  width: 9%;
}

.attendance-ledger-table th:nth-child(7),
.attendance-ledger-table td:nth-child(7) {
  width: 10%;
}

.attendance-ledger-table th:nth-child(8),
.attendance-ledger-table td:nth-child(8) {
  width: 10%;
}

.attendance-ledger-table th:nth-child(9),
.attendance-ledger-table td:nth-child(9) {
  width: 9%;
}

.attendance-ledger-table td strong,
.attendance-ledger-table td small {
  display: block;
}

.attendance-ledger-table td strong {
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.35;
}

.attendance-ledger-table td small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
  margin-top: 3px;
}

.employee-cell-primary {
  text-align: start !important;
}

.attendance-status-cell {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-width: 116px;
}

.attendance-status-cell .employee-status-badge {
  min-width: max-content;
  padding: 5px 9px;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.attendance-row-absent {
  background: #fff5f5;
}

.attendance-row-warning {
  background: #fffbeb;
}

.attendance-row-annual-leave {
  background: #dbeafe;
  box-shadow: inset 4px 0 0 #2563eb;
}

.attendance-row-auto-checkout {
  background: #fef9c3;
  box-shadow: inset 4px 0 0 #f59e0b;
}

.employee-auto-badge {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  color: #92400e !important;
}

.employee-split-badge {
  border-color: #38bdf8 !important;
  background: #ecfeff !important;
  color: #075985 !important;
}

.attendance-row-unlinked {
  background: #f8fafc;
  color: #92400e;
}

.attendance-action-cell {
  white-space: normal;
}

.attendance-action-cell .compact {
  margin: 2px;
}

.employee-attendance-ledger-wide .table-wrap {
  overflow-x: visible;
}

.employee-ledger-console {
  display: grid;
  gap: 8px;
  align-self: start;
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #f8fafc;
}

.employee-ledger-nav {
  width: 100%;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 10px 12px;
  text-align: start;
  cursor: pointer;
  box-shadow: none;
}

.employee-ledger-nav strong,
.employee-ledger-nav span {
  display: block;
}

.employee-ledger-nav strong {
  font-size: 0.92rem;
}

.employee-ledger-nav span {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.employee-ledger-nav:hover,
.employee-ledger-nav.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #065f46;
}

.employee-ledger-nav.active {
  box-shadow: inset 4px 0 0 #0f766e;
}

.employee-settings-drawer {
  padding: 0;
  overflow: hidden;
}

.employee-settings-drawer > :not(.employee-settings-summary) {
  margin-inline: 16px;
}

.employee-settings-drawer > :last-child {
  margin-bottom: 16px;
}

.employee-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 900;
  color: #0f766e;
  background: linear-gradient(90deg, #f0fdfa 0%, #ffffff 100%);
  border-bottom: 1px solid #d7e6f0;
}

.employee-settings-summary::after {
  content: "فتح الإعداد";
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 5px 10px;
  color: #0f766e;
  background: #fff;
  font-size: 0.78rem;
}

.employee-settings-drawer[open] .employee-settings-summary::after {
  content: "إخفاء";
}

.employee-inline-drawer {
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7e6f0;
  border-radius: 12px;
  background: #fff;
}

.employee-inline-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  color: #0f766e;
  font-weight: 900;
  background: #f8fcff;
  border-bottom: 1px solid transparent;
}

.employee-inline-summary::-webkit-details-marker,
.employee-settings-summary::-webkit-details-marker {
  display: none;
}

.employee-inline-summary::after {
  content: "فتح";
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 10px;
  color: #0f766e;
  background: #fff;
  font-size: 0.76rem;
}

.employee-inline-drawer[open] > .employee-inline-summary {
  border-bottom-color: #d7e6f0;
}

.employee-inline-drawer[open] > .employee-inline-summary::after {
  content: "إخفاء";
}

.employee-inline-drawer > :not(.employee-inline-summary) {
  margin: 14px;
}

.employee-finance-panel.employee-inline-drawer,
.employee-profile-admin-panel.employee-inline-drawer {
  display: block;
}

.employee-audit-result-drawer {
  margin-top: 12px;
}

.employee-import-note {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed #99c9c3;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
  line-height: 1.7;
}

.employee-import-method {
  grid-column: 1 / -1;
  border: 1px solid #bde7df;
  border-right: 4px solid #0f766e;
  border-radius: 8px;
  background: #f8fffd;
  padding: 10px 12px;
  line-height: 1.6;
}

.employee-import-method strong,
.employee-import-method span {
  display: block;
}

.employee-import-method strong {
  color: #0f766e;
}

.button-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.78;
}

.button-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-inline-start: 8px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: employeeSpin 0.75s linear infinite;
  vertical-align: -2px;
}

@keyframes employeeSpin {
  to { transform: rotate(360deg); }
}

.employee-import-audit,
.employee-ai-audit-results {
  margin-top: 12px;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.employee-import-audit:empty {
  display: none;
}

.employee-import-audit-ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.employee-import-audit-warning {
  border-color: #facc15;
  background: #fefce8;
  color: #854d0e;
}

.employee-audit-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.employee-audit-metrics span {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  text-align: center;
}

.employee-ai-issue-list {
  display: grid;
  gap: 8px;
}

.employee-ai-issue {
  border-radius: 8px;
  padding: 9px 10px;
  border: 1px solid #d7e6f0;
  background: #fff;
}

.employee-ai-issue strong,
.employee-ai-issue span {
  display: block;
}

.employee-ai-issue em {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed currentColor;
  font-style: normal;
  font-weight: 700;
}

.employee-ai-critical {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.employee-ai-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.employee-ai-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.employee-ai-clean {
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 10px;
  text-align: center;
}

.employee-bridge-status {
  margin-top: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  font-weight: 800;
  line-height: 1.55;
}

.employee-bridge-status strong {
  font-size: 0.95rem;
}

.employee-bridge-status span,
.employee-bridge-status small {
  display: block;
}

.employee-bridge-ok {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
}

.employee-bridge-warning {
  border: 1px solid #facc15;
  background: #fefce8;
  color: #854d0e;
}

.employee-payroll-divider {
  border: 1px solid #d7e6f0;
  border-right: 4px solid #7c3aed;
  border-radius: 8px;
  background: #fbf8ff;
  padding: 10px;
}

.employee-payroll-divider strong {
  display: block;
  color: #4c1d95;
  margin-bottom: 4px;
}

.employee-payroll-divider span {
  color: #64748b;
  font-weight: 800;
}

.employee-payroll-rate-preview {
  border: 1px solid #bde7df;
  border-right: 4px solid #0f766e;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.6;
}

.employee-payroll-rate-preview strong {
  color: #0f172a;
}

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

.employee-finance-panel {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 0;
}

.employee-finance-panel h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1rem;
}

.employee-finance-settings {
  grid-column: 1 / -1;
  border-top: 3px solid #7c3aed;
  background: #fbf8ff;
}

.employee-finance-entry {
  grid-column: span 4;
  border-top: 3px solid #0f766e;
}

.employee-finance-payment {
  grid-column: span 4;
  border-top: 3px solid #2563eb;
}

.employee-payroll-delivery-box {
  border: 1px solid #a7f3d0;
  background: #f0fdfa;
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
}

.employee-payroll-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.employee-payroll-delivery-head strong {
  color: #0f766e;
  font-size: 1rem;
}

.employee-payroll-delivery-head span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 800;
}

.employee-payroll-delivery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  border: 1px dashed #14b8a6;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 9px;
  font-weight: 800;
}

.employee-payroll-delivery-preview strong {
  color: #0f766e;
}

.employee-finance-settings .employees-form-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.employee-finance-opening {
  border-top: 3px solid #b45309;
}

.employee-finance-reports {
  grid-column: span 4;
  border-top: 3px solid #334155;
  background: #f8fafc;
}

.employee-finance-reports .employees-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.employee-finance-reports #employeeStatementFilterClearBtn {
  min-height: 42px;
  align-self: end;
}

.employee-finance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.employees-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.employees-summary article {
  border: 1px solid #b7e4dc;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  text-align: center;
  box-shadow: inset 0 3px 0 #0f766e;
}

.employees-summary article:nth-child(2) { box-shadow: inset 0 3px 0 #2563eb; }
.employees-summary article:nth-child(3) { box-shadow: inset 0 3px 0 #b45309; }
.employees-summary article:nth-child(4) { box-shadow: inset 0 3px 0 #7c3aed; }
.employees-summary article:nth-child(5) { box-shadow: inset 0 3px 0 #db2777; }
.employees-summary article:nth-child(6) { box-shadow: inset 0 3px 0 #0f766e; }

.employees-summary strong {
  display: block;
  font-size: 1.2rem;
  color: #075e55;
}

.employees-summary span {
  color: #526177;
  font-weight: 800;
}

.employees-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.employees-table th,
.employees-table td {
  border-bottom: 1px solid #dbe6f2;
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
}

.employees-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef5fb;
  color: #334155;
  font-size: 0.8rem;
}

.employees-table tbody tr:hover {
  background: #f8fafc;
}

#employeesView .table-wrap {
  overflow-x: visible;
  max-width: 100%;
}

#employeesView .employees-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

#employeesView .employees-table th,
#employeesView .employees-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}

#employeesView .employees-table th {
  font-size: 0.76rem;
}

#employeesView .employees-table td {
  font-size: 0.83rem;
}

#employeesView .employees-table .compact {
  min-width: 0;
  padding-inline: 8px;
}

.employees-ledger {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.employees-ledger > .ledger-card-head {
  grid-column: 1 / -1;
}

.employee-ledger-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.employee-ledger-card {
  border: 1px solid #d7e6f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-width: 0;
  grid-column: 1 / -1;
  overflow: hidden;
  display: none;
}

.employee-ledger-wide {
  grid-column: 1 / -1;
}

.employee-ledger-card.employee-ledger-active {
  display: block;
}

.employee-ledger-card .table-wrap {
  border: 1px solid #e2edf5;
  border-radius: 8px;
  background: #fff;
}

.employee-ledger-card .employees-table {
  border-collapse: separate;
  border-spacing: 0;
}

.employee-ledger-card .employees-table tr:last-child td {
  border-bottom: 0;
}

.employee-statement-card {
  border-top: 4px solid #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f8fffd 100%);
}

.employee-statement-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.employee-statement-head span {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.6;
}

.employee-statement-head > strong {
  border: 1px solid #bde7df;
  border-radius: 8px;
  background: #ecfeff;
  padding: 10px 14px;
  min-width: 150px;
  text-align: center;
}

.employee-statement-positive {
  color: #047857;
}

.employee-statement-negative {
  color: #b91c1c;
}

.employee-statement-table .employee-credit {
  color: #047857;
  font-weight: 900;
}

.employee-statement-table .employee-debit {
  color: #b91c1c;
  font-weight: 900;
}

.employee-statement-summary-row td {
  background: #f8fffd;
  padding: 12px;
}

.employee-statement-summary-grid,
.employee-leave-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.employee-statement-metric,
.employee-leave-summary-grid > div {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: center;
}

.employee-statement-metric b,
.employee-leave-summary-grid b {
  display: block;
  color: #475569;
  font-size: 0.76rem;
  margin-bottom: 4px;
}

.employee-statement-metric strong,
.employee-leave-summary-grid strong {
  display: block;
  font-size: 1rem;
  font-weight: 900;
}

.employee-statement-metric span,
.employee-leave-summary-grid span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  margin-top: 3px;
}

.employee-statement-metric.credit strong {
  color: #047857;
}

.employee-statement-metric.debit strong {
  color: #b91c1c;
}

.employee-statement-metric.balance,
.employee-statement-metric.leave,
.employee-statement-metric.sick {
  background: #ecfeff;
  border-color: #99f6e4;
}

.employee-statement-audit-ok,
.employee-statement-audit-warn {
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 900;
  line-height: 1.6;
}

.employee-statement-audit-ok {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.employee-statement-audit-warn {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}

.employee-leave-usage-summary {
  margin-top: 10px;
}

.employee-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.employee-status-active {
  background: #dcfce7;
  color: #166534;
}

.employee-status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.employee-link-ok {
  background: #e0f2fe;
  color: #075985;
}

.employee-link-warning {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 900px) {
  .employees-workspace,
  .employees-ledger,
  .employee-ledger-grid,
  .employees-process-map,
  .employee-hr-split,
  .employee-attendance-tools,
  .employee-ledger-subgrid {
    grid-template-columns: 1fr;
  }

  .employees-command-grid {
    grid-template-columns: 1fr;
  }

  .employee-ledger-console {
    position: static;
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .employee-command-title {
    display: block;
  }

  .employee-finance-layout {
    grid-template-columns: 1fr;
  }

  .employee-finance-settings,
  .employee-finance-entry,
  .employee-finance-payment,
  .employee-finance-reports {
    grid-column: 1 / -1;
  }

  .employee-profile-admin-grid,
  .employee-policy-grid,
  .voucher-print-meta {
    grid-template-columns: 1fr;
  }

  .employee-warehouse-card,
  .employee-shift-card,
  .employee-salary-items-card,
  .employee-leave-card,
  .employee-ledger-card {
    grid-column: 1 / -1;
  }

  .employee-finance-reports {
    grid-column: auto;
  }
}

.partners-card:nth-child(1) {
  border-top: 4px solid #0f766e;
}

.partners-card:nth-child(2) {
  border-top: 4px solid #2563eb;
}

.partners-card:nth-child(3) {
  border-top: 4px solid #b45309;
}

.partners-card:nth-child(4) {
  border-top: 4px solid #7c3aed;
}

.partners-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

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

.partners-form-grid .wide-field {
  grid-column: 1 / -1;
}

.partner-auto-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #bde7df;
  border-radius: 8px;
  background: #f0fdfa;
  padding: 10px 12px;
  font-weight: 800;
}

.partner-auto-toggle input {
  width: 18px;
  height: 18px;
}

.partner-target-preview,
.partner-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
  color: #334155;
  font-size: 0.9rem;
}

.partner-target-preview strong {
  color: #0f766e;
}

.auto-sale-pill,
.manual-sale-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.auto-sale-pill {
  color: #075985;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.manual-sale-pill {
  color: #365314;
  background: #ecfccb;
  border: 1px solid #d9f99d;
}

.partner-auto-countdown {
  display: grid;
  gap: 6px;
  min-width: 240px;
  border: 1px solid #5eead4;
  border-inline-start: 5px solid #0f766e;
  border-radius: 8px;
  padding: 9px 10px;
  background: linear-gradient(180deg, #ecfeff, #f8fafc);
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  vertical-align: middle;
}

.partner-auto-countdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.partner-auto-countdown b {
  color: #0f766e;
  font-size: 0.9rem;
}

.partner-auto-countdown em {
  color: #0369a1;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.partner-auto-digital {
  direction: ltr;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 5px;
  border: 1px solid #0f172a;
  border-radius: 7px;
  padding: 6px;
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #d1fae5;
  font-family: "Consolas", "Courier New", monospace;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.16);
}

.partner-auto-digital > span {
  display: grid;
  place-items: center;
  gap: 1px;
  min-width: 46px;
  border-radius: 5px;
  padding: 4px 3px;
  background: rgba(20, 184, 166, 0.12);
}

.partner-auto-digital strong {
  color: #67e8f9;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0;
}

.partner-auto-digital i {
  align-self: center;
  color: #22c55e;
  font-style: normal;
  font-weight: 900;
}

.partner-auto-digital small {
  color: #a7f3d0;
  font-size: 0.58rem;
  line-height: 1;
}

.partner-auto-countdown small {
  display: block;
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.45;
}

.partner-auto-progress {
  color: #0f766e !important;
  font-weight: 850;
}

.partner-auto-countdown.done {
  border-color: #bbf7d0;
  border-inline-start-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
}

.partner-auto-countdown.paused {
  border-color: #fed7aa;
  border-inline-start-color: #ea580c;
  background: linear-gradient(180deg, #fff7ed, #fffbeb);
}

.partner-auto-countdown.due .partner-auto-digital {
  border-color: #f97316;
  background: linear-gradient(180deg, #431407, #7c2d12);
}

.partner-auto-countdown.due .partner-auto-digital strong {
  color: #fed7aa;
}

.partner-auto-ai-audit {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.partner-auto-ai-audit h4 {
  margin: 0;
  color: #0f766e;
}

.partner-auto-audit-ok td {
  background: #f0fdf4;
}

.partner-auto-audit-info td {
  background: #eff6ff;
}

.partner-auto-audit-danger td {
  background: #fff1f2;
}

.partners-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.partner-balance-card {
  position: relative;
  border: 1px solid #d7e4ef;
  border-inline-start: 5px solid #0f766e;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.partner-balance-card::after {
  content: "";
  position: absolute;
  inset-inline-end: 12px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0f766e;
}

.partner-balance-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.partner-balance-card .balance-lines {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.partner-balance-card .balance-lines span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.partner-balance-card .available {
  color: #047857;
  font-weight: 800;
}

.partner-balance-card .used {
  color: #b45309;
  font-weight: 800;
}

.partner-balance-card.negative {
  border-inline-start-color: #dc2626;
  background: #fff1f2;
}

.partner-balance-card.negative::after {
  background: #dc2626;
}

.partner-balance-card.negative .available {
  color: #b91c1c;
}

.partners-timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.partner-progress-row {
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.partner-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.partner-sale-track {
  height: 16px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 8px, #eef2f7 8px, #eef2f7 16px);
  overflow: hidden;
}

.partner-sale-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #22c55e);
}

.partner-progress-meta {
  margin-top: 8px;
  justify-content: space-between;
}

.partners-ledgers {
  align-items: start;
}

.partners-ledgers .operations-ledger-card {
  border-inline-start: 4px solid #0f766e;
}

.partners-ledgers .operations-ledger-card:nth-child(2) {
  border-inline-start-color: #2563eb;
}

.partners-ledgers .operations-ledger-card:nth-child(3) {
  border-inline-start-color: #b45309;
}

.partners-ledgers .operations-ledger-card:nth-child(4) {
  border-inline-start-color: #7c3aed;
}

.partners-table {
  min-width: 980px;
}

.partners-table th,
.partners-table td {
  vertical-align: middle;
}

.partners-table td strong {
  letter-spacing: 0;
}

.partners-table .operations-row-actions {
  min-width: 150px;
}

.partners-report .operations-report-card {
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #f0fdfa;
}

.partners-report .operations-report-metrics span {
  background: #ffffff;
  border-color: #ccfbf1;
}

.partner-report-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.partner-report-charts > div {
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.partner-report-charts b,
.partner-report-charts span {
  display: block;
}

.partner-report-charts b {
  color: #0f172a;
  font-size: 0.92rem;
}

.partner-report-charts span {
  color: #475569;
  font-size: 0.84rem;
  margin-top: 3px;
}

.partner-report-charts i {
  display: block;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.partner-report-charts em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #22c55e);
}

.partner-report-charts em.warning {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}

.partner-report-list {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
}

.partner-report-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.partner-report-toolbar label {
  display: grid;
  gap: 6px;
}

.partner-status-open {
  color: #b45309;
  font-weight: 800;
}

.partner-status-closed {
  color: #047857;
  font-weight: 800;
}

.partner-status-risk {
  color: #b91c1c;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .partners-grid,
  .partners-form-grid {
    grid-template-columns: 1fr;
  }

  .partner-progress-head,
  .partner-progress-meta,
  .partner-balance-card .balance-lines span {
    display: grid;
    gap: 4px;
  }
}

.operations-audit-results {
  display: grid;
  gap: 8px;
}

.operations-audit-card {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px;
}

.operations-audit-card.has-issues {
  border-color: #fde68a;
  background: #fffbeb;
}

.operations-audit-card.is-clean {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.operations-audit-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.operations-audit-card ul {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 4px;
}

.operations-audit-card li.error {
  color: #b91c1c;
  font-weight: 900;
}

.operations-audit-card li.warning {
  color: #92400e;
  font-weight: 850;
}

.operations-audit-card li.info {
  color: #0369a1;
}

.operations-print-summary .operations-balance {
  min-width: 150px;
}

.operations-print-audit {
  border: 1px solid #fbbf24;
  background: #fffbeb;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0;
  font-size: 11px;
}

.operations-print-audit ul {
  margin: 4px 0 0;
  padding-inline-start: 18px;
}

.operations-table {
  min-width: 1320px;
}

.cost-table th {
  background: #f4f8fb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.cost-table td {
  vertical-align: middle;
}

.cost-table th,
.cost-table td {
  border-inline-end: 1px solid #d7e2ee;
}

.cost-table .cost-col-item {
  min-width: 210px;
}

.cost-table .cost-col-costbasis,
.cost-table .cost-col-pcsperpackage,
.cost-table .cost-col-sqmperpiece {
  background: #f8fafc;
}

.cost-table th.cost-col-truecostjod,
.cost-table td.cost-col-truecostjod,
.cost-print-table th.cost-col-truecostjod,
.cost-print-table td.cost-col-truecostjod {
  background: #ecfdf5;
  border-inline: 2px solid #0f766e;
  color: #064e3b;
  font-weight: 950;
}

.cost-table td.cost-col-truecostjod {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.cost-table th.cost-col-expenseshare,
.cost-table td.cost-col-expenseshare {
  background: #fffbeb;
  color: #92400e;
}

.cost-table small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
}

.cost-table input {
  min-width: 110px;
}

.cost-page {
  padding: 8mm;
}

.cost-print-header {
  border: 2px solid #0f172a;
  border-bottom: 0;
  padding: 8px 10px;
  text-align: center;
}

.cost-print-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.cost-print-header p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 900;
}

.cost-print-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 2px solid #0f172a;
  border-bottom: 0;
}

.cost-print-summary span {
  border-inline-end: 1px solid #0f172a;
  padding: 7px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 950;
}

.cost-print-summary b {
  display: block;
  color: #0f766e;
  font-size: 10px;
  margin-bottom: 3px;
}

.cost-print-summary span:last-child {
  border-inline-end: 0;
}

.cost-print-expenses {
  border: 2px solid #0f172a;
  border-bottom: 0;
  padding: 7px;
}

.cost-print-expenses h2,
.cost-print-section h2 {
  margin: 0 0 6px;
  background: #0f172a;
  color: #fff;
  padding: 5px 8px;
  font-size: 13px;
  text-align: center;
}

.cost-print-expenses div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 5px;
}

.cost-print-expenses span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  padding: 5px 7px;
  font-size: 11px;
}

.cost-print-section {
  border: 2px solid #0f172a;
  border-top: 0;
  padding: 7px;
}

.cost-print-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.cost-print-table th,
.cost-print-table td {
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.cost-print-table th {
  background: #dbeafe;
}

.cost-print-table th small {
  display: block;
  color: #334155;
  font-size: 8px;
  margin-top: 2px;
}

.cost-print-table td:first-child,
.cost-print-table th:first-child {
  text-align: start;
}

.cost-print-table.price-table th {
  background: #dcfce7;
}

.cost-print-table .cost-col-expenseshare {
  background: #fff7ed;
}

.customs-page {
  color: #000;
  background: #fff;
  font-family: Arial, Tahoma, sans-serif;
  direction: ltr;
  font-size: 11px;
  font-weight: 700;
  position: relative;
}

.invoice-print-stamp {
  position: absolute;
  transform: translate(-50%, -50%);
  max-height: 44mm;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 9999;
}

.invoice-print-stamp-wrap {
  display: inline-block;
  line-height: 0;
  transform: translate(-50%, -50%) rotate(var(--stamp-rotate, -2deg));
  transform-origin: 50% 50%;
  isolation: isolate;
  user-select: none;
}

.invoice-print-stamp-wrap img {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: var(--stamp-ink-opacity, 0.86);
  filter:
    contrast(var(--stamp-darkness, 110%))
    saturate(var(--stamp-thickness, 110%))
    drop-shadow(var(--stamp-bleed-x, 0.2px) 0 0 var(--stamp-color, #0b63c7))
    drop-shadow(calc(var(--stamp-bleed-x, 0.2px) * -0.7) var(--stamp-bleed-y, 0.14px) 0 rgba(11, 99, 199, 0.25));
  mix-blend-mode: multiply;
}

.invoice-print-stamp-wrap.live-stamp img {
  filter:
    contrast(calc(var(--stamp-darkness, 110%) + 4%))
    saturate(var(--stamp-thickness, 110%))
    drop-shadow(var(--stamp-live-bleed-x, 0.28px) var(--stamp-live-bleed-y, 0.07px) 0 rgba(11, 99, 199, 0.32))
    drop-shadow(calc(var(--stamp-live-bleed-x, 0.28px) * -0.45) calc(var(--stamp-live-bleed-y, 0.07px) * -1) 0 rgba(11, 99, 199, 0.18));
}

.invoice-print-stamp-wrap.live-stamp::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid var(--stamp-color, #0b63c7);
  border-radius: 8px;
  opacity: var(--stamp-border-ink-opacity, 0.11);
  transform: rotate(0.8deg) scale(var(--stamp-border-scale, 1.025));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0.24px 0.12px 0 var(--stamp-color, #0b63c7) inset;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.invoice-print-stamp-wrap .stamp-live-grain {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at 13% 28%, rgba(255,255,255,0.95) 0 1px, transparent 1.8px),
    radial-gradient(circle at 31% 64%, rgba(255,255,255,0.75) 0 1.2px, transparent 2px),
    radial-gradient(circle at 56% 37%, rgba(255,255,255,0.82) 0 0.9px, transparent 1.8px),
    radial-gradient(circle at 76% 72%, rgba(255,255,255,0.9) 0 1.1px, transparent 2px),
    radial-gradient(ellipse at 4% 96%, rgba(255,255,255,0.62) 0 1.8px, transparent 3.4px),
    radial-gradient(ellipse at 96% 9%, rgba(255,255,255,0.58) 0 1.4px, transparent 3px),
    radial-gradient(ellipse at 48% 91%, rgba(255,255,255,0.42) 0 2.2px, transparent 4.2px),
    radial-gradient(ellipse at 88% 48%, rgba(255,255,255,0.36) 0 1.7px, transparent 3.7px),
    repeating-linear-gradient(7deg, transparent 0 9px, rgba(255,255,255,0.34) 9px 10px, transparent 10px 18px);
  background-size: 19px 17px, 23px 21px, 29px 18px, 17px 25px, 31px 29px, 27px 33px, 37px 23px, 29px 39px, 100% 100%;
  opacity: calc(var(--stamp-roughness, 42) / 145);
  mix-blend-mode: screen;
  pointer-events: none;
}

.invoice-print-stamp-wrap:not(.live-stamp) .stamp-live-grain {
  display: none;
}

.stamp-resize-handle {
  display: none;
}

.invoice-preview-host .invoice-print-stamp {
  pointer-events: auto;
  cursor: move;
  outline: 1px dashed rgba(14, 165, 233, 0.75);
  outline-offset: 4px;
  touch-action: none;
  border-radius: 6px;
  transition: outline-color 0.16s ease, box-shadow 0.16s ease;
}

.invoice-preview-host .invoice-print-stamp:hover,
.invoice-preview-host .invoice-print-stamp:focus-within {
  outline-color: rgba(15, 118, 110, 0.95);
  box-shadow: none;
}

.invoice-preview-host .stamp-resize-handle {
  display: block;
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  border: 2px solid #0f766e;
  border-radius: 50%;
  background: #fff;
  cursor: nwse-resize;
  z-index: 5;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.25);
}

.invoice-preview-host .stamp-resize-handle::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-right: 2px solid #0f766e;
  border-bottom: 2px solid #0f766e;
}

.invoice-preview-host .customs-page {
  cursor: crosshair;
}

.stamp-preview-sheet {
  position: relative;
  min-height: 130px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
}

.stamp-preview-item {
  max-height: 110px;
}

.customs-family-arial {
  font-family: Arial, Tahoma, sans-serif;
}

.customs-family-tahoma {
  font-family: Tahoma, Arial, sans-serif;
}

.customs-family-calibri {
  font-family: Calibri, Arial, sans-serif;
}

.customs-font-compact {
  font-size: 10px;
}

.customs-font-normal {
  font-size: 11px;
}

.customs-font-readable {
  font-size: 12px;
}

.customs-font-large {
  font-size: 12.5px;
}

.customs-font-xlarge {
  font-size: 13.5px;
}

.customs-three-per-page {
  padding: 4.2mm;
}

.customs-header {
  text-align: center;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

.customs-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.customs-header p {
  margin: 4px 0;
  font-size: 13px;
  font-weight: 800;
}

.customs-header h2 {
  margin: 4px 0 2px;
  font-size: 20px;
  text-decoration: underline;
}

.customs-meta,
.packing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-inline-start: 1px solid #000;
  border-top: 1px solid #000;
}

.customs-party-meta {
  grid-template-columns: 1.35fr 1.35fr 0.8fr 0.8fr;
}

.packing-meta.customs-party-meta {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.45fr) minmax(86px, 0.42fr) minmax(96px, 0.46fr);
}

.customs-meta div,
.packing-meta div {
  min-height: 22px;
  border-inline-end: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 4px 6px;
  white-space: pre-line;
  text-align: center;
  display: grid;
  place-items: center;
  gap: 2px;
}

.customs-party span,
.customs-party strong {
  display: block;
  line-height: 1.25;
  text-align: center;
}

.packing-meta .packing-party {
  place-items: stretch;
  align-content: start;
  justify-items: stretch;
  min-height: 58px;
  text-align: left;
}

.packing-meta .packing-party b {
  width: 100%;
  text-align: center;
  font-size: 1.08em;
  letter-spacing: 0;
}

.packing-meta .packing-party span {
  width: 100%;
  text-align: left;
  line-height: 1.35;
  white-space: pre-line;
}

.packing-meta .packing-shipper,
.packing-meta .packing-consignee {
  grid-column: span 2;
}

.packing-meta .packing-mini {
  min-width: 0;
  padding-inline: 3px;
  font-size: 0.95em;
}

.packing-meta .packing-mini strong {
  font-size: 1.05em;
  line-height: 1.2;
  word-break: break-word;
}

.packing-meta .packing-port {
  min-height: 42px;
}

.customs-meta div:nth-child(1),
.customs-meta div:nth-child(2),
.customs-meta div:nth-child(3) {
  grid-column: span 1;
}

.customs-meta div:nth-child(4),
.customs-meta div:nth-child(5) {
  grid-column: span 1;
}

.packing-total {
  grid-column: span 3;
  text-align: center;
  display: grid;
  gap: 4px;
}

.customs-party-meta .packing-total {
  grid-column: 1 / -1;
}

.packing-total b {
  font-size: 13px;
}

.packing-total strong {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #000;
  background: #f6f6f6;
  font-size: 15px;
  letter-spacing: 0;
  word-spacing: 3px;
}

.customs-container {
  break-inside: avoid;
}

.customs-packing .packing-table th,
.customs-packing .packing-table td {
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
}

.customs-packing .packing-table .customs-description-cell {
  text-align: left;
  font-weight: 800;
}

.invoice-table .customs-group-col,
.packing-table .customs-group-col {
  width: 15%;
}

.invoice-table .customs-description-col {
  width: 25%;
}

.invoice-table .customs-qty-col {
  width: 8%;
}

.invoice-table .customs-price-col {
  width: 10%;
}

.invoice-table .customs-money-col,
.invoice-table .customs-weight-col {
  width: 11.5%;
}

.packing-table .customs-description-col {
  width: 36%;
}

.packing-table .customs-qty-col {
  width: 12%;
}

.packing-table .customs-weight-col {
  width: 12.5%;
}

.customs-table .customs-description-heading,
.customs-table .customs-description-cell {
  white-space: nowrap;
}

.customs-table .customs-description-cell {
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: 0;
  word-spacing: 1px;
  font-size: 0.95em;
}

.invoice-table .customs-price-heading,
.invoice-table .customs-tight-heading {
  overflow: hidden;
  word-break: normal;
  overflow-wrap: normal;
  letter-spacing: 0;
}

.invoice-table .customs-price-heading {
  padding-inline: 2px;
  font-size: 0.92em;
  line-height: 1.12;
}

.invoice-table .customs-price-heading span {
  display: block;
  white-space: nowrap;
}

.invoice-table .customs-tight-heading {
  padding-inline: 1px;
  white-space: nowrap;
  font-size: 0.82em;
  line-height: 1.05;
}

.customs-invoice .invoice-table .customs-description-cell,
.customs-packing .packing-table .customs-description-cell {
  text-align: left;
}

.customs-container-bar {
  background: #d9d9d9;
  border: 1px solid #000;
  border-top: 0;
  padding: 4px 5px;
  font-size: 12px;
  font-weight: 900;
}

.customs-table,
.customs-total-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.customs-table th,
.customs-table td,
.customs-total-table th,
.customs-total-table td {
  border: 1px solid #000;
  padding: 4px 5px;
  text-align: center;
  vertical-align: middle;
}

.customs-table th {
  font-size: 13px;
}

.customs-three-per-page.customs-font-compact {
  font-size: 9.2px;
}

.customs-three-per-page.customs-font-normal {
  font-size: 10px;
}

.customs-three-per-page.customs-font-readable {
  font-size: 10.8px;
}

.customs-three-per-page.customs-font-large {
  font-size: 11.3px;
}

.customs-three-per-page.customs-font-xlarge {
  font-size: 11.8px;
}

.customs-three-per-page .customs-header h1 {
  font-size: 18px;
}

.customs-three-per-page.customs-font-readable .customs-header h1,
.customs-three-per-page.customs-font-large .customs-header h1,
.customs-three-per-page.customs-font-xlarge .customs-header h1 {
  font-size: 20px;
}

.customs-three-per-page .customs-header h2 {
  font-size: 14px;
}

.customs-three-per-page.customs-font-readable .customs-header h2,
.customs-three-per-page.customs-font-large .customs-header h2,
.customs-three-per-page.customs-font-xlarge .customs-header h2 {
  font-size: 16px;
}

.customs-three-per-page .customs-header p,
.customs-three-per-page .customs-container-bar {
  font-size: 9.5px;
}

.customs-three-per-page.customs-font-readable .customs-header p,
.customs-three-per-page.customs-font-readable .customs-container-bar,
.customs-three-per-page.customs-font-large .customs-header p,
.customs-three-per-page.customs-font-large .customs-container-bar,
.customs-three-per-page.customs-font-xlarge .customs-header p,
.customs-three-per-page.customs-font-xlarge .customs-container-bar {
  font-size: 10.5px;
}

.customs-three-per-page .customs-meta div,
.customs-three-per-page .packing-meta div {
  min-height: 17px;
  padding: 2px 4px;
}

.customs-three-per-page .packing-meta .packing-party {
  min-height: 46px;
}

.customs-three-per-page .packing-meta .packing-port {
  min-height: 30px;
}

.customs-three-per-page .customs-container {
  margin-top: 3px;
}

.customs-three-per-page .customs-table,
.customs-three-per-page .customs-total-table {
  font-size: inherit;
}

.customs-three-per-page .customs-table th {
  font-size: 1.08em;
}

.customs-three-per-page .invoice-table .customs-price-heading {
  font-size: 0.92em;
}

.customs-three-per-page .invoice-table .customs-tight-heading {
  font-size: 0.82em;
}

.customs-three-per-page .customs-table th,
.customs-three-per-page .customs-table td,
.customs-three-per-page .customs-total-table th,
.customs-three-per-page .customs-total-table td {
  padding: 2px 3px;
}

.customs-total-row td,
.customs-total-table th,
.customs-total-table td {
  font-size: 13px;
  font-weight: 900;
}

.invoice-total-row td,
.packing-container-total-row td {
  background: #f3f4f6;
  font-weight: 900;
}

.invoice-total-row td:nth-last-child(-n + 2),
.packing-container-total-row td:nth-last-child(-n + 2) {
  background: #e8f5f3;
}

.packing-grand-summary {
  margin-top: 5px;
  border: 2px solid #000;
  table-layout: fixed;
}

.packing-grand-summary td {
  background: #e8f5f3;
  color: #08111f;
  padding: 4px 7px;
  font-size: 12.5px;
  white-space: nowrap;
  border-inline-end: 2px solid #000;
}

.packing-grand-summary td:last-child {
  border-inline-end: 1px solid #000;
}

.packing-grand-summary td span,
.packing-grand-summary td strong {
  display: inline-block;
  vertical-align: middle;
}

.packing-grand-summary td span {
  color: #111827;
  font-weight: 950;
  margin-inline-end: 8px;
}

.packing-grand-summary td strong {
  color: #006c5b;
  font-size: 13.5px;
  font-weight: 950;
}

.customs-amount,
.customs-origin {
  margin: 0;
  padding: 6px;
  border: 1px solid #000;
  border-top: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.invoice-grand-total {
  margin-top: 4px;
}

.invoice-grand-total th {
  width: 72%;
}

.invoice-grand-total td {
  font-size: 15px;
}

@media print {
  body.printing-bol > * {
    display: none !important;
  }

  body.printing-bol main,
  body.printing-bol #bolView {
    display: block !important;
  }

  body.printing-bol main > *:not(#bolView),
  body.printing-bol .print-report {
    display: none !important;
  }

  body.printing-bol #bolView {
    width: 100%;
    color: #111827;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-bol .bol-panel {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.printing-bol .bol-toolbar {
    grid-template-columns: repeat(3, 1fr);
    padding: 6px 0 9px;
    border-bottom: 2px solid #111827;
  }

  body.printing-bol .bol-toolbar button {
    display: none !important;
  }

  body.printing-bol .bol-toolbar input,
  body.printing-bol .bol-toolbar select {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 900;
  }

  body.printing-bol .bol-columns {
    grid-template-columns: 1fr;
    gap: 8mm;
  }

  body.printing-bol .bol-side {
    border: 2px solid #cbd5e1;
    background: #fff;
    break-inside: avoid;
  }

  body.printing-bol .bol-card {
    break-inside: avoid;
  }

  body.printing-bol .bol-mini-table {
    width: 100%;
    font-size: 12px;
  }

  body.printing-bol .bol-mini-table th {
    background: #111827;
    color: #fff;
  }

  body.printing-bol .bol-mini-table td {
    background: #fbfcfe;
  }

  body.printing-bol .bol-mini-table input,
  body.printing-bol .bol-mini-table select {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-weight: 800;
    color: #111827;
  }

  body.printing-bol .proposal-card th:last-child,
  body.printing-bol .proposal-card td:last-child {
    display: none;
  }
}

@media (max-width: 980px) {
  .cost-actions,
  .cost-toolbar,
  .cost-saved-row,
  .cost-settings-grid {
    grid-template-columns: 1fr;
  }

  .cost-expense-settings {
    grid-template-columns: 1fr;
  }

  .cost-expense-card,
  .cost-expense-header {
    grid-template-columns: 1fr;
  }

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

  .invoice-preview-host .customs-page {
    width: 100%;
    min-width: 820px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-main);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="text"]:not(#loginUsername),
input[type="search"],
textarea {
  text-transform: uppercase;
}

button,
.file-button {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.file-button:focus-within {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.format-button {
  width: 48px;
  min-width: 48px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
}

.format-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.format-button.pdf .format-icon {
  background: #dc2626;
}

.format-button.xls .format-icon {
  background: #15803d;
}

.format-button:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

#saveLoadBtn.editing-load {
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.secondary,
.file-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover,
.file-button:hover {
  border-color: #9fb0c2;
}

.danger {
  background: #fff6f5;
  border-color: #f1b8b2;
  color: var(--danger);
}

.file-button input {
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  position: absolute;
}

.auth-locked .app-header,
.auth-locked main {
  display: none;
}

.login-overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #101828, #1f2937);
}

.login-overlay[hidden] {
  display: none;
}

.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.45);
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 14px;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
}

.login-card input {
  text-transform: none;
}

.login-message {
  min-height: 22px;
  color: var(--danger);
  font-weight: 800;
}

.login-reset-link {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.login-reset-link:hover {
  text-decoration: underline;
}

.password-card {
  max-width: 440px;
}

.password-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-header {
  min-height: 112px;
  padding: 22px 32px;
  background: #101828;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.35fr) minmax(260px, 0.9fr);
  align-items: center;
  justify-content: stretch;
  gap: 24px;
}

.save-status {
  grid-column: 1 / -1;
  min-height: 22px;
  color: #d1fae5;
  font-weight: 900;
}

.save-status[data-type="success"] {
  color: #a7f3d0;
}

.save-status[data-type="error"] {
  color: #fecaca;
}

.save-status[data-type="info"] {
  color: #bfdbfe;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.top-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tab-button {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.08);
  color: #d0d5dd;
  border-color: rgba(255, 255, 255, 0.14);
}

.tab-button.active {
  background: #fff;
  color: #101828;
}

.eyebrow {
  margin: 0;
  color: #8da4bd;
  font-size: 13px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-content: flex-start;
}

.global-bol-center {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  margin: 0;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  min-width: 0;
}

.global-bol-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: end;
}

.global-bol-search label,
.global-ai-panel label {
  display: grid;
  gap: 5px;
  color: #d0d5dd;
  font-size: 12px;
  font-weight: 900;
}

.global-bol-search select,
.global-bol-search input,
.global-ai-panel input {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #fff;
  color: #101828;
  padding: 8px 10px;
}

.global-bol-search label {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(170px, 0.75fr);
  gap: 8px;
  min-width: 0;
}

.global-bol-search label > span {
  grid-column: 1 / -1;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.list-pagination span {
  margin-inline-end: auto;
}

.global-report-center {
  border: 1px solid rgba(167, 243, 208, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  padding: 12px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  max-height: 340px;
  overflow: auto;
}

.global-report-center[hidden] {
  display: none !important;
}

.global-report-center header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.global-report-center header strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.global-report-center header span {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 850;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
}

.global-report-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.global-report-actions button {
  width: 100%;
  justify-content: center;
}

.report-action-set {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.report-action-set > button:first-child {
  min-width: 170px;
}

.global-report-actions .report-action-set .format-button {
  width: 46px;
  min-width: 46px;
}

.global-report-actions .strong-action {
  border-color: #2dd4bf;
}

.global-ai-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content;
  gap: 8px;
  align-items: end;
}

.global-ai-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: #d1fae5;
  font-size: 13px;
  font-weight: 850;
}

.global-ai-results span {
  display: block;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 9px;
  color: #e0f2fe;
}

.language-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #d0d5dd;
}

.language-field span {
  color: #d0d5dd;
  margin: 0;
}

.language-field select {
  min-width: 118px;
  width: auto;
}

main {
  width: min(1480px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.app-view {
  display: none;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.intro-panel {
  display: grid;
  gap: 16px;
}

.form-grid,
.dimensions-row {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.dimensions-row {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  align-items: end;
}

.intro-panel > .dimensions-row {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.catalog-panel {
  margin: 16px 0;
}

.catalog-form {
  display: grid;
  grid-template-columns: minmax(155px, 0.9fr) minmax(180px, 1.35fr) repeat(7, minmax(105px, 1fr)) minmax(190px, 1.2fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.catalog-group-settings {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) max-content minmax(240px, 2fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #bfe7df;
  border-radius: 8px;
  background: #fbfffe;
}

.catalog-group-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.catalog-group-list span {
  border: 1px solid #cfe2ff;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ink);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-actions strong {
  color: var(--accent-dark);
  min-width: 96px;
}

.catalog-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.catalog-list-header div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-list-header strong {
  font-size: 15px;
}

.catalog-list-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.catalog-table {
  min-width: 1040px;
}

.merge-panel,
.catalog-panel {
  margin: 16px 0;
}

.merge-builder {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.merge-choice {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.merge-choice input {
  width: auto;
  min-height: auto;
}

.merged-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.merged-card {
  border-color: #7dd3c7;
  background: #fbfffe;
}

.remove-merge {
  margin-top: 12px;
}

.merged-note {
  background: rgba(15, 118, 110, 0.12);
  border-radius: 5px;
  padding: 3px 5px;
}

.dimensions-row.compact {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  margin: 18px 0;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
  font-family: var(--font-number);
  line-height: 1.55;
}

input[type="number"],
.number-cell,
.metric strong,
.line-total,
.part-totals span {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: 0;
}

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

.section-title h2,
.part-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.visual-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.visual-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  font-weight: 800;
}

.visual-toggle input {
  width: auto;
  min-height: auto;
}

.visual-control {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

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

.drawing-target-select {
  min-width: min(360px, 100%);
  width: 360px;
}

#drawingStatus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.container-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  direction: ltr;
  min-height: 190px;
  margin-top: 118px;
  border: 5px solid #344054;
  border-left-width: 16px;
  background: #eef4f6;
  overflow: visible;
}

.container-visual.drawing-mode {
  cursor: crosshair;
  touch-action: none;
}

.container-visual::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 16px;
  display: block;
  background: repeating-linear-gradient(
    45deg,
    #ef4444,
    #ef4444 8px,
    #facc15 8px,
    #facc15 16px
  );
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22);
  z-index: 9;
  pointer-events: none;
}

.visual-door-label {
  position: absolute;
  top: -112px;
  left: -2px;
  color: #fff;
  background: #dc2626;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 950;
  z-index: 12;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.28);
  text-transform: uppercase;
}

.visual-door-label::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 22px;
  width: 3px;
  height: 16px;
  background: #dc2626;
}

.visual-ruler {
  position: absolute;
  left: 0;
  right: 0;
  top: -74px;
  height: 34px;
  border-block-end: 2px solid #344054;
  z-index: 7;
  pointer-events: none;
}

.visual-ruler::before,
.visual-ruler::after {
  content: "";
  position: absolute;
  inset-block-end: -6px;
  width: 2px;
  height: 12px;
  background: #344054;
}

.visual-ruler::before {
  left: 0;
}

.visual-ruler::after {
  right: 0;
}

.visual-ruler-tick {
  position: absolute;
  inset-block-end: -2px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 3px;
}

.visual-ruler-tick i {
  width: 1px;
  height: 12px;
  background: #344054;
}

.visual-ruler-tick b {
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  font-family: var(--font-number);
}

.visual-section-labels {
  position: absolute;
  left: 0;
  right: 0;
  top: -40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  direction: ltr;
  gap: 6px;
  z-index: 7;
  pointer-events: none;
}

.visual-section-label {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 8px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.visual-section-label strong,
.visual-section-label span,
.visual-section-label small {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-section-label strong {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.visual-section-label span,
.visual-section-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.visual-drawing-tip {
  position: absolute;
  right: 0;
  top: -108px;
  max-width: min(460px, 62%);
  color: #475467;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  z-index: 7;
  text-align: end;
}

.visual-part {
  position: relative;
  z-index: 1;
  border-left: 1px dashed #8aa0b4;
  min-width: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.visual-part:first-child {
  background: #d9f0ed;
}

.visual-fill {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.26), rgba(15, 118, 110, 0.58));
  transition: height 160ms ease;
}

.visual-stack {
  position: relative;
  z-index: 1;
  min-height: 42px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.visual-stack-bottom {
  align-content: end;
}

.visual-item-tag {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-inline-start: 6px solid var(--item-color);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}

.visual-item-tag b {
  min-width: 0;
  color: color-mix(in srgb, var(--item-color) 78%, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-item-tag strong {
  flex: 0 0 auto;
  color: #b42318;
  font-family: var(--font-number);
  white-space: nowrap;
}

.visual-item-tag em {
  color: #344054;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-merge-zone {
  position: absolute;
  z-index: 2;
  min-height: 24px;
  border: 3px solid rgba(180, 83, 9, 0.82);
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 248, 235, 0.58),
    rgba(255, 248, 235, 0.58) 10px,
    rgba(254, 223, 137, 0.34) 10px,
    rgba(254, 223, 137, 0.34) 20px
  );
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 12px 28px rgba(180, 83, 9, 0.12);
}

.visual-merge-zone span {
  position: absolute;
  top: 8px;
  left: 10px;
  max-width: calc(100% - 12px);
  color: #fff;
  background: rgba(122, 63, 5, 0.9);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-drawing-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: auto;
}

.visual-drawing-layer.hidden {
  display: none;
}

.visual-boundary {
  position: absolute;
  min-width: 40px;
  min-height: 24px;
  border: 3px solid var(--item-color, var(--accent));
  background: color-mix(in srgb, var(--item-color, var(--accent)) 18%, rgba(255, 255, 255, 0.4));
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
  overflow: hidden;
  cursor: move;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-boundary.active {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

.visual-boundary.draft {
  --item-color: #101828;
  border-style: dashed;
  background: rgba(16, 24, 40, 0.08);
}

.boundary-label {
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  font-family: var(--boundary-font-family);
  font-size: var(--boundary-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
}

.boundary-name {
  min-width: 0;
  max-width: 100%;
  color: color-mix(in srgb, var(--item-color, var(--accent)) 78%, #101828);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boundary-packages {
  color: #b42318;
  font-size: 1.08em;
  font-family: var(--font-number);
  white-space: nowrap;
}

.boundary-group {
  max-width: 100%;
  color: #475467;
  font-size: 0.58em;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.boundary-packages em {
  color: #344054;
  font-style: normal;
  font-size: 0.7em;
  font-weight: 900;
  text-transform: uppercase;
}

.boundary-resize-handle,
.visual-boundary::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 11px;
  height: 11px;
}

.boundary-resize-handle {
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: nwse-resize;
}

.visual-boundary::after {
  pointer-events: none;
  border-inline-end: 2px solid rgba(255, 255, 255, 0.95);
  border-block-end: 2px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 1px rgba(16, 24, 40, 0.4));
}

.alerts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.alert {
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 700;
}

.alert.warn {
  background: #fff8eb;
  color: var(--warn);
  border: 1px solid #fedf89;
}

.alert.danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.parts {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.part-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.part-eyebrow {
  color: var(--accent);
}

.part-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.part-totals span {
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: right;
  vertical-align: top;
}

html[dir="ltr"] th,
html[dir="ltr"] td {
  text-align: left;
}

th {
  background: #f7fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

td input,
td select {
  min-width: 92px;
}

.drawing-target-row {
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 var(--accent);
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 6px;
}

.item-detail {
  min-width: 190px;
  color: var(--muted);
  font-weight: 800;
}

.line-total {
  min-width: 118px;
  color: var(--muted);
  font-weight: 800;
}

.add-item {
  margin-top: 12px;
}

.summary-panel,
.saved-panel {
  margin-top: 16px;
}

.saved-loads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.saved-folder {
  --folder-accent: #0f766e;
  --folder-bg: #eefcf8;
  border: 1px solid color-mix(in srgb, var(--folder-accent) 35%, #d7dee8);
  border-inline-start: 8px solid var(--folder-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--folder-bg) 0%, #ffffff 58%);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.07);
  padding: 14px;
}

.saved-work-card.locked {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 72%);
  box-shadow: none;
}

.saved-work-card.active {
  border-color: var(--folder-accent);
  box-shadow: 0 18px 38px rgba(15, 118, 110, .12), inset 5px 0 0 var(--folder-accent);
}

.saved-folder-locked {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px dashed color-mix(in srgb, var(--folder-accent) 35%, #d7dee8);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.saved-folder-locked strong {
  color: var(--folder-accent);
  font-size: 13px;
  text-align: end;
}

.saved-folder-tone-1 { --folder-accent: #0f766e; --folder-bg: #ecfdf5; }
.saved-folder-tone-2 { --folder-accent: #2563eb; --folder-bg: #eff6ff; }
.saved-folder-tone-3 { --folder-accent: #7c3aed; --folder-bg: #f5f3ff; }
.saved-folder-tone-4 { --folder-accent: #be123c; --folder-bg: #fff1f2; }
.saved-folder-tone-5 { --folder-accent: #b45309; --folder-bg: #fffbeb; }
.saved-folder-tone-6 { --folder-accent: #047857; --folder-bg: #f0fdf4; }
.saved-folder-tone-7 { --folder-accent: #0369a1; --folder-bg: #f0f9ff; }
.saved-folder-tone-8 { --folder-accent: #a21caf; --folder-bg: #fdf4ff; }
.saved-folder-tone-9 { --folder-accent: #c2410c; --folder-bg: #fff7ed; }
.saved-folder-tone-10 { --folder-accent: #334155; --folder-bg: #f8fafc; }

.saved-folder-header {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, max-content);
  gap: 14px;
  align-items: end;
  border-bottom: 1px solid color-mix(in srgb, var(--folder-accent) 25%, var(--line));
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.saved-folder-header strong,
.saved-folder-header span,
.saved-folder-header em {
  display: block;
}

.saved-folder-header strong {
  font-size: 20px;
  color: var(--folder-accent);
}

.saved-folder-header span,
.saved-folder-header em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.saved-folder-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) max-content max-content max-content max-content;
  gap: 8px;
  align-items: end;
}

.saved-folder-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.saved-folder-metrics b {
  border: 1px solid color-mix(in srgb, var(--folder-accent) 35%, #d7dee8);
  border-radius: 999px;
  background: #fff;
  color: var(--folder-accent);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 950;
}

.saved-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.saved-card {
  border: 1px solid #d6e3f2;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fbfcff;
  border-inline-start: 4px solid #3b82f6;
}

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

.saved-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.bol-panel {
  margin-top: 16px;
}

.bol-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.2fr) repeat(2, minmax(130px, 165px)) repeat(5, max-content);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.bol-hidden-control {
  display: none !important;
}

.bol-status {
  min-height: 28px;
  color: var(--accent-dark);
  font-weight: 800;
  margin-bottom: 12px;
}

.bol-saved-rows {
  margin: 10px 0 16px;
  border: 1px solid #bfe7df;
  border-radius: 10px;
  background: #fbfffe;
  padding: 12px;
}

.bol-saved-table {
  display: grid;
  gap: 8px;
}

.bol-saved-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(4, minmax(115px, 0.8fr)) max-content;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  border-inline-start: 5px solid #0f766e;
}

.bol-saved-row.active {
  border-color: #0f766e;
  box-shadow: inset 4px 0 0 #0f766e;
}

.bol-work-card.locked {
  border-inline-start-color: #94a3b8;
}

.bol-work-card.expanded {
  background: #f0fdfa;
}

.bol-row-main {
  display: grid;
  gap: 4px;
}

.bol-saved-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bol-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bol-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.bol-columns.paired {
  grid-template-columns: 1fr;
}

.bol-columns.paired .proposed-side {
  display: none;
}

.bol-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.04);
}

.bol-side:first-child {
  border-color: #b8d7ff;
  background: #f8fbff;
}

.proposed-side {
  background: #fbfffe;
  border-color: #bfe7df;
}

.compact-title h3 {
  margin: 0;
  font-size: 18px;
}

.bol-list {
  display: grid;
  gap: 12px;
}

.bol-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid #d8e6f8;
  border-radius: 10px;
  background: linear-gradient(90deg, #f8fbff 0%, #ffffff 50%, #fbfffe 100%);
  padding: 12px;
}

.bol-pair-row > .actual-card {
  border-inline-start: 5px solid #2563eb;
  background: #f8fbff;
}

.bol-pair-row > .proposal-card {
  border-inline-start: 5px solid #0f766e;
  background: #fbfffe;
}

.bol-pair-head {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.bol-pair-head.actual {
  color: #1d4ed8;
}

.bol-pair-head.proposed {
  color: #0f766e;
}

.bol-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 100%;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.035);
}

.bol-line-name {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.bol-line-group {
  display: inline-block;
  margin-inline-start: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bol-side:first-child .bol-card {
  border-inline-start: 4px solid #3b82f6;
}

.proposed-side .bol-card {
  border-inline-start: 4px solid #0f766e;
}

.missing-proposal {
  border-style: dashed;
  opacity: 0.72;
}

.bol-print-grid {
  display: grid;
  gap: 8px;
}

.bol-print-container {
  break-inside: avoid;
}

.bol-print-container h2 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.bol-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.bol-card header strong {
  display: block;
  font-size: 16px;
}

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

.bol-mini-table {
  min-width: 0;
}

.bol-mini-table input {
  min-width: 90px;
}

.bol-item-input {
  min-width: 180px;
}

.bol-number-input {
  max-width: 130px;
}

.proposed-line-total,
.proposal-total-weight {
  min-width: 120px;
  white-space: nowrap;
  font-weight: 800;
}

.smart-search {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.saved-filters,
.backup-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.backup-actions {
  grid-template-columns: repeat(5, minmax(150px, max-content));
  justify-content: start;
  align-items: center;
}

.backup-status,
.backup-verify-status {
  border: 1px solid #b7e4d8;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.backup-verify-status {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.backup-verify-status.ok {
  background: #ecfdf5;
  border-color: #99f6e4;
  color: #047857;
}

.backup-verify-status.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.backup-verify-status.loading {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.backup-verify-status span {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.invoice-quality-panel {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  display: grid;
  gap: 8px;
  font-weight: 800;
  margin: 12px 0;
  padding: 12px 14px;
}

.invoice-quality-panel.success {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.invoice-quality-panel.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.invoice-quality-panel ul {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding-inline-start: 20px;
}

.server-pagination {
  margin-top: 12px;
}

.search-results h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.search-table {
  min-width: 1040px;
}

.search-belongs {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.print-report {
  display: none;
}

@media (max-width: 980px) {
  .app-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: stretch;
  }

  .global-bol-center,
  .global-bol-search,
  .global-ai-panel {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .global-bol-search label {
    grid-template-columns: 1fr;
  }

  .invoice-toolbar button:nth-last-child(-n + 4) {
    grid-row: auto;
    grid-column: auto;
    justify-self: stretch;
  }

  .header-actions > * {
    flex: 1 1 130px;
  }

  .form-grid,
  .catalog-form,
  .operations-grid,
  .operations-form-grid,
  .operations-form-grid.two,
  .catalog-group-settings,
  .saved-folder-header,
  .saved-folder-actions,
  .bol-saved-row,
  .bol-pair-row,
  .invoice-toolbar,
  .invoice-meta-grid,
  .invoice-party-grid,
  .invoice-settings-grid,
  .invoice-bl-settings,
  .invoice-group-settings,
  .shipment-grid,
  .shipment-chip,
  .bol-toolbar,
  .bol-columns,
  .saved-filters,
  .dimensions-row,
  .dimensions-row.compact,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 20px, 1480px);
    margin-top: 12px;
  }

  .app-header {
    padding: 18px;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .form-grid,
  .catalog-form,
  .operations-grid,
  .operations-form-grid,
  .operations-form-grid.two,
  .invoice-toolbar,
  .invoice-meta-grid,
  .invoice-party-grid,
  .invoice-settings-grid,
  .invoice-bl-settings,
  .invoice-group-settings,
  .shipment-grid,
  .shipment-chip,
  .bol-toolbar,
  .bol-columns,
  .saved-filters,
  .backup-actions,
  .dimensions-row,
  .dimensions-row.compact,
  .metrics {
    grid-template-columns: 1fr;
  }

  .container-visual {
    grid-template-columns: 1fr;
    min-height: 520px;
  }

  .visual-part {
    border-block-start: 1px dashed #8aa0b4;
    border-inline-start: 0;
  }
}

@media screen and (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body:not(.auth-locked) {
    min-width: 0;
  }

  .app-header {
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    padding: 14px 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
  }

  .app-header > *,
  .top-tabs,
  .header-actions,
  .global-bol-center,
  .global-bol-search,
  .global-ai-panel {
    min-width: 0;
    max-width: 100%;
  }

  .app-header h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  .top-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .tab-button,
  .header-actions button,
  .header-actions .file-button,
  .header-actions select,
  .global-bol-search button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 13px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 7px;
  }

  .language-field,
  .global-bol-search label,
  .global-ai-panel label {
    min-width: 0;
    max-width: 100%;
  }

  .global-bol-search {
    grid-template-columns: 1fr;
  }

  .global-bol-search label {
    grid-template-columns: 1fr;
  }

  main {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 32px;
    padding: 0 10px;
    overflow-x: hidden;
  }

  .panel,
  .invoice-panel,
  .shipment-panel,
  .invoice-settings-panel,
  .invoice-options-panel,
  .saved-folder,
  .bol-panel,
  .invoice-container-card,
  .cost-card {
    max-width: 100%;
    overflow: hidden;
    padding: 12px;
  }

  input,
  select,
  textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap,
  .invoice-preview-host,
  .invoice-containers-host,
  .saved-folder-body,
  .bol-side,
  .cost-table-shell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .container-visual {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 245px;
    margin-top: 130px;
    overflow: hidden;
  }

  .visual-section-labels {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .visual-section-label {
    padding: 4px 5px;
  }

  .visual-section-label strong {
    font-size: 11px;
  }

  .visual-section-label span,
  .visual-section-label small,
  .visual-ruler-tick b,
  .visual-drawing-tip {
    font-size: 9px;
  }

  .visual-drawing-tip {
    left: 0;
    right: 0;
    max-width: 100%;
    top: -124px;
  }

  .visual-door-label {
    top: -124px;
    left: 0;
    padding: 6px 8px;
    font-size: 11px;
  }

  .visual-part {
    border-block-start: 0;
    border-inline-start: 1px dashed #8aa0b4;
    min-width: 0;
  }

  .visual-part:first-child {
    border-inline-start: 0;
  }

  .login-overlay {
    padding: 16px;
    overflow: hidden;
  }

  .login-card {
    width: min(100%, 420px);
    padding: 20px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  body {
    background: #fff;
  }

  body > *,
  main > *:not(.print-report) {
    display: none !important;
  }

  main,
  .print-report {
    display: block !important;
  }

  .header-actions,
  .saved-panel,
  .add-item,
  .danger,
  .file-button {
    display: none !important;
  }

  .app-header {
    background: #fff;
    color: #111827;
    border-bottom: 2px solid #111827;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .panel,
  .metric {
    box-shadow: none;
    break-inside: avoid;
  }

  .report-page {
    width: 100%;
    min-height: 281mm;
    color: #111827;
    font-size: 13px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-header {
    border-bottom: 2px solid #111827;
    padding-bottom: 5px;
    margin-bottom: 7px;
  }

  .report-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
  }

  .report-header div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .report-plan {
    position: relative;
    direction: ltr;
    margin: 18mm 0 7px;
  }

  .report-door-label {
    position: absolute;
    top: -15mm;
    left: 0;
    background: #dc2626;
    color: #fff;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .report-door-label::after {
    content: "";
    position: absolute;
    bottom: -7mm;
    left: 15px;
    width: 3px;
    height: 7mm;
    background: #dc2626;
  }

  .report-part-labels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    direction: ltr;
    gap: 4px;
    margin-bottom: 4px;
  }

  .report-part-label {
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    padding: 4px 5px;
    background: #f8fafc;
  }

  .report-part-label strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
  }

  .report-part-label span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: #475467;
  }

  .report-part-label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 900;
    color: #111827;
  }

  .report-container-visual {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    direction: ltr;
    border: 3px solid #111827;
    border-left-width: 11px;
    height: 70mm;
    margin-bottom: 7px;
    overflow: hidden;
    background: #eef4f6;
  }

  .report-visual-part {
    border-left: 1px dashed #667085;
    min-width: 0;
  }

  .report-merge-zone {
    position: absolute;
    inset-block: 2mm;
    border: 2px solid #b45309;
    border-radius: 5px;
    background: rgba(254, 223, 137, 0.22);
  }

  .report-merge-zone span {
    position: absolute;
    top: 2mm;
    left: 2mm;
    background: #92400e;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 900;
  }

  .report-boundary {
    position: absolute;
    border: 2px solid var(--item-color);
    border-radius: 4px;
    background: color-mix(in srgb, var(--item-color) 15%, #fff);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .report-boundary .boundary-label,
  .report-inline-item .boundary-label {
    font-size: 13px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.88);
  }

  .report-boundary .boundary-packages,
  .report-inline-item .boundary-packages {
    color: #b42318;
  }

  .report-boundary .boundary-group,
  .report-inline-item .boundary-group {
    color: #344054;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .report-inline-items {
    position: absolute;
    inset: 4px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    align-items: end;
    pointer-events: none;
  }

  .report-inline-item {
    border: 1px solid var(--item-color);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
  }

  .report-notes {
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    padding: 5px 7px;
    margin: 0 0 7px;
    background: #fbfcfe;
    break-inside: avoid;
  }

  .report-notes strong {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
  }

  .report-notes p {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
  }

  .report-table {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0 3px;
  }

  .report-table th,
  .report-table td {
    padding: 6px 7px;
    border: 1px solid #d0d5dd;
    vertical-align: top;
  }

  .report-table th {
    background: #111827;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0;
  }

  .report-zone-row td {
    background: #f8fafc;
    border-block: 1px solid #cbd5e1;
  }

  .report-zone-row:nth-child(even) td {
    background: #eef6f4;
  }

  .report-zone-name {
    width: 19%;
    border-inline-start: 4px solid #0f766e !important;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
  }

  .report-zone-contents {
    width: 49%;
  }

  .report-zone-contents span {
    display: inline-grid;
    gap: 2px;
    margin: 0 3px 3px 0;
    padding: 4px 7px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #eff6ff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
  }

  .report-zone-contents span b,
  .report-zone-contents span small,
  .report-zone-contents span em,
  .report-zone-contents span strong {
    display: block;
  }

  .report-zone-contents span small {
    color: #475467;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .report-zone-contents span em {
    color: #0f766e;
    font-family: var(--font-number);
    font-size: 10px;
    font-style: normal;
    font-weight: 950;
    line-height: 1.1;
    white-space: nowrap;
  }

  .report-zone-contents span strong {
    color: #b42318;
    font-family: var(--font-number);
    font-size: 11px;
  }

  .report-zone-number {
    width: 16%;
    color: #0f766e;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
  }

  .report-table tfoot td {
    border-top: 2px solid #111827;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    background: #dff7ef;
  }

  body.printing-bundle .print-report {
    display: block !important;
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-bundle .report-page,
  body.printing-bundle .customs-page {
    display: block;
    width: 100%;
    break-after: page;
    page-break-after: always;
  }

  body.printing-bundle .report-page:last-child,
  body.printing-bundle .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-bundle .cost-page {
    page: costReport;
    min-height: 196mm;
  }

  body.printing-bundle .cost-page .customs-table {
    font-size: 9.5px;
  }

  body.printing-bundle .cost-page .customs-table th,
  body.printing-bundle .cost-page .customs-table td {
    padding: 4px 4px;
  }
}

@media print {
  body.printing-invoice {
    background: #fff !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 7mm;
  }

  body.printing-invoice > * {
    display: none !important;
  }

  body.printing-invoice main,
  body.printing-invoice .invoice-print {
    display: block !important;
  }

  body.printing-invoice #plannerView,
  body.printing-invoice #bolView,
  body.printing-invoice #invoiceView,
  body.printing-invoice .print-report,
  body.printing-invoice main > *:not(.invoice-print) {
    display: none !important;
  }

  body.printing-invoice .invoice-print {
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-invoice .customs-page {
    display: block;
    width: 100%;
    min-height: 283mm;
    break-after: page;
    page-break-after: always;
  }

  body.printing-invoice .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-invoice .customs-header h1 {
    font-size: 22px;
  }

  body.printing-invoice .customs-table th,
  body.printing-invoice .customs-table td {
    padding: 3px 4px;
  }

  body.printing-invoice .invoice-print-stamp {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@media print {
  .catalog-color-row,
  .settlement-due-row,
  .settlement-credit-row {
    background: #fff !important;
    box-shadow: none !important;
  }

  .catalog-color-row td:first-child {
    color: #000 !important;
  }

  @page costReport {
    size: A4 landscape;
    margin: 6mm;
  }

  body.printing-cost {
    background: #fff !important;
  }

  body.printing-cost > * {
    display: none !important;
  }

  body.printing-cost main,
  body.printing-cost .invoice-print,
  body.printing-cost .cost-print {
    display: block !important;
  }

  body.printing-cost #plannerView,
  body.printing-cost #bolView,
  body.printing-cost #invoiceView,
  body.printing-cost #costView,
  body.printing-cost .print-report,
  body.printing-cost main > *:not(.cost-print) {
    display: none !important;
  }

  body.printing-cost .cost-print {
    width: 100%;
    margin: 0;
    color: #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-cost .customs-page {
    page: costReport;
    display: block;
    width: 100%;
    min-height: 196mm;
    break-after: page;
    page-break-after: always;
  }

  body.printing-cost .customs-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-cost .cost-print-header h1 {
    font-size: 21px;
  }

  body.printing-cost .cost-print-summary span {
    font-size: 12px;
    padding: 5px 6px;
  }

  body.printing-cost .customs-table {
    font-size: 9.5px;
  }

  body.printing-cost .customs-table th,
  body.printing-cost .customs-table td {
    padding: 4px 4px;
  }
}

.employee-attendance-audit-card {
  border-top: 4px solid #0f766e;
}

.employee-attendance-audit-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.employee-attendance-audit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.employee-attendance-audit-result {
  margin-top: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.employee-audit-empty {
  padding: 18px;
  color: #64748b;
  font-weight: 800;
  text-align: center;
}

.employee-audit-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #cbd5e1;
}

.employee-audit-header strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
}

.employee-audit-header span,
.employee-audit-header small {
  color: #475569;
  font-weight: 800;
}

.employee-audit-metrics {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
}

.employee-audit-metrics span,
.employee-audit-payroll span {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: center;
}

.employee-audit-metrics b {
  display: block;
  color: #0f766e;
  font-size: 18px;
}

.employee-audit-metrics small {
  color: #64748b;
  font-weight: 800;
}

.employee-audit-payroll {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f0fdfa;
  border-top: 1px solid #ccfbf1;
  border-bottom: 1px solid #ccfbf1;
}

.employee-audit-payroll b {
  color: #0f172a;
  font-family: var(--font-number);
}

.employee-audit-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.employee-audit-two-col section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.employee-audit-two-col h4 {
  margin: 0 0 8px;
  color: #0f172a;
}

.employee-audit-list {
  margin: 0;
  padding-inline-start: 18px;
  color: #334155;
  font-weight: 800;
}

.employee-audit-list li {
  margin-bottom: 6px;
}

.employee-audit-ok {
  color: #047857;
}

.employee-audit-warning {
  color: #b45309;
}

.employee-audit-danger {
  color: #b91c1c;
}

.employee-audit-table-wrap {
  padding: 12px;
}

.employee-audit-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.employee-audit-table th,
.employee-audit-table td {
  border: 1px solid #dbe3ef;
  padding: 7px 6px;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.employee-audit-table th {
  background: #eaf1f8;
  color: #334155;
}

.employee-audit-print-page {
  direction: rtl;
  width: 100%;
  color: #0f172a;
  font-family: Arial, sans-serif;
}

.employee-audit-print-page header {
  border-bottom: 2px solid #0f172a;
  margin-bottom: 8px;
  padding-bottom: 6px;
  text-align: center;
}

.employee-audit-print-page h1 {
  margin: 0;
  font-size: 22px;
}

.employee-audit-print-summary {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.employee-audit-print-summary span,
.employee-audit-print-payroll th,
.employee-audit-print-payroll td {
  border: 1px solid #111827;
  padding: 5px;
  text-align: center;
  font-size: 11px;
}

.employee-audit-print-summary span {
  background: #ecfeff;
  font-weight: 800;
}

.employee-audit-print-payroll,
.employee-audit-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 8px;
}

.employee-audit-print-payroll th {
  background: #0f172a;
  color: #fff;
}

.employee-audit-print-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.employee-audit-print-notes section {
  border: 1px solid #94a3b8;
  padding: 6px;
}

.employee-audit-print-notes h2 {
  margin: 0 0 4px;
  font-size: 13px;
}

.employee-audit-print-notes ul {
  margin: 0;
  padding-inline-start: 16px;
  font-size: 11px;
}

.employee-audit-print-table th,
.employee-audit-print-table td {
  border: 1px solid #111827;
  padding: 4px;
  text-align: center;
  font-size: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.employee-audit-print-table th {
  background: #e5e7eb;
}

@media (max-width: 1100px) {
  .employee-attendance-audit-controls,
  .employee-audit-metrics,
  .employee-audit-payroll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-audit-two-col {
    grid-template-columns: 1fr;
  }
}

.users-view {
  width: min(1680px, calc(100vw - 48px));
  margin-inline: auto;
}

.users-shell {
  border-top: 4px solid #0f766e;
}

.users-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.users-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(360px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.users-tables-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 14px;
  margin-top: 14px;
}

.users-card {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.users-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.users-card-title strong {
  font-size: 1rem;
  color: #0f172a;
}

.users-card-title span {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.5;
}

.users-card .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.users-card .span-2 {
  grid-column: span 2;
}

.permission-matrix {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  padding-inline-end: 4px;
}

.employee-permission-scope {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #b7ded7;
  border-radius: 10px;
  background: #f0fdfa;
}

.employee-permission-scope label {
  display: grid;
  gap: 6px;
}

.employee-permission-scope p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  font-size: 0.86rem;
}

.employee-section-permission-title {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #0f766e;
}

.employee-permission-matrix {
  max-height: 520px;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(64px, auto));
  gap: 8px;
  align-items: center;
  border: 1px solid #dbeafe;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
}

.employee-permission-row {
  border-color: #99f6e4;
  background: #f8fffd;
}

.permission-row strong {
  color: #0f172a;
  line-height: 1.35;
}

.permission-toggle {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 8px;
  background: #fff;
  color: #334155;
  font-size: 0.78rem;
  white-space: nowrap;
}

.permission-toggle input {
  width: auto;
}

.users-table {
  width: 100%;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.users-table .compact-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.permission-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.status-pill.active {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.status-pill.muted {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.tab-button.permission-hidden {
  display: none !important;
}

.permission-disabled {
  opacity: 0.48;
  cursor: not-allowed !important;
}

.permission-hidden-section {
  display: none !important;
}

.employee-inline-summary::after {
  content: "فتح";
}

.employee-inline-drawer[open] > .employee-inline-summary::after {
  content: "إخفاء";
}

.employee-allowance-manager,
.employee-advance-fund-manager {
  border: 1px solid #b7ded7;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #f8fffd 0%, #ffffff 100%);
}

.employee-allowance-entry-grid {
  margin-top: 12px;
}

.employee-allowance-table-wrap {
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
}

.employee-allowance-table tr.is-selected {
  background: #ecfeff;
  box-shadow: inset 4px 0 0 #0f766e;
}

.employee-allowance-table small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.72rem;
}

.employee-allowance-type-drawer {
  margin-top: 12px;
}

.employee-advance-fund-manager {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.employee-advance-fund-grid {
  margin-top: 12px;
}

.employee-advance-fund-preview {
  margin-top: 10px;
  border: 1px solid #99f6e4;
  background: #ecfdf5;
  color: #0f766e;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 1200px) {
  .users-grid,
  .users-tables-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .users-view {
    width: min(100%, calc(100vw - 18px));
  }

  .users-card .form-grid,
  .permission-row {
    grid-template-columns: 1fr;
  }

  .users-card .span-2 {
    grid-column: auto;
  }
}


