
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 248, 241, 0.76), rgba(247, 232, 217, 0.42)),
    var(--bg);
  font: 14px/1.45 var(--body-font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  min-height: 38px;
}

button:hover {
  background: var(--accent-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(249, 190, 112, 0.45);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-soft);
}

td {
  color: var(--text);
}

td strong {
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(249, 190, 112, 0.28), transparent 32%),
    linear-gradient(135deg, rgba(255, 248, 241, 0.88), rgba(247, 232, 217, 0.62)),
    var(--bg);
}

.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin: 2px 0 0;
  color: var(--primary);
  font-family: var(--heading-font);
  font-size: 28px;
  line-height: 1.1;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--rose);
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 241, 0.96);
  color: var(--text-primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(220, 144, 61, 0.22);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-item,
.ghost-button {
  width: 100%;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item {
  border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary-dark);
  background: rgba(220, 144, 61, 0.12);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.ghost-button {
  border: 1px solid var(--border-soft);
  text-align: center;
}

.ghost-button:hover {
  background: rgba(220, 144, 61, 0.1);
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto;
  grid-auto-rows: min-content;
  align-content: start;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 241, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--heading-font);
  font-size: 24px;
  line-height: 1.1;
}

.topbar-actions {
  width: min(840px, 64vw);
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
}

.contract-search {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-root {
  min-width: 0;
  padding: 24px;
}

.section {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.section-header h3 {
  margin: 0;
  color: var(--primary);
  font-family: var(--heading-font);
  font-size: 17px;
  line-height: 1.15;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(100, 63, 34, 0.08);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 24px;
  line-height: 1.1;
}

.metric-card small {
  color: var(--muted);
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel:nth-of-type(even),
.metric-card:nth-of-type(even) {
  background: var(--surface-soft);
}

.table-panel {
  min-width: 0;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.toolbar,
.filters {
  display: grid;
  gap: 10px;
}

.toolbar {
  grid-template-columns: 1.4fr repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
}

.report-toolbar {
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: span 2;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.split > * {
  min-width: 0;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.quick-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quick-list li:last-child {
  border-bottom: 0;
}

.quick-list strong {
  display: block;
  min-width: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.quick-list small {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-primary);
  background: var(--warning-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.assinado,
.status-pill.pago,
.status-pill.concluída,
.status-pill.concluido {
  color: #11442d;
  background: var(--success-soft);
}

.status-pill.vencido,
.status-pill.cancelado,
.status-pill.alta {
  color: #7e2d2d;
  background: var(--danger-soft);
}

.status-pill.pendente,
.status-pill.orçamento,
.status-pill.media,
.status-pill.média,
.status-pill.em-revisao,
.status-pill.incompleto,
.status-pill.pendente-de-revisao {
  color: var(--primary-dark);
  background: var(--warning-soft);
}

.muted {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button,
.small-button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--border-soft);
  color: var(--primary-dark);
  background: #fff;
}

.row-actions button:hover,
.small-button:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.danger-button {
  color: #fff;
  background: var(--rose);
}

.danger-button:hover {
  background: #8f3434;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.check-item input {
  width: 16px;
  min-height: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.history-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.history-item strong {
  display: block;
  color: var(--primary-dark);
}

.history-item small {
  color: var(--muted);
}

.import-result {
  display: grid;
  gap: 10px;
}

.analysis-box,
.analysis-result,
.upload-slot {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.analysis-box {
  margin-bottom: 12px;
}

.analysis-box strong,
.upload-slot strong {
  display: block;
  color: var(--primary-dark);
}

.analysis-box small,
.upload-slot small,
.analysis-list small {
  color: var(--muted);
}

.analysis-controls,
.reset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.receipt-analysis-controls {
  grid-template-columns: 1fr;
  align-items: start;
}

.receipt-analysis-controls small,
.receipt-auto-fill-note {
  color: var(--text-muted);
}

.receipt-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 104px;
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.receipt-drop-zone:hover,
.receipt-drop-zone.is-dragging {
  border-color: var(--info);
  background: var(--info-soft);
  box-shadow: inset 0 0 0 1px rgba(56, 111, 121, 0.12);
}

.receipt-drop-zone__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--info);
  background: #fff;
  border: 1px solid var(--line);
}

.receipt-drop-zone__icon svg {
  width: 22px;
  height: 22px;
}

.receipt-drop-zone__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.receipt-drop-zone__copy strong {
  color: var(--text-primary);
}

.receipt-drop-zone__action {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--primary-dark);
  background: #fff;
  font-weight: 650;
  white-space: nowrap;
}

.receipt-analysis-loading {
  min-height: 88px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.receipt-analysis-loading > svg {
  width: 24px;
  height: 24px;
  color: var(--info);
  animation: receipt-analysis-spin 900ms linear infinite;
}

.receipt-analysis-loading > span {
  display: grid;
  gap: 3px;
}

.receipt-analysis-loading small {
  color: var(--text-muted);
}

@keyframes receipt-analysis-spin {
  to {
    transform: rotate(360deg);
  }
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

.analysis-summary .metric-card {
  min-height: 78px;
  padding: 10px;
}

.analysis-summary .metric-card strong {
  font-size: 18px;
}

.analysis-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.analysis-list strong {
  color: var(--text-primary);
}

.analysis-list li:last-child {
  border-bottom: 0;
}

.analysis-result pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.analysis-stack,
.upload-grid {
  display: grid;
  gap: 12px;
}

.upload-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.upload-slot input {
  margin-top: 2px;
}

.danger-panel {
  border-color: rgba(185, 87, 87, 0.32);
  background: #fff9f7;
}

.empty.compact {
  padding: 12px;
}

.path-cell {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.print-area {
  background: var(--panel);
}

@media (max-width: 1180px) {
  .metrics-grid,
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .report-toolbar,
  .form-grid,
  .analysis-summary,
  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    position: static;
    display: grid;
  }

  .topbar-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .view-root {
    padding: 16px;
  }

  .metrics-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .toolbar,
  .report-toolbar,
  .form-grid,
  .analysis-controls,
  .reset-row,
  .analysis-summary,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .actions-row,
  .toast {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .view-root {
    padding: 0;
  }

  .panel,
  .table-panel,
  .metric-card {
    box-shadow: none;
  }
}

/* Review, reconciliation and DRE workflows */
.actions-row.left {
  justify-content: flex-start;
}

.onboarding-panel {
  min-height: 280px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: 32px;
}

.onboarding-panel h3 {
  margin: 0;
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 26px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.action-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 16px;
  color: var(--text-primary);
  text-align: left;
  background: var(--surface);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.action-card:hover {
  color: var(--text-primary);
  background: var(--surface-soft);
}

.action-card span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.action-card strong {
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 28px;
}

.action-card small {
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.action-card.has-items {
  border-color: rgba(143, 63, 59, 0.3);
  background: var(--danger-soft);
}

.quality-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
}

.quality-ok {
  padding: 12px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 8px;
}

.duplicate-warning {
  padding: 12px;
  color: #7e2d2d;
  background: var(--danger-soft);
  border: 1px solid rgba(143, 63, 59, 0.28);
  border-radius: 8px;
}

.duplicate-warning p {
  margin: 4px 0;
}

.receipt-layout {
  grid-template-columns: minmax(330px, 0.85fr) minmax(0, 1.5fr);
}

.receipt-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.receipt-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-card__header,
.receipt-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-card__header strong,
.receipt-card__header small {
  display: block;
}

.receipt-card__header strong {
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 20px;
}

.receipt-card__header small,
.receipt-progress {
  color: var(--text-secondary);
  font-size: 12px;
}

.allocation-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.35fr) auto;
  gap: 8px;
  align-items: end;
}

.allocation-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.allocation-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--success-soft);
  border-radius: 8px;
}

.icon-button {
  width: 30px;
  min-height: 30px;
  padding: 2px;
  color: var(--primary-dark);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.danger-text {
  color: var(--danger) !important;
}

.compact-text {
  margin: 0;
}

.review-center {
  display: grid;
  gap: 14px;
}

.review-field-list {
  display: grid;
  gap: 10px;
}

.review-field {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(220px, 1.2fr) minmax(170px, 0.9fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.review-field.has-conflict {
  border-color: rgba(143, 63, 59, 0.34);
  background: var(--danger-soft);
}

.review-field.is-reviewed {
  box-shadow: inset 4px 0 0 var(--success);
}

.review-field__label {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.candidate-list {
  display: grid;
  gap: 6px;
}

.candidate-button {
  display: grid;
  justify-items: start;
  min-height: 0;
  padding: 8px 10px;
  color: var(--text-primary);
  text-align: left;
  background: #fff;
  border-color: var(--border-soft);
  box-shadow: none;
}

.candidate-button:hover,
.candidate-button.active {
  color: var(--text-primary);
  background: var(--warning-soft);
  border-color: var(--primary);
}

.candidate-button small {
  color: var(--text-muted);
}

.review-evidence {
  grid-column: 2 / -1;
  color: var(--text-secondary);
}

.review-check {
  grid-column: 3;
}

.document-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.document-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.document-preview-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.document-preview--full {
  padding: 0;
  overflow: hidden;
}

.document-preview-panel .document-preview--full iframe,
.document-preview-panel .document-preview--full img {
  height: min(70vh, 680px);
}

.document-preview--unavailable {
  align-items: start;
  justify-items: start;
}

.document-preview iframe,
.document-preview img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  border: 1px solid var(--border-soft);
  background: #fff;
}

.muted-panel {
  background: var(--info-soft);
}

.status-pill.parcial,
.status-pill.confirmado,
.status-pill.coincidente {
  color: #11442d;
  background: var(--success-soft);
}

.status-pill.conflito,
.status-pill.rejeitado {
  color: #7e2d2d;
  background: var(--danger-soft);
}

@media (max-width: 980px) {
  .review-field {
    grid-template-columns: 1fr;
  }

  .review-evidence,
  .review-check {
    grid-column: auto;
  }

  .document-preview-grid,
  .allocation-form {
    grid-template-columns: 1fr;
  }
}

/* Premium operational polish */

body {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(247, 239, 228, 0.96)),
    var(--background);
}

button {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #c9914e, #a96d33);
  box-shadow: 0 8px 18px rgba(141, 86, 36, 0.16);
  font-weight: 750;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

button:hover {
  background: linear-gradient(180deg, #b27a3e, #864d28);
  box-shadow: 0 10px 24px rgba(113, 68, 34, 0.2);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

input,
select,
textarea {
  min-height: 42px;
  border-color: rgba(151, 103, 56, 0.26);
  background: #fffefd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(151, 103, 56, 0.42);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(185, 130, 67, 0.16);
  outline: 0;
}

label {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(248, 239, 226, 0.96)),
    var(--surface-soft);
  box-shadow: inset -1px 0 0 rgba(151, 103, 56, 0.08);
}

.brand {
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(151, 103, 56, 0.16);
}

.brand-mark {
  background: linear-gradient(145deg, #6b3a24, #bd8848);
  box-shadow: 0 14px 28px rgba(105, 58, 36, 0.2);
}

.brand strong {
  font-family: var(--heading-font);
  font-size: 18px;
}

.nav-list {
  gap: 7px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  color: #6f5d4d;
  font-weight: 750;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.nav-item::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(93, 50, 31, 0.28);
}

.nav-item:hover {
  border-color: rgba(151, 103, 56, 0.18);
  background: rgba(255, 255, 255, 0.62);
  transform: translateX(2px);
}

.nav-item.active {
  border-color: rgba(185, 130, 67, 0.3);
  color: var(--primary-dark);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(251, 244, 234, 0.92));
  box-shadow: var(--shadow-soft);
}

.nav-item.active::before {
  background: var(--primary);
}

.sidebar-footer {
  padding: 14px;
  border: 1px solid rgba(151, 103, 56, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.topbar {
  min-height: 78px;
  padding: 18px 28px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 10px 28px rgba(73, 48, 28, 0.06);
}

.topbar h2 {
  font-size: clamp(22px, 2vw, 30px);
}

.topbar-actions {
  align-items: center;
  grid-template-columns: minmax(210px, 0.85fr) minmax(260px, 1.25fr) auto;
}

#newContractBtn {
  min-width: 136px;
}

.view-root {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 28px;
}

.section {
  gap: 20px;
}

.section-header {
  min-height: 42px;
  padding: 0 0 12px;
}

.section-header h3 {
  color: var(--primary-dark);
  font-size: 18px;
}

.section-kicker {
  margin: 0 0 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-layout > .metrics-grid {
  margin-top: -4px;
}

.dashboard-layout > .section-header:not(:first-child) {
  margin-top: 8px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px;
}

.metrics-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

.metric-card,
.panel,
.table-panel {
  border-color: rgba(151, 103, 56, 0.18);
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  min-height: 118px;
  padding: 17px 18px;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.7;
}

.metric-card span {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--text-primary);
  font-size: clamp(22px, 2vw, 30px);
}

.metric-card--success::after,
.metric-card:nth-child(2)::after {
  background: var(--success);
}

.metric-card--danger::after,
.metric-card:nth-child(5)::after {
  background: var(--danger);
}

.metric-card--warning::after,
.metric-card:nth-child(3)::after {
  background: #c89132;
}

.metric-card--review::after {
  background: var(--review);
}

.metric-card--info::after,
.metric-card--money::after {
  background: var(--info);
}

.panel,
.table-panel {
  padding: 18px;
}

.table-panel {
  padding: 0;
}

.table-title {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(151, 103, 56, 0.16);
}

.table-scroll {
  border-radius: 0 0 8px 8px;
}

table {
  background: transparent;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: rgba(151, 103, 56, 0.22);
  color: #735c49;
  background: #f8efe3;
  text-transform: uppercase;
}

td {
  padding: 12px 10px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(251, 244, 234, 0.7);
}

td small {
  display: block;
  margin-top: 4px;
}

.filter-card,
.report-config-panel {
  padding: 16px;
  border: 1px solid rgba(151, 103, 56, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow-soft);
}

.toolbar {
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(128px, 1fr)) auto;
}

.dashboard-filter-toolbar {
  grid-template-columns: repeat(4, minmax(148px, 1fr)) auto auto;
}

.quick-filter-panel .grid {
  gap: 10px;
}

.form-grid {
  gap: 14px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 -2px;
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 16px;
  font-weight: 800;
}

.form-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(151, 103, 56, 0.18);
}

.action-panel {
  border-color: rgba(185, 130, 67, 0.28);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(251, 244, 234, 0.9));
}

.order-import-mode {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.order-import-mode legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-import-mode__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.order-import-option {
  display: block;
  cursor: pointer;
}

.order-import-option > span {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  background: transparent;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.order-import-option strong {
  color: var(--text-primary);
  font-size: 13px;
}

.order-import-option small {
  color: var(--text-muted);
  font-weight: 500;
}

.order-import-option input:checked + span {
  border-color: rgba(164, 92, 56, 0.32);
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 2px 7px rgba(100, 63, 34, 0.08);
}

.order-import-option input:focus-visible + span {
  outline: 3px solid rgba(249, 190, 112, 0.45);
  outline-offset: 1px;
}

.check-item {
  min-height: 44px;
  background: rgba(255, 253, 249, 0.9);
  transition: border-color 140ms ease, background 140ms ease;
}

.check-item:hover {
  border-color: rgba(151, 103, 56, 0.32);
  background: #fff;
}

.history-list {
  position: relative;
  padding-left: 14px;
}

.history-list::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 4px;
  width: 1px;
  background: rgba(151, 103, 56, 0.22);
}

.history-item {
  position: relative;
  padding: 10px 0 10px 12px;
}

.history-item::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 16px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(151, 103, 56, 0.26);
}

.status-pill {
  border: 1px solid rgba(151, 103, 56, 0.12);
  background: #f6ead2;
}

.status-pill.assinado,
.status-pill.pago,
.status-pill.concluÃ­da,
.status-pill.concluido,
.status-pill.confirmado {
  color: #314922;
  background: var(--success-soft);
}

.status-pill.vencido,
.status-pill.cancelado,
.status-pill.alta {
  color: #74302e;
  background: var(--danger-soft);
}

.status-pill.em-revisao,
.status-pill.pendente-de-revisao {
  color: #7a3d20;
  background: var(--review-soft);
}

.row-actions {
  align-items: center;
}

.row-actions button,
.small-button,
.ghost-button {
  color: var(--primary-dark);
  background: rgba(255, 253, 249, 0.72);
  box-shadow: none;
}

.row-actions button:hover,
.small-button:hover,
.ghost-button:hover {
  color: #fff;
}

.danger-button {
  border-color: rgba(143, 63, 59, 0.22);
  background: linear-gradient(180deg, #ad5b4d, #8f3f3b);
}

.danger-panel {
  border-color: rgba(143, 63, 59, 0.3);
  background: linear-gradient(180deg, #fff8f5, #f8e9e3);
}

.empty {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 96px;
  border: 1px dashed rgba(151, 103, 56, 0.22);
  border-radius: 8px;
  background: rgba(251, 244, 234, 0.5);
}

.empty strong {
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 16px;
}

.empty small {
  color: var(--text-muted);
}

td.empty {
  display: table-cell;
  min-height: 0;
  border: 0;
  background: transparent;
}

.analysis-box,
.analysis-result,
.upload-slot {
  padding: 14px;
  background: rgba(255, 253, 249, 0.88);
}

.upload-slot {
  min-height: 118px;
  border-style: dashed;
}

.upload-slot:hover {
  border-color: rgba(185, 130, 67, 0.48);
  background: #fffefd;
}

.analysis-summary {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-steps span {
  min-height: 42px;
  display: grid;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(151, 103, 56, 0.18);
  border-radius: 8px;
  color: var(--primary-dark);
  background: rgba(255, 253, 249, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.toast {
  border-color: rgba(151, 103, 56, 0.2);
  background: #fffdf9;
}

@media (max-width: 1180px) {
  .toolbar,
  .report-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    display: grid;
  }

  .topbar-actions {
    width: 100%;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 132px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .view-root {
    padding: 18px;
  }

  .topbar-actions,
  .toolbar,
  .report-toolbar,
  .flow-steps {
    grid-template-columns: 1fr;
  }
}

/* Scaled operational UI */

html,
body {
  background: var(--background);
}

body {
  color: var(--text-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  background: var(--primary);
  box-shadow: none;
}

button:hover {
  background: #8d5125;
  box-shadow: 0 5px 14px rgba(91, 52, 31, 0.16);
}

input,
select,
textarea {
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9b1a8;
}

label {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: none;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
  border-color: var(--border);
  background: #faf9f7;
  box-shadow: none;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand {
  flex: 1;
  padding: 4px 4px 14px;
  border: 0;
}

.brand-mark {
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(85, 48, 30, 0.16);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  min-width: 42px;
  padding: 0;
  color: var(--primary-dark);
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  font-size: 21px;
}

.mobile-menu-button:hover {
  color: #fff;
}

.nav-item,
.nav-item.active {
  background: transparent;
  box-shadow: none;
}

.nav-item:hover {
  background: #f1efeb;
  border-color: var(--border);
}

.nav-item.active {
  color: var(--primary-dark);
  border-color: #d7c2a7;
  background: #f6efe6;
}

.sidebar-footer {
  border-color: var(--border);
  background: #fff;
}

.topbar {
  min-height: 76px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.topbar h2 {
  font-size: 28px;
}

.topbar-actions {
  grid-template-columns: minmax(340px, 620px) auto;
  justify-content: end;
}

.contract-finder {
  position: relative;
  min-width: 0;
}

.contract-search {
  padding-right: 40px;
}

.contract-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.contract-result {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #ece9e5;
  border-radius: 0;
  color: var(--text-primary);
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.contract-result:hover,
.contract-result:focus-visible {
  color: var(--text-primary);
  background: #f6f2ed;
  box-shadow: none;
  transform: none;
}

.contract-result strong {
  color: var(--primary-dark);
}

.contract-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-result-more,
.contract-result-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 12px;
}

#newContractBtn {
  min-width: 132px;
}

.view-root {
  padding: 24px;
}

.section-header h3,
.form-section-title,
.empty strong {
  font-family: var(--body-font);
}

.section-header h3 {
  font-size: 18px;
}

.panel,
.table-panel,
.metric-card,
.filter-card,
.report-config-panel {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel.panel,
.metric-card.metric-card {
  background: var(--surface);
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
}

.metrics-grid--primary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
  min-width: 0;
  min-height: 108px;
  padding: 16px;
}

.metric-card span {
  color: var(--text-secondary);
  font-size: 11px;
}

.metric-card strong {
  color: var(--text-primary);
  font-size: 23px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.metric-card small {
  color: var(--text-muted);
  font-size: 11px;
}

.metric-card.metric-card--success::after {
  background: var(--success);
}

.metric-card.metric-card--danger::after {
  background: var(--danger);
}

.metric-card.metric-card--warning::after {
  background: #bf852f;
}

.metric-card.metric-card--review::after {
  background: var(--review);
}

.metric-card.metric-card--info::after,
.metric-card.metric-card--money::after {
  background: var(--info);
}

.healthy-summary {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 14px;
  border: 1px solid #d7e2d3;
  border-radius: 8px;
  color: #40583d;
  background: var(--success-soft);
  font-size: 12px;
}

.healthy-summary span {
  overflow: hidden;
  color: #61725d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-overflow {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.metrics-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.metrics-details > summary {
  padding: 12px 14px;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 750;
}

.metrics-details[open] > summary {
  border-bottom: 1px solid var(--border);
}

.metrics-details .metrics-grid {
  padding: 14px;
}

.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.action-card {
  min-height: 108px;
  background: #fff;
  box-shadow: none;
}

.action-card.has-items {
  border-color: #dfb9aa;
  background: #fbf0eb;
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.table-scroll {
  max-height: 720px;
  overflow: auto;
  border-radius: 0;
}

thead th {
  color: var(--text-secondary);
  background: #f4f2ef;
}

tbody tr:hover {
  background: #faf8f5;
}

.client-cell {
  width: 270px;
  max-width: 270px;
}

.client-cell > strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.review-label {
  color: var(--review);
  font-weight: 750;
}

.pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: #fff;
  font-size: 12px;
}

.pagination > div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination button {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
}

.pagination button:hover,
.pagination .page-button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  transform: none;
}

.pagination button:disabled {
  color: #aaa39d;
  background: #f3f1ee;
}

.pagination-ellipsis {
  padding: 0 3px;
}

.path-details {
  margin-top: 6px;
}

.path-details summary,
.technical-details summary {
  color: var(--info);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.path-details code {
  display: block;
  max-width: 420px;
  overflow: hidden;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-details {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.technical-details[open] summary {
  margin-bottom: 10px;
}

.technical-details input[readonly],
input[readonly] {
  color: var(--text-secondary);
  background: #f4f2ef;
}

.dre-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dre-metrics .metric-card strong {
  font-size: 23px;
}

.import-analysis-panel {
  align-self: start;
}

.import-read-empty {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  text-align: center;
}

.import-read-empty strong {
  color: var(--text-primary);
  font-size: 16px;
}

.import-read-empty p {
  max-width: 430px;
  margin: 0;
}

.danger-button,
.danger-button:hover {
  border-color: var(--danger);
  background: var(--danger);
}

.row-actions .danger-button,
.row-actions .danger-button:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.login-screen {
  background: var(--background);
}

@media (max-width: 1180px) {
  .topbar-actions {
    grid-template-columns: minmax(280px, 1fr) auto;
  }

  .metrics-grid--primary,
  .dre-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    display: block;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(250, 249, 247, 0.98);
  }

  .brand-row {
    border: 0;
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 16px;
  }

  .mobile-menu-button {
    display: grid;
    place-items: center;
  }

  .nav-list,
  .sidebar-footer {
    display: none;
  }

  .sidebar.menu-open .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    overflow: visible;
  }

  .sidebar.menu-open .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }

  .sidebar.menu-open .sidebar-footer {
    display: grid;
    margin-top: 4px;
    padding: 8px 10px;
  }

  .topbar {
    min-height: 0;
    padding: 14px 16px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  #newContractBtn {
    width: 100%;
  }

  .contract-search-results {
    position: fixed;
    top: 150px;
    right: 16px;
    left: 16px;
  }

  .view-root {
    padding: 16px;
  }

  .metrics-grid--primary,
  .dre-metrics,
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 100px;
  }

  .metric-card strong,
  .dre-metrics .metric-card strong {
    font-size: 22px;
  }

  .healthy-summary {
    display: grid;
  }

  .healthy-summary span {
    white-space: normal;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination > div {
    justify-content: space-between;
  }

  .pagination .page-button:nth-of-type(n+6) {
    display: none;
  }

  .table-scroll {
    max-height: 620px;
  }

  .table-scroll table {
    min-width: 760px;
  }

  .document-preview-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .receipt-drop-zone {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .receipt-drop-zone__action {
    display: none;
  }

  .metrics-grid--primary,
  .dre-metrics,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .sidebar.menu-open .nav-list {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 92px;
  }
}

/* Wedding workspace information architecture */
.contract-context {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(620px, 1.2fr);
  align-items: center;
  gap: 18px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 249, 247, 0.98);
  box-shadow: 0 5px 14px rgba(45, 40, 36, 0.04);
}

.contract-context__summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
}

.contract-context__summary > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contract-context__summary strong {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-context__summary > div > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-back {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--primary-dark);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
  font-size: 22px;
}

.context-tabs {
  min-width: 0;
  display: flex;
  align-self: end;
  gap: 2px;
}

.context-tab {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text-secondary);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  white-space: nowrap;
}

.context-tab:hover {
  color: var(--primary-dark);
  background: #f3efe9;
  box-shadow: none;
  transform: none;
}

.context-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  background: #fff;
}

.summary-callout {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.summary-callout--success {
  border-left-color: var(--success);
  background: var(--success-soft);
}

.summary-callout--warning {
  border-left-color: #bf852f;
  background: var(--warning-soft);
}

.summary-callout--review {
  border-left-color: var(--review);
  background: var(--review-soft);
}

.summary-callout strong {
  font-size: 16px;
}

.summary-content-grid {
  align-items: start;
}

.summary-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.summary-list > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #ece9e5;
}

.summary-list > div:last-child {
  border-bottom: 0;
}

.summary-list dt {
  color: var(--text-muted);
  font-size: 12px;
}

.summary-list dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 650;
}

.summary-checklist {
  margin-top: 12px;
}

.summary-action-list {
  display: grid;
  gap: 8px;
}

.summary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.summary-action:hover {
  color: var(--text-primary);
  border-color: #cdb38f;
  background: #f8f4ef;
  box-shadow: none;
}

.summary-action strong {
  color: var(--primary-dark);
}

.action-disclosure {
  align-self: start;
  padding: 0;
  overflow: hidden;
}

.action-disclosure > summary,
.import-fields-disclosure > summary,
.admin-danger-zone > summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 800;
}

.action-disclosure[open] > summary,
.import-fields-disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.action-disclosure__form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.finance-layout > .split {
  grid-template-columns: 1fr;
}

.receipt-layout .table-panel {
  order: 1;
}

.receipt-layout .receipt-disclosure {
  order: 2;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.document-requirements {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.document-requirement {
  min-height: 62px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.document-requirement > span {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 850;
}

.document-requirement.complete > span {
  color: #fff;
  background: var(--success);
}

.document-requirement.missing > span {
  color: #fff;
  background: var(--review);
}

.document-requirement small {
  color: var(--text-muted);
}

.import-workflow-form {
  margin: 0;
}

.import-start-grid {
  align-items: start;
}

.import-fields-disclosure {
  padding: 0;
}

.import-fields-disclosure > .form-grid,
.import-fields-disclosure > .actions-row {
  margin: 18px;
}

.inline-filter {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  gap: 8px;
  margin-left: auto;
}

.inline-filter input {
  min-height: 36px;
}

.agenda-grid {
  align-items: start;
}

.agenda-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.agenda-calendar-panel,
.agenda-day-panel {
  min-width: 0;
}

.agenda-calendar-toolbar {
  gap: 18px;
  min-height: 72px;
  padding: 14px 16px 12px;
  border-bottom: 0;
}

.agenda-calendar-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.agenda-calendar-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.agenda-calendar-navigation .icon-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 8px;
  touch-action: manipulation;
}

.agenda-calendar-navigation button svg {
  pointer-events: none;
}

.agenda-calendar-title {
  width: 164px;
  color: var(--text-primary);
  font-size: 14px;
  text-align: center;
}

.agenda-today-button {
  margin-left: 4px;
}

.agenda-calendar {
  border-top: 1px solid var(--border);
}

.agenda-calendar-weekdays,
.agenda-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-calendar-weekdays span {
  min-width: 0;
  padding: 8px 6px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
  text-transform: uppercase;
}

.agenda-calendar-weekdays span:last-child,
.agenda-calendar-day:nth-child(7n) {
  border-right: 0;
}

.agenda-calendar-day {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  gap: 8px;
  padding: 9px;
  color: var(--text-primary);
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.agenda-calendar-day:hover {
  color: var(--text-primary);
  background: var(--info-soft);
  box-shadow: none;
  transform: none;
}

.agenda-calendar-day--outside {
  color: var(--text-muted);
  background: #f7f8f8;
}

.agenda-calendar-day--selected {
  position: relative;
  z-index: 1;
  background: var(--info-soft);
  box-shadow: inset 0 0 0 2px var(--info);
}

.agenda-calendar-day-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.agenda-calendar-day--today .agenda-calendar-day-number {
  color: #fff;
  background: var(--info);
}

.agenda-calendar-count {
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 6px;
  color: var(--info-strong);
  border-radius: 5px;
  background: var(--info-soft);
  font-size: 10px;
  white-space: nowrap;
}

.agenda-calendar-count strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.agenda-calendar-day--selected .agenda-calendar-count {
  background: #fff;
}

.agenda-day-list {
  max-height: 652px;
}

.environment-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  color: #704908;
  border-bottom: 1px solid #d9b255;
  background: #fff4ce;
  font-size: 12px;
}

.environment-banner svg { width: 16px; height: 16px; }
.change-reason-dialog { width: min(480px, calc(100% - 48px)); border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: 0 20px 60px rgb(0 0 0 / 18%); }
.change-reason-dialog::backdrop { background: rgb(24 31 38 / 35%); }
.change-reason-dialog h2 { font-size: 18px; margin: 0 0 18px; }
.change-reason-dialog textarea { min-height: 110px; resize: vertical; }
.change-reason-dialog .actions-row { margin-top: 18px; justify-content: flex-end; }
.audit-center { min-width: 0; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.audit-filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 12px; margin: 16px 0; }
.audit-event { margin-bottom: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.audit-event summary { display: grid; grid-template-columns: 175px minmax(90px, 1fr) minmax(130px, 1fr) 75px 16px; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; font-size: 12px; }
.audit-event summary > svg { width: 16px; height: 16px; transition: transform 120ms ease; }
.audit-event[open] summary > svg { transform: rotate(90deg); }
.audit-event summary::after { content: none; }
.audit-event summary > * { overflow-wrap: anywhere; min-width: 0; }
.audit-event[open] summary { border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.audit-detail { padding: 12px 16px; font-size: 12px; }
.audit-detail p { overflow-wrap: anywhere; }
.audit-detail table { table-layout: fixed; width: 100%; }
.audit-detail th:first-child { width: 22%; }
.audit-detail td { overflow-wrap: anywhere; white-space: pre-wrap; vertical-align: top; }
#auditResult { margin-bottom: 10px; color: var(--text-secondary); font-size: 12px; }
.backup-center { min-width: 0; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.backup-actions { display: flex; gap: 8px; align-items: center; }
.backup-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 14px 0; }
.backup-facts dt { color: var(--text-muted); font-size: 11px; margin-bottom: 4px; }
.backup-facts dd { margin: 0; font-size: 13px; font-weight: 600; }
.backup-locations { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 11px; }
.backup-locations span { color: var(--text-muted); }
.backup-locations code, .backup-restore-result code { overflow-wrap: anywhere; font-size: 11px; }
.backup-notice { padding: 10px 12px; background: #fff4dc; color: #79530a; border-left: 3px solid #c99b42; font-size: 12px; }
.backup-restore-result { display: grid; gap: 4px; margin: 12px 0; padding: 10px 12px; background: #edf5f1; border-left: 3px solid #5d9071; font-size: 12px; }
.backup-history { margin-top: 14px; }
.backup-history td { vertical-align: middle; }
.backup-history td:last-child { text-align: right; }
.backup-result { font-weight: 600; font-size: 12px; }
.backup-result--complete { color: #316b49; }
.backup-result--partial { color: #875b13; }
.backup-result--failed { color: #a33439; }
.backup-missing { font-size: 12px; margin: 10px 0; }

.agenda-list {
  max-height: 620px;
  overflow: auto;
}

@media (max-width: 1180px) {
  .agenda-calendar-layout {
    grid-template-columns: 1fr;
  }

  .agenda-day-list {
    max-height: 360px;
  }
}

@media (max-width: 620px) {
  .agenda-calendar-toolbar,
  .agenda-calendar-navigation {
    align-items: stretch;
  }

  .agenda-calendar-toolbar {
    display: grid;
    padding: 14px;
  }

  .agenda-calendar-navigation {
    width: 100%;
    margin-left: 0;
  }

  .agenda-calendar-title {
    min-width: 0;
    width: auto;
    flex: 1;
    align-self: center;
  }

  .agenda-today-button span,
  .agenda-calendar-count span {
    display: none;
  }

  .agenda-today-button {
    width: 38px;
    padding: 8px;
  }

  .agenda-calendar-day {
    min-height: 68px;
    padding: 5px;
  }

  .agenda-calendar-day-number {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .agenda-calendar-count {
    min-width: 24px;
    justify-content: center;
    padding: 2px 5px;
  }

  .agenda-calendar-count strong {
    font-size: 12px;
  }
}

.agenda-item {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-primary);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.agenda-item:hover {
  color: var(--text-primary);
  background: var(--surface-soft);
  box-shadow: none;
  transform: none;
}

.agenda-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.agenda-item > span:last-child > strong,
.agenda-item > span:last-child > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-date {
  display: grid;
  place-items: center;
  padding: 5px;
  border-radius: 6px;
  color: var(--primary-dark);
  background: #f3ece3;
}

.agenda-date small {
  font-size: 10px;
}

.quick-list-link {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 0;
  color: var(--text-primary);
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.quick-list-link:hover {
  color: var(--primary-dark);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.admin-page {
  max-width: 920px;
}

.admin-danger-zone {
  padding: 0;
}

.admin-danger-zone > p,
.admin-danger-zone > .reset-row {
  margin-right: 18px;
  margin-left: 18px;
}

.admin-danger-zone > .reset-row {
  margin-bottom: 18px;
}

.status-pill.em-aberto,
.status-pill.a-revisar {
  color: #7a3d20;
  background: var(--review-soft);
}

@media (max-width: 1180px) {
  .contract-context {
    position: static;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .context-tabs {
    overflow-x: auto;
  }

  .document-requirements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .contract-context {
    padding: 12px 16px 0;
  }

  .contract-context__summary > div > span {
    white-space: normal;
  }

  .context-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding-bottom: 10px;
    overflow: visible;
  }

  .context-tab {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: normal;
  }

  .context-tab.active {
    border-color: var(--primary);
    background: #f6efe6;
  }

  .summary-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-callout button {
    width: 100%;
  }

  .summary-list > div {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .document-requirements {
    grid-template-columns: 1fr 1fr;
  }

  .inline-filter {
    width: 100%;
    grid-template-columns: 1fr;
    order: 3;
  }

  .table-title:has(.inline-filter) {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .document-requirements {
    grid-template-columns: 1fr;
  }

  .contract-context__summary > div > strong {
    white-space: normal;
  }
}

/* Semantic color system */

input[type="checkbox"] {
  accent-color: var(--success);
}

.workspace,
.topbar,
.view-root,
.view-root > .section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.nav-item {
  --nav-tone: #aaa39c;
}

.nav-item[data-view="dashboard"],
.nav-item[data-view="contracts"] {
  --nav-tone: var(--primary);
}

.nav-item[data-view="review"] {
  --nav-tone: var(--review);
}

.nav-item[data-view="agenda"] {
  --nav-tone: var(--info);
}

.nav-item[data-view="financeOverview"] {
  --nav-tone: var(--success);
}

.nav-item[data-view="reports"] {
  --nav-tone: var(--event);
}

.nav-item[data-view="admin"] {
  --nav-tone: #746e68;
}

.nav-item::before {
  background: var(--nav-tone);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--nav-tone);
}

.contract-result {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-left: 3px solid transparent;
}

.contract-result:hover,
.contract-result:focus-visible {
  border-left-color: var(--info);
  background: var(--info-soft);
}

.contract-result__identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.contract-result__identity > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-result__identity small {
  color: var(--text-muted);
  font-size: 11px;
}

.contract-result__status {
  overflow: visible !important;
}

.status-pill.assinado,
.status-pill.coincidente {
  color: var(--info-strong);
  background: var(--info-soft);
}

.status-pill.pago,
.status-pill.confirmado,
.status-pill.concluido,
.status-pill.concluida {
  color: var(--success-strong);
  background: var(--success-soft);
}

.status-pill.pendente,
.status-pill.parcial,
.status-pill.em-aberto,
.status-pill.a-receber,
.status-pill.orcamento,
.status-pill.media,
.status-pill.média {
  color: var(--warning-strong);
  background: var(--warning-soft);
}

.status-pill.em-revisao,
.status-pill.pendente-de-revisao,
.status-pill.a-revisar,
.status-pill.incompleto {
  color: #7d3f2d;
  background: var(--review-soft);
}

.status-pill.vencido,
.status-pill.cancelado,
.status-pill.rejeitado,
.status-pill.alta {
  color: var(--danger-strong);
  background: var(--danger-soft);
}

.metric-card.metric-card--success {
  background: #f8fbf8;
}

.metric-card.metric-card--warning {
  background: #fdfaf3;
}

.metric-card.metric-card--danger {
  background: #fdf8f8;
}

.metric-card.metric-card--review {
  background: #fdf9f7;
}

.metric-card.metric-card--info {
  background: #f7fbfc;
}

.metric-card.metric-card--money {
  background: #f8fbf6;
}

.metric-card.metric-card--warning::after {
  background: var(--warning);
}

.metric-card.metric-card--money::after {
  background: var(--money);
}

.action-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--warning);
}

.action-card.has-items {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.action-card--info.has-items {
  border-color: var(--info);
  background: var(--info-soft);
}

.action-card--review.has-items {
  border-color: var(--review);
  background: var(--review-soft);
}

.action-card--danger.has-items {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.action-card--success {
  border-color: var(--success);
  background: var(--success-soft);
}

.action-card--info strong {
  color: var(--info-strong);
}

.action-card--review strong {
  color: var(--review);
}

.action-card--danger strong {
  color: var(--danger-strong);
}

.action-card--warning strong {
  color: var(--warning-strong);
}

.quick-panel,
.agenda-panel,
.summary-panel {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--border);
}

.quick-panel--info,
.agenda-panel--delivery,
.summary-panel--event {
  border-top-color: var(--info);
}

.quick-panel--event,
.agenda-panel--event {
  border-top-color: var(--event);
}

.quick-panel--warning,
.agenda-panel--tasks,
.summary-panel--operations {
  border-top-color: var(--warning);
}

.quick-panel--review {
  border-top-color: var(--review);
}

.summary-panel--progress {
  border-top-color: var(--event);
}

.summary-panel--finance {
  border-top-color: var(--success);
}

.quick-panel--info .section-header h3,
.agenda-panel--delivery .section-header h3,
.summary-panel--event .section-header h3 {
  color: var(--info-strong);
}

.quick-panel--event .section-header h3,
.agenda-panel--event .section-header h3,
.summary-panel--progress .section-header h3 {
  color: var(--event);
}

.quick-panel--warning .section-header h3,
.agenda-panel--tasks .section-header h3,
.summary-panel--operations .section-header h3 {
  color: var(--warning-strong);
}

.summary-panel--finance .section-header h3 {
  color: var(--success-strong);
}

.summary-action {
  border-left: 3px solid var(--border);
}

.summary-action--info {
  border-left-color: var(--info);
  background: #f8fbfc;
}

.summary-action--warning {
  border-left-color: var(--warning);
  background: #fdfaf3;
}

.summary-action--success {
  border-left-color: var(--success);
  background: #f8fbf8;
}

.summary-action--money {
  border-left-color: var(--money);
  background: #f8fbf6;
}

.summary-action--info strong {
  color: var(--info-strong);
}

.summary-action--warning strong {
  color: var(--warning-strong);
}

.summary-action--success strong,
.summary-action--money strong {
  color: var(--success-strong);
}

.context-tab {
  --tab-tone: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.context-tab::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--tab-tone);
  opacity: 0.62;
}

.context-tab--info {
  --tab-tone: var(--info);
}

.context-tab--success {
  --tab-tone: var(--success);
}

.context-tab--money {
  --tab-tone: var(--money);
}

.context-tab--warning {
  --tab-tone: var(--warning);
}

.context-tab.active {
  color: var(--tab-tone);
  border-bottom-color: var(--tab-tone);
}

.agenda-item--delivery .agenda-date {
  color: var(--info-strong);
  background: var(--info-soft);
}

.agenda-item--event .agenda-date {
  color: #72451f;
  background: var(--event-soft);
}

.agenda-item--delivery:hover {
  background: #f4fafb;
}

.agenda-item--event:hover {
  background: #fcf8f3;
}

.money-success {
  color: var(--success-strong) !important;
  font-weight: 750;
}

.money-warning {
  color: var(--warning-strong) !important;
  font-weight: 750;
}

.money-danger {
  color: var(--danger-strong) !important;
  font-weight: 800;
}

.date-info {
  color: var(--info-strong);
  font-weight: 700;
}

.date-warning {
  color: var(--warning-strong);
  font-weight: 700;
}

.date-danger {
  color: var(--danger-strong);
  font-weight: 800;
}

.table-row--success > td:first-child,
.financial-row--pago > td:first-child {
  box-shadow: inset 3px 0 var(--success);
}

.table-row--warning > td:first-child,
.financial-row--em-aberto > td:first-child {
  box-shadow: inset 3px 0 var(--warning);
}

.table-row--review > td:first-child,
.financial-row--a-revisar > td:first-child {
  box-shadow: inset 3px 0 var(--review);
}

.table-row--danger > td:first-child,
.financial-row--vencido > td:first-child {
  box-shadow: inset 3px 0 var(--danger);
}

.table-row--danger:hover {
  background: #fdf7f7;
}

.table-row--review:hover {
  background: #fdf8f5;
}

.form-section-title {
  color: var(--primary-dark);
}

.form-section-title::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--primary);
}

.form-section-title--event {
  color: var(--info-strong);
}

.form-section-title--event::before,
.form-section-title--event::after {
  background: var(--info);
}

.form-section-title--finance {
  color: var(--success-strong);
}

.form-section-title--finance::before,
.form-section-title--finance::after {
  background: var(--success);
}

.form-section-title--extra {
  color: var(--text-secondary);
}

.form-section-title--extra::before,
.form-section-title--extra::after {
  background: #aaa39c;
}

.receipt-card {
  border-left: 3px solid var(--border);
}

.receipt-card:has(.status-pill.confirmado) {
  border-left-color: var(--success);
}

.receipt-card:has(.status-pill.em-revisao) {
  border-left-color: var(--review);
}

.receipt-card:has(.status-pill.rejeitado) {
  border-left-color: var(--danger);
}

@media (max-width: 620px) {
  .contract-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .contract-result__status {
    grid-column: 2;
    justify-self: start;
  }
}

/* Professional operational UI */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


html,
body {
  color: var(--text-primary);
  background: var(--background);
  font-family: var(--body-font);
  font-size: 13px;
}

h1,
h2,
h3,
.brand strong,
.metric-card strong,
.action-card strong,
.section-header h3,
.form-section-title,
.empty strong {
  font-family: var(--body-font);
  letter-spacing: 0;
}

h1,
h2,
h3 {
  color: var(--text-primary);
  font-weight: 650;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  font-weight: 600;
}

button svg,
.button-icon,
.section-header h3 svg,
.summary-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 1.8;
}

input,
select,
textarea {
  border-radius: 6px;
}

.login-screen {
  background: var(--background);
}

.login-box {
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 650;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 12px;
  background: #fff;
}

.brand-row {
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--border);
}

.brand {
  padding: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: #fff;
  border-radius: 7px;
  background: var(--primary-dark);
  box-shadow: none;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.brand strong {
  font-size: 14px;
  font-weight: 700;
}

.brand small {
  color: var(--text-muted);
  font-size: 10px;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 40px;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text-secondary);
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
}

.nav-item::before {
  display: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  stroke-width: 1.8;
}

.nav-item:hover {
  color: var(--text-primary);
  background: #f4f5f6;
}

.nav-item.active {
  color: var(--primary-dark);
  border: 0;
  background: #f3eee9;
  box-shadow: inset 2px 0 var(--primary);
}

.nav-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.ghost-button {
  gap: 6px;
}

.topbar {
  min-height: 66px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.97);
}

#viewKicker {
  display: none;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 650;
  white-space: nowrap;
}

.topbar-actions {
  width: min(760px, calc(100% - 210px));
  grid-template-columns: minmax(320px, 600px) auto;
}

.finder-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.contract-search {
  padding-right: 38px;
  padding-left: 38px;
}

#newContractBtn {
  min-width: 142px;
}

.view-root {
  padding: 20px 24px 28px;
}

.section {
  gap: 18px;
}

.dashboard-layout .section-kicker {
  display: none;
}

.section-header h3 {
  font-size: 15px;
  font-weight: 650;
}

.section-header h3:has(svg) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h3 svg {
  color: currentColor;
}

.eyebrow,
.section-kicker,
.metric-card span,
th,
label {
  letter-spacing: 0;
  text-transform: none;
}

.panel,
.table-panel,
.metric-card,
.filter-card,
.report-config-panel {
  border-color: var(--border);
  border-radius: 6px;
  box-shadow: none;
}

.metric-card.metric-card--success,
.metric-card.metric-card--warning,
.metric-card.metric-card--danger,
.metric-card.metric-card--review,
.metric-card.metric-card--info,
.metric-card.metric-card--money {
  background: #fff;
}

.metric-card {
  min-height: 96px;
  gap: 6px;
  padding: 14px 15px;
}

.metric-card span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
}

.metric-card strong {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  font-variant-numeric: tabular-nums;
}

.action-grid {
  gap: 10px;
}

.action-card,
.action-card.has-items,
.action-card--info.has-items,
.action-card--review.has-items,
.action-card--danger.has-items,
.action-card--success {
  --action-tone: var(--warning);
  --action-soft: var(--warning-soft);
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 10px;
  padding: 14px;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.action-card--info {
  --action-tone: var(--info);
  --action-soft: var(--info-soft);
}

.action-card--review {
  --action-tone: var(--review);
  --action-soft: var(--review-soft);
}

.action-card--danger {
  --action-tone: var(--danger);
  --action-soft: var(--danger-soft);
}

.action-card--success {
  --action-tone: var(--success);
  --action-soft: var(--success-soft);
}

.action-card:hover {
  color: var(--text-primary);
  border-color: var(--action-tone);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.action-card__icon {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--action-tone);
  border-radius: 6px;
  background: var(--action-soft);
}

.action-card__icon svg {
  width: 17px;
  height: 17px;
}

.action-card__label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.action-card strong,
.action-card--info strong,
.action-card--review strong,
.action-card--danger strong,
.action-card--warning strong {
  grid-row: 1 / span 2;
  grid-column: 3;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.action-card small {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.healthy-summary {
  border-radius: 6px;
}

.summary-callout {
  min-height: 66px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}

.summary-callout--success,
.summary-callout--warning,
.summary-callout--review {
  background: #fff;
}

.summary-panel {
  border: 0;
  border-top-width: 2px;
  border-top-style: solid;
  border-radius: 0;
  background: transparent;
}

.summary-panel--event {
  border-top-color: var(--info);
}

.summary-panel--progress {
  border-top-color: var(--event);
}

.summary-panel--finance {
  border-top-color: var(--success);
}

.summary-panel--operations {
  border-top-color: var(--warning);
}

.summary-action {
  min-height: 42px;
  border-radius: 5px;
  background: #fff;
}

.summary-action--info,
.summary-action--warning,
.summary-action--success,
.summary-action--money {
  background: #fff;
}

.summary-action > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contract-context {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.context-back {
  color: var(--text-secondary);
}

.context-back svg {
  width: 17px;
  height: 17px;
}

.context-tab {
  gap: 6px;
  color: var(--text-secondary);
}

.context-tab::before {
  display: none;
}

.context-tab svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.context-tab.active svg {
  color: var(--tab-tone);
}

.quick-panel,
.agenda-panel {
  border-top-width: 2px;
}

.quick-list li {
  padding: 9px 0;
}

.agenda-item {
  min-height: 60px;
  padding: 8px 14px;
}

.agenda-date {
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

thead th {
  color: var(--text-secondary);
  background: #f6f7f8;
  font-size: 10px;
  font-weight: 600;
}

th,
td {
  padding: 9px 10px;
}

td,
td strong,
.client-cell > strong {
  font-weight: 500;
}

td strong {
  font-weight: 600;
}

.numeric-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table-row--success > td:first-child,
.financial-row--pago > td:first-child {
  box-shadow: inset 2px 0 var(--success);
}

.table-row--warning > td:first-child,
.financial-row--em-aberto > td:first-child {
  box-shadow: inset 2px 0 var(--warning);
}

.table-row--review > td:first-child,
.financial-row--a-revisar > td:first-child {
  box-shadow: inset 2px 0 var(--review);
}

.table-row--danger > td:first-child,
.financial-row--vencido > td:first-child {
  box-shadow: inset 2px 0 var(--danger);
}

.status-pill {
  padding: 4px 8px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 650;
}

.row-actions {
  white-space: nowrap;
}

.icon-button,
.row-open-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #fff;
}

.icon-button:hover,
.row-open-button:hover {
  color: var(--primary-dark);
  border-color: #c7b09b;
  background: #f8f5f2;
}

.icon-button.danger-text:hover {
  color: var(--danger);
  border-color: #d9acae;
  background: var(--danger-soft);
}

.form-section-title {
  margin-top: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.form-section-title::before {
  display: none;
}

.form-section-title::after,
.form-section-title--event::after,
.form-section-title--finance::after,
.form-section-title--extra::after {
  background: var(--border);
}

.form-section-title--event,
.form-section-title--finance,
.form-section-title--extra {
  color: var(--text-primary);
}

.filter-card,
.quick-filter-panel {
  background: #fff;
}

.contracts-filter-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.contracts-filter-heading,
.contracts-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contracts-filter-heading h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.contracts-filter-heading span {
  color: var(--text-muted);
  font-size: 11px;
}

.contracts-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.contracts-filter-grid label {
  min-width: 0;
}

.contracts-filter-grid--primary .filter-search-field {
  grid-column: span 2;
}

.contracts-filter-advanced {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contracts-filter-advanced > summary {
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 11px 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.contracts-filter-advanced > summary::-webkit-details-marker {
  display: none;
}

.contracts-filter-advanced > summary svg {
  width: 15px;
  height: 15px;
  margin-right: 7px;
}

.contracts-filter-advanced > summary small {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  margin-left: 7px;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 10px;
}

.contracts-filter-advanced[open] {
  padding-bottom: 14px;
}

.contracts-filter-toggles,
.active-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-toggle {
  display: inline-flex;
  min-height: 34px;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 550;
}

.filter-toggle:has(input:checked) {
  color: var(--primary-dark);
  border-color: #cdb49d;
  background: var(--primary-soft);
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  display: grid;
  flex: 0 0 18px;
  place-content: center;
  border: 1.5px solid #aab3b8;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

input[type="checkbox"]::before {
  width: 10px;
  height: 10px;
  content: "";
  background: #fff;
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 38% 62%);
  transform: scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

input[type="checkbox"]:hover {
  border-color: var(--primary);
}

input[type="checkbox"]:checked {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.active-filter-list {
  margin-top: -2px;
}

.active-filter-chip {
  min-height: 30px;
  padding: 5px 8px 5px 10px;
  border: 1px solid #d6c6b8;
  border-radius: 4px;
  color: var(--text-secondary);
  background: #fff;
  font-size: 11px;
  font-weight: 550;
}

.active-filter-chip svg {
  width: 13px;
  height: 13px;
}

.active-filter-chip:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.contracts-table {
  min-width: 1120px;
}

.receipt-card {
  border-radius: 6px;
}

@media (max-width: 1180px) {
  .contracts-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .sidebar {
    padding: 10px 14px;
  }

  .brand-row {
    padding: 0;
    border: 0;
  }

  .topbar {
    padding: 12px 16px;
  }

  .topbar-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .view-root {
    padding: 16px;
  }

  .nav-item {
    justify-content: flex-start;
  }

  .contracts-filter-heading,
  .contracts-filter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contracts-filter-heading .small-button,
  .contracts-filter-footer > button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .order-import-mode__options {
    grid-template-columns: 1fr;
  }

  .contracts-filter-grid {
    grid-template-columns: 1fr;
  }

  .contracts-filter-grid--primary .filter-search-field {
    grid-column: auto;
  }

  .action-card,
  .action-card.has-items,
  .action-card--info.has-items,
  .action-card--review.has-items,
  .action-card--danger.has-items,
  .action-card--success {
    min-height: 84px;
  }

  .context-tab {
    font-size: 11px;
  }
}

/* The wedding keeps the same financial-state marker across every workspace. */
.contract-tone--paid {
  --contract-tone-color: var(--success);
  --contract-tone-border: #739c80;
  --contract-tone-background: #eef6f0;
  --contract-tone-background-hover: #e4f0e7;
}

.contract-tone--open {
  --contract-tone-color: var(--warning);
  --contract-tone-border: #bd9148;
  --contract-tone-background: #fff8e9;
  --contract-tone-background-hover: #faefd8;
}

.contract-tone--overdue {
  --contract-tone-color: var(--danger);
  --contract-tone-border: #bf747a;
  --contract-tone-background: #fbf0f1;
  --contract-tone-background-hover: #f6e3e5;
}

.contract-tone--review {
  --contract-tone-color: var(--review);
  --contract-tone-border: #bd7b62;
  --contract-tone-background: #fbf1ed;
  --contract-tone-background-hover: #f6e5de;
}

.contract-result.contract-tone,
.quick-list-link.contract-tone,
.agenda-item.contract-tone {
  background: var(--contract-tone-background);
  box-shadow: inset 0 0 0 1px var(--contract-tone-border);
}

.contract-result.contract-tone:hover,
.contract-result.contract-tone:focus-visible,
.quick-list-link.contract-tone:hover,
.agenda-item.contract-tone:hover {
  background: var(--contract-tone-background-hover);
}

.quick-list-link.contract-tone {
  padding: 7px 10px;
  border-radius: 5px;
}

.contract-context.contract-tone {
  background: var(--contract-tone-background);
  box-shadow: inset 0 0 0 1px var(--contract-tone-border);
}

tr.contract-tone > td {
  border-top: 1px solid var(--contract-tone-border);
  border-bottom: 1px solid var(--contract-tone-border);
  background: var(--contract-tone-background);
}

tr.contract-tone:hover > td {
  background: var(--contract-tone-background-hover);
}

tr.contract-tone > td:first-child {
  border-left: 1px solid var(--contract-tone-border);
  box-shadow: none;
}

tr.contract-tone > td:last-child {
  border-right: 1px solid var(--contract-tone-border);
}

/* Desktop density and hierarchy refinement. Mobile remains unchanged. */
@media (min-width: 861px) {
  html,
  body {
    line-height: 1.4;
  }

  .topbar {
    min-height: 60px;
    padding: 9px 24px;
  }

  .topbar h2 {
    font-size: 21px;
  }

  .topbar-actions {
    width: min(760px, calc(100% - 210px));
  }

  .view-root {
    padding: 16px 24px 24px;
  }

  .section,
  .dashboard-layout {
    gap: 14px;
  }

  .section-header {
    min-height: 28px;
    padding-bottom: 6px;
  }

  .section-header h3 {
    font-size: 14px;
  }

  input:not([type="checkbox"]),
  select {
    min-height: 34px;
    padding: 6px 9px;
  }

  input[type="file"] {
    min-height: 34px;
    padding: 3px 4px;
    color: var(--text-muted);
    font-size: 11px;
  }

  input[type="file"]::file-selector-button {
    min-height: 26px;
    margin-right: 8px;
    padding: 4px 9px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font: 600 11px/1 var(--body-font);
  }

  input[type="file"]::file-selector-button:hover {
    color: var(--primary-dark);
    border-color: #c7b09b;
    background: #f8f5f2;
  }

  #contractSearchInput {
    padding-right: 38px;
    padding-left: 38px;
  }

  button {
    min-height: 36px;
    padding: 8px 12px;
  }

  .icon-button,
  .row-open-button,
  .context-back {
    min-height: 32px;
    padding: 0;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline-width: 2px;
  }

  #dashboardFiltersForm {
    grid-template-columns: repeat(2, minmax(170px, 220px)) auto auto;
    justify-content: start;
    gap: 8px;
    padding: 10px 12px;
  }

  #dashboardFiltersForm label {
    gap: 3px;
    font-size: 11px;
  }

  #dashboardFiltersForm button {
    min-width: 104px;
    min-height: 34px;
  }

  .action-grid {
    gap: 8px;
  }

  .action-card,
  .action-card.has-items,
  .action-card--info.has-items,
  .action-card--review.has-items,
  .action-card--danger.has-items,
  .action-card--success {
    min-height: 76px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 3px 9px;
    padding: 10px 12px;
  }

  .action-card__icon {
    width: 30px;
    height: 30px;
  }

  .action-card strong,
  .action-card--info strong,
  .action-card--review strong,
  .action-card--danger strong,
  .action-card--warning strong {
    font-size: 21px;
  }

  .healthy-summary {
    min-height: 38px;
    padding: 8px 12px;
  }

  .metrics-grid,
  .metrics-grid--primary {
    gap: 10px;
  }

  .metric-card,
  .metric-card.metric-card {
    min-height: 78px;
    gap: 3px;
    padding: 10px 12px;
  }

  .metric-card strong {
    font-size: 20px;
  }

  .metric-card small {
    font-size: 10px;
  }

  .metrics-details > summary {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 12px;
  }

  .metrics-details .metrics-grid {
    padding: 10px;
  }

  .quick-panel {
    padding: 12px 14px 14px;
  }

  .quick-list {
    gap: 6px;
  }

  .quick-list li,
  .quick-list li:last-child {
    padding: 0;
    border-bottom: 0;
  }

  .quick-list-link.contract-tone {
    min-height: 48px;
    padding: 7px 10px;
  }

  .upload-slot {
    min-height: 108px;
    padding: 12px;
    border-color: #d8c7b7;
    background: #fff;
  }

  .list-overflow {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }

  .contracts-filter-card {
    gap: 10px;
    padding: 12px;
  }

  .contracts-filter-heading,
  .contracts-filter-footer {
    gap: 12px;
  }

  .contracts-filter-heading h3 {
    font-size: 14px;
  }

  .contracts-filter-heading .small-button {
    min-height: 30px;
    padding: 5px 9px;
  }

  .contracts-filter-grid {
    gap: 8px 10px;
  }

  .contracts-filter-grid label {
    gap: 3px;
    font-size: 11px;
  }

  .contracts-filter-advanced > summary {
    min-height: 32px;
    padding: 7px 0;
    font-size: 11px;
  }

  .contracts-filter-advanced[open] {
    padding-bottom: 10px;
  }

  .contracts-filter-toggles,
  .active-filter-list {
    gap: 6px;
  }

  .filter-toggle {
    min-height: 30px;
    gap: 6px;
    padding: 5px 8px;
  }

  .filter-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-basis: 16px;
  }

  .contracts-filter-footer > button {
    min-height: 34px;
    padding: 7px 12px;
  }

  .table-title {
    min-height: 42px;
    padding: 10px 14px 8px;
  }

  .result-count {
    font-size: 11px;
  }

  thead th {
    padding: 7px 9px;
    font-size: 10px;
  }

  td {
    padding: 8px 9px;
    line-height: 1.35;
  }

  td small {
    margin-top: 2px;
  }

  .status-pill {
    padding: 3px 7px;
  }

  .table-panel:has(.contracts-table) .table-scroll {
    max-height: 560px;
  }

  .table-panel table:has(tbody tr.contract-tone) tbody tr,
  .table-panel table:has(tbody tr.contract-tone) tbody td {
    height: 72px;
  }

  .table-panel table:has(tbody tr.contract-tone) tbody td {
    padding-top: 8px;
    padding-bottom: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  .table-panel table:has(tbody tr.contract-tone) tbody td:first-child,
  .table-panel table:has(tbody tr.contract-tone) .table-cell-clamp--2 {
    white-space: normal;
  }

  .table-panel table:has(tbody tr.contract-tone) tbody td:first-child > strong,
  .table-panel table:has(tbody tr.contract-tone) .table-cell-clamp--2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .table-panel table:has(tbody tr.contract-tone) tbody td:first-child > small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .contracts-table {
    min-width: 960px;
    table-layout: fixed;
  }

  .contracts-table th:nth-child(1) { width: 20%; }
  .contracts-table th:nth-child(2),
  .contracts-table th:nth-child(3) { width: 9%; }
  .contracts-table th:nth-child(4) { width: 17%; }
  .contracts-table th:nth-child(5) { width: 12%; }
  .contracts-table th:nth-child(6) { width: 8%; }
  .contracts-table th:nth-child(7) { width: 12%; }
  .contracts-table th:nth-child(8) { width: 8%; }
  .contracts-table th:nth-child(9) { width: 5%; }

  .contracts-table td:nth-child(1),
  .contracts-table td:nth-child(4) {
    overflow-wrap: anywhere;
  }

  .contracts-table td:nth-child(4) {
    font-size: 12px;
    line-height: 1.3;
  }

  .finance-overview-table {
    min-width: 900px;
    table-layout: fixed;
  }

  .finance-overview-table th:nth-child(1) { width: 41%; }
  .finance-overview-table th:nth-child(2) { width: 12%; }
  .finance-overview-table th:nth-child(3) { width: 11%; }
  .finance-overview-table th:nth-child(4) { width: 10%; }
  .finance-overview-table th:nth-child(5) { width: 12%; }
  .finance-overview-table th:nth-child(6) { width: 8%; }
  .finance-overview-table th:nth-child(7) { width: 6%; }

  .table-panel td.row-actions:has(> .row-open-button:only-child) {
    display: table-cell;
    padding-right: 8px;
    padding-left: 8px;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    vertical-align: middle;
  }

  .table-panel tr.contract-tone > td.row-actions:has(> .row-open-button:only-child) {
    background: var(--contract-tone-background);
  }

  .table-panel tr.contract-tone:hover > td.row-actions:has(> .row-open-button:only-child) {
    background: var(--contract-tone-background-hover);
  }

  .table-panel tr.contract-tone .row-actions > .row-open-button:only-child {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    color: var(--text-secondary);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-panel tr.contract-tone .row-actions > .row-open-button:only-child:hover,
  .table-panel tr.contract-tone .row-actions > .row-open-button:only-child:focus-visible {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px var(--border);
  }

  .agenda-calendar-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.7fr);
    gap: 14px;
  }

  .agenda-calendar-toolbar {
    min-height: 58px;
    padding: 9px 12px 8px;
  }

  .agenda-calendar-navigation {
    gap: 6px;
  }

  .agenda-calendar-navigation .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 6px;
  }

  .agenda-calendar-title {
    width: 150px;
    font-size: 13px;
  }

  .agenda-calendar-weekdays span {
    padding: 6px;
  }

  .agenda-calendar-day {
    min-height: 74px;
    gap: 5px;
    padding: 7px;
  }

  .agenda-calendar-day-number {
    width: 24px;
    height: 24px;
  }

  .agenda-calendar-count {
    padding: 3px 5px;
  }

  .agenda-calendar-count strong {
    font-size: 12px;
  }

  .agenda-day-list {
    max-height: 530px;
  }

  .agenda-item {
    height: 72px;
    min-height: 72px;
    padding: 8px 10px;
    border-radius: 6px;
  }

  .agenda-panel .agenda-list {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 6px 8px 8px;
    background: #f6f7f8;
  }

  .agenda-panel .agenda-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .agenda-panel .agenda-date {
    width: 54px;
    height: 48px;
  }

  .agenda-panel .agenda-item > span:last-child > strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.25;
  }

  .agenda-panel .agenda-item > span:last-child > small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .contract-context {
    gap: 14px;
    padding: 8px 24px 0;
  }

  .contract-context__summary {
    gap: 8px;
    padding-bottom: 8px;
  }

  .context-back {
    width: 30px;
    min-width: 30px;
  }

  .context-tab {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .summary-callout {
    min-height: 56px;
    padding: 10px 14px;
  }

  .summary-callout strong {
    font-size: 14px;
  }

  .summary-callout button {
    min-height: 34px;
  }

  .summary-content-grid {
    gap: 14px;
  }

  .summary-panel .section-header {
    min-height: 40px;
  }

  .summary-list > div {
    padding: 7px 0;
  }

  .summary-action {
    min-height: 38px;
  }
}
.account-dialog {
  width: min(520px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  box-shadow: 0 16px 48px #18232d29;
}
.account-dialog::backdrop { background: #1d283e66; }
.account-dialog form { display: grid; gap: 16px; }
.account-dialog h2 { font-size: 20px; margin: 0 0 4px; }
.account-dialog .reset-password-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid #dce1e6; }
.users-center { padding: 8px 0 24px; border-bottom: 1px solid #dce1e6; }
.users-table td { height: 64px; vertical-align: middle; }
.users-table td small { display: block; margin-top: 4px; color: #626e79; }
.contracts-table--operations th:nth-child(n), .contracts-table--operations td:nth-child(n) { width: auto; }
.contracts-table--operations th:first-child { width: 30%; }
.contracts-table--operations th:last-child { width: 56px; }
#operationalDetailForm fieldset { border: 0; padding: 16px 0; margin: 0; }
.operation-dialog { width: min(760px, calc(100vw - 64px)); }
.operation-dialog--wide { width: min(1080px, calc(100vw - 64px)); }
.operation-dialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operation-dialog input, .operation-dialog select { min-width: 0; width: 100%; }
.operation-dialog .checkbox-line { display: flex; align-items: center; gap: 10px; }
.operation-dialog .checkbox-line input { width: 18px; height: 18px; }
.order-ledger { padding-bottom: 20px; border-bottom: 1px solid #dce1e6; }
.order-ledger__list { display: grid; gap: 10px; }
.order-entry { border: 1px solid #c7d5dc; border-radius: 8px; background: #fff; padding: 14px 18px; }
.order-entry--historical { background: #f6f7f8; color: #626e79; }
.order-entry__heading { display: grid; grid-template-columns: minmax(180px, 1fr) 110px 140px 36px; align-items: center; gap: 16px; min-height: 48px; }
.order-entry small, .fulfillment-entry small { display: block; color: #626e79; font-size: 12px; margin-top: 5px; }
.order-entry small { overflow-wrap: anywhere; }
.order-entry summary { margin-top: 12px; cursor: pointer; }
.order-review { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8a6114; margin: 8px 0; }
.order-review svg { width: 16px; height: 16px; flex-shrink: 0; }
.order-history-table td { padding: 10px; border-bottom: 1px solid #e2e7eb; }
.manual-order-labels, .manual-order-line { display: grid; grid-template-columns: minmax(200px, 1fr) 130px 70px 105px 140px 40px; gap: 10px; align-items: center; margin-bottom: 10px; }
.manual-order-labels { font-size: 12px; color: #626e79; }
@media (max-width: 900px) { .manual-order-labels { display: none; } .manual-order-line { grid-template-columns: minmax(140px, 1fr) minmax(115px, 1fr) 65px 95px 110px 40px; } }
@media (max-width: 650px) { .manual-order-line { grid-template-columns: 1fr 1fr 42px; } .manual-order-line [name="line_description"] { grid-column: 1 / -1; } .manual-order-line [name="line_price"] { grid-column: 1 / 3; } }
.allocation-editor { overflow: auto; padding-top: 12px; border-top: 1px solid #dce1e6; }
.allocation-editor td { padding: 8px; border-bottom: 1px solid #e2e7eb; }
.allocation-editor input { min-width: 90px; max-width: 140px; }
.fulfillment-list { display: grid; gap: 12px; }
.fulfillment-entry { display: grid; grid-template-columns: 160px minmax(200px, 1fr) 150px 160px 36px; gap: 20px; align-items: center; min-height: 110px; border: 1px solid #b8cbd0; border-radius: 8px; background: #f5fafb; padding: 16px 20px; }
.fulfillment-entry--concluido { background: #f0f8f2; border-color: #82ad8d; }
.fulfillment-entry--cancelado { background: #f6f7f8; border-color: #cdd2d8; }
.fulfillment-location { min-width: 0; }
.fulfillment-location small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.fulfillment-location strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fulfillment-state { font-size: 12px; font-weight: 600; }
.unallocated-items { border-top: 1px solid #dce1e6; padding: 18px 0; }
.unallocated-items ul { list-style: none; padding: 0; }
.unallocated-items li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #e2e7eb; }
.contract-tone--operational {
  --contract-tone-background: #f7fafb;
  --contract-tone-background-hover: #edf5f7;
  --contract-tone-border: #b8cbd0;
  --contract-tone-color: #32636c;
}
.contracts-table--operations tbody tr { height: 82px; }
.contracts-table--operations .client-cell strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-section { padding: 0 18px 18px; }
.catalog-tabs { display: flex; gap: 24px; border-bottom: 1px solid #dce1e6; margin-bottom: 18px; }
.catalog-tabs button { min-height: 48px; padding: 12px 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #626e79; box-shadow: none; }
.catalog-tabs button.active { color: #246678; border-bottom-color: #246678; }
.catalog-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 180px auto; gap: 16px; align-items: end; margin-bottom: 18px; }
.catalog-toolbar label { display: grid; gap: 7px; }
.catalog-toolbar input, .catalog-toolbar select { width: 100%; }
.catalog-table { table-layout: fixed; width: 100%; min-width: 700px; }
.catalog-table th, .catalog-table td { padding: 14px 16px; vertical-align: middle; }
.catalog-table td { height: 94px; border-bottom: 1px solid #e2e7eb; overflow-wrap: anywhere; }
.catalog-table th:first-child { width: 30%; }
.catalog-table th:nth-child(2) { width: 24%; }
.catalog-table th:nth-child(3) { width: 16%; }
.catalog-table th:last-child { width: 92px; }
.catalog-table th { overflow-wrap: normal; }
.catalog-table td strong, .catalog-table td small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-table small { font-size: 12px; color: #626e79; margin-top: 5px; }
.catalog-table .catalog-actions { white-space: nowrap; }
.catalog-actions button + button { margin-left: 6px; }
.catalog-state { display: inline-block; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; }
.catalog-state--review { background: #fff3db; color: #805610; }
.catalog-state--confirmed { background: #e7f4eb; color: #336b48; }
.catalog-table .catalog-warning, .fulfillment-entry .catalog-warning, .catalog-warning { color: #95601f; }
.material-table th:last-child { width: 200px; }
.material-table td { height: 52px; }
.mold-properties { padding: 14px 0; border-top: 1px solid #dce1e6; border-bottom: 1px solid #dce1e6; }
.venue-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 16px; }
.venue-picker p { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.operation-filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #d9e0e4; border-radius: 8px; background: #fff; }
.operation-filter-bar > label { display: grid; flex: 1 1 130px; gap: 6px; font-size: 12px; color: #626e79; }
.operation-filter-bar input, .operation-filter-bar select { width: 100%; }
.operation-periods { display: flex; flex: 2 1 450px; gap: 4px; padding: 3px; border: 1px solid #d9e0e4; border-radius: 7px; background: #f4f6f7; }
.operation-periods button { min-height: 36px; flex: 1; padding: 6px 10px; border: 0; background: transparent; color: #52616b; box-shadow: none; }
.operation-periods button.active { background: #fff; color: #225f70; box-shadow: 0 1px 3px #1d283e1f; }
.operation-filter-bar .operation-pending { display: flex; flex: 0 0 auto; align-items: center; min-height: 42px; white-space: nowrap; color: #394650; }
.operation-pending input { width: 18px; }

.production-center { padding: 0 18px 24px; }
.production-filter-bar { display: grid; grid-template-columns: minmax(280px, 1fr) 170px 170px auto; gap: 14px; align-items: end; padding: 16px; margin-bottom: 16px; border: 1px solid #d9e0e4; border-radius: 8px; background: #fff; }
.production-periods { display: flex; gap: 4px; padding: 3px; border: 1px solid #d9e0e4; border-radius: 7px; background: #f4f6f7; }
.production-periods button { flex: 1; min-height: 36px; padding: 6px 12px; color: #52616b; background: transparent; box-shadow: none; }
.production-periods button.active { color: #225f70; background: #fff; box-shadow: 0 1px 3px #1d283e1f; }
.production-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.production-metric { position: relative; min-height: 108px; padding: 17px 18px; overflow: hidden; border: 1px solid #dce1e6; border-radius: 8px; background: #fff; }
.production-metric::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: #7397a1; }
.production-metric span, .production-metric small { display: block; color: #68747d; font-size: 12px; }
.production-metric strong { display: block; margin: 5px 0 2px; color: #263640; font-size: 25px; line-height: 1.1; }
.production-metric--products::before { background: #7773a7; }
.production-metric--weddings::before { background: #b47b49; }
.production-metric--ready::before { background: #4d8a61; }
.production-metric--blocked::before { background: #b56a52; }
.production-release { display: grid; grid-template-columns: minmax(310px, 1fr) minmax(260px, .8fr) auto; gap: 24px; align-items: center; min-height: 82px; padding: 14px 16px; margin-bottom: 8px; border: 1px solid #cfd8dc; border-radius: 8px; background: #f8fafb; }
.production-release--current { border-color: #8eb59a; background: #f1f8f3; }
.production-release--changed { border-color: #d2a061; background: #fff7e9; }
.production-release__identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.production-release__identity > svg { width: 22px; height: 22px; flex: 0 0 auto; color: #376b59; }
.production-release--changed .production-release__identity > svg { color: #9a601d; }
.production-release__identity strong, .production-release__identity small { display: block; }
.production-release__identity small { margin-top: 3px; color: #68747d; }
.production-release__progress { display: grid; grid-template-columns: auto minmax(80px, 1fr); gap: 5px 10px; align-items: center; color: #52616b; font-size: 12px; }
.production-progress { width: 100%; height: 6px; overflow: hidden; border-radius: 3px; background: #e2e7e9; }
.production-progress span { display: block; height: 100%; border-radius: inherit; background: #3d7a63; }
.production-progress--separated span { background: #bd7b38; }
.production-tabs { margin-top: 8px; }
.production-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.production-section { min-width: 0; overflow: hidden; border: 1px solid #dce1e6; border-radius: 8px; background: #fff; }
.production-section > .section-header { min-height: 67px; padding: 12px 16px; margin: 0; border-bottom: 1px solid #e2e7eb; }
.production-section > .section-header .section-kicker { margin: 0 0 2px; }
.production-section > .section-header > span { color: #74818a; font-size: 12px; }
.production-table { min-width: 700px; table-layout: fixed; }
.production-table th, .production-table td { height: 70px; padding: 10px 14px; vertical-align: middle; }
.production-table th { height: 42px; }
.production-table td strong, .production-table td small { display: block; }
.production-table td small { margin-top: 4px; color: #68747d; }
.production-table th:first-child { width: 31%; }
.production-table th:last-child { width: 110px; }
.production-table-scroll { max-height: 430px; overflow: auto; }
.production-wedding-table th:first-child { width: 34%; }
.production-wedding-table th:last-child { width: 54px; }
.production-center--forminha .production-wedding-table th:last-child { width: 120px; }
.production-center--forminha .production-wedding-table td:last-child { white-space: nowrap; }
.production-center--forminha .production-wedding-table td:last-child .icon-button + .icon-button { margin-left: 6px; }
.production-blockers { margin-top: 16px; overflow: hidden; border: 1px solid #e0b67d; border-radius: 8px; background: #fffaf1; }
.production-blockers summary { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 11px 16px; color: #805610; font-weight: 700; cursor: pointer; list-style: none; }
.production-blockers summary svg { width: 18px; height: 18px; }
.production-blockers summary svg:last-child { margin-left: auto; transition: transform .18s ease; }
.production-blockers[open] summary svg:last-child { transform: rotate(180deg); }
.production-blocker-scroll { max-height: 360px; overflow: auto; border-top: 1px solid #ecd2ad; }
.production-blocker-scroll td { height: 68px; padding: 10px 14px; vertical-align: middle; }
.production-blocker-scroll td strong, .production-blocker-scroll td small { display: block; }
.production-tracking { margin-top: 16px; }
.production-tracking-scroll { max-height: 520px; overflow: auto; }
.production-tracking .production-table th:first-child { width: 32%; }
.production-tracking .production-table th:last-child { width: 58px; }
.production-tracking .production-progress { margin-top: 6px; }
.production-state { display: inline-block; padding: 5px 9px; border-radius: 6px; color: #6a4f22; background: #f7ecd7; font-size: 12px; font-weight: 700; }
.production-state--em_producao { color: #285d6b; background: #e5f1f4; }
.production-state--produzido { color: #346949; background: #e7f4eb; }
.production-state--separado { color: #805610; background: #fff1d8; }
.inline-alert { margin: 12px 16px 0; padding: 10px 12px; border-radius: 6px; font-size: 12px; }
.inline-alert--warning { color: #805610; background: #fff1d8; }
.production-tracking--stale tbody { opacity: .72; }

.dre-reconciliation {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(620px, 1.7fr);
  gap: 16px 28px;
  align-items: center;
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid #d5dde1;
  border-left: 4px solid #9a6a39;
  border-radius: 8px;
  background: #fff;
}

/* Review center */
.review-page {
  padding: 0 18px 24px;
}

.review-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.review-filter-bar {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) repeat(3, minmax(155px, .72fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #d8dee2;
  border-radius: 8px;
  background: #fff;
}

.review-filter-bar .small-button {
  min-height: 38px;
}

.review-table-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 0 2px 10px;
}

.review-table-heading h3 {
  margin: 0;
  font-size: 16px;
}

.review-table-heading span {
  color: var(--text-on-secondary);
  font-size: 11px;
}

.review-issues {
  margin-top: 6px;
  color: var(--text-on-secondary);
  font-size: 13px;
}

.review-issues summary {
  width: fit-content;
  padding: 6px 2px;
  color: var(--success-strong);
  cursor: pointer;
  font-weight: 600;
}

.review-issues ul {
  margin: 4px 0;
  padding-inline-start: 18px;
  white-space: normal;
}

.review-table-scroll {
  max-height: calc(100vh - 350px);
  min-height: 320px;
  overflow: auto;
  border: 1px solid #d8dee2;
  border-radius: 8px;
  background: #fff;
}

.review-table {
  min-width: 1080px;
  table-layout: fixed;
}

.review-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.review-table th,
.review-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.review-table th:first-child { width: 20%; }
.review-table th:nth-child(2) { width: 11%; }
.review-table th:nth-child(3) { width: 9%; }
.review-table th:nth-child(4) { width: 11%; }
.review-table th:nth-child(5) { width: 34%; }
.review-table th:nth-child(6) { width: 11%; }
.review-table th:last-child { width: 44px; }

.review-row {
  height: 104px;
}

.review-row--pendente {
  background: #fffaf5;
}

.review-row--pronto {
  background: #f5fafb;
}

.review-row--concluido {
  background: #f5faf6;
}

.review-row--pendente > td:first-child {
  box-shadow: inset 3px 0 var(--review);
}

.review-row--pronto > td:first-child {
  box-shadow: inset 3px 0 var(--info);
}

.review-row--concluido > td:first-child {
  box-shadow: inset 3px 0 var(--success);
}

.review-client strong,
.review-client small,
.review-dates strong,
.review-dates small,
.review-table td:nth-child(6) small {
  display: block;
}

.review-client strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.review-client small,
.review-dates small,
.review-table td:nth-child(6) small {
  margin-top: 4px;
  color: var(--text-on-secondary);
  font-size: 11px;
}

.review-dates strong {
  color: var(--info-strong);
  font-variant-numeric: tabular-nums;
}

.review-progress {
  min-width: 110px;
}

.review-progress > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #68747d;
  font-size: 11px;
}

.review-progress > div:first-child strong {
  color: #394650;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.review-progress-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: #e2e7e9;
}

.review-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.review-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-area {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.review-area svg {
  width: 13px;
  height: 13px;
}

.review-area strong {
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 5px;
  color: inherit;
  background: rgba(255, 255, 255, .72);
  text-align: center;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.review-area--pending {
  color: #7d3f2d;
  border-color: #e7c4b7;
  background: var(--review-soft);
}

.review-area--ready {
  color: var(--success-strong);
  border-color: #c1d8c7;
  background: var(--success-soft);
}
.dre-reconciliation--success { border-left-color: #4f8560; background: #f7fbf8; }
.dre-reconciliation--warning { border-left-color: #bd813f; background: #fffaf2; }
.dre-reconciliation--review { border-left-color: #a65f50; background: #fff8f5; }
.dre-reconciliation__status { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dre-reconciliation__status strong, .dre-reconciliation__status small { display: block; }
.dre-reconciliation__status small { margin-top: 4px; color: #68747d; }
.dre-reconciliation .status-pill.status-success { color: #2f6743; background: #e6f3e9; }
.dre-reconciliation .status-pill.status-warning { color: #805610; background: #fff0d5; }
.dre-reconciliation .status-pill.status-review { color: #884c3f; background: #f7e6e1; }
.dre-reconciliation__equation {
  display: grid;
  grid-template-columns: repeat(9, auto);
  gap: 10px;
  align-items: center;
  justify-content: end;
}
.dre-reconciliation__equation span { min-width: 98px; text-align: right; }
.dre-reconciliation__equation small, .dre-reconciliation__equation strong { display: block; white-space: nowrap; }
.dre-reconciliation__equation small { margin-bottom: 4px; color: #68747d; font-size: 11px; }
.dre-reconciliation__equation strong { color: #263640; font-size: 14px; }
.dre-reconciliation__equation b { color: #8a969d; font-size: 16px; }
.dre-reconciliation__note { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid #e2e7eb; color: #5d6870; font-size: 12px; }
.cost-basis { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.cost-basis--real { color: #2f6743; background: #e6f3e9; }
.cost-basis--simulado { color: #805610; background: #fff0d5; }
.cost-basis + small { display: block; margin-top: 4px; color: #68747d; font-size: 11px; white-space: nowrap; }
.workspace { overflow-x: hidden; }

/* Production-only area lists and printable weekly/monthly summaries. */
.production-reports { min-width: 0; margin: 0 0 18px; padding: 18px; border: 1px solid #d9e0e4; border-radius: 9px; background: #fff; }
.production-center--forminha .production-reports { display: none; }
.production-reports-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.production-reports-heading h3 { margin: 2px 0 4px; font-size: 18px; }
.production-reports-heading small { color: #68747d; }
.production-reports-heading label { min-width: 180px; }
.production-reports-heading input { display: block; width: 100%; margin-top: 5px; }
.production-print-source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 13px; }
.production-print-source > span { margin-right: 4px; color: #52616b; font-size: 12px; font-weight: 700; }
.production-print-source button { padding: 9px 13px; border: 1px solid #d9e0e4; border-radius: 7px; color: #52616b; background: #f8fafb; box-shadow: none; }
.production-print-source button.active { border-color: #7a9eaa; color: #225f70; background: #eaf4f6; }
.production-report-periods { display: flex; gap: 7px; overflow-x: auto; margin: 17px 0 12px; padding-bottom: 3px; }
.production-report-periods button { display: grid; gap: 2px; flex: 1 0 auto; min-width: 110px; padding: 8px 12px; border: 1px solid #d9e0e4; border-radius: 7px; color: #52616b; background: #f8fafb; box-shadow: none; text-align: center; }
.production-report-periods button.active { border-color: #7a9eaa; color: #225f70; background: #eaf4f6; }
.production-report-periods button small { color: #68747d; font-size: 10px; font-weight: 400; white-space: nowrap; }
.production-report-caption { margin: 0 0 13px; color: #485660; font-size: 12px; }
.production-report-note { margin: 12px 0 0; color: #485660; font-size: 12px; line-height: 1.45; }
.production-report-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.production-report-card { min-width: 0; overflow: hidden; border: 1px solid #e0e6e8; border-radius: 8px; }
.production-report-card > header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid #e8edef; }
.production-report-card > header > div { display: grid; gap: 5px; }
.production-report-card > header strong { color: #34414a; font-size: 12px; }
.production-report-card .small-button { white-space: nowrap; }
.production-area-label { display: inline-block; width: max-content; padding: 4px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.production-area-label--finalizacao { color: #6e4f19; background: #fff0d7; }
.production-area-label--chocolate { color: #634443; background: #f3e8e5; }
.production-area-label--a_classificar { color: #7d3f2d; background: #f8e9e5; }
.production-report-table-wrap { max-height: 320px; overflow: auto; }
.production-report-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.production-report-card th, .production-report-card td { padding: 8px 12px; border-bottom: 1px solid #eff1f2; text-align: left; }
.production-report-card th:last-child, .production-report-card td:last-child { text-align: right; white-space: nowrap; }
.production-report-card td small { display: block; margin-top: 2px; color: #9a601d; }
.production-unclassified { margin-top: 13px; padding: 10px 12px; border: 1px solid #e4cda8; border-radius: 7px; color: #6c531c; background: #fff9ef; font-size: 12px; }
.production-unclassified summary { cursor: pointer; font-weight: 700; }
.production-unclassified p { margin: 9px 0; }
.production-unclassified ul { margin: 0 0 2px; padding-left: 19px; }
.production-unclassified li { margin: 3px 0; }
.production-print-dialog { width: min(920px, 96vw); max-width: 96vw; max-height: 94vh; padding: 0; border: 1px solid #dce1e6; border-radius: 9px; background: #f4f6f5; }
.production-print-dialog::backdrop { background: #15202a99; }
.production-print-toolbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #dce1e6; background: #fff; }
.production-print-toolbar > div { display: flex; gap: 8px; }
.production-print-sheet { width: min(100%, 210mm); min-height: 260mm; margin: 15px auto; padding: 17mm 15mm; color: #26332d; background: #fff; box-shadow: 0 3px 18px #29322b18; }
.production-print-sheet > header { text-align: center; }
.production-print-sheet > header span { display: block; color: #586a5b; font-size: 12px; }
.production-print-sheet h1 { margin: 7px 0 17px; font-size: 24px; }
.production-print-periods { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-bottom: 18px; text-align: left; }
.production-print-periods > div { padding: 12px 14px; border: 1px solid #aebdad; border-left: 4px solid #607d66; border-radius: 5px; }
.production-print-periods small { display: block; margin-bottom: 5px; color: #526354; font-size: 11px; font-weight: 700; }
.production-print-periods strong { display: block; color: #26332d; font-size: 18px; line-height: 1.25; }
.production-print-summary { display: flex; flex-wrap: wrap; gap: 7px 18px; padding: 11px 0; border-top: 1px solid #cbd6cd; border-bottom: 1px solid #cbd6cd; font-size: 12px; }
.production-print-warning { margin: 11px 0 0; color: #805610; font-size: 11px; }
.production-print-sheet table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 13px; }
.production-print-sheet th { padding: 9px 6px; color: #4f5d52; background: #f2f5f1; text-align: left; }
.production-print-sheet td { padding: 9px 6px; border-bottom: 1px solid #e5e9e2; }
.production-print-sheet th:not(:first-child), .production-print-sheet td:not(:first-child) { text-align: center; white-space: nowrap; }
.production-print-sheet th:nth-child(2), .production-print-sheet td:nth-child(2) { text-align: right; }
.production-print-sheet tr { break-inside: avoid; }
.production-print-sheet footer { margin-top: 18px; color: #69756b; font-size: 11px; }
@media (max-width: 950px) { .production-center > * { min-width: 0; } .production-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .production-periods { grid-column: 1 / -1; } .production-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .production-release { grid-template-columns: 1fr; } }
@media (max-width: 850px) { .production-report-columns { grid-template-columns: minmax(0, 1fr); } .production-reports-heading { align-items: stretch; flex-wrap: wrap; } .production-reports-heading label { width: 100%; } }
@media (max-width: 650px) { .production-filter-bar, .production-overview { grid-template-columns: minmax(0, 1fr); } .production-reports { padding: 13px; } .production-report-card > header { flex-wrap: wrap; } .production-print-sheet { min-height: 0; margin: 0; padding: 22px 16px; } .production-print-periods { grid-template-columns: 1fr; } }
@media print {
  body:has(#productionPrintDialog[open]) > *:not(#productionPrintDialog) { display: none !important; }
  #productionPrintDialog[open] { position: static; display: block; width: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; }
  #productionPrintDialog::backdrop, #productionPrintDialog .production-print-toolbar { display: none !important; }
  #productionPrintDialog .production-print-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  #productionPrintDialog .production-print-sheet thead { display: table-header-group; }
  @page { size: A4; margin: 14mm; }
}
.dispatch-center { display:grid; gap:18px; padding-bottom:32px; }
.dispatch-heading, .dispatch-date-bar, .dispatch-routes > header, .dispatch-map-panel > header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.dispatch-heading h2 { margin:5px 0 7px; font-size:26px; color:#303b31; }
.dispatch-heading p, .dispatch-routes header p, .dispatch-fleet header p, .dispatch-map-panel header p { margin:6px 0 0; color:#697367; font-size:13px; line-height:1.5; }
.dispatch-kicker { font-size:11px; letter-spacing:1.5px; color:#758064; font-weight:700; }
.dispatch-date-bar { border:1px solid #dce2d6; background:#fff; border-radius:9px; padding:12px 16px; }
.dispatch-date-bar input { width:165px; }
.dispatch-date-bar > strong { font-size:16px; text-transform:capitalize; }
.dispatch-stats { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.dispatch-stats > div { background:#fff; border:1px solid #dee4d9; border-radius:9px; padding:14px; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.dispatch-stats strong { font-size:28px; color:#4c6047; }
.dispatch-stats span { font-size:12px; color:#677163; }
.dispatch-stats .dispatch-stat-warning strong { color:#a2692b; }
.dispatch-base-line { display:flex; gap:10px; align-items:center; padding:12px 16px; background:#ecf0e5; border-radius:7px; font-size:13px; color:#566449; }
.dispatch-base-line svg { width:19px; flex-shrink:0; }
.dispatch-notice { padding:13px 16px; background:#fff5df; border:1px solid #e8d5a9; border-radius:7px; color:#865e28; font-size:13px; line-height:1.5; }
.dispatch-layout { display:grid; grid-template-columns:minmax(330px,.95fr) minmax(400px,1.35fr); gap:18px; align-items:start; }
.dispatch-center .panel { padding:0; overflow:hidden; margin:0; }
.dispatch-center .panel > header { padding:18px 20px; border-bottom:1px solid #e3e8de; }
.dispatch-center h3 { margin:0; font-size:15px; }
.dispatch-search { display:block; margin:12px 0 10px; }
.dispatch-selection { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#6d7667; font-size:11px; }
.dispatch-cards { max-height:650px; overflow:auto; padding:14px; display:grid; gap:12px; }
.dispatch-card { border:1px solid #e1e6db; border-left:4px solid var(--dispatch-color); border-radius:8px; background:#fff; padding:14px; font-size:12px; }
.dispatch-card-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.dispatch-card-title label { display:flex; align-items:center; gap:7px; }
.dispatch-card input[type=checkbox], .dispatch-vehicle input[type=checkbox] { width:17px; height:17px; accent-color:#5b7250; flex-shrink:0; }
.dispatch-mode { font-size:10px; color:#6b776b; background:#f2f5ee; padding:4px 7px; border-radius:5px; }
.dispatch-card > .record-link { font-size:14px; font-weight:650; display:block; line-height:1.4; }
.dispatch-card > p { display:flex; gap:6px; align-items:center; margin:10px 0 5px; }
.dispatch-card svg { width:14px; height:14px; flex-shrink:0; }
.dispatch-card > small { color:#72806d; display:block; line-height:1.5; }
.dispatch-card-facts { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; color:#5f7159; }
.dispatch-card-facts span { display:flex; gap:6px; align-items:center; }
.dispatch-card details { padding:9px 0; border-top:1px solid #edf0e8; }
.dispatch-card details summary { cursor:pointer; color:#66775c; }
.dispatch-card details ul { padding-left:18px; line-height:1.6; }
.dispatch-card .dispatch-missing { color:#976828; background:#fff6e6; padding:7px 9px; border-radius:5px; font-size:11px; }
.dispatch-card-actions { display:flex; gap:8px; margin-top:10px; }
.dispatch-card-actions label { min-width:0; flex:1; }
.dispatch-card-actions select { font-size:12px; padding:8px; }
.dispatch-card-actions .small-button { font-size:12px; }
.dispatch-map { min-height:480px; height:540px; background:#eef1ea; }
.dispatch-map-empty { height:100%; min-height:480px; padding:45px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; color:#66765e; gap:13px; }
.dispatch-map-empty > svg { width:45px; height:45px; color:#91a283; }
.dispatch-map-empty > strong { font-size:19px; color:#46573f; }
.dispatch-map-empty p { margin:0; max-width:340px; font-size:13px; line-height:1.7; }
.dispatch-map-legend { padding:13px 18px; display:flex; flex-wrap:wrap; gap:12px; font-size:11px; color:#677361; border-top:1px solid #e0e6d9; }
.dispatch-map-legend span { display:flex; align-items:center; gap:5px; }
.dispatch-map-legend i { display:inline-block; width:9px; height:9px; border-radius:50%; }
.dispatch-vehicle-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:12px; padding:16px 20px; }
.dispatch-vehicle { display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid #dfe6d8; border-radius:8px; padding:12px; }
.dispatch-vehicle label { display:flex; gap:11px; align-items:center; flex:1; cursor:pointer; }
.dispatch-vehicle label strong { font-size:13px; }
.dispatch-vehicle small { display:block; color:#74816d; font-size:11px; margin-top:4px; }
.dispatch-route-grid { padding:16px 20px; display:grid; grid-template-columns:repeat(auto-fit,minmax(310px,1fr)); gap:16px; }
.dispatch-route { border:1px solid #dfe4da; border-top:4px solid var(--dispatch-color); border-radius:8px; padding:16px; }
.dispatch-route header h4 { margin:0 0 5px; color:var(--dispatch-color); font-size:15px; }
.dispatch-route header small { color:#7b8475; font-size:11px; }
.dispatch-route ol { list-style:none; padding:0; margin:14px 0; }
.dispatch-route li { display:flex; gap:10px; align-items:center; padding:12px 0; border-top:1px solid #e7ebe3; }
.dispatch-stop-number { width:24px; height:24px; border-radius:50%; flex-shrink:0; display:grid; place-items:center; background:var(--dispatch-color); color:#fff; font-size:12px; }
.dispatch-route li > div:nth-child(2) { min-width:0; flex:1; }
.dispatch-route li strong { font-size:12px; line-height:1.4; display:block; }
.dispatch-route li small { display:block; color:#74816e; font-size:11px; margin:5px 0; }
.dispatch-route li a { font-size:11px; color:#516e48; }
.dispatch-stop-move { display:flex; flex-direction:column; gap:4px; }
.dispatch-stop-move button { width:26px; height:26px; min-height:26px; padding:3px; }
.dispatch-stop-move svg { width:14px; height:14px; }
.dispatch-estimate { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; background:#eef4e8; border-radius:6px; margin-top:12px; font-size:12px; color:#59714e; }
.dispatch-estimate-empty, .dispatch-api-hint { font-size:11px; color:#77806f; line-height:1.6; }
.dispatch-api-hint { padding:0 20px; }
.dispatch-empty { padding:25px; text-align:center; color:#7a8372; font-size:13px; }
.dispatch-google-setup { margin-top:18px; padding:13px; border:1px solid #dfe5d9; border-radius:7px; font-size:12px; line-height:1.6; }
.dispatch-google-setup summary, .dispatch-manual-coordinates summary { cursor:pointer; color:#667a5b; }
.dispatch-address-tools { display:grid; gap:10px; }
.dispatch-manual-coordinates { font-size:12px; }
.dispatch-manual-coordinates > div { margin-top:10px; }
.dispatch-center button:disabled { opacity:.5; cursor:wait; }
@media(max-width:1100px) { .dispatch-layout { grid-template-columns:1fr; } .dispatch-map { height:440px; min-height:350px; } .dispatch-map-empty { min-height:350px; } .dispatch-cards { max-height:560px; grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) { .dispatch-heading, .dispatch-date-bar, .dispatch-routes > header, .dispatch-map-panel > header { align-items:flex-start; flex-direction:column; } .dispatch-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .dispatch-stats > div { padding:12px; gap:8px; } .dispatch-stats strong { font-size:23px; } .dispatch-cards { grid-template-columns:1fr; } .dispatch-vehicle-grid, .dispatch-route-grid { grid-template-columns:1fr; padding:14px; } .dispatch-map-empty { padding:25px; } .dispatch-heading > .actions-row { flex-wrap:wrap; } .dispatch-card-actions { flex-wrap:wrap; } }

/* Map comparison controls stay above the map on small screens. */
.dispatch-map-tools {padding:14px 18px;background:#f8fafc;border-bottom:1px solid #e2e8f0;display:grid;gap:10px;}
.dispatch-map-tools label {font-size:12px;font-weight:600;display:grid;gap:6px;color:#334155;}
.dispatch-map-tools input {width:100%;background:white;}
.dispatch-map-tools p {font-size:12px;margin:0;color:#64748b;line-height:1.5;}
.dispatch-probe-results {display:grid;gap:5px;}
.dispatch-probe-result {background:#fff;color:#1e293b;text-align:left;border:1px solid #cbd5e1;padding:10px 12px;line-height:1.4;font-size:12px;border-radius:6px;}
.dispatch-probe-result:hover {background:#eff6ff;border-color:#1565ff;}
.dispatch-places-attribution {font-family:Arial,sans-serif;font-style:normal;font-weight:400;font-size:12px;letter-spacing:normal;white-space:nowrap;color:#5e5e5e;padding:5px 0;}
.dispatch-map-legend .dispatch-route-filter {font-size:12px;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:7px;display:flex;gap:7px;align-items:center;padding:8px 10px;line-height:1.4;text-align:left;}
.dispatch-map-legend .dispatch-route-filter[aria-pressed=true] {background:#eff6ff;border-color:var(--route-color,#1565ff);box-shadow:0 0 0 1px var(--route-color,#1565ff);font-weight:650;}
.dispatch-map-legend .dispatch-route-filter i,.dispatch-week-stops i {width:12px;height:12px;border-radius:50%;display:inline-block;flex-shrink:0;}
.dispatch-route-title {background:none;border:0;color:var(--dispatch-color);padding:0;font-weight:650;text-align:left;font-size:15px;}
.dispatch-map-period {padding:14px 20px;background:#f4f7fa;display:flex;gap:10px;flex-wrap:wrap;align-items:end;border-bottom:1px solid #dce3ea;}
.dispatch-map-period label {font-size:12px;display:grid;gap:5px;flex:1;min-width:120px;}
.dispatch-map-period input {width:100%;min-height:36px;}
.dispatch-map-period p {width:100%;margin:0;color:#526173;font-size:12px;}
.dispatch-map-summary {padding:0 20px 16px;display:flex;gap:7px;flex-wrap:wrap;}
.dispatch-map-summary p {width:100%;font-size:12px;color:#526173;line-height:1.6;}
.dispatch-route-driver,.dispatch-swap,.dispatch-stop-transfer {display:grid;gap:5px;font-size:11px;color:#546171;margin:12px 0;}
.dispatch-route-driver select,.dispatch-swap select,.dispatch-stop-transfer select {width:100%;max-width:100%;min-width:0;font-size:12px;}
.dispatch-route-ends {display:grid;gap:6px;margin:14px 0;padding:10px;background:#f5f7f9;border-radius:6px;font-size:11px;line-height:1.5;}
.dispatch-route-ends span {color:#526173;}
.dispatch-route li[draggable=true] {cursor:grab;}
.dispatch-route li[draggable=true]:active {cursor:grabbing;}
.dispatch-route li[draggable=true]:hover {background:#f6faff;}
.dispatch-route [hidden] {display:none !important;}
.dispatch-routes > header {flex-wrap:wrap;}
.dispatch-routes > header .actions-row {flex-wrap:wrap;}
.dispatch-map-period .actions-row {flex-wrap:wrap;}
.dispatch-week-stops {font-size:12px;color:#475569;padding-top:12px;}
.dispatch-week-stops p {margin:8px 0;line-height:1.5;}
.dispatch-week-stops i {margin-right:5px;}
.dispatch-week-dialog .dispatch-map-tools {border:1px solid #e2e8f0;border-radius:8px;}
.dispatch-week-dialog .dispatch-map-legend {padding:12px 0;border:0;}
.dispatch-week-dialog .dialog-body > p {font-size:13px;line-height:1.5;}
.dispatch-finder-results:empty {display:none;}
.dispatch-finder-results {display:grid;gap:8px;width:100%;}
.dispatch-finder-result {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #dce3d5;border-radius:8px;background:#f8faf6;}
.dispatch-finder-result > div {display:grid;gap:5px;min-width:0;}
.dispatch-finder-result small {font-size:12px;color:#667064;}
.dispatch-finder-result .record-link {font-weight:650;line-height:1.4;}
.dispatch-finder-result button {flex-shrink:0;}
.dispatch-selected-orders {padding:16px 18px;background:#f8faf6;border-block:1px solid #dce3d5;}
.dispatch-selected-orders h4 {margin:0 0 8px;font-size:16px;}
.dispatch-selected-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:12px;margin-top:12px;}
@media(max-width:700px){.dispatch-finder-result{align-items:flex-start;flex-direction:column;}}
@media(max-width:700px){.dispatch-week-dialog{width:calc(100vw - 24px);padding:16px;}.dispatch-week-dialog h2{font-size:18px;}.dispatch-map-tools{padding:12px;}}
.native-sales-filters{margin-bottom:1rem;grid-template-columns:2fr 1fr 1fr}
.native-order-entry h3{margin:1.25rem 0 .75rem;border-bottom:1px solid var(--border,#ddd);padding-bottom:.5rem}
.native-customer-picker{display:flex;align-items:flex-end;gap:.75rem}
.native-customer-picker label{flex:1}
.native-product-line{display:grid;grid-template-columns:minmax(220px,2fr) minmax(100px,.6fr) minmax(140px,1fr) 36px;gap:.75rem;align-items:start;padding:.8rem 0;border-bottom:1px solid #ddd}
.native-product-line label{display:flex;flex-direction:column;gap:.35rem}
.native-product-line .icon-button{margin-top:1.5rem}
.native-product-line small{color:#6b7280}
.native-order-total{font-size:1.4rem;font-weight:700;text-align:right;padding:1rem;background:#edf1e6;border-radius:8px}
#dispatchSaveStatus{min-height:1.6rem;display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}
#dispatchSaveStatus [data-save-state]{display:inline-flex;align-items:center;gap:.35rem;font-weight:600}
#dispatchSaveStatus [data-save-state=saved]{color:#23714b}
#dispatchSaveStatus [data-save-state=saving]{color:#875c16}
#dispatchSaveStatus [data-save-state=error]{color:#b23b35}
#dispatchSaveStatus .form-error{flex-basis:100%;margin:0}
.dispatch-execution-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;padding:12px 0;border-top:1px solid var(--border,#dbe1e5);border-bottom:1px solid var(--border,#dbe1e5);font-size:12px}
.dispatch-execution-summary>span{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.dispatch-execution-status{display:inline-flex;align-items:center;padding:4px 8px;border-radius:6px;font-size:12px;font-weight:600;background:#f5efd9;color:#785917;white-space:nowrap;width:fit-content}
.dispatch-execution-status[data-route-status=confirmado]{background:#e5effb;color:#245d9b}
.dispatch-execution-status[data-route-status=finalizado]{background:#e3f3e9;color:#236b45}
.driver-closings{display:grid;gap:20px;min-width:0}
.driver-closings .workspace-toolbar p{margin:4px 0;color:#69757c;font-size:13px}
.driver-closing-filters{display:grid;grid-template-columns:180px 180px minmax(200px,1fr) auto;gap:12px;align-items:end}
.driver-closing-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;padding:16px 0;border-block:1px solid var(--border,#dbe1e5)}
.driver-closing-totals>div{display:grid;gap:6px}.driver-closing-totals span{font-size:12px;color:#69757c}.driver-closing-totals strong{font-size:20px}
.driver-closings .panel>header{padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.driver-closing-table{min-width:900px}.driver-closing-table td{height:64px}
.driver-closing-receipt{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.7;max-height:50vh;overflow:auto}
@media(max-width:760px){.driver-closing-filters{grid-template-columns:1fr 1fr}.driver-closing-totals{grid-template-columns:1fr 1fr}.driver-closings .workspace-toolbar{flex-wrap:wrap}.driver-closing-table{min-width:800px}}
.dispatch-history{width:min(880px,calc(100vw - 48px));max-width:none;border-radius:8px}
.dispatch-history [data-history-preview]{max-height:40vh;overflow:auto;margin:1rem 0}
.dispatch-history [data-history-preview] section{padding:.75rem 0;border-bottom:1px solid var(--border,#dbe1e5)}
@media(max-width:640px){.native-sales-filters{grid-template-columns:1fr}.native-product-line{grid-template-columns:1fr 1fr 36px}.native-product-line label:first-child{grid-column:1/-1}.native-product-line .icon-button{margin-top:1.5rem}.native-customer-picker{align-items:stretch;flex-direction:column}}
