:root {
  --ink: #1d2433;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #f5f7fa;
  --paper: #ffffff;
  --brand: #16646f;
  --brand-strong: #103d45;
  --gold: #c6922e;
  --green: #2d7a4f;
  --rose: #9f3d55;
  --shadow: 0 18px 50px rgba(29, 36, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 9px 16px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button:focus-visible {
  outline: 3px solid rgba(22, 100, 111, 0.25);
  outline-offset: 2px;
}

button:active {
  color: #fff;
  background: var(--brand-strong);
}

button.is-pressed {
  transform: translateY(1px);
  filter: brightness(0.92);
}

button.is-saving {
  color: #0f172a !important;
  background: #fde68a !important;
  box-shadow: 0 0 0 3px rgba(198, 146, 46, 0.18);
}

button.is-saved {
  color: #fff !important;
  background: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.2);
}

button.is-error {
  color: #fff !important;
  background: var(--rose) !important;
  box-shadow: 0 0 0 3px rgba(159, 61, 85, 0.2);
}

button.secondary {
  color: var(--ink);
  background: #e8edf4;
}

button.secondary:hover {
  background: #dce4ef;
}

button.danger {
  color: #fff;
  background: var(--rose);
}

button.danger:hover {
  background: #7f2f43;
}

button:disabled {
  color: #526071;
  background: #eef2f7;
  opacity: 1;
  cursor: not-allowed;
}

button.is-done:disabled {
  color: #166534;
  background: #dff3e8;
  border: 1px solid #a7dfba;
}

.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.is-warning:disabled {
  color: #8a4b00;
  background: #fff4d6;
  border: 1px solid #ffd687;
}

button.danger:disabled {
  color: #fff;
  background: #9f3d55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

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

.app-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 420px);
  gap: 28px;
  align-items: center;
  min-height: 100vh;
  padding: 36px;
  background:
    linear-gradient(120deg, rgba(22, 100, 111, 0.96), rgba(29, 36, 51, 0.9)),
    #1d2433;
}

.brand-block {
  max-width: 680px;
  color: #fff;
}

.login-logo {
  width: 156px;
  height: 156px;
  object-fit: contain;
  margin-bottom: 18px;
  border-radius: 50%;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
}

h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.message {
  min-height: 20px;
  color: var(--rose);
  font-weight: 700;
}

.dashboard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 20px;
  color: #fff;
  background: #1d2433;
}

.sidebar-brand,
.session-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #071522;
}

.sidebar-brand strong,
.session-card strong {
  display: block;
}

.sidebar-brand small,
.session-card small,
.session-card span {
  color: rgba(255, 255, 255, 0.7);
}

.nav-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.tab {
  width: 100%;
  justify-content: start;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
}

.tab:hover,
.tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.session-card {
  display: grid;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.main-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workspace-header h2 {
  margin-bottom: 0;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  color: #24513a;
  background: #e6f4ec;
  border: 1px solid #b9dfc9;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.panel-view {
  min-width: 0;
}

#agentsPanel {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.agent-grid {
  display: grid;
  align-content: start;
  gap: 12px;
}

.agent-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 138px;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(29, 36, 51, 0.06);
  text-align: left;
}

.agent-card:hover,
.agent-card.is-selected {
  background: #fff;
  border-color: var(--brand);
  border-left-color: var(--brand);
}

.agent-card span {
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-card strong {
  font-size: 18px;
}

.agent-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.conversation,
.section-heading,
.sales-form,
.search-form,
.search-results,
.sales-list,
.sales-extra,
.sales-tools,
.production-list,
.production-info,
.production-filters,
.production-summary,
.production-kanban,
.route-sync-panel,
.settings-form,
.warranty-search-form,
.warranty-form,
.warranty-clauses-form,
.warranty-preview,
.warranty-list,
.admin-maintenance,
.reset-code-form,
.dashboard-summary,
.daily-dashboard,
.routes-list,
.user-form,
.user-list,
.activity-list,
.roadmap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(29, 36, 51, 0.06);
}

.conversation {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  min-height: calc(100vh - 150px);
  overflow: hidden;
}

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

.conversation-header small {
  display: block;
  color: var(--muted);
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.chat-bubble {
  max-width: min(720px, 86%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-bubble small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.chat-bubble p {
  margin-bottom: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mention-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #b9dfc9;
  border-radius: 999px;
  background: #e6f4ec;
  color: #24513a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.from-user {
  justify-self: end;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.from-user small {
  color: rgba(255, 255, 255, 0.8);
}

.from-user .mention-chip {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.chat-form button {
  align-self: end;
}

.section-heading {
  padding: 18px;
  margin-bottom: 14px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.inline-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.inline-filter-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inline-filter-form input {
  min-height: 38px;
}

.activity-list,
.sales-list,
.production-list,
.daily-dashboard,
.routes-list,
.user-list,
.case-list,
.roadmap {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.activity-item,
.sale-item,
.production-item,
.search-result-item,
.alert-item,
.day-row,
.user-item,
.case-item,
.roadmap article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.activity-item span,
.sale-item span,
.sale-item small,
.user-item span,
.case-item span,
.roadmap span {
  color: var(--muted);
}

.case-form,
.case-update-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.case-form .full-span,
.case-update-form .full-span {
  grid-column: 1 / -1;
}

.case-item {
  display: block;
  border-left: 5px solid var(--brand);
}

.case-item.priority-alta,
.case-item.priority-urgente {
  border-left-color: var(--rose);
}

.case-item summary {
  cursor: pointer;
  list-style: none;
}

.case-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.case-notes {
  display: grid;
  gap: 8px;
}

.case-notes article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.case-notes p {
  margin: 6px 0 0;
}

.case-alert {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: #7f2f43;
  background: #fff1f3;
  border: 1px solid #f2bac5;
  border-radius: 7px;
}

.case-alert span {
  color: #7f2f43;
}

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

.user-actions select {
  min-width: 160px;
  min-height: 42px;
}

.sales-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
}

.sales-subheading {
  margin-top: 16px;
}

.layaway-panel,
.quote-panel {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.layaway-panel summary,
.quote-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand);
}

.layaway-grid,
.quote-grid,
.layaway-payment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.layaway-summary {
  display: grid;
  gap: 4px;
  padding: 10px;
  color: #7f1d1d;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 7px;
}

.layaway-due-warning {
  color: #991b1b;
  font-weight: 900;
}

.layaway-alert-list {
  display: grid;
  gap: 8px;
}

.layaway-due-alert {
  background: #fff7ed;
  border-color: #fdba74;
}

.layaway-due-alert strong {
  color: #9a3412;
}

.layaway-payments {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.sales-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.followup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.followup-badge strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 15px;
}

.followup-badge span {
  font-weight: 800;
  font-size: 13px;
}

.followup-badge.success strong {
  background: #dcfce7;
  color: #166534;
}

.followup-badge.danger strong {
  background: #fee2e2;
  color: #b91c1c;
}

.followup-badge.neutral strong {
  background: #e0f2fe;
  color: #075985;
}

.followup-badge.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(24, 115, 124, 0.12);
}

.followup-overdue {
  border-color: #fecaca;
  border-left: 4px solid #dc2626;
}

.followup-overdue summary small {
  color: #b91c1c;
  font-weight: 800;
}

.followup-processed {
  border-left: 4px solid #0284c7;
}

.followup-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.followup-edit-form button {
  min-height: 42px;
}

.sales-extra {
  padding: 14px;
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sales-extra summary {
  cursor: pointer;
  font-weight: 800;
}

.sales-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sales-group summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 900;
}

.sales-group summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-form {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-form,
.route-date-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-date-form {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.search-results {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.search-result-item,
.alert-item,
.production-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.alert-item {
  border-color: #f0b8c6;
  background: #fff5f8;
}

.deleted-record {
  border-color: #b8c0cc;
  background: #f1f4f8;
  opacity: 0.9;
}

.sales-form label:nth-child(6) {
  grid-column: span 2;
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
}

.settings-block,
.driver-print-panel {
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-block h3,
.driver-print-panel h4 {
  margin: 0 0 10px;
}

.driver-settings-form,
.document-form,
.technical-sheet-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.driver-settings-form label,
.document-form label:nth-child(7),
.document-form label:nth-child(8),
.document-form button,
.technical-sheet-form .form-wide,
.technical-sheet-form button {
  grid-column: 1 / -1;
}

.muted-copy {
  margin: -4px 0 12px;
  color: var(--muted);
}

.technical-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.technical-icon-grid legend {
  padding: 0 6px;
  font-weight: 800;
  color: var(--primary);
}

.technical-icon-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 7px 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.driver-settings-list,
.driver-print-list,
.document-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.driver-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.driver-chip span {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  color: #24513a;
  background: #e9f8ef;
  border: 1px solid #b7e2c5;
  border-radius: 999px;
  font-weight: 800;
}

.driver-chip button {
  min-height: 32px;
  padding: 6px 10px;
}

.driver-print-list article,
.document-item {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.driver-print-list article {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.driver-print-list strong,
.driver-print-list span,
.document-item summary span {
  display: block;
}

.document-item summary {
  display: grid;
  gap: 4px;
  cursor: pointer;
}

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

.archive-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.archive-search-results {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.document-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.document-select {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 15px;
  cursor: pointer;
}

.document-select input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.document-select span,
.document-select small {
  display: block;
}

.agent-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 10px;
  align-items: center;
  text-align: left;
}

.agent-card .chat-avatar {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.chat-user-select {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
}

.agent-card strong,
.agent-card small {
  min-width: 0;
}

.admin-maintenance {
  padding: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.backup-section-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.reset-code-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.danger-zone {
  border-color: #fecaca;
  background: #fff7f7;
}

.warranty-search-form,
.warranty-form,
.warranty-clauses-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.warranty-direct-panel {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.warranty-direct-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.warranty-form button,
.warranty-lines-wrap,
.warranty-options,
.warranty-clauses-form label {
  grid-column: 1 / -1;
}

.inline-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.warranty-options {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.warranty-option-row {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) 110px;
  gap: 8px;
  align-items: center;
}

.warranty-option-other {
  grid-template-columns: auto minmax(80px, 0.6fr) minmax(140px, 1fr) 110px;
}

.warranty-line-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.warranty-line {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.direct-warranty-line {
  grid-template-columns: minmax(220px, 1fr) 170px auto;
}

.warranty-sale-card,
.warranty-list {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.warranty-sale-card strong,
.warranty-sale-card span,
.warranty-sale-card small {
  display: block;
}

.warranty-match {
  width: 100%;
  color: inherit;
  text-align: left;
  background: #fff;
}

.warranty-warning {
  display: block;
  margin-top: 10px;
  color: #b91c1c;
}

.warranty-duplicate-alert {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  color: #7f1d1d;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
}

.is-deleted-record {
  opacity: 0.72;
  background: #fff7f7;
  border-color: #f2bac5;
}

.warranty-document,
.warranty-document-preview {
  background: #fff;
  color: #0f172a;
}

.warranty-document {
  max-width: 900px;
  margin: 0 auto;
  padding: 34px;
  font-family: Arial, sans-serif;
}

.warranty-document header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--brand);
}

.warranty-document header img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.warranty-document .letterhead-header img {
  width: 120px;
  height: auto;
}

.letterhead-header div {
  flex: 1;
}

.letterhead-header h1 {
  margin: 0;
}

.letterhead-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.letterhead-footer {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
}

.letterhead-footer img {
  display: block;
  width: 100%;
  height: auto;
}

.warranty-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.warranty-doc-grid span {
  padding: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.warranty-doc-grid b {
  display: block;
  margin-bottom: 4px;
  color: #475569;
}

.warranty-document table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.warranty-document th,
.warranty-document td {
  padding: 10px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.warranty-document th {
  background: #e2e8f0;
}

.technical-sheet-document {
  max-width: 820px;
  padding: 18px 26px;
}

.technical-sheet-document.technical-sheet-document header {
  justify-content: center;
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 0;
}

.technical-sheet-document.technical-sheet-document header img {
  width: min(245px, 68%);
  height: auto;
  max-height: 78px;
}

.technical-title-block {
  text-align: center;
}

.technical-title-block h1 {
  margin: 2px 0 4px;
  color: #123b6d;
  font-size: 25px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.technical-title-block p {
  max-width: 620px;
  margin: 5px auto 8px;
  color: #334155;
  font-weight: 800;
}

.technical-rule {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: #123b6d;
}

.technical-rule span {
  width: 160px;
  height: 1px;
  background: #123b6d;
}

.technical-rule b {
  width: 8px;
  height: 8px;
  background: #123b6d;
  border-radius: 999px;
}

.technical-hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 12px;
  align-items: center;
  margin: 9px 0;
}

.technical-hero h2 {
  margin: 0 0 5px;
  color: #123b6d;
  font-size: 19px;
}

.technical-hero p {
  margin: 0;
  line-height: 1.35;
}

.technical-hero figure {
  display: grid;
  place-items: center;
  min-height: 125px;
  margin: 0;
  border: 2px dashed #b9c7d8;
  border-radius: 8px;
  background: #f8fafc;
}

.technical-hero figure img {
  max-height: 140px;
  object-fit: contain;
}

.technical-hero figure span {
  color: #64748b;
  font-size: 22px;
  font-weight: 900;
}

.technical-icon-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}

.technical-icon-strip span {
  display: grid;
  min-width: 56px;
  gap: 2px;
  justify-items: center;
}

.technical-icon-strip img,
.technical-feature-table td:first-child img,
.technical-benefits img {
  object-fit: contain;
}

.technical-icon-strip img {
  width: 25px;
  height: 25px;
}

.technical-icon-strip small {
  color: #2563a8;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.technical-feature-table {
  margin: 8px 0;
  font-size: 10px;
}

.technical-feature-table th,
.technical-feature-table td {
  padding: 6px;
}

.warranty-document .technical-feature-table th {
  color: #fff;
  background: #0d66c2;
  text-align: center;
}

.technical-feature-table td:first-child {
  width: 36px;
  text-align: center;
}

.technical-feature-table td:first-child img {
  width: 23px;
  height: 23px;
}

.technical-feature-table td:nth-child(2) {
  width: 126px;
  color: #123b6d;
  font-weight: 900;
}

.technical-feature-table td:nth-child(3) {
  width: 140px;
  font-weight: 900;
}

.technical-benefits {
  margin-top: 9px;
  border: 1px solid #d6e4f4;
}

.technical-benefits h2 {
  margin: 0;
  padding: 6px;
  color: #fff;
  background: #0d66c2;
  font-size: 13px;
  text-align: center;
}

.technical-benefits > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.technical-benefits article {
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 7px;
  border-right: 1px solid #d6e4f4;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.technical-benefits article:last-child {
  border-right: 0;
}

.technical-benefits img {
  width: 25px;
  height: 25px;
}

.technical-sheet-footer {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #cbd5e1;
  color: #475569;
  font-size: 8px;
  text-align: center;
}

.technical-sheet-footer span:first-child {
  height: 1px;
  background: #cbd5e1;
}

.warranty-note-box {
  display: block;
  margin-top: 12px;
}

.business-document h2 {
  margin-top: 22px;
}

.document-body {
  line-height: 1.65;
}

.document-signature {
  display: grid;
  justify-items: center;
  width: 280px;
  margin: 52px 0 0 auto;
  text-align: center;
}

.document-signature img {
  max-width: 220px;
  max-height: 110px;
  object-fit: contain;
}

.signature-placeholder {
  width: 240px;
  height: 70px;
  border-bottom: 2px solid #0f172a;
}

.document-signature strong {
  margin-top: 8px;
}

.document-signature span,
.document-signature small {
  color: var(--muted);
}

.quote-document {
  position: relative;
  min-height: 980px;
  overflow: hidden;
  border-top: 8px solid #0b4f75;
}

.quote-document::before {
  content: "";
  position: absolute;
  right: -160px;
  top: 120px;
  width: 420px;
  height: 420px;
  background: rgba(11, 79, 117, 0.06);
  border-radius: 999px;
}

.quote-header {
  display: grid !important;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  align-items: center;
  border-bottom: 2px solid #0b4f75 !important;
}

.quote-header img {
  width: 170px !important;
  height: auto !important;
}

.quote-header h1 {
  margin: 0;
  color: #0b4f75;
  font-size: 30px;
  letter-spacing: 0;
  text-align: right;
  text-transform: uppercase;
}

.quote-header p {
  margin: 4px 0 0;
  color: #1f2937;
  text-align: right;
  font-weight: 800;
}

.quote-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin: 18px 0;
}

.quote-meta-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.quote-meta-box b {
  color: #0b4f75;
  font-size: 12px;
  text-transform: uppercase;
}

.quote-hero {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}

.quote-hero-text {
  display: grid;
  gap: 8px;
}

.quote-hero-text h2 {
  margin: 0;
  color: #0b4f75;
  font-size: 26px;
}

.quote-hero-text p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.quote-product-image {
  width: 100%;
  max-height: 275px;
  object-fit: contain;
}

.quote-no-image {
  display: grid;
  place-items: center;
  min-height: 210px;
  color: #64748b;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-table th {
  color: #fff;
  background: #0b4f75 !important;
}

.quote-total-box {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin: 12px 0 18px;
}

.quote-total-box span,
.quote-total-box strong {
  min-width: 240px;
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid #cbd5e1;
}

.quote-total-box strong {
  color: #0b4f75;
  font-size: 20px;
  border-bottom: 3px solid #0b4f75;
}

.quote-conditions {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.quote-conditions h3 {
  margin: 0 0 4px;
  color: #0b4f75;
}

.quote-conditions p {
  margin: 0;
}

.quote-signature {
  margin-top: 34px;
  margin-left: auto;
  width: 270px;
  text-align: center;
}

.quote-signature .signature-placeholder {
  width: 100%;
  height: 46px;
}

.driver-route-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.driver-route-table th,
.driver-route-table td {
  padding: 9px;
  border: 1px solid #cbd5e1;
  text-align: left;
  vertical-align: top;
}

.driver-route-table th {
  background: #e2e8f0;
}

.compact-route-table {
  margin-top: 10px;
  font-size: 9.5px;
  line-height: 1.2;
}

.compact-route-table th,
.compact-route-table td {
  padding: 4px 5px;
}

.compact-route-table th {
  color: #fff;
  background: #155e75;
}

.compact-route-table td:nth-child(1),
.compact-route-table td:nth-child(6),
.compact-route-table td:nth-child(10) {
  white-space: nowrap;
  text-align: center;
}

.signature-line {
  min-width: 130px;
  height: 34px;
  border-bottom: 2px solid #111827;
}

.compact-signature {
  min-width: 90px;
  height: 22px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 10px 0;
  font-weight: 800;
}

.product-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-form label:first-child {
  grid-column: span 2;
}

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

.product-edit-item {
  display: block;
}

.product-edit-item summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.product-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.product-edit-form label:first-child {
  grid-column: 1 / -1;
}

.product-edit-form .route-actions {
  grid-column: 1 / -1;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.dashboard-summary article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.dashboard-summary span,
.day-row span {
  color: var(--muted);
}

.rejected-record,
.alert-item.rejected-record {
  border-color: #fca5a5;
  background: #fef2f2;
}

.rejected-record strong {
  color: #991b1b;
}

.dashboard-summary strong {
  color: var(--brand);
  font-size: 22px;
}

.daily-dashboard {
  padding: 14px;
}

.day-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr 1.2fr;
  align-items: center;
}

.routes-layout {
  display: grid;
}

.routes-list {
  align-content: start;
  padding: 14px;
}

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

.routes-summary article {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.routes-summary strong {
  color: var(--brand);
  font-size: 21px;
}

.routes-summary span {
  color: var(--muted);
}

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

.repair-route-columns section,
.route-month-table-wrap {
  display: grid;
  gap: 10px;
}

.repair-route-card {
  display: grid;
  gap: 10px;
  background: #f0fdfa;
  border-color: #99f6e4;
}

.route-month-table-wrap {
  overflow-x: auto;
}

.route-month-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.route-month-table th {
  color: #fff;
  background: #8f2531;
}

.route-month-table th,
.route-month-table td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.system-sales-overview {
  display: grid;
  gap: 8px;
}

.system-sale-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #f2c24e;
  border-left: 5px solid #d59b12;
  border-radius: 7px;
  background: #fff8e1;
}

.system-sale-row span,
.system-sale-row small {
  color: var(--muted);
}

.active-system-panel,
.production-pending-sales,
.routes-pending-sales {
  border-color: #f2c24e;
  background: #fffbeb;
}

.routes-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.route-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 320px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-card {
  display: grid;
  gap: 5px;
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 7px;
  padding: 12px;
}

.route-card summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.route-card:hover {
  color: var(--ink);
  background: #fff;
  border-color: var(--brand);
  border-left-color: var(--brand);
}

.route-card span,
.route-card small {
  color: var(--muted);
}

.status-badge {
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #344054;
  background: #eef2f7;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.en_camino {
  color: #6a4d10;
  background: #fff2ca;
}

.status-badge.procesada {
  color: #24513a;
  background: #dff3e8;
}

.status-badge.rechazada {
  color: #7f2f43;
  background: #f9dce4;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.detail-grid div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-grid strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.route-driver-field {
  min-width: min(100%, 220px);
  flex: 1 1 220px;
}

.rejected-box {
  padding: 14px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rejected-box summary {
  cursor: pointer;
  font-weight: 800;
}

.rejected-routes-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.production-item {
  align-items: center;
}

.production-info {
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #23446d;
  background: #f3f8ff;
  border-color: #bfd7ff;
}

.production-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.production-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.production-summary article {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.production-summary strong {
  color: var(--brand);
  font-size: 22px;
}

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

.production-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.production-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 340px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.production-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
}

.production-column-header .route-print-list-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.production-column-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.production-column-header span {
  min-width: 28px;
  padding: 4px 8px;
  color: var(--ink);
  background: #eef2f7;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
}

.production-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 7px;
}

.production-card summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.production-card summary strong {
  color: var(--ink);
}

.production-card summary span,
.production-card summary small {
  color: var(--muted);
}

.production-card summary b {
  color: var(--ink);
}

.production-card.urgency-red {
  border-left-color: var(--rose);
}

.production-card.urgency-orange,
.production-card.urgency-yellow {
  border-left-color: var(--gold);
}

.production-card.urgency-green {
  border-left-color: var(--green);
}

.production-internal-notes {
  padding: 10px;
  border: 1px solid #f2cc7d;
  border-radius: 7px;
  background: #fff8e6;
}

.production-internal-notes strong {
  color: #8a5200;
}

.production-internal-notes span {
  white-space: pre-wrap;
  color: var(--ink);
  font-weight: 700;
}

.urgency-tag,
.route-sync-badge {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.urgency-tag.urgency-red {
  color: #b42318;
  background: #fff0ed;
  border: 1px solid #ffb4a8;
}

.urgency-tag.urgency-orange,
.urgency-tag.urgency-yellow {
  color: #9a5b00;
  background: #fff4d6;
  border: 1px solid #ffd687;
}

.urgency-tag.urgency-green,
.route-sync-badge {
  color: #166534;
  background: #e8f7ee;
  border: 1px solid #a7dfba;
}

.route-sync-badge.is-held {
  color: #6b7280;
  background: #f1f5f9;
  border-color: #d6dde8;
}

.production-actions button {
  font-size: 12px;
  padding: 8px 10px;
}

.production-actions button.is-current-stage {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

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

.route-sync-panel {
  padding: 12px;
}

.route-sync-panel .section-heading {
  padding: 0;
  margin-bottom: 10px;
  border: 0;
  box-shadow: none;
}

.route-sync-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.route-sync-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.route-sync-table th,
.route-sync-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.route-sync-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.production-item summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.priority-muy_urgente {
  border-left: 5px solid var(--rose);
}

.priority-media {
  border-left: 5px solid var(--gold);
}

.priority-normal {
  border-left: 5px solid var(--green);
}

.production-photo {
  display: block;
  width: min(520px, 100%);
  max-height: 360px;
  object-fit: contain;
  margin: 12px 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sales-check-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.sales-check-panel div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sale-item {
  display: grid;
  align-items: start;
}

.sale-item.is-in-routes {
  border-color: #f2c24e;
  background: #fff8e1;
  box-shadow: inset 5px 0 0 #d59b12;
}

.sale-item.is-repair-sale {
  box-shadow: inset 5px 0 0 #0f766e;
}

.sale-item.is-in-routes.is-repair-sale {
  box-shadow: inset 5px 0 0 #d59b12, inset 10px 0 0 #0f766e;
}

.sale-item summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.sale-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.sale-detail-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.sale-detail-grid strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.detail-wide,
.sales-observations-field {
  grid-column: 1 / -1;
}

.sale-items-detail,
.sale-items-preview {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.sale-items-detail span,
.sale-items-preview article,
.sale-items-preview > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.sale-items-preview button {
  min-height: 30px;
  padding: 5px 8px;
}

.sales-line-tools {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.payment-method-panel {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, auto) minmax(160px, 1fr);
  gap: 8px 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.payment-method-panel legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-method-panel label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.payment-method-panel input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.payment-method-panel input[name="paymentMethodCustom"] {
  min-height: 34px;
  padding: 7px 9px;
}

.quote-wholesale-toggle {
  align-self: end;
  min-height: 42px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.sale-money {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  text-align: left;
}

.sale-money strong {
  color: var(--brand);
}

.sale-ticket-preview {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 12px;
  padding: 12px;
  color: #24513a;
  background: #eef9f2;
  border: 1px solid #a7dfba;
  border-radius: 8px;
}

.sale-ticket-preview img {
  width: min(100%, 360px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 12px 28px rgba(29, 36, 51, 0.14);
}

.ticket-download-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  color: #fff;
  background: var(--brand);
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #cbd3df;
  border-radius: 8px;
}

.details-lazy-placeholder {
  padding: 12px;
  margin-top: 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.print-area {
  display: none;
}

.route-ticket {
  display: grid;
  gap: 16px;
  color: #111827;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.route-ticket header,
.route-ticket footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid #17233a;
  padding-bottom: 12px;
}

.route-ticket footer {
  border-top: 1px solid #d7dce6;
  border-bottom: 0;
  padding-top: 12px;
  color: #4b5563;
  font-size: 12px;
}

.route-ticket h1 {
  margin: 0;
  font-size: 24px;
}

.route-ticket p {
  margin: 0 0 4px;
  color: #ad7806;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.route-ticket header strong {
  padding: 8px 12px;
  border: 1px solid #17233a;
  border-radius: 6px;
  font-size: 18px;
}

.ticket-main {
  display: grid;
  grid-template-columns: 0.95fr 1.4fr;
  gap: 16px;
  align-items: start;
}

.ticket-image {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ticket-image img {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  background: #f8fafc;
}

.ticket-image figcaption,
.ticket-no-image {
  color: #4b5563;
  font-size: 12px;
  text-align: center;
}

.ticket-no-image {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #9aa4b2;
  border-radius: 8px;
  background: #f8fafc;
}

.ticket-details,
.ticket-money {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #d7dce6;
  border-radius: 8px;
  overflow: hidden;
}

.ticket-money {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ticket-details div,
.ticket-money div {
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 10px;
  border-right: 1px solid #d7dce6;
  border-bottom: 1px solid #d7dce6;
}

.ticket-details strong,
.ticket-money strong {
  color: #4b5563;
  font-size: 11px;
  text-transform: uppercase;
}

.ticket-details span,
.ticket-money span {
  font-size: 14px;
  font-weight: 700;
}

.ticket-list-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d7dce6;
  border-radius: 8px;
  overflow: hidden;
}

.ticket-list-summary div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-right: 1px solid #d7dce6;
}

.ticket-list-summary strong {
  color: #4b5563;
  font-size: 11px;
  text-transform: uppercase;
}

.ticket-list-summary span {
  font-size: 15px;
  font-weight: 800;
}

.ticket-list-items {
  display: grid;
  gap: 12px;
}

.route-ticket-mini {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  break-inside: avoid;
}

.ticket-mini-image {
  display: grid;
  place-items: center;
  min-height: 130px;
  background: #f8fafc;
  border: 1px solid #d7dce6;
  border-radius: 7px;
}

.ticket-mini-image img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.ticket-mini-no-image {
  color: #4b5563;
  font-size: 12px;
}

.ticket-mini-info {
  display: grid;
  gap: 8px;
}

.ticket-mini-info h2 {
  margin: 0;
  font-size: 17px;
}

.ticket-mini-info > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #d7dce6;
  border-radius: 7px;
  overflow: hidden;
}

.ticket-mini-info > div div {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-right: 1px solid #d7dce6;
  border-bottom: 1px solid #d7dce6;
}

.ticket-mini-info strong {
  color: #4b5563;
  font-size: 10px;
  text-transform: uppercase;
}

.ticket-mini-info span {
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1050px) {
  .dashboard,
  #agentsPanel,
  .login-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .layaway-grid,
  .layaway-payment-form {
    grid-template-columns: 1fr 1fr;
  }

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

  .dashboard-summary,
  .production-summary,
  .routes-summary,
  .routes-layout {
    grid-template-columns: 1fr;
  }

  .production-filters {
    grid-template-columns: 1fr 1fr;
  }

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

  .sale-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .login-view,
  .main-workspace,
  .sidebar {
    padding: 14px;
  }

  .workspace-header,
  .activity-item,
  .sale-item,
  .production-item,
  .search-form,
  .route-date-form,
  .user-item,
  .roadmap article,
  .chat-form {
    display: grid;
  }

  .nav-tabs,
  .sales-form,
  .layaway-grid,
  .layaway-payment-form,
  .case-form,
  .case-update-form,
  .product-form,
  .compact-form,
  .search-form,
  .route-date-form,
  .settings-form,
  .technical-sheet-form,
  .technical-hero,
  .dashboard-summary,
  .production-summary,
  .production-filters,
  .routes-summary,
  .day-row,
  .detail-grid,
  .sale-detail-grid,
  .sales-check-panel div,
  .user-form,
  .warranty-form,
  .warranty-line,
  .direct-warranty-line {
    grid-template-columns: 1fr;
  }

  .technical-benefits > div {
    grid-template-columns: 1fr 1fr;
  }

  .conversation {
    min-height: 620px;
  }
}

@page {
  size: letter portrait;
  margin: 12mm;
}

@media print {
  html,
  body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    font-size: 11pt;
    overflow: visible;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > *:not(.print-area) {
    display: none !important;
  }

  .no-print,
  button,
  nav,
  aside,
  .sidebar,
  .navbar,
  .toolbar,
  .actions,
  .route-actions,
  .nav-tabs,
  .search-form,
  .compact-form,
  .print-toolbar {
    display: none !important;
  }

  .print-area {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .print-page {
    width: 100%;
    max-width: 100%;
    page-break-after: always;
    break-after: page;
  }

  .print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .new-page {
    page-break-before: always;
    break-before: page;
  }

  .avoid-break,
  .card,
  .section,
  .summary,
  .totals,
  .signatures,
  .observations,
  .customer-info,
  .header,
  .footer,
  .ticket-main,
  .ticket-money,
  .ticket-image,
  .ticket-list-summary,
  .letterhead-header,
  .letterhead-footer,
  .document-signature,
  .document-totals {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    page-break-inside: auto;
    break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  tr,
  td,
  th {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  td,
  th {
    vertical-align: top;
    overflow-wrap: anywhere;
  }

  img {
    max-width: 100%;
    height: auto;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
    break-after: avoid;
  }

  .route-ticket {
    width: 100%;
    min-height: auto;
    margin: 0 auto;
  }
}

.copy-image-fallback {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.copy-image-fallback-panel {
  width: min(980px, 96vw);
  max-height: 94vh;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}

.copy-image-fallback-panel img {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.local-notice-area {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
}

.local-notice {
  transform: translateY(8px);
  opacity: 0;
  padding: 12px 14px;
  border: 1px solid #99d4ce;
  border-radius: 8px;
  color: #0f172a;
  background: #eefcf9;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  font-weight: 700;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.local-notice.is-visible {
  transform: translateY(0);
  opacity: 1;
}
