:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #172026;
  --muted: #68757f;
  --line: #dce3e8;
  --accent: #007f73;
  --accent-strong: #005f56;
  --amber: #d88a00;
  --red: #c74343;
  --green: #2f8f5b;
  --blue: #2e75b6;
  --shadow: 0 18px 48px rgba(23, 32, 38, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  display: grid;
  grid-template-columns: 280px 1fr;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  background: #172026;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
  font-size: 24px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #a9b7bf;
  font-size: 13px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c7d2d9;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  text-align: left;
  font-weight: 600;
}

.nav-item span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #e9f1f3;
}

.nav-item:hover,
.nav-item.active {
  background: #243139;
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  color: #a9b7bf;
}

.sidebar-footer strong {
  display: block;
  color: #fff;
  margin-top: 4px;
}

.app-shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.topbar-actions,
.section-head,
.section-actions,
.modal-actions,
.modal-head-actions,
.report-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.screen-filter {
  min-width: 250px;
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.screen-filter input {
  min-width: 0;
  min-height: 38px;
  border: 0;
  outline: 0;
  padding: 0 10px;
}

.screen-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.screen-filter .icon-button {
  width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 0;
}

.cloud-sync-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cloud-sync-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7b8790;
  content: "";
}

.cloud-sync-status.synced::before {
  background: #14866d;
}

.cloud-sync-status.syncing::before {
  background: #d88a00;
}

.cloud-sync-status.error::before {
  background: #a33a2b;
}

.primary-button,
.secondary-button,
.icon-button,
.action-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  padding: 0 16px;
}

.report-tabs {
  margin-bottom: 16px;
}

.report-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
}

.report-tab.active,
.report-tab:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  font-size: 18px;
}

.action-button {
  min-height: 32px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
}

.action-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.record-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.danger-button {
  min-height: 40px;
  border: 1px solid #d7a5a5;
  border-radius: 8px;
  background: #fff;
  color: #a52f2f;
  padding: 0 14px;
  font-weight: 800;
}

.danger-button:hover,
.danger-action:hover {
  border-color: var(--red);
  color: #982c2c;
  background: #fff4f4;
}

.section-description,
.trash-warning {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trash-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.trash-search {
  width: min(520px, 100%);
}

.trash-count {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.trash-warning {
  margin-top: 12px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  text-align: left;
  font-weight: 800;
}

.link-button:hover {
  text-decoration: underline;
}

.file-label input {
  display: none;
}

.user-switcher {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.table-wrap,
.order-column,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.metric strong,
.metric-link {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.metric-link {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.metric-link:hover {
  color: var(--accent-strong);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 18px;
}
.dashboard-workspace-grid { grid-template-columns: minmax(0, 1fr); }

.dashboard-customer-search {
  margin-bottom: 18px;
}

.dashboard-customer-search label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.dashboard-customer-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.dashboard-customer-results:not(:empty) {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.dashboard-customer-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}

.dashboard-customer-result span {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invoice-builder {
  margin-bottom: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.invoice-builder .panel-header h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.invoice-builder .panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice-builder-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.invoice-builder-form .primary-button {
  width: 100%;
}

.invoice-builder-form .field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-builder-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invoice-builder-status.error {
  color: var(--red);
}

.invoice-candidate-table {
  margin-top: 2px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.invoice-candidate-table table {
  min-width: 620px;
}

.invoice-candidate-table th:first-child,
.invoice-candidate-table td:first-child {
  width: 48px;
  text-align: center;
}

.invoice-builder-summary {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invoice-builder-summary strong {
  color: var(--ink);
}

.kanban,
.order-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

#dashboard #kanban {
  display: block;
}

#dashboard .dashboard-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 115px 150px;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.dashboard-work-name {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-work-name .ledger-order-link {
  text-align: left;
  white-space: normal;
}

.dashboard-work-due small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.dashboard-work-row.deadline-overdue .dashboard-work-due {
  color: var(--red);
}

.dashboard-work-row select {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  font: inherit;
  font-size: 12px;
}

.dashboard-archive {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.dashboard-archive summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-archive summary::before {
  content: "+";
  width: 14px;
  font-size: 18px;
}

.dashboard-archive details[open] summary::before {
  content: "-";
}

.dashboard-archive summary b {
  margin-left: auto;
}

#dashboard .follow-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

@media (max-width: 700px) {
  #dashboard .dashboard-work-row {
    grid-template-columns: minmax(0, 1fr) 135px;
    gap: 8px;
  }

  .dashboard-work-name {
    grid-column: 1 / -1;
  }
}

.work-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.work-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.work-board-head h3 { margin: 0; }
.work-board-head span { color: var(--muted); font-size: 13px; font-weight: 700; }

.kanban-column,
.order-column {
  min-height: 190px;
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 10px;
}

.kanban-column.drag-over {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #eaf7f4;
}

.kanban-drop-zone {
  min-height: 130px;
}

.kanban-more {
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  margin-top: 8px;
  padding: 10px;
  width: 100%;
}

.order-column {
  box-shadow: none;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.task-card,
.follow-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.task-card + .task-card,
.follow-item + .follow-item {
  margin-top: 8px;
}

.task-card strong,
.follow-item strong {
  display: block;
  margin-bottom: 6px;
}

.task-card span,
.follow-item span {
  color: var(--muted);
  font-size: 13px;
}

.work-card {
  cursor: grab;
  display: grid;
  gap: 7px;
  border-left: 4px solid var(--line);
}

.work-card.dragging {
  cursor: grabbing;
  opacity: 0.45;
}

.work-card.deadline-overdue {
  border-left-color: var(--red);
}

.work-card.deadline-today {
  border-left-color: #e89125;
}

.work-card.deadline-soon {
  border-left-color: #d5ad21;
}

.work-card.deadline-complete {
  border-left-color: var(--primary);
}

.work-card-top,
.work-card .record-actions,
.work-status-control,
.work-report-totals,
.list-controls,
.deadline-alerts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.work-card-top {
  justify-content: space-between;
}

.work-kind,
.work-priority {
  background: var(--surface-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px !important;
  font-weight: 800;
  padding: 4px 6px;
}

.work-status-control {
  justify-content: space-between;
  margin-top: 3px;
}

.work-status-control select {
  min-width: 0;
  width: 145px;
  min-height: 34px;
}

.deadline-alerts {
  margin-bottom: 16px;
}

.deadline-alert,
.deadline-clear {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.deadline-alert {
  cursor: pointer;
  display: grid;
  gap: 2px;
  text-align: left;
}

.deadline-alert span,
.deadline-clear {
  color: var(--muted);
  font-size: 12px;
}

.deadline-alert.overdue {
  border-color: #e5a69f;
  background: #fff5f3;
}

.deadline-alert.today,
.deadline-alert.soon {
  border-color: #e6cf8c;
  background: #fffaf0;
}

.screen-tip {
  align-items: flex-start;
  background: #eef7f5;
  border: 1px solid #c8e4de;
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px 13px;
}

.screen-tip-icon {
  align-items: center;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 13px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
}

.screen-tip div,
.screen-tip div span {
  display: block;
}

.screen-tip div span,
.field-help,
.mobile-app-panel p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.list-controls {
  margin-top: 8px;
}

.list-controls label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.list-controls label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.list-controls select {
  min-height: 36px;
  padding: 0 28px 0 10px;
}

.mobile-app-panel,
.work-report-panel {
  margin-bottom: 18px;
}

.work-report-totals span {
  color: var(--muted);
  font-size: 12px;
}

.work-report-totals strong {
  color: var(--ink);
  margin-left: 4px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fafbfc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--blue);
}

.badge.waiting {
  background: var(--amber);
}

.badge.done {
  background: var(--green);
}

.badge.risk {
  background: var(--red);
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(23, 32, 38, 0.48);
}

.modal-card {
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.customer-card-modal {
  width: min(980px, calc(100vw - 28px));
}

.offer-modal {
  width: min(1180px, calc(100vw - 28px));
}

.offer-lines-heading,
.offer-lines-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offer-lines-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.offer-line-head,
.offer-line-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) minmax(190px, 1.6fr) 78px 78px 112px 104px 72px 82px 112px 40px;
  align-items: center;
  gap: 8px;
  min-width: 1160px;
  padding: 9px;
}

.offer-line-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.offer-line-row + .offer-line-row {
  border-top: 1px solid var(--line);
}

.offer-price-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding-top: 2px;
}

.offer-price-tools small { color: var(--muted); }

.offer-line-row input,
.offer-line-row select {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
  color: var(--ink);
}

.offer-line-total {
  text-align: right;
}

.offer-lines-summary {
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.offer-lines-summary strong {
  margin-left: 5px;
  color: var(--ink);
}

.receipt-modal {
  width: min(760px, calc(100vw - 28px));
}

.receipt-card {
  background: #f8fafb;
}

.document-modal {
  width: min(860px, calc(100vw - 28px));
}

.document-card {
  background: #f8fafb;
}

.document-paper,
.receipt-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.compact-document {
  max-width: 680px;
  margin: 0 auto;
}

.document-brand {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: start;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.document-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.offer-brand {
  grid-template-columns: 94.6px minmax(0, 1fr) auto;
}

.offer-brand .document-logo {
  width: 81.4px;
  height: auto;
}

.offer-preparer {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.receipt-signatures .offer-preparer {
  min-height: 0;
  border: 0;
  padding: 0;
}

.customer-print-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.customer-print-brand .document-logo,
#customerPrintHeader .document-logo {
  width: 135px;
  height: auto;
}

.customer-print-date {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.customer-print-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.customer-print-name {
  display: grid;
  gap: 4px;
}

.customer-print-name span,
.customer-print-balance span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-print-name strong {
  font-size: 18px;
}

.customer-print-balance {
  display: grid;
  gap: 3px;
  text-align: right;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #eef5f4;
}

.customer-print-balance strong {
  font-size: 22px;
  line-height: 1.1;
  color: var(--primary-dark);
}

.customer-print-balance b {
  font-size: 13px;
}

@media (max-width: 600px) {
  .customer-print-heading { grid-template-columns: 1fr; }
  .customer-print-balance { text-align: left; }
}

.document-company {
  display: grid;
  gap: 3px;
}

.document-company strong {
  font-size: 20px;
}

.document-company span {
  color: var(--muted);
  line-height: 1.35;
}

.document-title {
  min-width: 150px;
  text-align: right;
  font-size: 18px;
  font-weight: 900;
  color: var(--primary-dark);
  text-transform: uppercase;
}

.document-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.document-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.document-meta span,
.document-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.document-table th,
.document-table td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
}

.document-table th {
  background: var(--surface-soft);
}

.customer-ledger-movements td {
  font-weight: 400;
  overflow-wrap: anywhere;
}

.customer-ledger-movements .customer-ledger-payment-row td {
  font-weight: 700;
}

.customer-ledger-movements tr {
  break-inside: avoid;
}

.customer-ledger-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.customer-info-details {
  margin: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-info-details > summary {
  padding: 12px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-info-details .modal-subtitle {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.customer-card-edit-form {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.customer-card-edit-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.customer-card-edit-fields .full { grid-column: 1 / -1; }

.customer-card-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.order-amount-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.order-amount-control > input { flex: 1 1 180px; min-width: 0; }

.order-vat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  white-space: nowrap;
  cursor: pointer;
}

.order-amount-control .order-vat-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
}

.customer-ledger-filters label {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.customer-ledger-filters input {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font: inherit;
}

.customer-ledger-filters label:first-child {
  flex: 1 1 230px;
  max-width: 360px;
}

.customer-icon-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: max-content;
}

.customer-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.customer-action-icon:hover,
.customer-action-icon:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.customer-action-icon.danger-action:hover,
.customer-action-icon.danger-action:focus-visible {
  border-color: var(--red);
  color: var(--red);
}

.customer-action-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.customer-ledger-movements td:first-child,
.customer-ledger-movements td:nth-child(5),
.customer-ledger-movements td:nth-child(6) {
  white-space: nowrap;
}

.customer-ledger-opening td {
  background: var(--surface-soft);
}

.document-total {
  width: min(320px, 100%);
  margin: 18px 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: right;
  background: var(--surface-soft);
}

.document-total strong {
  display: block;
  font-size: 24px;
}

.offer-document-notes {
  margin-top: 18px;
  color: var(--ink);
  line-height: 1.5;
}

.offer-document-notes p {
  margin: 6px 0;
}

.document-stamp {
  width: min(360px, 100%);
  margin: 20px 0 0 auto;
  text-align: center;
}

.document-stamp span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-stamp img {
  display: block;
  width: 100%;
  max-height: 132px;
  object-fit: contain;
}

.receipt-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.receipt-brand strong,
.receipt-no strong,
.receipt-row strong {
  display: block;
}

.receipt-brand > div:first-child strong {
  font-size: 20px;
}

.receipt-brand span,
.receipt-no span,
.receipt-meta span,
.receipt-row span,
.receipt-signatures span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.receipt-no {
  text-align: right;
}

.receipt-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.receipt-status-warning {
  background: #fff4d6;
  border: 2px solid #d5a62b;
  border-radius: 6px;
  color: #7b5700;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 14px;
  padding: 10px 12px;
  text-align: center;
}

.pending-receipt .document-title {
  color: #8b6500;
}

.receipt-meta div,
.receipt-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.receipt-row + .receipt-row {
  margin-top: 10px;
}

.receipt-note {
  line-height: 1.6;
}

.receipt-note strong {
  display: inline;
}

.receipt-row.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
}

.receipt-row.total strong {
  font-size: 24px;
}

.receipt-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 42px;
}

.receipt-signatures div {
  min-height: 86px;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
}

.receipt-signatures .document-stamp {
  width: min(260px, 100%);
  margin: 8px 0 0;
  text-align: left;
}

.receipt-signatures .document-stamp img {
  max-height: 86px;
}

.receipt-paper.compact-document {
  max-width: 794px;
  padding: 16px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.receipt-paper .document-brand {
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-paper .document-logo {
  width: 52px;
  height: 52px;
}

.receipt-paper .document-company strong,
.receipt-paper .document-title {
  font-size: 14px;
}

.receipt-paper .document-company span {
  font-size: 10px;
  line-height: 1.25;
}

.receipt-paper .receipt-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.receipt-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.receipt-paper .receipt-meta div,
.receipt-paper .receipt-row {
  padding: 6px 8px;
  border-radius: 4px;
  margin: 0;
  break-inside: avoid;
}

.receipt-paper .receipt-meta span,
.receipt-paper .receipt-row span,
.receipt-paper .receipt-signatures span {
  font-size: 9px;
}

.receipt-paper .receipt-row.total strong {
  font-size: 18px;
}

.receipt-details .receipt-note {
  grid-column: 1 / -1;
  line-height: 1.3;
}

.receipt-paper .receipt-status-warning {
  padding: 5px 8px;
  margin-bottom: 8px;
  font-size: 10px;
}

.receipt-paper .receipt-signatures {
  margin-top: 14px;
  gap: 16px;
  break-inside: avoid;
}

.receipt-paper .receipt-signatures div {
  min-height: 64px;
  padding-top: 5px;
}

.receipt-paper .receipt-signatures .document-stamp {
  width: 180px;
  min-height: 0;
  border: 0;
  margin-top: 4px;
  padding: 0;
}

.receipt-paper .receipt-signatures .document-stamp img {
  max-height: 52px;
}

.print-only {
  display: none;
}

.customer-ledger-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.customer-ledger-summary small, .ledger-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.due-tracking { margin: 12px 0 20px; }
.due-tracking h3 { margin: 0 0 10px; }
.due-group { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 10px; }
.due-group summary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; cursor: pointer; font-size: 12px; }
.due-group .follow-item { display: grid; gap: 5px; padding: 10px; border-bottom: 1px solid var(--line); }
.due-group .follow-item strong { margin-bottom: 0; }
.due-group .record-actions, .due-group .action-button { justify-self: start; }
.due-group .action-button { margin-top: 5px; }
.customer-ledger-movements td:nth-child(5), .customer-ledger-movements td:nth-child(6) { white-space: nowrap; }
@media (max-width: 650px) {
  .customer-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { #ledgerDueSummary { display: none; } }

.work-archive,
.work-order-history { margin-top: 18px; }
.work-archive > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  padding: 4px 0;
}
.work-archive > summary b {
  border-radius: 20px;
  background: var(--surface-soft);
  padding: 4px 10px;
}
.work-archive-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
}
.work-archive-controls label { font-weight: 700; }
.work-archive-controls select { min-height: 38px; padding: 6px; }
.work-archive-controls span { margin-left: auto; color: var(--muted); font-size: 13px; }
.work-archive-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.work-archive-list .task-card + .task-card { margin-top: 0; }
.work-order-history > summary { cursor: pointer; font-weight: 800; padding: 4px 0 12px; }
.work-order-history[open] > .table-wrap { margin-top: 8px; }
#ledgerCustomerTable .record-actions { white-space: nowrap; }
@media (max-width: 720px) {
  #ledgerCustomerTable .record-actions { white-space: normal; }
  #ledgerCustomerTable .record-actions button { margin: 2px; }
}
.ledger-pdf-preview-modal { width: min(960px, calc(100vw - 28px)); max-height: min(92vh, 1050px); overflow: auto; }
.ledger-pdf-preview-range { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 12px; }
.ledger-pdf-preview-range label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.ledger-pdf-preview-range input { min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ledger-pdf-preview-summary { margin: 0 0 12px; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.ledger-pdf-preview-summary.error { color: var(--red); }
.ledger-pdf-preview-content { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); padding: 14px; }
.ledger-pdf-preview-content .document-paper { max-width: 820px; margin: 0 auto; }
.customer-statement-period { margin: 0 0 18px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
@media (max-width: 600px) { .ledger-pdf-preview-content { padding: 6px; } .ledger-pdf-preview-content .document-paper { padding: 14px; } }

.customer-invoice-info {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.customer-invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-invoice-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.customer-invoice-head > div > span,
.customer-invoice-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-invoice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.customer-invoice-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.customer-invoice-grid .full {
  grid-column: 1 / -1;
}

.customer-invoice-grid strong {
  overflow-wrap: anywhere;
}

.customer-ledger-summary article {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.customer-ledger-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.customer-ledger-summary strong {
  font-size: 20px;
}

.customer-ledger-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.customer-ledger-grid h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.ledger-list {
  display: grid;
  gap: 8px;
}

.ledger-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.ledger-item span {
  color: var(--muted);
  font-size: 13px;
}

.ledger-item b {
  color: var(--ink);
}

.ledger-order-link {
  background: transparent;
  border: 0;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.ledger-order-link:hover {
  text-decoration: underline;
}

.customer-order-actions {
  margin-top: 4px;
}

.success-action {
  border-color: #9dcfc4;
  color: var(--primary);
}

.work-approval,
.work-file-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.work-file-links a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.pricing-editor .ledger-note { margin: 0; }

.pricing-rows { display: grid; gap: 8px; }

.pricing-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.4fr) minmax(100px, 1fr) minmax(100px, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.pricing-row input { min-width: 0; }

.pricing-options { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pricing-options label { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.pricing-options input[type="checkbox"] { min-height: auto; }
.pricing-loss-warning { color: #b42318; }

.product-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.product-select-row .secondary-button {
  white-space: nowrap;
}

.inline-product-create {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.inline-product-create[hidden] {
  display: none;
}

.inline-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inline-product-grid label {
  display: grid;
  gap: 6px;
}

.inline-product-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.inline-product-actions span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.inline-product-actions span.error {
  color: var(--red);
}

.bank-transaction-panel {
  margin-bottom: 18px;
}

.bank-transaction-panel .panel-header {
  align-items: flex-start;
}

.bank-transaction-actions {
  display: flex;
  gap: 8px;
}

.bank-transaction-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.bank-transaction-form .inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.bank-transaction-form .inline-add .icon-button {
  width: 42px;
  height: 42px;
}

.bank-transaction-description {
  grid-column: span 2;
}

.bank-transaction-save {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 82px;
}

.customer-picker {
  position: relative;
}

.customer-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.customer-picker.open .customer-results {
  display: grid;
  gap: 4px;
}

.customer-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.customer-option:hover,
.customer-option:focus {
  background: var(--surface-soft);
}

.customer-option strong,
.customer-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-option span,
.customer-empty {
  color: var(--muted);
  font-size: 13px;
}

.customer-empty {
  padding: 12px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.modal-actions {
  justify-content: flex-end;
  padding: 18px 0 0;
  margin: 0;
}

.modal-head-actions {
  margin-left: auto;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
}

.empty-state {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 3px;
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.segmented-control button.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgb(15 43 49 / 12%);
}

.document-actions {
  flex-wrap: wrap;
}

.ledger-list.list-mode {
  display: block;
}

.ledger-table-wrap {
  max-height: 480px;
}

.ledger-table {
  min-width: 720px;
  font-size: 12px;
}

.ledger-table th,
.ledger-table td {
  padding: 9px 10px;
  vertical-align: top;
}

.reminder-modal {
  width: min(1080px, calc(100vw - 28px));
}
.reminder-whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.reminder-whatsapp-link[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.reminder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.check-control input,
[data-debtor-select] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.reminder-message-field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-weight: 800;
}

.reminder-message-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 500;
  line-height: 1.5;
}

.reminder-table-wrap {
  max-height: 48vh;
}

.report-print-header {
  margin-bottom: 16px;
}

.report-document-range {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.report-summary-grid > div {
  border: 1px solid #cdd9dc;
  border-radius: 7px;
  background: #f2f7f6;
  padding: 12px;
}

.report-summary-grid span {
  display: block;
  color: #607278;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-summary-grid strong {
  display: block;
  margin-top: 5px;
  color: #0c3937;
  font-size: 18px;
}

.report-document-section {
  margin-top: 22px;
}

.report-document-section h3 {
  margin: 0 0 10px;
  color: #17292d;
  font-size: 16px;
}

.report-document-table {
  font-size: 10px;
}

.report-document-table th,
.report-document-table td {
  padding: 7px 8px;
  vertical-align: top;
}

.document-footer {
  margin-top: 20px;
  border-top: 1px solid #ccd8da;
  padding-top: 8px;
  color: #607278;
  font-size: 10px;
  text-align: right;
}

.pdf-ledger-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pdf-ledger-cards article {
  display: grid;
  gap: 5px;
  break-inside: avoid;
  border: 1px solid #ccd8da;
  border-radius: 7px;
  padding: 10px;
}

.pdf-ledger-cards span {
  color: #607278;
  font-size: 11px;
}

.pdf-export-stage {
  position: fixed;
  left: -100000px;
  top: 0;
  width: 190mm;
  z-index: -1;
  background: #fff;
  color: #172026;
}

.pdf-export-stage .document-paper,
.pdf-export-stage .receipt-paper {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.pdf-export-stage .page-break-before {
  break-before: page;
}

.pdf-export-stage .record-actions,
.pdf-export-stage button {
  display: none !important;
}

@media (max-width: 1040px) {
  .work-board,
  .work-archive-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    overflow: auto;
  }

  .nav-item {
    justify-content: center;
    white-space: nowrap;
  }

  .workspace-grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    min-width: 0;
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions,
  .modal-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .screen-tip {
    margin-bottom: 14px;
  }

  .list-controls {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .list-controls label {
    justify-content: space-between;
  }

  .list-controls select {
    width: 65%;
  }

  .work-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-board.has-items .kanban-column.is-empty { display: none; }

  .work-archive-list { grid-template-columns: minmax(0, 1fr); }

  .section-actions > button,
  .customer-card-modal .modal-head-actions > button:not(.icon-button) {
    flex: 1 1 140px;
  }

  .trash-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    width: 100%;
  }

  .screen-filter {
    grid-column: 1 / -1;
    width: 100%;
  }

  .cloud-sync-status {
    grid-column: 1;
    min-width: 0;
    width: 100%;
  }

  .user-switcher {
    grid-column: 2 / -1;
    min-width: 0;
    width: 100%;
  }

  #installAppBtn,
  #quickAddBtn {
    grid-column: 1 / -1;
    width: 100%;
  }

  #printBtn {
    grid-column: 1;
    min-width: 0;
    width: 100%;
  }

  #exportBtn {
    grid-column: 2;
  }

  .topbar-actions > .file-label {
    grid-column: 3;
  }

  .primary-button {
    flex: 1;
  }

  .metrics,
  .customer-ledger-summary,
  .customer-ledger-grid,
  .workspace-grid,
  .kanban,
  .order-board,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .product-select-row,
  .inline-product-grid,
  .bank-transaction-form {
    grid-template-columns: 1fr;
  }

  .bank-transaction-panel .panel-header,
  .bank-transaction-actions {
    width: 100%;
  }

  .bank-transaction-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bank-transaction-description {
    grid-column: auto;
  }

  .bank-transaction-save .primary-button {
    width: 100%;
  }

  .product-select-row .secondary-button {
    width: 100%;
  }

  .invoice-builder-form {
    grid-template-columns: 1fr;
  }

  .invoice-builder .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .invoice-builder-summary {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .offer-lines-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .offer-lines-summary {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .customer-invoice-grid {
    grid-template-columns: 1fr;
  }

  .customer-invoice-grid .full {
    grid-column: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    min-width: 0;
    gap: 6px;
    padding: 0 8px;
    white-space: normal;
    font-size: 13px;
  }
}

.defter-shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 124px);
  background: #0f1b1f;
  border: 1px solid #21343a;
  border-radius: 8px;
  overflow: hidden;
}

.defter-accounts {
  background: #0b171a;
  border-right: 1px solid #21343a;
  color: #c7d7dd;
  min-width: 0;
}

.defter-tools {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #21343a;
}

.defter-tools input {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  border: 1px solid #21343a;
  border-radius: 8px;
  background: #122227;
  color: #d9e7eb;
  padding: 0 12px;
}

.defter-tools .icon-button,
.defter-actionbar .secondary-button {
  background: #122227;
  border-color: #21343a;
  color: #d9e7eb;
}

.defter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #90a2aa;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
}

.defter-group-title {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1c2a2f;
  color: #91a3aa;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.defter-account {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #18292e;
  background: transparent;
  color: #d9e7eb;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
}

.defter-account:hover,
.defter-account.active {
  background: #132b32;
}

.defter-account strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}

.defter-account small {
  color: #7f959d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.defter-work {
  padding: 18px;
  color: #d9e7eb;
}

.defter-actionbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.defter-form {
  width: min(680px, 100%);
  border: 1px solid #21343a;
  border-radius: 8px;
  overflow: hidden;
  background: #101f23;
}

.defter-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #2aa0bd;
  color: #07161a;
  padding: 14px 18px;
  font-weight: 800;
}

.defter-form-title span {
  font-size: 13px;
  font-weight: 700;
}

.defter-form label {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border-bottom: 1px solid #21343a;
  min-height: 56px;
}

.defter-form label > span {
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: #c7d7dd;
  font-weight: 800;
  border-right: 1px solid #21343a;
}

.defter-form input,
.defter-form select {
  border: 0;
  background: #101f23;
  color: #d9e7eb;
  min-width: 0;
  padding: 0 18px;
  outline: 0;
}

.defter-form .inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
}

.defter-form .inline-add select {
  min-width: 0;
}

.defter-form .inline-add .customer-picker {
  min-width: 0;
}

.defter-form .inline-add .customer-picker input {
  width: 100%;
  min-height: 56px;
}

.defter-form .inline-add .icon-button {
  width: 44px;
  height: 100%;
  min-height: 56px;
  border-radius: 0;
  border-width: 0 0 0 1px;
  border-color: #21343a;
  background: #122227;
  color: #d9e7eb;
}

.defter-form input::placeholder {
  color: #6d828a;
}

.defter-save-row {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px;
}

.migration-panel {
  margin-top: 24px;
}

.migration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.migration-source {
  display: grid;
  gap: 8px;
}

.migration-source > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.migration-source textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
}

.migration-actions {
  display: grid;
  gap: 10px;
  min-width: 190px;
}

.migration-status {
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.migration-status.error {
  color: #a33a2b;
}

.local-import-only {
  display: none;
}

.local-runtime .local-import-only {
  display: inline-flex;
}

.cloud-import-only {
  display: none;
}

.cloud-runtime .cloud-import-only {
  display: block;
}

@media (max-width: 960px) {
  .migration-grid {
    grid-template-columns: 1fr;
  }

  .migration-actions {
    min-width: 0;
  }

  .defter-shell {
    grid-template-columns: 1fr;
  }

  .defter-accounts {
    border-right: 0;
    border-bottom: 1px solid #21343a;
  }
}

@media (max-width: 640px) {
  .defter-form label {
    grid-template-columns: 1fr;
  }

  .defter-form label > span {
    min-height: 36px;
    border-right: 0;
  }

  .defter-form input,
  .defter-form select {
    min-height: 44px;
  }
}

.material-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
}

.material-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: thin;
}

.material-category-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 10px 15px;
  white-space: nowrap;
  cursor: pointer;
}

.material-category-tabs button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.catalog-sheet-field[hidden],
.catalog-profile-field[hidden] { display: none; }

.material-form {
  display: grid;
  gap: 14px;
}

.material-form-heading {
  border-top: 1px solid var(--line);
  margin: 2px 0 0;
  padding-top: 18px;
  font-size: 16px;
}

.material-form > .primary-button { min-height: 44px; }

.profile-field {
  display: none;
}

.material-form.profile-mode .sheet-field {
  display: none;
}

.material-form.profile-mode .profile-field {
  display: grid;
}

.material-result {
  min-height: 520px;
}

.material-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.material-summary article {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.material-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.material-summary strong {
  font-size: 22px;
}

.material-cost-totals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.material-key-total {
  background: #e4f3f0 !important;
}

.material-key-total strong { color: var(--accent-strong); }

.material-cost-prompt,
.material-cost-error {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 14px;
  background: var(--surface-soft);
  color: var(--muted);
}

.material-cost-error { color: var(--red); }

.material-breakdown {
  border-top: 1px solid var(--line);
  margin: 16px 0;
  padding-top: 12px;
}

.material-breakdown h3 { margin: 0 0 10px; font-size: 16px; }
.material-breakdown dl { margin: 0; }
.material-breakdown dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.material-breakdown dt { color: var(--muted); }
.material-breakdown dd { margin: 0; font-weight: 700; white-space: nowrap; }

.material-guidance { margin-top: 18px; }
.material-guidance h3 { margin: 0 0 10px; }
.material-guidance ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.6; }

.material-recommendation {
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #eaf7f4;
  padding: 16px;
  margin: 16px 0;
}
.material-recommendation strong { color: var(--accent-strong); }
.material-recommendation p { margin: 8px 0 0; line-height: 1.5; }
.material-recommendation .ledger-note { margin-bottom: 0; }

.cut-template {
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 340px;
  padding: 12px;
  background: #fafbfc;
}

.cut-template svg {
  width: 100%;
  height: auto;
  max-height: 620px;
}

.cut-label {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 1040px) {
  .material-grid {
    grid-template-columns: 1fr;
  }

  #materialResult { scroll-margin-top: 90px; }
}

@media (max-width: 720px) {
  .material-summary {
    grid-template-columns: 1fr;
  }

  .material-cost-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-key-total strong { font-size: 18px; }

  .modal-head-actions,
  .document-actions {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .report-summary-grid,
  .pdf-ledger-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.customer-print-root {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  @page receipt {
    size: A5 landscape;
    margin: 8mm;
  }

  @page document {
    size: A4;
    margin: 12mm;
  }

  body {
    display: block;
    background: #fff;
    color: #111;
  }

  body::before {
    content: "DOKA Reklam Matbaa Promosyon - " attr(data-print-title);
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
  }

  body.print-dialog::before {
    display: none;
  }

  body.print-customer-statement::before,
  body.print-customer-statement > :not(.customer-print-root) {
    display: none !important;
  }

  body.print-customer-statement > .customer-print-root {
    display: block !important;
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .customer-print-root .document-paper {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .customer-print-root .report-document-section {
    break-inside: auto;
  }

  .customer-print-root thead {
    display: table-header-group;
  }

  .sidebar,
  .topbar-actions,
  .section-head button,
  .action-button,
  .icon-button,
  .secondary-button,
  .primary-button,
  .segmented-control,
  .report-tabs,
  .defter-actionbar,
  .defter-tools,
  .modal-actions {
    display: none !important;
  }

  .invoice-builder {
    display: none !important;
  }

  #reports > .section-head {
    display: none !important;
  }

  .report-document-section,
  .ledger-table tr {
    break-inside: avoid;
  }

  .app-shell {
    padding: 0;
  }

  .topbar {
    min-height: auto;
    margin-bottom: 14px;
  }

  .eyebrow {
    color: #333;
  }

  .view {
    display: none !important;
  }

  .view.active {
    display: block !important;
  }

  body.print-dialog .view.active,
  body.print-dialog .topbar {
    display: none !important;
  }

  dialog[open] {
    display: block;
    position: static;
    width: 100%;
    max-width: none;
    border: 0;
    padding: 0;
    background: #fff;
  }

  dialog::backdrop {
    display: none;
  }

  .document-paper {
    page: document;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .receipt-paper {
    page: receipt;
  }

  body.print-a4 .receipt-paper {
    page: document;
  }

  .document-brand {
    break-inside: avoid;
  }

  .document-logo {
    width: 64px;
    height: 64px;
  }

  .offer-brand .document-logo {
    width: 70.4px;
    height: auto;
  }

  .customer-print-brand .document-logo,
  #customerPrintHeader .document-logo {
    width: 117px;
    height: auto;
  }

  .document-company span {
    color: #333;
  }

  .document-title {
    color: #111;
  }

  .document-meta div,
  .receipt-row,
  .document-table th,
  .document-table td,
  .document-total {
    border-color: #aaa;
  }

  .document-stamp {
    break-inside: avoid;
  }

  .print-only {
    display: block !important;
  }

  .metric,
  .panel,
  .table-wrap,
  .order-column,
  .modal-card,
  .task-card,
  .follow-item,
  .ledger-item {
    box-shadow: none;
    border-color: #bbb;
  }

  .metrics,
  .workspace-grid,
  .customer-ledger-summary,
  .customer-ledger-grid,
  .material-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .defter-shell {
    display: block;
    min-height: auto;
    background: #fff;
    border-color: #bbb;
  }

  .defter-accounts,
  .defter-work,
  .defter-form,
  .defter-form input,
  .defter-form select {
    background: #fff;
    color: #111;
  }

  .defter-work {
    padding: 0;
  }

  .defter-form {
    width: 100%;
    margin-top: 12px;
    border-color: #bbb;
  }

  .defter-form-title {
    background: #eee;
    color: #111;
  }

  table {
    min-width: 0;
    font-size: 11px;
  }

  th,
  td {
    padding: 7px 8px;
  }

  .badge {
    color: #111;
    background: #eee !important;
    border: 1px solid #aaa;
  }

  .customer-results {
    display: none !important;
  }
}
.cloud-access-gate:not([hidden]) { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: #f3f6f7; }
.cloud-access-gate > div { width: min(100%, 520px); padding: 32px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.cloud-access-gate p { line-height: 1.6; }
.cloud-access-gate a { margin-left: 16px; color: var(--accent); }
[hidden] { display: none !important; }
.column-picker { position: relative; }
.column-picker summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.column-picker summary::-webkit-details-marker { display: none; }
.column-picker summary::after { content: "⌄"; }
.column-picker[open] summary { border-color: var(--accent); }
.column-picker-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 280px; max-width: calc(100vw - 40px); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #17202620; }
.column-picker-panel strong { display: block; margin-bottom: 8px; }
.column-picker-panel { max-height: 70vh; overflow-y: auto; }
.column-picker-panel label { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: 14px; }
.column-picker-panel input { width: 18px; height: 18px; accent-color: var(--accent); }
.column-picker-panel p { color: var(--muted); font-size: 12px; line-height: 1.5; }
#customers th[hidden], #customers td[hidden] { display: none !important; }
@media (max-width: 720px) { .column-picker-panel { left: 0; right: auto; } }
@media print { .column-picker { display: none !important; } }
/* Compact, accessible document and ledger action buttons. */
button.toolbar-icon,
.section-actions > button.toolbar-icon,
.customer-card-modal .modal-head-actions > button.toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
}
.toolbar-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

#customerCardModal [data-customer-sale] {
  color: #16803c;
  border-color: #16803c;
}

#customerCardModal [data-customer-purchase] {
  color: var(--red);
  border-color: var(--red);
}
#customerBalanceWhatsapp { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; padding: 0; color: #16803c; border-color: #16803c; text-decoration: none; }
#customerBalanceWhatsapp[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.toolbar-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.toolbar-icon[aria-busy="true"] { opacity: .5; cursor: wait; }
.customer-card-modal .segmented-control { width: auto; flex: 0 0 auto; }
/* Financial reports retain the application's compact, teal working surface. */
.report-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:16px 0; }
.report-filters label { display:grid; gap:6px; font-size:13px; font-weight:700; }
.report-filters input,.report-filters select { min-width:0; width:100%; padding:10px; border:1px solid var(--line); border-radius:6px; background:white; color:var(--ink); }
.report-method { color:#52636c; font-size:13px; line-height:1.6; margin:12px 0 18px; }
.financial-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; align-items:start; }
.financial-chart-grid .panel,.report-breakdown,.ledger-customer-summary { padding:20px; min-width:0; }
.financial-chart-grid h3,.report-breakdown h3,.ledger-customer-summary h3 { margin:0 0 16px; font-size:16px; }
.financial-bars { display:grid; gap:12px; }
.financial-bar-row { display:grid; grid-template-columns:minmax(70px,24%) minmax(0,1fr); gap:12px; align-items:center; break-inside:avoid; }
.financial-bar-row > strong { font-size:12px; overflow-wrap:anywhere; }
.financial-bar-line { display:flex; align-items:center; gap:8px; min-height:19px; }
.financial-bar-line > span { width:90px; text-align:right; font-size:11px; flex-shrink:0; font-variant-numeric:tabular-nums; }
.financial-bar-track { flex:1; height:9px; background:#eef2f3; border-radius:3px; overflow:hidden; }
.financial-bar-track i { display:block; height:100%; }
.chart-legend { display:flex; flex-wrap:wrap; gap:12px; font-size:11px; margin:0 0 18px; }
.chart-legend span { display:flex; align-items:center; gap:5px; }
.chart-legend i { width:9px; height:9px; border-radius:2px; }
.report-cash-summary { display:flex; flex-wrap:wrap; gap:24px; padding:16px 0; font-size:13px; }
.report-cash-summary b { margin-left:8px; }
.report-row-meta { display:block; color:#65747a; margin-top:4px; }
.report-breakdown,.ledger-customer-summary { margin-bottom:18px; }
.ledger-customer-summary tfoot { background:#edf4f3; font-weight:800; }
.report-a4-document .financial-chart-grid { grid-template-columns:1fr; }
.report-a4-document .panel { box-shadow:none; overflow:visible; }
.report-a4-document .financial-bar-row { break-inside:avoid; page-break-inside:avoid; }
.document-paper table { width:100%; min-width:0; table-layout:fixed; }
.document-paper th,.document-paper td { padding:7px 5px; white-space:normal; overflow-wrap:anywhere; font-size:10px; }
.document-paper .table-wrap { overflow:visible; max-height:none; }
.document-paper .document-table .badge { white-space:normal; font-size:9px; padding:3px 5px; }
.customer-link { border:0; background:none; color:var(--primary); text-align:left; cursor:pointer; font:inherit; font-weight:700; }
@media(max-width:800px) { .report-filters,.financial-chart-grid { grid-template-columns:1fr; } }
@media print { .report-filters { display:none; } .financial-chart-grid { grid-template-columns:1fr; } .financial-bar-row { break-inside:avoid; } .financial-bar-track,.chart-legend { print-color-adjust:exact; -webkit-print-color-adjust:exact; } }

.mobile-menu-toggle,
.mobile-shortcuts { display: none; }
.mobile-customer-list { display: none; }
.view[data-loading="true"] > :not(.mobile-view-loading) { display: none !important; }
.mobile-view-loading { display: grid; justify-items: start; gap: 12px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.nav-item[hidden] { display: none !important; }

@media (max-width: 720px) {
  body { align-content: start; }
  body.mobile-menu-open { overflow: hidden; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace-grid > .panel { min-width: 0; }
  .sidebar {
    min-height: 0;
    height: 60px;
    padding: 0 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px #17202624;
  }
  .sidebar .brand { display: flex; gap: 9px; margin: 0; }
  .sidebar .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .sidebar .brand strong { font-size: 16px; }
  .sidebar .brand span { display: none; }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #566770;
    border-radius: 8px;
    background: #243139;
    color: #fff;
    font-weight: 700;
  }
  .mobile-menu-toggle span[aria-hidden] { font-size: 19px; line-height: 1; }
  .sidebar .nav { display: none; }
  .sidebar.menu-open .nav {
    display: grid;
    position: fixed;
    inset: 60px 0 calc(66px + env(safe-area-inset-bottom));
    z-index: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #172026;
  }
  .sidebar .nav .nav-item { min-height: 52px; justify-content: flex-start; padding: 8px 12px; white-space: normal; }
  .mobile-shortcuts {
    display: flex;
    position: fixed;
    inset: auto 0 0;
    z-index: 3;
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    align-items: stretch;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -3px 14px #17202616;
  }
  .mobile-shortcuts .nav-item,
  .mobile-more-button {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #485960;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }
  .mobile-shortcuts .nav-item span,
  .mobile-more-button span { width: auto; height: 22px; color: inherit; font-size: 20px; line-height: 1; }
  .mobile-shortcuts .nav-item.active,
  .mobile-more-button.current-view,
  .mobile-more-button[aria-expanded="true"] { background: #e4f3f0; color: var(--accent-strong); }
  .mobile-menu-toggle:focus-visible,
  .mobile-shortcuts button:focus-visible,
  .sidebar .nav .nav-item:focus-visible { outline: 2px solid #56c9bb; outline-offset: 2px; }
  .app-shell { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }

  body[data-active-view="customers"] .eyebrow,
  body[data-active-view="work"] .eyebrow,
  body[data-active-view="customers"] #screenTip,
  body[data-active-view="work"] #screenTip,
  body[data-active-view="customers"] #installAppBtn,
  body[data-active-view="work"] #installAppBtn,
  body[data-active-view="customers"] #printBtn,
  body[data-active-view="work"] #printBtn,
  body[data-active-view="customers"] #exportBtn,
  body[data-active-view="work"] #exportBtn,
  body[data-active-view="customers"] .topbar-actions > .file-label,
  body[data-active-view="work"] .topbar-actions > .file-label,
  body[data-active-view="customers"] #quickAddBtn,
  body[data-active-view="work"] #quickAddBtn,
  #work .section-head > div:first-child,
  #customers .section-head > div:first-child,
  #customers #customerColumnPicker,
  #customers > .table-wrap { display: none !important; }
  body[data-active-view="customers"] .topbar { margin-bottom: 10px; }
  body[data-active-view="work"] .topbar { margin-bottom: 10px; }
  #work .section-head { margin-bottom: 12px; }
  #work .work-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #work #workAlerts { display: none; }
  #customers .section-head { margin-bottom: 12px; }
  #customers .section-actions { width: 100%; }
  #customers .section-actions > [data-open-modal="customer"] { width: 100%; }
  #customers .mobile-customer-list { display: grid; gap: 8px; }
  .mobile-customer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 3px 12px #1720260c;
    text-align: left;
  }
  .mobile-customer-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .mobile-customer-name { min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
  .mobile-customer-balance { display: grid; justify-items: end; gap: 1px; text-align: right; }
  .mobile-customer-balance small { color: var(--muted); font-size: 11px; line-height: 1.2; }
  .mobile-customer-balance strong { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
}

@media print {
  .mobile-menu-toggle,
  .mobile-shortcuts { display: none !important; }
  #customers > .table-wrap { display: block !important; }
  #customers .mobile-customer-list { display: none !important; }
}
.customer-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.customer-quick-actions button { flex: 1 1 120px; min-height: 44px; }
@media (max-width: 720px) { .customer-quick-actions { display: grid; grid-template-columns: 1fr 1fr; } .customer-quick-actions [data-customer-payment] { grid-column: 1 / -1; } }
@media print { .customer-quick-actions { display: none !important; } }
.offer-follow-ups { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.offer-follow-ups h3 { margin: 0 0 12px; }
.offer-follow-up { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.offer-follow-up > div:first-child { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.offer-follow-up small { color: var(--muted); }
@media (max-width: 720px) { .offer-follow-up { flex-direction: column; } .offer-follow-up .record-actions { flex-wrap: wrap; } }
@media print { .offer-follow-ups { display: none !important; } }
.table-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.table-pagination .record-actions { display: flex; gap: 8px; }
.table-pagination button { min-height: 44px; }
.back-to-top { position: fixed; right: 20px; bottom: 24px; z-index: 4; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 24px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px #17202625; }
.back-to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media (max-width: 720px) { .back-to-top { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); } }
@media print { .back-to-top { display: none !important; } }
.daily-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.customer-history, #bulkPaymentDetails { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.customer-history summary, #bulkPaymentDetails summary { cursor: pointer; font-weight: 600; }
.history-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
#bulkPaymentOrders { display: grid; gap: 8px; margin: 12px 0; }
#bulkPaymentPreview { margin: 12px 0; }
#jobProfitReport { margin: 16px 0; }
#materialTransferForm { display: grid; gap: 14px; }
#materialTransferForm label { display: grid; gap: 6px; }
#materialTransferPreview { padding: 12px; background: var(--surface-soft); border-radius: 8px; }
.profit-ranking { margin: 14px 0; }
.profit-ranking summary { font-weight: 600; cursor: pointer; }
.job-template-toolbar { padding: 14px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 10px; display: grid; gap: 8px; }

.report-details { margin-top: 18px; }
.report-details > summary { cursor: pointer; padding: 18px; border: 1px solid var(--border, #dce3e8); border-radius: 12px; font-weight: 600; background: var(--surface, #fff); }
.report-details[open] > summary { margin-bottom: 12px; }
.report-period-summary { margin: 18px 0; }
.metric[hidden] { display: none; }

#reports > .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { #reports > .metrics { grid-template-columns: 1fr; } }

#reports .financial-bar-track { height: 12px; }
#reports .financial-bar-row { padding: 12px 0; }
#reports .report-tabs { flex-wrap: wrap; }
#workReportChart { margin: 20px 0; }

.monthly-sales-total { display:flex; gap:12px; align-items:baseline; margin:20px 0; }
.monthly-sales-total strong { font-size:24px; color:#5464ad; }
.monthly-sales-scroll { overflow-x:auto; }
.monthly-sales-chart { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:8px; min-width:840px; padding:16px 0; }
.monthly-sales-column { text-align:center; min-width:0; }
.monthly-sales-value { font-size:11px; display:block; margin-bottom:12px; white-space:nowrap; }
.monthly-sales-track { height:200px; display:flex; align-items:flex-end; justify-content:center; border-bottom:1px solid #cdd6df; background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#edf0f5 49px,#edf0f5 50px); }
.monthly-sales-track i { display:block; width:65%; max-width:48px; border-radius:6px 6px 0 0; }
.monthly-sales-column strong { display:block; font-size:11px; margin-top:10px; }
.monthly-sales-table { width:100%; min-width:840px; font-size:11px; border-collapse:collapse; }
.monthly-sales-table th,.monthly-sales-table td { padding:10px 6px; text-align:center; border-bottom:1px solid #e2e8ef; white-space:nowrap; }
.report-a4-document .monthly-sales-chart,.report-a4-document .monthly-sales-table { min-width:0; }
.report-a4-document .monthly-sales-chart { grid-template-columns:repeat(12,minmax(0,1fr)); gap:3px; }
.report-a4-document .monthly-sales-value,.report-a4-document .monthly-sales-column strong,.report-a4-document .monthly-sales-table { font-size:8px; }
@media print { .monthly-sales-track i { print-color-adjust:exact; -webkit-print-color-adjust:exact; } }

.sales-category-pie { display:grid; grid-template-columns:240px minmax(0,1fr); align-items:center; gap:32px; }
.sales-category-pie svg { width:240px; height:240px; max-width:100%; }
.sales-pie-legend { list-style:none; padding:0; margin:0; }
.sales-pie-legend li { display:grid; grid-template-columns:12px minmax(0,1fr) auto 60px; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid #e2e8ef; font-size:13px; }
.sales-pie-legend i { width:12px; height:12px; border-radius:3px; }
.sales-pie-legend b { text-align:right; }
@media(max-width:600px) { .sales-category-pie { grid-template-columns:1fr; gap:16px; } .sales-category-pie svg { justify-self:center; } .sales-pie-legend li { gap:8px; font-size:12px; } }

.quick-workflow-entry { margin-bottom:16px; }
#quickWorkflowModal .form-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:20px; }
#quickWorkflowModal .full { grid-column:1/-1; }
.quick-workflow-sale { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.quick-workflow-sale[hidden] { display:none; }
.quick-workflow-sale fieldset { grid-column:1/-1; border:1px solid #dce3e8; padding:12px; }
#quickWorkflowPlan { display:flex; gap:12px; flex-wrap:wrap; }
#quickWorkflowModal label { display:flex; flex-direction:column; gap:6px; }
#quickWorkflowModal input[type=checkbox] { width:auto; }
#dailyWorkList { padding:20px; margin-bottom:16px; }
.daily-work-section > summary,.bulk-work-panel > summary { cursor:pointer; font-weight:600; padding:14px 0; }
.daily-action-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-top:1px solid #e2e8ef; }
.daily-action-row span,.bulk-work-row small { display:block; margin-top:6px; color:#667581; }
.bulk-work-panel { padding:20px; margin-bottom:16px; }
.bulk-work-panel .record-actions { margin:12px 0; }
#bulkWorkList { max-height:350px; overflow:auto; }
.bulk-work-row { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid #e2e8ef; }
.bulk-work-row input { width:auto; }
.bulk-work-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:16px; }
.bulk-work-fields label { display:flex; flex-direction:column; gap:8px; }
.bulk-work-fields button { grid-column:1/-1; }
@media(max-width:720px) { #quickWorkflowModal .form-fields,.quick-workflow-sale,.bulk-work-fields { grid-template-columns:1fr; } .daily-action-row { align-items:flex-start; flex-direction:column; } }

/* Daily workspace, navigation and progressive disclosure. */
.nav-group { display:grid; gap:4px; margin-top:12px; }
.nav-group-label { padding:8px 12px 4px; margin:0; font-size:11px; font-weight:700; letter-spacing:.04em; color:#afc0c9; }
.sidebar .nav { overflow-y:auto; overscroll-behavior:contain; }
#dashboardCustomerSearchPanel { margin-bottom:14px; padding:20px; border:1px solid #a5d2c9; }
#dashboardCustomerSearch { min-height:48px; font-size:16px; }
.quick-workflow-entry .primary-button { min-height:48px; }
.daily-work-section { border-bottom:1px solid var(--line); }
.daily-work-section[open] > summary { color:var(--accent-strong); }
.customer-contact-header { display:flex; flex-wrap:wrap; gap:16px; color:var(--muted); margin-bottom:16px; }
.customer-contact-header a { color:var(--accent-strong); font-weight:600; }
.customer-card-tabs { display:flex; gap:8px; overflow-x:auto; margin:20px 0; padding-bottom:8px; border-bottom:1px solid var(--line); }
.customer-card-tabs button { flex:0 0 auto; min-height:44px; padding:10px 16px; border:1px solid var(--line); border-radius:10px; background:var(--surface); font:inherit; font-weight:600; cursor:pointer; }
.customer-card-tabs button.active { color:var(--accent-strong); background:#e4f3f0; border-color:#93cbbf; }
.customer-card-tabs button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#customerCardModal .customer-ledger-grid { grid-template-columns:1fr; }
#customerCardModal .customer-ledger-summary article:first-child { border-left:4px solid var(--accent); }
#customerCardModal .customer-ledger-summary article:first-child strong { font-size:28px; }
.customer-quick-actions { flex-wrap:wrap; gap:8px; }
.form-details { grid-column:1/-1; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.form-details > summary { padding:16px; cursor:pointer; font-weight:600; }
.form-details-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 16px 16px; gap:16px; }
#entryForm > .modal-actions,#quickWorkflowForm > .modal-footer { position:sticky; bottom:-1px; z-index:3; background:var(--surface); padding:16px 0; margin-bottom:0; border-top:1px solid var(--line); box-shadow:0 -8px 16px #17202608; }
.work-status-chip { padding:4px 8px; border-radius:6px; background:#edf1f5; font-size:11px; font-weight:700; }
.work-card > strong { font-size:17px; line-height:1.4; }
.work-card-details { order:8; font-size:12px; }
.work-card-details summary { cursor:pointer; color:var(--muted); }
.work-card-details span { display:block; margin:8px 0; }
.work-progress { display:grid; gap:6px; font-size:12px; }
.work-progress progress { width:100%; height:8px; accent-color:var(--accent); }
.work-card[data-urgency=overdue],.dashboard-work-row[data-urgency=overdue] { border-left:4px solid #c34b44; }
.work-card[data-urgency=today],.dashboard-work-row[data-urgency=today] { border-left:4px solid #d18a26; }
.work-card[data-urgency=ready],.dashboard-work-row[data-urgency=ready] { border-left:4px solid #13846b; background:#f1faf5; }
.work-card[data-urgency=overdue] .work-status-chip { background:#fff0ee; color:#ad3e38; }
.work-card[data-urgency=today] .work-status-chip { background:#fff5e6; color:#96601c; }
.work-card[data-urgency=ready] .work-status-chip { background:#dff2e8; color:#087451; }
.mobile-quick-action { display:none; }
@media(max-width:720px) {
  .sidebar.menu-open .nav { grid-template-columns:1fr; max-height:calc(100dvh - 160px); }
  .nav-group { margin-top:4px; }
  .nav-group .nav-item { min-height:44px; }
  .mobile-shortcuts .mobile-quick-action { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-width:0; min-height:56px; border:0; border-radius:8px; background:#e4f3f0; color:var(--accent-strong); font:inherit; font-size:12px; font-weight:700; }
  .mobile-quick-action span { font-size:22px; line-height:1; }
  .mobile-quick-action:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
  .form-details-grid { grid-template-columns:1fr; }
  .modal input:not([type=checkbox]):not([type=radio]),.modal select,.modal button { min-height:44px; }
  .modal textarea { min-height:88px; }
  #customerCardModal .customer-contact-header { gap:8px; font-size:13px; }
  #customerCardModal .customer-ledger-summary article:first-child strong { font-size:24px; }
  .customer-quick-actions button { flex:1 1 44%; min-height:44px; }
  #entryForm > .modal-actions { bottom:-18px; padding:12px 0 calc(12px + env(safe-area-inset-bottom)); }
}
@media print { .customer-card-tabs,.customer-contact-header,.mobile-quick-action { display:none !important; } }

.customer-card-tabs { position:sticky; top:0; z-index:2; background:var(--surface); padding-top:8px; }

@media(max-width:720px) { #entryForm > .modal-actions button { font-size:13px; padding:10px; min-width:0; } }

.customer-statement-share { display:inline-flex; align-items:center; justify-content:center; gap:6px; color:#087451; }
.customer-statement-share svg { width:20px; height:20px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.8; }
#customersTable .customer-statement-share { width:auto; padding:8px 10px; }
@media(max-width:720px) {
  .mobile-customer-open { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; min-height:44px; padding:0; width:100%; border:0; background:transparent; text-align:left; font:inherit; color:inherit; }
  .mobile-customer-row .customer-statement-share { width:44px; min-height:44px; padding:8px; }
  .mobile-customer-row .customer-statement-share span { display:none; }
  .mobile-customer-open:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:6px; }
}

#pdfShareFileName { overflow-wrap:anywhere; font-weight:600; color:var(--muted); }

/* Shared screen presentation. Document/PDF templates keep their own styles. */
.review-request-notice { margin-bottom: 18px; border-color: #b6d9d1; }
.review-request-notice[hidden] { display: none !important; }
.review-request-notice h2 { font-size: 17px; }
.review-request-notice > p { color: var(--muted); font-size: 13px; line-height: 1.5; }
#reviewRequestNoticeList { max-height: 280px; overflow-y: auto; }
.review-request-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.review-request-row > div { min-width: 0; }
.review-request-row strong, .review-request-row span { display: block; }
.review-request-row div > span { margin-top: 4px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.review-request-action { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.review-request-action small { color: var(--muted); font-size: 11px; }
.review-request-button { color: #076b5e; border-color: #a7cfc2; background: #edf8f3; white-space: nowrap; }
#reviewRequestModal textarea { width: 100%; resize: vertical; line-height: 1.6; }
#reviewRequestModal .modal-subtitle { margin-bottom: 16px; line-height: 1.6; }
@media (max-width: 720px) { .review-request-row { align-items: flex-start; flex-direction: column; gap: 10px; } .review-request-button { min-height: 44px; } }
@media print { .review-request-notice, .review-request-action { display: none !important; } }
@media screen {
  body { background: #f1f5f7; }
  .app-shell, .modal {
    --muted: #576a75;
    --line: #dce5e9;
    --surface-soft: #f3f7f8;
    --shadow: 0 2px 8px #17202606, 0 8px 24px #17202604;
  }
  .sidebar { background: #17282e; }
  .sidebar .brand-mark { border-radius: 12px; background: #07887c; box-shadow: 0 4px 12px #00000018; }
  .sidebar .brand strong { letter-spacing: .03em; }
  .sidebar .brand span { color: #b1c5cd; line-height: 1.4; }
  .sidebar .nav .nav-item { border-radius: 10px; color: #c4d3d9; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
  .sidebar .nav .nav-item > span { border-radius: 6px; color: #b9d1d7; background: #ffffff07; }
  .sidebar .nav .nav-item:hover { background: #ffffff09; color: #fff; }
  .sidebar .nav .nav-item.active { background: #214a46; color: #fff; font-weight: 700; box-shadow: inset 3px 0 #42c6ac; }
  .sidebar .nav .nav-item.active > span { color: #a4eddb; background: #ffffff0c; }
  .sidebar .nav-group-label { color: #9fb7c0; font-size: 10px; letter-spacing: .08em; }
  .app-shell > .topbar { padding: 20px; border: 1px solid #e1e9ed; border-radius: 16px; background: #fff; box-shadow: 0 2px 8px #17202603; }
  .topbar .eyebrow { color: #526c78; font-size: 11px; letter-spacing: .045em; line-height: 1.5; }
  .topbar h1 { font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.035em; line-height: 1.2; }
  .app-shell .section-head h2, .app-shell .panel h2 { font-size: 20px; letter-spacing: -.02em; }
  .app-shell .section-description { line-height: 1.65; font-size: 13px; }
  .app-shell .view { line-height: 1.45; }
  .app-shell .view :is(.metric, .panel, .table-wrap, .order-column) { border-radius: 14px; }
  .app-shell .view .panel { padding: 22px; }
  .app-shell .view .panel > h3 { margin: 0 0 16px; font-size: 17px; letter-spacing: -.015em; }
  .app-shell .view .metric { padding: 20px; box-shadow: 0 2px 8px #17202604; }
  .app-shell .view .metric > span { font-size: 12px; font-weight: 600; }
  .app-shell .view .metric-link { font-size: clamp(21px, 2vw, 28px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .app-shell .view .metric:has(.metric-link:hover) { border-color: #7ebeb4; }
  .app-shell .primary-button, .modal .primary-button { background: #087c70; border-color: #087c70; box-shadow: 0 2px 4px #006c5d14; }
  .app-shell .primary-button:hover, .modal .primary-button:hover { background: #00695e; border-color: #00695e; }
  :is(.app-shell, .modal) :is(.primary-button, .secondary-button, .icon-button, .action-button) { border-radius: 9px; transition: background .15s, border-color .15s, box-shadow .15s; }
  :is(.app-shell, .modal) .secondary-button:hover { background: #f3f8f7; border-color: #92bdb4; }
  :is(.app-shell, .modal) .action-button { min-height: 34px; font-size: 12px; font-weight: 600; }
  :is(.app-shell, .modal) .action-button:hover { background: #edf7f4; border-color: #87bfb2; }
  :is(.app-shell, .modal) .danger-action { color: #a3332d; border-color: #e7cbc7; background: #fff9f8; }
  :is(.app-shell, .modal) .danger-action:hover { color: #8b241f; border-color: #cc8e87; background: #fcecea; }
  .app-shell .list-controls select { min-height: 40px; padding: 8px 12px; border: 1px solid #cddae1; border-radius: 9px; color: #29434f; background: #fff; }
  :is(.app-shell, .sidebar, .modal, .mobile-shortcuts) :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid #167d71; outline-offset: 3px;
  }
  .sidebar :is(button, a):focus-visible { outline-color: #7de2cb; }
  :is(.app-shell, .modal) button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
  .app-shell .screen-filter { border-radius: 9px; background: #f8fafb; border-color: #d8e3e8; }
  .app-shell .screen-filter:focus-within { border-color: #2d9585; box-shadow: 0 0 0 3px #087c7014; }
  .app-shell .screen-filter input { background: transparent; }
  .app-shell .screen-filter .icon-button { border-radius: 0 8px 8px 0; }
  .app-shell .cloud-sync-status { border: 1px solid #e0e8ec; border-radius: 999px; font-size: 11px; background: #f8fafb; }
  .app-shell .cloud-sync-status.synced { background: #edf8f3; color: #256c52; border-color: #d2e9de; }
  .app-shell .user-switcher { border-radius: 9px; }
  .app-shell .screen-tip { background: #f3f8fa; border: 1px solid #dae8ee; border-radius: 12px; box-shadow: none; }
  .app-shell .screen-tip strong { color: #345f73; }
  .app-shell .view .table-wrap { border-color: #dbe5ea; box-shadow: 0 2px 8px #17202604; }
  .app-shell .view .table-wrap table { font-size: 13px; }
  .app-shell .view .table-wrap th { background: #edf3f5; color: #47616e; font-size: 11px; font-weight: 700; padding: 15px 16px; white-space: nowrap; }
  .app-shell .view .table-wrap td { padding: 16px; border-bottom-color: #e9eef1; line-height: 1.5; font-variant-numeric: tabular-nums; }
  .app-shell .view .table-wrap tbody tr:nth-child(even) { background: #fafcfd; }
  .app-shell .view .table-wrap tbody tr:hover,
  .app-shell .view .table-wrap tbody tr:focus-within { background: #eef7f5; }
  .app-shell .view .table-wrap td strong { font-weight: 600; }
  .app-shell .view .table-wrap td small { color: #627682; }
  .app-shell .view .badge { min-height: 26px; border: 1px solid #d6e5f4; background: #edf4fb; color: #245886; font-size: 11px; font-weight: 700; }
  .app-shell .view .badge.waiting { background: #fff6e5; color: #835300; border-color: #f1dfb6; }
  .app-shell .view .badge.done { background: #edf7f0; color: #28643e; border-color: #cfe7d8; }
  .app-shell .view .badge.risk { background: #fcefed; color: #a3332d; border-color: #f0d2cd; }
  .app-shell #dashboardCustomerSearchPanel { border-color: #b6d9d1; box-shadow: 0 2px 8px #087c7005; }
  .app-shell #dashboardCustomerSearchPanel label { color: #1e514a; font-size: 14px; }
  .app-shell #dashboardCustomerSearch { background: #f8fcfb; border-color: #ccded9; border-radius: 10px; }
  .app-shell .dashboard-customer-result { border-radius: 9px; padding: 10px; background: #f5f9f8; border: 1px solid #e4eeea; }
  .app-shell .quick-workflow-entry { margin: 0 0 20px; }
  .app-shell #dailySummary { margin-bottom: 20px; }
  .app-shell .daily-summary-grid { gap: 12px; }
  .app-shell .daily-summary-grid > button { min-width: 0; min-height: 94px; padding: 16px; text-align: left; background: #f6f9fa; border-color: #e1e9ed; }
  .app-shell .daily-summary-grid > button span { display: block; color: #546d79; font-size: 12px; font-weight: 600; line-height: 1.45; }
  .app-shell .daily-summary-grid > button strong { display: block; color: #1f3b45; margin-top: 8px; font-size: clamp(18px, 1.75vw, 26px); letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .app-shell .daily-summary-grid > button:hover { background: #eaf5f1; border-color: #87bfb1; }
  .app-shell #dailyWorkList { margin-bottom: 20px; }
  .app-shell .daily-work-section > summary { padding: 15px 0; font-size: 13px; }
  .app-shell .daily-action-row { padding: 14px 0; font-size: 13px; }
  .app-shell .daily-action-row span { color: #627581; font-size: 12px; }
  .app-shell .work-card { border-radius: 12px; box-shadow: 0 2px 6px #17202605; }
  .app-shell .work-status-chip { border-radius: 6px; }
  .modal .modal-card { border-radius: 16px; box-shadow: 0 24px 72px #17202624; }
  .modal .modal-head { padding-bottom: 16px; border-bottom: 1px solid #e6ecef; }
  .modal .modal-head h2 { font-size: 20px; letter-spacing: -.02em; }
  .modal .field > span { color: #39515d; font-size: 13px; font-weight: 600; }
  .modal .field :is(input, select, textarea), .modal .form-details-grid :is(input, select, textarea),
  #quickWorkflowForm :is(input:not([type=checkbox]), select, textarea) { border-radius: 9px; border: 1px solid #cddae1; background: #fcfdfd; }
  .modal .form-details { background: #f6f9fa; border-color: #e0e8ec; }
  .modal .form-details > summary { font-size: 13px; color: #34515f; }
  .modal::backdrop { background: #10272d80; }
}
@media screen and (min-width: 1041px) {
  body { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; min-height: 0; padding: 24px 14px 18px; }
  .sidebar .brand { margin: 0 8px 24px; flex-shrink: 0; }
  .sidebar .nav { min-height: 0; flex: 1; gap: 4px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #44616b transparent; }
  .sidebar .nav-group { margin-top: 8px; }
  .sidebar .sidebar-footer { flex-shrink: 0; margin-top: 16px; padding: 14px 10px 0; font-size: 12px; }
  .app-shell { padding: 24px 28px; }
  .topbar-actions { gap: 8px; }
}
@media screen and (max-width: 1040px) and (min-width: 721px) {
  .sidebar .nav { display: flex; align-items: flex-start; gap: 12px; }
  .sidebar .nav-group { flex: 0 0 auto; margin-top: 0; }
  .sidebar .nav > .nav-item { flex: 0 0 auto; margin-top: 26px; }
  .sidebar .nav-group-label { padding-top: 0; }
}
@media screen and (max-width: 720px) {
  .app-shell { padding: 14px; }
  .app-shell > .topbar { padding: 16px; gap: 14px; margin-bottom: 16px; }
  .topbar .eyebrow { max-width: none; font-size: 10px; }
  .topbar h1 { font-size: 25px; }
  .app-shell .view .panel { padding: 18px; }
  .app-shell .view .metric { padding: 16px; }
  .app-shell .view .metric-link { font-size: 23px; }
  .app-shell .daily-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-shell .daily-summary-grid > button { padding: 12px; min-height: 88px; }
  .app-shell .daily-summary-grid > button span { font-size: 11px; }
  .app-shell .daily-summary-grid > button strong { font-size: 19px; }
  .app-shell .view .mobile-customer-row { padding: 14px; border-radius: 12px; border-color: #dce6e9; box-shadow: 0 2px 8px #17202604; }
  .app-shell .view .mobile-customer-row:nth-child(even) { background: #f9fcfc; }
  .mobile-shortcuts { border-top-color: #d9e7e5; box-shadow: 0 -4px 18px #1720260a; }
  .mobile-shortcuts .nav-item.active { background: #e8f4ef; color: #096a5c; border-radius: 10px; }
  .sidebar.menu-open .nav { background: #17282e; }
  .app-shell .action-button { min-height: 44px; }
  .modal .modal-card { border-radius: 14px; }
}
@media screen and (prefers-reduced-motion: reduce) {
  :is(.app-shell, .sidebar, .modal) button { transition: none; }
}

@media screen {
  .sidebar .nav { align-content: start; }
  .workspace-controls { display: grid; gap: 8px; margin: 16px 8px 8px; min-width: 180px; }
  .workspace-controls .workspace-choice { color: #dce9e6; font-size: 12px; }
  .workspace-controls select { width: 100%; min-height: 44px; border-radius: 8px; padding: 8px; }
  .workspace-controls #workspaceMore { width: 100%; min-height: 44px; color: #fff; background: #243d41; border-color: #65817b; }
  .weekly-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
  .weekly-facts article { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid #dce8e4; border-radius: 12px; background: #f7fbf9; }
  .weekly-facts span { font-size: 13px; color: #475e58; }
  .weekly-facts strong { font-size: 23px; overflow-wrap: anywhere; }
  .weekly-business-summary > p { color: #596c66; font-size: 12px; line-height: 1.6; }
  .next-work-step { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border-left: 3px solid #187967; padding: 8px 10px; background: #edf7f3; border-radius: 6px; }
  .next-work-step small { color: #43685e; }
  .next-work-step button { white-space: normal; text-align: left; min-height: 44px; font-size: 13px; }
  #dashboard .dashboard-work-row { grid-template-columns: minmax(0,1fr) 100px minmax(130px,220px) 150px; }
  body[data-workspace-mode="simple"] #dashboard > .metrics { display: none; }
  .production-workspace #dashboardCustomerSearchPanel,
  .production-workspace #dashboard > .metrics,
  .production-workspace #dashboardOfferFollowUps,
  .production-workspace #reviewRequestNotice,
  .production-workspace #dailySummary,
  .production-workspace .work-card-details,
  .production-workspace .bulk-work-panel { display: none; }
  .accounting-workspace #dailyWorkList,
  .accounting-workspace #dashboardAlerts,
  .accounting-workspace #dashboard .dashboard-workspace-grid,
  .accounting-workspace #dashboardOfferFollowUps,
  .accounting-workspace #dailySummary { display: none; }
}
@media screen and (max-width:720px) {
  #dashboard .dashboard-work-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  #dashboard .dashboard-work-row .dashboard-work-name { grid-column: 1 / -1; }
  #dashboard .dashboard-work-row select { grid-column: 1 / -1; }
  .workspace-controls { margin: 12px 0; min-width: 0; }
  .weekly-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .weekly-facts strong { font-size: 19px; }
  .weekly-business-summary .panel-header { flex-wrap: wrap; }
  .sidebar-footer { flex-shrink: 0; }
}

/* Sipariş tekrar sipariş etiketi: A4 üzerinde gerçek 90 mm. */
.order-label-preview { overflow: auto; padding: 8px 0; }
.order-label { box-sizing: border-box; width: 99.1mm; height: 93.1mm; padding: 4mm; border: 0; outline: 0.2mm dashed #ccc; outline-offset: -0.2mm; background: white; color: black; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1mm; text-align: center; font: 9pt Arial, sans-serif; break-inside: avoid; }
.order-label img.order-label-brand { width: 44mm; height: 10.212mm; object-fit: contain; }
.order-label h3 { font-size: 12pt; line-height: 1.15; margin: 1mm 0; overflow-wrap: anywhere; }
.order-label-number { font-size: 8pt; overflow-wrap: anywhere; max-width: 100%; }
.order-label img { width: 36mm; height: 36mm; flex-shrink: 0; object-fit: contain; }
.order-label-print-root { display: none; }
@media print {
  @page orderlabels { size: A4 portrait; margin: 0; }
  body.print-order-label { margin: 0 !important; padding: 0 !important; }
  body.print-order-label::before, body.print-order-label > :not(.order-label-print-root) { display: none !important; }
  body.print-order-label > .order-label-print-root { page: orderlabels; display: block !important; width: 210mm; margin: 0; padding: 0; }
}

.label-cart-orders { max-height: 330px; overflow: auto; margin-top: 12px; border: 1px solid #dce4e4; border-radius: 8px; }
.label-cart-choice { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid #e5eaea; cursor: pointer; }
.label-cart-choice input { width: 20px; height: 20px; flex-shrink: 0; }
.label-cart-choice small { display: block; overflow-wrap: anywhere; color: #526165; }
.label-cart-selected { margin: 12px 0; }
.label-cart-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e5eaea; }
.label-cart-row > span { flex: 1; overflow-wrap: anywhere; }
.label-cart-row label { font-size: 12px; width: 90px; }
.label-cart-row input { width: 100%; }
/* Tanex official TW-2006 DOCX: top 498 twips, left 260 + table indent -15;
   grid 5618 / 165 / 5618 twips, three exact 5278-twip rows.
   Nominal label size 99.1 x 93.1 mm; positions follow the supplied template. */
.order-label-sheet { box-sizing: border-box; display: grid; grid-template-columns: 99.1mm 99.1mm; grid-template-rows: repeat(3, 93.1mm); column-gap: 2.910417mm; row-gap: 0; align-content: start; width: 210mm; height: 297mm; padding: 8.784167mm 0 0 4.321528mm; margin: 0 0 8mm; background: white; }
@media (max-width: 600px) { .label-cart-row { flex-wrap: wrap; } .label-cart-row > span { flex-basis: 100%; } }
@media print {
  body.print-order-label > .label-cart-print-root { display: block !important; }
  .order-label-sheet { page: orderlabels; margin: 0; break-after: page; break-inside: avoid; }
  .order-label-sheet:last-child { break-after: auto; }
  .order-label { outline: none; }
}

.label-position-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-width:420px; }
.label-position-grid label { padding:12px; border:1px solid #ccc; border-radius:8px; cursor:pointer; }
.label-position-grid label:has(input:checked) { background:#eee; text-decoration:line-through; }
.order-label-unused { background:repeating-linear-gradient(45deg,#eee,#eee 8px,#ddd 8px,#ddd 10px); }
@media print { .order-label-unused { background:none !important; } }

.sales-trend-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.sales-trend-eyebrow { color:#6678bd; font-size:10px; letter-spacing:2px; font-weight:700; margin:0 0 8px; }
.sales-trend-tabs { display:flex; padding:4px; gap:4px; background:#eef1f8; border-radius:12px; }
.sales-trend-tabs button { border:0; border-radius:9px; padding:9px 16px; background:transparent; color:#46516b; cursor:pointer; font:inherit; }
.sales-trend-tabs button[aria-pressed="true"] { color:#fff; background:#47599e; box-shadow:0 3px 8px #38478d30; }
.sales-trend-metrics { display:flex; align-items:baseline; gap:32px; flex-wrap:wrap; }
.sales-trend-metrics p { display:flex; gap:12px; align-items:baseline; color:#657087; }
.sales-trend-metrics strong { color:#38478d; }
.sales-trend-empty { color:#657087; }
.monthly-sales-track { position:relative; }
.monthly-sales-track i { position:absolute; width:14px; max-width:40%; border-radius:4px 4px 0 0; min-height:0; }
.monthly-sales-track.has-negative::before { content:""; position:absolute; top:50%; width:100%; border-top:1px solid #929bb2; }
.sales-trend-day .monthly-sales-chart { min-width:1550px; gap:6px; }
.sales-trend-week .monthly-sales-chart { min-width:540px; }
.sales-trend-details { min-width:0; margin-top:18px; }
.sales-trend-details th,.sales-trend-details td { text-align:left; }
.report-a4-document .sales-trend-tabs { display:none; }
.report-a4-document .sales-trend-day .monthly-sales-chart,.report-a4-document .sales-trend-week .monthly-sales-chart { min-width:0; }
.report-a4-document .sales-trend-day .monthly-sales-value { display:none; }
.report-a4-document .monthly-sales-panel { break-inside:auto; }
.report-a4-document .monthly-sales-table tr { break-inside:avoid; }
@media (max-width:600px) { .sales-trend-metrics { gap:0; } .sales-trend-heading { align-items:flex-start; } }
@media print { .sales-trend-tabs { display:none !important; } .sales-trend-day .monthly-sales-chart,.sales-trend-week .monthly-sales-chart { min-width:0; } .sales-trend-day .monthly-sales-value { display:none; } .monthly-sales-panel { break-inside:auto; } }

.report-a4-document .sales-trend-day .monthly-sales-column strong { font-size:6px; white-space:nowrap; }
@media print { .sales-trend-day .monthly-sales-column strong { font-size:6px; white-space:nowrap; } }

.dashboard-order-summary { border:1px solid #dfe5ef; border-radius:16px; padding:20px; background:linear-gradient(135deg,#f8faff,#fff); min-width:0; }
.dashboard-order-summary header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.dashboard-order-summary h3 { margin:6px 0 10px; overflow-wrap:anywhere; }
.dashboard-order-summary header small { color:#5464ad; font-weight:700; }
.order-summary-status { background:#e9edf8; color:#38478d; border-radius:20px; padding:6px 12px; font-size:12px; }
.order-summary-details { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:20px 0; }
.order-summary-details dt,.order-summary-money span { font-size:12px; color:#68758c; }
.order-summary-details dd { margin:5px 0 0; font-weight:600; overflow-wrap:anywhere; }
.order-summary-description { white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; background:#f0f3f8; border-radius:8px; }
.order-summary-production h4 { margin:16px 0 10px; }
.order-summary-production ul { display:flex; flex-wrap:wrap; gap:8px; list-style:none; margin:0; padding:0; }
.order-summary-production li { border:1px solid #e0e5ed; padding:8px 12px; border-radius:8px; font-size:12px; }
.order-summary-production .is-done { background:#edf7f1; color:#24654e; border-color:#cce6d7; }
.order-summary-production .is-pending { background:#fff8ee; color:#8b672c; }
.order-summary-money { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; border-top:1px solid #dfe5ef; padding-top:16px; margin-top:20px; }
.order-summary-money strong { display:block; margin-top:6px; font-size:23px; color:#38478d; overflow-wrap:anywhere; }
.order-summary-notice { color:#68758c; font-size:12px; line-height:1.6; }
.dashboard-order-summary .record-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
@media (max-width:600px) { .dashboard-order-summary { padding:14px; } .order-summary-details { grid-template-columns:repeat(2,minmax(0,1fr)); } .order-summary-money strong { font-size:19px; } }

#customerMovementsList .customer-ledger-movements { table-layout:fixed; min-width:0; width:100%; }
#customerMovementsList .customer-ledger-movements th:nth-child(1) { width:11%; }
#customerMovementsList .customer-ledger-movements th:nth-child(2) { width:8%; }
#customerMovementsList .customer-ledger-movements th:nth-child(3) { width:29%; }
#customerMovementsList .customer-ledger-movements th:nth-child(4) { width:10%; }
#customerMovementsList .customer-ledger-movements th:nth-child(5),#customerMovementsList .customer-ledger-movements th:nth-child(6) { width:13%; }
#customerMovementsList .customer-ledger-movements th:nth-child(7) { width:16%; }
#customerMovementsList .customer-ledger-movements th,#customerMovementsList .customer-ledger-movements td { padding:10px 8px; white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
#customerMovementsList .customer-ledger-movements td:nth-child(2),#customerMovementsList .customer-ledger-movements td:nth-child(4) { overflow-wrap:normal; }
.customer-icon-actions { min-width:0; max-width:100%; flex-wrap:wrap; }
.customer-action-icon { flex:0 0 34px; cursor:pointer; }
.customer-action-icon:disabled { opacity:.5; cursor:not-allowed; }
@media (max-width:720px) {
  #customerMovementsList .customer-ledger-movements,#customerMovementsList .customer-ledger-movements tbody { display:block; }
  #customerMovementsList .customer-ledger-movements thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #customerMovementsList .customer-ledger-movements tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid var(--line); margin-bottom:12px; border-radius:8px; }
  #customerMovementsList .customer-ledger-movements td { border:0; }
  #customerMovementsList .customer-ledger-movements td::before { content:attr(data-label); display:block; font-size:11px; color:var(--muted); margin-bottom:5px; font-weight:400; }
  #customerMovementsList .customer-ledger-movements td:nth-child(3),#customerMovementsList .customer-ledger-movements td:last-child { grid-column:1 / -1; }
  #customerMovementsList .customer-ledger-opening { display:flex !important; flex-wrap:wrap; }
  #customerMovementsList .customer-ledger-opening td::before { display:none; }
}

.dashboard-menu-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(108px,1fr)); gap:10px; margin-bottom:22px; }
.dashboard-menu-tile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; min-height:104px; padding:14px 8px; border:1px solid #dce5e8; border-radius:10px; background:#fff; color:#354f5b; font:inherit; font-size:12px; font-weight:600; line-height:1.4; text-align:center; cursor:pointer; }
.dashboard-menu-icon { display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; background:#f1f5f7; color:#4b6878; }
.dashboard-menu-icon svg { width:26px; height:26px; }
.dashboard-menu-tile.is-frequent { border-color:#bedbd1; background:#f6fbf8; color:#205e4f; }
.dashboard-menu-tile.is-frequent .dashboard-menu-icon { background:#e0f1e8; color:#23765d; }
.dashboard-menu-tile:hover { background:#edf7f3; border-color:#76b8a7; }
.dashboard-menu-tile:focus-visible { outline:3px solid #287c6b; outline-offset:2px; }
@media screen and (max-width:720px), print { .dashboard-menu-grid { display:none; } }
.dashboard-quick-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.dashboard-quick-actions button { min-height:52px; border:1px solid #d7e6e3; background:#fff; color:#27675f; border-radius:12px; font:inherit; font-weight:650; cursor:pointer; box-shadow:0 3px 12px #12372e05; }
.dashboard-quick-actions button:hover,.dashboard-quick-actions button:focus-visible { background:#e9f5f1; border-color:#76b8a7; }
.dashboard-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:22px 0 18px; border-bottom:1px solid #dce6eb; padding-bottom:12px; }
.dashboard-tabs button { display:flex; align-items:center; gap:9px; padding:11px 16px; font:inherit; font-size:13px; font-weight:600; border:1px solid #dde6eb; border-radius:10px; background:#fff; color:#657b88; cursor:pointer; }
.dashboard-tabs button[aria-selected="true"] { background:#e7f4ef; color:#196b5a; border-color:#8ac4b3; }
.dashboard-tabs b { padding:2px 7px; background:#dcebe5; border-radius:12px; font-size:12px; }
[data-dashboard-pane] > * { margin-bottom:16px; }
.dashboard-extra-metrics { padding:14px; border:1px solid #e0e7ed; border-radius:12px; }
body[data-active-view="dashboard"] .screen-filter { display:none; }
#customerCardModal .modal-card { background:#fff; border-radius:20px; }
#customerCardModal .customer-card-tabs { gap:26px; border-bottom:1px solid #e2e9ee; padding-bottom:0; }
#customerCardModal .customer-card-tabs button { border:0; border-radius:0; background:transparent; color:#7b8995; padding:12px 0 15px; font-size:13px; }
#customerCardModal .customer-card-tabs button.active { color:#18786c; border-bottom:3px solid #18786c; }
#customerCardModal .customer-ledger-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
#customerCardModal .customer-ledger-summary article { padding:18px; border:1px solid #e1e9ed; border-radius:12px; background:#fafcfd; border-left:1px solid #e1e9ed; }
#customerCardModal .customer-ledger-summary strong { font-size:26px; color:#253c49; font-variant-numeric:tabular-nums; }
#customerCardModal .customer-ledger-summary .customer-current-balance { background:#edf7f4; border-color:#cde4de; }
#customerCardModal .customer-current-balance strong { color:#177765; }
.customer-ledger-period-note { grid-column:1 / -1; font-size:12px; color:#7b8c98; margin:0; }
#customerMovementsList { border:1px solid #e2e9ef; border-radius:12px; }
#customerMovementsList .document-table { margin-top:0; }
#customerMovementsList .customer-ledger-movements th { background:#f5f8fa; border:0; color:#7f919e; font-size:10px; font-weight:650; letter-spacing:.4px; padding:13px 10px; }
#customerMovementsList .customer-ledger-movements td { border:0; border-bottom:1px solid #e7edf2; padding:17px 10px; font-size:12px; line-height:1.6; }
#customerMovementsList .customer-ledger-movements th:nth-child(3) { width:25%; }
#customerMovementsList .customer-ledger-movements th:nth-child(4) { width:12%; }
#customerMovementsList .customer-ledger-movements th:nth-child(7) { width:18%; }
#customerMovementsList .customer-ledger-movements th:nth-child(5),#customerMovementsList .customer-ledger-movements th:nth-child(6),#customerMovementsList .customer-ledger-movements td:nth-child(5),#customerMovementsList .customer-ledger-movements td:nth-child(6) { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
#customerMovementsList .customer-ledger-payment-row td { background:#f8fcfa; font-weight:400; }
.ledger-description-title { display:block; font-weight:600; }
.ledger-order-number { display:inline-block; margin-top:6px; font-size:10px; color:#708397; background:#eef2f7; border:1px solid #e2e8ef; border-radius:5px; padding:1px 6px; }
.ledger-status { display:inline-block; font-size:10px; padding:3px 7px; border-radius:5px; font-weight:600; background:#eef2fa; color:#5b719d; }
.ledger-status.is-complete { background:#e8f5ee; color:#39765e; }
.ledger-status.is-waiting { background:#fff4df; color:#8c6d39; }
.ledger-status.is-cancelled { background:#f9ecec; color:#a66b6b; }
#customerMovementsList .ledger-balance-zero { color:#a0acb7; font-weight:400 !important; }
#customerMovementsList .ledger-balance-due { color:#177765; }
#customerMovementsList .ledger-balance-credit { color:#8062a9; }
.grouped-customer-actions { display:flex; gap:6px; align-items:flex-start; }
.customer-action-group { display:inline-flex; gap:3px; flex-wrap:wrap; }
.customer-action-delete { border-left:1px solid #e3e9ef; padding-left:6px; }
#customerMovementsList .customer-action-icon { width:28px; height:28px; flex-basis:28px; color:#718899; border-color:#e1e8ee; }
#customerMovementsList .customer-action-icon svg { width:15px; height:15px; }
#customerMovementsList .customer-action-icon.danger-action { color:#b87979; }
@media(max-width:720px) {
  .dashboard-quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-tabs button { justify-content:center; padding:10px; font-size:12px; }
  #customerCardModal .customer-ledger-summary { grid-template-columns:1fr; }
  #customerMovementsList .customer-ledger-movements td:nth-child(5),#customerMovementsList .customer-ledger-movements td:nth-child(6) { text-align:left; }
}

.sales-bucket-button { display:block; width:100%; padding:0; margin:0; border:0; border-radius:8px; background:transparent; color:inherit; font:inherit; cursor:pointer; text-align:center; }
.sales-bucket-button:hover { background:#eef2fb; }
.sales-bucket-button:focus-visible { outline:2px solid #5464ad; outline-offset:2px; }
.sales-bucket-button .monthly-sales-track { width:100%; }
.sales-drilldown-total { display:flex; align-items:baseline; gap:20px; color:#687b8c; }
.sales-drilldown-total strong { font-size:26px; color:#38478d; }
.sales-drilldown-table { min-width:0; table-layout:fixed; }
.sales-drilldown-table td,.sales-drilldown-table th { padding:12px; overflow-wrap:anywhere; vertical-align:top; }
.sales-drilldown-table td strong,.sales-drilldown-table td small { display:block; }
.sales-drilldown-table td small { color:#708397; }
.sales-drilldown-table th:last-child,.sales-drilldown-table td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
@media(max-width:600px) { .sales-drilldown-table,.sales-drilldown-table tbody { display:block; } .sales-drilldown-table thead { display:none; } .sales-drilldown-table tr { display:grid; grid-template-columns:1fr 1fr; padding:10px 0; border-bottom:1px solid #e1e8ef; } .sales-drilldown-table td { border:0; } .sales-drilldown-table td:nth-child(2) { grid-column:1 / -1; } .sales-drilldown-table td::before { content:attr(data-label); display:block; color:#708397; font-size:11px; margin-bottom:4px; } }

.loss-warning { border:1px solid #e3bc85; border-left:4px solid #c27c29; background:#fff8e9; color:#815c28; padding:12px 14px; border-radius:8px; line-height:1.6; }
.customer-loss-history { margin:16px 0; padding:16px; border:1px solid #ecd5bd; border-radius:12px; }
.loss-history-row { display:flex; justify-content:space-between; gap:12px; border-top:1px solid #eee1d3; padding:12px 0; flex-wrap:wrap; }
.loss-history-row span,.loss-history-row small { display:block; margin-top:4px; }
.writeoff-choice { display:flex; align-items:center; gap:10px; padding:12px; margin:8px 0; border:1px solid #e1e7eb; border-radius:8px; flex-wrap:wrap; }
.writeoff-choice strong { margin-left:auto; }
#writeOffForm .field { margin:14px 0; }

.risk-summary-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0; }
.risk-summary-grid article { padding:14px;background:#f8f5ef;border-radius:10px;min-width:0; }
.risk-summary-grid span,.risk-summary-grid strong,.risk-summary-grid small { display:block;overflow-wrap:anywhere; }
.risk-summary-grid strong { font-size:1.25rem;margin-top:8px; }
.customer-risk-badge { margin:4px;display:inline-flex;font-size:11px; }
.ready-waiting-list { margin:16px 0; }
@media(max-width:720px) { .risk-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

#unsavedChangesModal .unsaved-changes-card { max-width: 560px; width: min(560px, calc(100vw - 32px)); }
#unsavedChangesModal .modal-actions { flex-wrap: wrap; }
