:root {
  --bg: #eef4f7;
  --panel: #ffffff;
  --text: #1c2930;
  --muted: #64747d;
  --line: #d8e2e6;
  --primary: #007b8a;
  --primary-dark: #00616d;
  --accent: #2f855a;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

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

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

button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  padding: 7px 12px;
  font-weight: 650;
  max-width: 100%;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f1c13;
}

button.success {
  background: var(--accent);
}

button.success:hover {
  background: #276749;
}

button.warning {
  background: #f2c94c;
  color: #1f2933;
}

button.warning:hover {
  background: #e6bb36;
}

button.small-button {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 4px;
}

a.button-link {
  align-items: center;
  background: var(--primary);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 650;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  text-decoration: none;
}

a.button-link:hover {
  background: var(--primary-dark);
}

a.button-link.small-button {
  border-radius: 4px;
  font-size: 11px;
  min-height: 26px;
  padding: 3px 7px;
}

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

.check-grid label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  padding: 8px;
}

.check-grid input {
  width: auto;
}

.section-spacer {
  margin-top: 22px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

label.checkbox-line {
  align-items: center;
  display: flex;
  gap: 8px;
}

label.checkbox-line input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
  width: auto;
}

.product-lot-check {
  min-width: max-content;
  white-space: nowrap;
}

.product-lot-options {
  display: grid;
  gap: 6px;
}

.kit-client-edit {
  display: grid;
  gap: 5px;
  min-width: 135px;
}

.kit-client-edit input[type="date"] {
  min-width: 135px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7fafb;
  color: #40525b;
  font-size: 11px;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(22, 45, 56, .12);
}

.login-panel h1 {
  margin-bottom: 18px;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 44px;
}

.system-version {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(100, 116, 125, .22);
  border-radius: 7px;
  bottom: max(9px, env(safe-area-inset-bottom));
  box-shadow: 0 4px 14px rgba(22, 45, 56, .08);
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  gap: 5px;
  left: max(10px, env(safe-area-inset-left));
  line-height: 1;
  padding: 6px 8px;
  pointer-events: none;
  position: fixed;
  user-select: none;
  z-index: 90;
}

.system-version-icon {
  color: var(--primary-dark);
  font-size: 12px;
  line-height: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - 1680px) / 2 + 16px));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 22px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.topbar-logo {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  object-position: center;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.notification-center {
  position: relative;
}

.notification-bell {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  min-height: 40px;
  padding: 0;
  position: relative;
  width: 40px;
}

.notification-bell:hover,
.notification-bell:focus-visible {
  background: #f8fbfc;
  border-color: #b9cbd2;
}

.notification-bell svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}

.notification-bell.has-unread {
  border-color: #ef9a94;
  color: var(--danger);
}

.notification-bell.new-arrival {
  animation: notification-pulse 1s ease-in-out 3;
}

@keyframes notification-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0); transform: scale(1); }
  50% { box-shadow: 0 0 0 7px rgba(180, 35, 24, .14); transform: scale(1.06); }
}

.notification-badge {
  align-items: center;
  background: #dc2626;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 10px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  padding: 0 4px;
  position: absolute;
  right: -6px;
  top: -6px;
}

.notification-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(22, 45, 56, .2);
  max-height: min(620px, calc(100vh - 86px));
  overflow: auto;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: min(430px, calc(100vw - 24px));
  z-index: 60;
}

.notification-panel::before {
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  content: "";
  height: 10px;
  position: absolute;
  right: 14px;
  top: -6px;
  transform: rotate(45deg);
  width: 10px;
}

.notification-panel-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 2px 2px 10px;
}

.notification-panel-heading h2 {
  font-size: 17px;
}

.notification-panel-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

button.text-button {
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  min-height: 0;
  padding: 3px;
}

button.text-button:hover {
  background: #eaf4f6;
}

.notification-quick-list {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.notification-quick-item {
  align-items: start;
  border-bottom: 1px solid #e7eef1;
  display: grid;
  gap: 9px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  padding: 10px 2px;
}

.notification-quick-item:last-child {
  border-bottom: 0;
}

.notification-quick-item.is-unread {
  background: #fffafa;
}

.notification-priority-dot {
  background: #7b8b94;
  border-radius: 50%;
  height: 8px;
  margin-top: 5px;
  width: 8px;
}

.notification-priority-dot.alta { background: #dc2626; }
.notification-priority-dot.media { background: #d99500; }
.notification-priority-dot.baja { background: #1976d2; }

.notification-quick-content strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.notification-quick-content p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.notification-quick-actions {
  align-items: end;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.notification-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 750;
  padding: 3px 7px;
}

.notification-status.proximo { background: #fdecec; color: var(--danger); }
.notification-status.hoy { background: #fff0c7; color: #805b00; }
.notification-status.vencido { background: #b42318; color: #fff; }
.notification-status.pendiente { background: #e5f1fb; color: #1769aa; }
.notification-status.completado { background: #e7f7ef; color: var(--accent); }

.notification-read-button {
  font-size: 10px;
  min-height: 24px;
  padding: 2px 6px;
}

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

.notification-manage-button {
  margin-top: 10px;
  width: 100%;
}

#logoutBtn {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

#logoutBtn:hover {
  background: #b91c1c;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 7px max(16px, calc((100vw - 1680px) / 2 + 16px));
  background: #f8fbfc;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tabs button {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  min-height: 30px;
  padding: 5px 10px;
}

.tabs button.active {
  background: #fff;
  border-color: var(--line);
  color: var(--primary-dark);
}

.tab-panel {
  display: none;
  width: min(100%, 1724px);
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.split > * {
  min-width: 0;
}

.production-layout {
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.stack {
  display: grid;
  gap: 10px;
}

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

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

.reminders-page-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.reminders-page-heading h2 {
  font-size: 23px;
  margin-top: 4px;
}

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

.reminders-layout.read-only {
  grid-template-columns: 1fr;
}

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

.reminders-list-panel {
  min-height: 430px;
}

.reminders-list-heading {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.reminder-search {
  min-width: min(280px, 100%);
}

.reminder-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.reminder-filters button {
  font-size: 12px;
  min-height: 30px;
  padding: 4px 9px;
}

.reminder-filters button.active {
  background: #e7f5f7;
  border-color: #94cbd2;
  color: var(--primary-dark);
}

.reminder-filters span {
  color: var(--muted);
  margin-left: 3px;
}

.reminders-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.reminder-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 10px minmax(190px, 1fr) minmax(145px, auto) auto;
  padding: 12px;
}

.reminder-row:last-child {
  border-bottom: 0;
}

.reminder-row.is-completed {
  background: #f8fbf9;
}

.reminder-main strong {
  display: block;
  font-size: 14px;
}

.reminder-main p,
.reminder-meta p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.reminder-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reminder-meta {
  min-width: 0;
}

.reminder-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.reminder-row-actions button {
  white-space: nowrap;
}

.reminders-list .empty {
  padding: 28px 12px;
  text-align: center;
}

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

.report-row {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, auto);
  padding-top: 14px;
}

.report-row h3 {
  font-size: 24px;
  line-height: 1.18;
  margin-bottom: 8px;
}

.report-row p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.report-filters {
  align-items: end;
  grid-template-columns: 110px 170px auto;
  margin: 0;
}

.ranking-filters {
  grid-template-columns: 130px 160px 160px auto;
}

.provider-report-filters {
  grid-template-columns: minmax(170px, 1fr) 130px 140px 90px 140px auto;
}

.production-report-filters {
  grid-template-columns: 160px 110px 170px minmax(210px, auto) auto;
}

.production-report-maintenance-option {
  align-self: center;
  color: var(--text);
  min-height: 34px;
  padding: 0 4px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  width: 100%;
}

.table-wrap table {
  min-width: 620px;
}

.pagination-bar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.pagination-bar span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

#localidadesLista table,
#zonasLista table,
#tiposClienteLista table,
#categoriasLista table,
#rolesLista table {
  min-width: 420px;
}

#localidadesLista.table-wrap,
#zonasLista.table-wrap,
#tiposClienteLista.table-wrap {
  overflow-x: visible;
}

#categoriasLista.table-wrap {
  overflow-x: visible;
}

#localidadesLista table,
#zonasLista table,
#tiposClienteLista table {
  min-width: 0;
  table-layout: fixed;
}

#categoriasLista table {
  min-width: 0;
  table-layout: fixed;
}

#localidadesLista th:last-child,
#localidadesLista td:last-child,
#zonasLista th:last-child,
#zonasLista td:last-child,
#tiposClienteLista th:last-child,
#tiposClienteLista td:last-child,
#categoriasLista th:last-child,
#categoriasLista td:last-child {
  width: 88px;
  white-space: nowrap;
}

#localidadesLista td:first-child,
#zonasLista td:first-child,
#tiposClienteLista td:first-child,
#categoriasLista td:first-child {
  overflow-wrap: anywhere;
}

#clientesLista table {
  min-width: 900px;
  table-layout: fixed;
}

#clientesLista th:nth-child(1),
#clientesLista td:nth-child(1) {
  width: 15%;
}

#clientesLista th:nth-child(2),
#clientesLista td:nth-child(2) {
  width: 13%;
}

#clientesLista th:nth-child(3),
#clientesLista td:nth-child(3) {
  width: 10%;
}

#clientesLista th:nth-child(4),
#clientesLista td:nth-child(4) {
  width: 10%;
}

#clientesLista th:nth-child(5),
#clientesLista td:nth-child(5) {
  width: 10%;
}

#clientesLista th:nth-child(6),
#clientesLista td:nth-child(6) {
  width: 20%;
}

#clientesLista th:nth-child(7),
#clientesLista td:nth-child(7) {
  width: 22%;
}

#clientesLista td {
  overflow-wrap: anywhere;
}

#clientesLista .row-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

#clientesLista .small-button {
  font-size: 10px;
  min-height: 24px;
  overflow-wrap: normal;
  padding: 3px 6px;
  white-space: nowrap;
}

#dispensersLista table {
  min-width: 780px;
  table-layout: fixed;
}

#dispensersLista th:nth-child(1),
#dispensersLista td:nth-child(1) {
  width: 7%;
}

#dispensersLista th:nth-child(2),
#dispensersLista td:nth-child(2) {
  width: 6%;
}

#dispensersLista th:nth-child(3),
#dispensersLista td:nth-child(3) {
  width: 20%;
}

#dispensersLista th:nth-child(4),
#dispensersLista td:nth-child(4) {
  width: 11%;
}

#dispensersLista th:nth-child(5),
#dispensersLista td:nth-child(5) {
  width: 10%;
}

#dispensersLista th:nth-child(6),
#dispensersLista td:nth-child(6) {
  width: 11%;
}

#dispensersLista th:nth-child(7),
#dispensersLista td:nth-child(7) {
  width: 15%;
}

#dispensersLista th:nth-child(8),
#dispensersLista td:nth-child(8) {
  width: 20%;
}

#dispensersLista td {
  overflow-wrap: anywhere;
}

.dispenser-client-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.client-table-meta {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

.product-table-meta {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

.product-price-tax-editor {
  display: grid;
  gap: 5px;
  min-width: 110px;
}

.search-field {
  margin-top: 8px;
}

.panel-description {
  color: var(--muted);
  margin-top: 4px;
}

.results-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.global-balance-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px);
  margin-top: 14px;
}

.section-title-row.global-balance-title-row {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.global-balance-title-row .results-count {
  align-self: center;
  justify-self: end;
  margin-top: 0;
}

.global-balances-table td:nth-child(4),
.global-balances-table td:nth-child(5) {
  white-space: nowrap;
}

.global-balances-table .table-sort-button,
#clientesLista .table-sort-button,
#repartosLista .table-sort-button,
#productosLista .table-sort-button,
#dispensersLista .table-sort-button,
#dispenserModelosLista .table-sort-button,
#proveedorMovimientosLista .table-sort-button {
  align-items: center;
  background: transparent;
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  gap: 5px;
  min-height: 0;
  padding: 0;
  text-transform: uppercase;
}

.global-balances-table .table-sort-button:hover,
.global-balances-table .table-sort-button.active,
#clientesLista .table-sort-button:hover,
#clientesLista .table-sort-button.active,
#repartosLista .table-sort-button:hover,
#repartosLista .table-sort-button.active,
#productosLista .table-sort-button:hover,
#productosLista .table-sort-button.active,
#dispensersLista .table-sort-button:hover,
#dispensersLista .table-sort-button.active,
#dispenserModelosLista .table-sort-button:hover,
#dispenserModelosLista .table-sort-button.active,
#proveedorMovimientosLista .table-sort-button:hover,
#proveedorMovimientosLista .table-sort-button.active {
  background: transparent;
  color: var(--primary-dark);
}

.global-balances-table .table-sort-button span,
#clientesLista .table-sort-button span,
#repartosLista .table-sort-button span,
#productosLista .table-sort-button span,
#dispensersLista .table-sort-button span,
#dispenserModelosLista .table-sort-button span,
#proveedorMovimientosLista .table-sort-button span {
  font-size: 13px;
  line-height: 1;
}

.global-balance-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.whatsapp-button.global-whatsapp-button {
  grid-column: auto;
  grid-row: auto;
  height: 30px;
  min-height: 30px;
  min-width: 30px;
  padding: 5px;
  width: 30px;
}

.whatsapp-button.global-whatsapp-button svg {
  height: 18px;
  width: 18px;
}

.table-secondary-text {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 3px;
}

.touch-hidden-field {
  display: none;
}

.selector-button {
  justify-content: center;
  min-height: 44px;
  width: 100%;
}

.client-select-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-client-sheet {
  max-width: 520px;
  overflow: auto;
}

.selected-client-card {
  border: 1px solid #b9d9e0;
  border-radius: 8px;
  background: #f6fbfc;
  color: var(--text);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

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

.selected-client-card.is-empty {
  border-style: dashed;
  color: var(--muted);
}

.client-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.client-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 600;
}

.client-row:hover,
.client-row.active {
  border-color: var(--primary);
  background: #eefafa;
  color: var(--text);
}

.client-row strong,
.client-row small {
  display: block;
}

.client-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.client-row b {
  white-space: nowrap;
}

.debt {
  color: var(--danger);
}

.credit {
  color: var(--accent);
}

.account-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

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

.account-header > div:first-child {
  min-width: 230px;
}

.account-balance {
  align-self: center;
  grid-column: 4;
  grid-row: 1;
  width: 128px;
  min-height: 70px;
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbfc;
  text-align: right;
}

.account-balance span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-balance strong {
  display: block;
  font-size: 19px;
}

.account-actions {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(86px, auto) 40px minmax(128px, auto);
  align-items: center;
  gap: 8px;
  flex: 1;
}

.account-payment-fields {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: end;
}

.account-payment-fields label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-payment-fields input,
.account-payment-fields select {
  margin-top: 6px;
}

.cheque-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
  min-width: 0;
}

.cheque-fields label {
  min-width: 0;
}

.cheque-fields .cheque-observaciones {
  grid-column: 1 / -1;
}

.cheque-fields textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
}

.reparto-payment-amount {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.reparto-payment-amount input {
  display: block;
  width: 100%;
  min-width: 120px;
  margin-top: 4px;
  font-size: 13px;
}

.account-payment-button {
  align-self: center;
  grid-column: 2;
  grid-row: 1;
  width: 86px;
  height: 40px;
  min-width: 86px;
}

.whatsapp-button {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
}

.whatsapp-button:hover {
  background: #1da851;
}

.whatsapp-button svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.date-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(135px, 190px));
  gap: 8px;
  margin-top: 8px;
}

.inline-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(135px, 190px);
  margin-bottom: 8px;
}

.section-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.production-period-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.production-period-controls label {
  min-width: 160px;
}

.production-period-controls input {
  min-height: 34px;
}

.production-maintenance-fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2px 0 0;
  min-width: 0;
  padding: 12px 0 0;
}

.production-maintenance-fieldset legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 0 6px 0 0;
}

.production-maintenance-fieldset .panel-description {
  margin: 0 0 8px;
}

.production-maintenance-list {
  display: grid;
  gap: 7px 12px;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, auto);
}

.production-maintenance-option {
  align-items: flex-start;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 500;
  gap: 7px;
  line-height: 1.3;
  min-width: 0;
}

.production-maintenance-option input[type="checkbox"] {
  accent-color: var(--primary);
  flex: 0 0 auto;
  margin: 1px 0 0;
  width: auto;
}

.production-maintenance-option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  grid-row: 6;
}

.production-maintenance-unregistered {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.production-maintenance-toggle {
  align-items: center;
  background: #e7f5f7;
  border: 1px solid transparent;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  gap: 5px;
  justify-content: center;
  line-height: 1.2;
  min-height: 24px;
  padding: 3px 8px;
  white-space: nowrap;
}

.production-maintenance-toggle:hover,
.production-maintenance-toggle:focus-visible,
.production-maintenance-toggle[aria-expanded="true"] {
  background: #d5eef1;
  border-color: #a8d8df;
  color: var(--primary-dark);
}

.production-maintenance-toggle-icon {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.production-maintenance-toggle[aria-expanded="true"] .production-maintenance-toggle-icon {
  transform: rotate(180deg);
}

.production-maintenance-detail-row td {
  background: #f5fafb;
  box-shadow: inset 4px 0 #80c5cf;
  padding: 10px 12px;
}

.production-maintenance-detail-panel {
  display: grid;
  gap: 8px;
}

.production-maintenance-detail-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.production-maintenance-detail-heading strong {
  color: var(--primary-dark);
  font-size: 12px;
}

.production-maintenance-detail-heading span,
.production-maintenance-detail-panel p {
  color: var(--muted);
  font-size: 11px;
}

.production-maintenance-detail-panel ul {
  display: grid;
  gap: 5px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.production-maintenance-detail-panel li {
  align-items: flex-start;
  display: flex;
  font-size: 11px;
  gap: 6px;
  line-height: 1.35;
}

.production-maintenance-detail-panel li::before {
  color: var(--accent);
  content: "✓";
  flex: 0 0 auto;
  font-weight: 800;
}

.account-invoice-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

#cuentaFacturaSeleccion {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-invoice-note {
  background: #eef9fb;
  border-left: 3px solid var(--primary);
  color: #40525b;
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0;
  padding: 7px 9px;
}

.invoice-select-cell {
  min-width: 98px;
}

.invoice-select-cell input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
  height: 18px;
  margin: 2px 0;
  width: 18px;
}

.invoice-draft-badge,
.invoice-draft-label {
  background: #e9f7f4;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  padding: 4px 8px;
  white-space: nowrap;
}

.invoice-draft-badge.is-invoiced {
  background: #e7f7ef;
  color: var(--accent);
}

.invoice-draft-badge.is-cancelled,
.invoice-draft-badge.is-error {
  background: #fdecec;
  color: var(--danger);
}

.invoice-draft-badge.is-pending {
  background: #fff4d6;
  color: #725800;
}

.invoice-draft-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.invoice-drafts-table td:nth-child(1),
.invoice-drafts-table td:nth-child(2),
.invoice-drafts-table td:nth-child(4),
.invoice-drafts-table td:nth-child(5),
.invoice-drafts-table td:nth-child(6),
.invoice-drafts-table td:nth-child(7),
.invoice-drafts-table td:nth-child(8),
.invoice-drafts-table td:nth-child(9),
.invoice-drafts-table td:nth-child(10) {
  white-space: nowrap;
}

.invoice-preview-modal {
  overflow-y: auto;
  padding-top: 20px;
}

.picker-sheet.invoice-preview-sheet {
  flex: 0 0 auto;
  gap: 14px;
  max-height: none;
  max-width: 1040px;
  overflow: visible;
  padding: 22px;
}

.invoice-preview-head h2 {
  font-size: 24px;
  margin-top: 6px;
}

.invoice-preview-parties {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-preview-parties article {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 14px;
}

.invoice-preview-parties article > span,
.invoice-preview-meta span {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-parties article > strong {
  font-size: 18px;
}

.invoice-preview-parties p {
  color: #40525b;
}

.invoice-preview-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.invoice-preview-meta > div {
  display: grid;
  gap: 4px;
}

.invoice-preview-items {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.invoice-preview-items table {
  min-width: 660px;
}

.invoice-preview-items td:last-child,
.invoice-preview-items th:last-child,
.invoice-preview-items td:nth-child(3),
.invoice-preview-items th:nth-child(3) {
  text-align: right;
}

.invoice-preview-summary {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.invoice-preview-summary > p {
  color: var(--muted);
  padding-top: 8px;
}

.invoice-preview-totals {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.invoice-preview-totals > div {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 8px 12px;
}

.invoice-preview-totals > div + div {
  border-top: 1px solid var(--line);
}

.invoice-preview-total {
  font-size: 20px;
}

.invoice-preview-warning {
  background: #eef7ff;
  border: 1px solid #b8d9f3;
  border-radius: 8px;
  color: #23445b;
  line-height: 1.45;
  padding: 11px 13px;
}

.invoice-preview-authorization {
  background: #e9f7ef;
  border: 1px solid #a9dbc1;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 14px;
}

.invoice-preview-authorization > div {
  display: grid;
  gap: 4px;
}

.invoice-preview-authorization span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
}

.repartos-filters {
  grid-template-columns: minmax(170px, 220px) fit-content(440px) minmax(135px, 190px) minmax(135px, 190px);
  align-items: end;
}

.repartos-zonas-filter {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0;
  min-width: 0;
  padding: 5px 9px 7px;
}

.repartos-zonas-filter legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 0 3px;
}

.repartos-zonas-filter small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

.repartos-zonas-opciones {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px 12px;
  min-height: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.repartos-zona-opcion {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
}

.repartos-zona-opcion input[type="checkbox"] {
  margin: 0;
  width: auto;
}

.proveedor-cuenta-filters {
  align-items: end;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 220px) minmax(150px, 220px) 86px;
  max-width: 760px;
}

.proveedor-cuenta-filters button {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  width: 86px;
}

.compras-shell,
.cuentas-shell {
  display: grid;
  gap: 8px;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}

.subtabs button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  width: auto;
  min-width: 108px;
  min-height: 30px;
  padding: 5px 10px;
}

.subtabs button:hover {
  background: #f7fafb;
  color: var(--primary-dark);
}

.subtabs button.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.repartos-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.repartos-productos {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  margin: 10px 0;
  padding: 12px;
}

.repartos-productos h3 {
  color: var(--primary-dark);
  font-size: 15px;
  margin: 0 0 9px;
}

.repartos-productos-vacio {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.repartos-productos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repartos-producto {
  align-items: center;
  background: #fff;
  border: 1px solid #ccfbf1;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 190px;
  padding: 7px 9px;
}

.repartos-producto strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.pedido-observacion-row td {
  background: #fff7d6;
  box-shadow: inset 4px 0 #d4a72c;
  color: #5d4b08;
  padding: 9px 12px;
}

.pedido-numero {
  align-items: center;
  display: flex;
  gap: 5px;
}

.pedido-observacion-icon {
  align-items: center;
  color: #725800;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
}

.pedido-observacion-content {
  display: flex;
  gap: 5px;
  white-space: pre-wrap;
}

.pedido-observacion-content strong {
  color: #725800;
  flex: 0 0 auto;
}

.movement-form {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.pedido-layout {
  width: 100%;
  max-width: 1280px;
}

.pedido-form {
  width: 100%;
}

.config-page-form {
  width: min(1080px, 100%);
}

.config-form {
  width: 100%;
}

.arca-connection-panel {
  margin-top: 16px;
  width: min(1080px, 100%);
}

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

.arca-connection-heading-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.arca-connection-summary .metric strong {
  font-size: 17px;
}

.arca-connection-notice {
  background: #eef9fb;
  border: 1px solid #b7dfe5;
  border-left: 4px solid var(--primary);
  border-radius: 7px;
  color: #40525b;
  line-height: 1.45;
  padding: 11px 13px;
}

.arca-connection-notice.error {
  background: #fff3f2;
  border-color: #efc7c3;
  border-left-color: var(--danger);
  color: #7a271f;
}

.arca-verification-result {
  background: #e7f7ef;
  border: 1px solid #b7dfca;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  color: #246b49;
  font-weight: 650;
  line-height: 1.4;
  padding: 9px 12px;
  white-space: pre-line;
}

.arca-verification-result.error {
  background: #fff3f2;
  border-color: #efc7c3;
  border-left-color: var(--danger);
  color: #7a271f;
}

.arca-credential-step {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 13px;
  grid-template-columns: 30px minmax(0, 1fr);
  padding-top: 15px;
}

.arca-step-number {
  align-items: center;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.arca-csr-form,
.arca-certificate-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(230px, 1fr) auto;
}

.arca-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.arca-doc-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 650;
  min-height: 34px;
  padding: 7px 12px;
  text-decoration: none;
  width: fit-content;
}

.arca-doc-link:hover {
  background: #eef9fb;
}

.arca-certificate-detail {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  overflow-wrap: anywhere;
  padding: 12px;
}

.arca-certificate-detail strong {
  color: var(--muted);
}

.config-fiscal-section,
.client-fiscal-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.config-fiscal-section h3,
.client-fiscal-section h3 {
  margin: 0;
}

.company-logo-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
}

.company-logo-field label {
  width: 100%;
}

.company-logo-field small {
  color: var(--muted);
}

.company-logo-preview {
  width: 120px;
  height: 120px;
  padding: 8px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  justify-self: start;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 0.9fr) 96px 48px;
  gap: 8px;
  align-items: start;
}

.pedido-product-field,
.pedido-manual-fields {
  display: grid;
  gap: 6px;
}

.pedido-manual-fields {
  grid-template-columns: minmax(145px, 1fr) minmax(110px, 0.7fr);
}

.product-selector-button {
  min-height: 42px;
}

.item-quantity,
.remove-item-button {
  align-self: start;
}

.remove-item-button {
  min-height: 31px;
  margin-top: 19px;
  padding-inline: 0;
  width: 100%;
}

.benefit-box,
.item-benefit {
  background: #eef9f7;
  border: 1px solid #b9e5de;
  border-radius: 6px;
  color: #155e57;
  font-size: 13px;
  padding: 8px 10px;
}

.item-benefit {
  grid-column: 1 / -1;
  padding: 6px 8px;
}

.row-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.category-form {
  margin-top: 12px;
}

#categoriaCompraForm label {
  max-width: 230px;
}

#categoriaCompraForm input {
  width: 100%;
}

.purchase-categories-table table {
  min-width: 0;
  width: 100%;
}

.purchase-categories-table th:last-child,
.purchase-categories-table td:last-child {
  width: 132px;
}

.purchase-categories-table .row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.purchase-categories-table .small-button {
  padding: 6px 8px;
}

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

button.repair-button {
  background: #f2c94c;
  color: #1f2933;
}

button.repair-button:hover {
  background: #e6bb36;
}

.field-title {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bonus-lines {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.bonus-line {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 78px auto;
  gap: 6px;
  align-items: center;
}

.bonus-line input,
.bonus-line select {
  min-width: 0;
}

.product-image-cell {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 170px;
}

.product-image-cell input {
  font-size: 12px;
  padding: 6px;
}

.image-picker-control {
  max-width: 100%;
}

.image-picker-control .image-picker-input {
  display: none;
}

.image-picker-control button {
  width: auto;
  min-width: 74px;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}

.product-thumb-small {
  width: 38px;
  height: 38px;
}

.product-thumb-empty {
  position: relative;
}

.product-thumb-empty::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-top: 2px solid #9aabb3;
  border-bottom: 2px solid #9aabb3;
}

.selected-product-preview {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 650;
  gap: 8px;
  min-height: 38px;
}

.selected-product-preview.is-empty {
  color: var(--muted);
}

.selected-product-preview span {
  display: grid;
  gap: 2px;
}

.selected-product-preview small {
  color: var(--muted);
  font-weight: 500;
}

#pickerModal.hidden {
  display: none;
}

.picker-modal {
  align-items: flex-start;
  background: rgba(15, 31, 38, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 42px 14px 14px;
  position: fixed;
  z-index: 100;
}

.update-notice-modal {
  align-items: center;
  padding: 14px;
}

.update-notice-sheet {
  gap: 16px;
  max-width: 590px;
  overflow-y: auto;
  padding: 24px;
}

.update-notice-heading {
  display: grid;
  gap: 10px;
}

.update-notice-heading h2 {
  font-size: clamp(21px, 4vw, 28px);
  line-height: 1.2;
}

.update-notice-badge {
  background: #e9f7f4;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 750;
  justify-self: start;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.update-notice-list {
  display: grid;
  gap: 10px;
  line-height: 1.45;
  margin: 0;
  padding-left: 22px;
}

.update-notice-actions {
  display: flex;
  justify-content: flex-end;
}

.update-notice-actions button {
  min-width: 130px;
}

.picker-sheet {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(10, 25, 30, 0.28);
  display: grid;
  gap: 10px;
  max-height: min(760px, calc(100vh - 28px));
  max-width: 720px;
  overflow: hidden;
  padding: 14px;
  width: 100%;
}

.delivery-confirmation-modal {
  align-items: center;
  padding: 14px;
}

.delivery-confirmation-sheet {
  gap: 14px;
  max-width: 620px;
  overflow-y: auto;
  padding: 20px;
}

.delivery-confirmation-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.delivery-confirmation-head h3 {
  font-size: 21px;
  line-height: 1.25;
}

.delivery-confirmation-form {
  display: grid;
  gap: 14px;
}

.order-item-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.32fr);
}

.order-item-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: -3px 0 0;
}

.delivery-order-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
}

.delivery-order-summary div {
  display: grid;
  gap: 3px;
}

.delivery-order-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.delivery-order-summary dd {
  font-size: 16px;
  margin: 0;
}

.delivery-order-summary dd strong {
  color: var(--primary-dark);
  font-size: 19px;
}

.delivery-products {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.delivery-products h4 {
  font-size: 14px;
  margin: 0 0 8px;
}

.delivery-products ul {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  max-height: 150px;
  overflow-y: auto;
  padding: 0;
}

.delivery-products li {
  align-items: baseline;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.delivery-products li small {
  color: var(--muted);
  grid-column: 1 / -1;
}

.delivery-payment-options {
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  min-width: 0;
  padding: 0;
}

.delivery-payment-options legend {
  font-size: 14px;
  font-weight: 750;
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 0;
}

.delivery-payment-options label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 650;
  gap: 8px;
  min-height: 46px;
  padding: 9px 10px;
}

.delivery-payment-options label:has(input:checked) {
  background: #ecfdf5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.delivery-payment-options input[type="radio"] {
  flex: 0 0 auto;
  margin: 0;
  width: auto;
}

.delivery-payment-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.delivery-payment-fields.hidden {
  display: none;
}

.delivery-payment-fields label.hidden {
  display: none;
}

.delivery-payment-fields label small {
  color: var(--muted);
  font-weight: 500;
}

.delivery-balance-summary {
  align-items: center;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 12px;
}

.delivery-balance-summary strong {
  color: var(--primary-dark);
}

.delivery-balance-summary strong.has-balance,
.delivery-payment-balance {
  color: #a33a1c;
}

.delivery-confirmation-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.delivery-confirmation-actions button {
  min-width: 150px;
}

.delivery-payment-detail {
  display: block;
  line-height: 1.35;
  margin-top: 4px;
}

.client-discount-sheet {
  overflow-y: auto;
}

.client-discount-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding: 12px;
}

.client-discount-form .discount-preview,
.client-discount-form .form-actions {
  grid-column: 1 / -1;
}

.discount-preview {
  background: #f7fafb;
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px;
}

.discount-preview strong {
  color: var(--accent);
}

.client-discount-list {
  overflow-x: auto;
}

.client-discount-badge {
  background: #fff3bf;
  border: 1px solid #f2c94c;
  border-radius: 999px;
  color: #6b4f00;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.picker-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.picker-head h3 {
  font-size: 18px;
}

.picker-search {
  min-height: 42px;
}

.picker-list,
.picker-products {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.picker-list {
  max-height: calc(100vh - 190px);
}

.picker-products {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  max-height: calc(100vh - 250px);
}

.picker-client-card,
.picker-product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 58px;
  text-align: left;
}

.picker-client-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.picker-client-card span,
.picker-client-card small,
.picker-product-card small {
  color: var(--muted);
}

.picker-product-card {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 8px;
}

.picker-product-card span {
  display: grid;
  gap: 3px;
}

.picker-product-card b {
  color: var(--accent);
  font-size: 13px;
}

.picker-client-card:hover,
.picker-client-card.active,
.picker-product-card:hover,
.picker-product-card.active,
.picker-tab.active {
  border-color: var(--primary);
  background: #eefafa;
}

.picker-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.picker-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  flex: 0 0 auto;
  min-height: 34px;
}

.product-thumb-picker {
  width: 46px;
  height: 46px;
}

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

.production-actions {
  flex-wrap: nowrap;
}

.client-dispenser-row td {
  background: #f7fafb;
  padding: 12px;
}

.client-dispenser-editor {
  display: grid;
  gap: 8px;
}

.dispenser-editor-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.dispenser-editor-head,
.dispenser-editor-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 84px 76px;
  gap: 8px;
  align-items: center;
}

.dispenser-repair-row {
  grid-template-columns: 154px minmax(240px, 1fr) 136px 84px;
}

.dispenser-repair-row input[type="date"] {
  width: 154px;
}

.dispenser-repair-row textarea {
  width: 100%;
}

.dispenser-editor-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dispenser-editor-add {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.client-dispenser-editor input,
.client-dispenser-editor select,
.client-dispenser-editor textarea {
  min-width: 0;
}

.repair-history {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.check-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-weight: 500;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  background: #e7f5f7;
  color: var(--primary-dark);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: #e7f7ef;
  color: var(--accent);
}

.badge.red {
  background: #fdecec;
  color: var(--danger);
}

.badge.warning {
  background: #fff4d6;
  color: #725800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

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

.dashboard-cards .metric {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 80px;
  padding: 10px 12px;
}

.compact-cards {
  margin-top: 10px;
}

.production-bidones-detail {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
}

.production-bidones-row {
  align-items: baseline;
  display: flex;
  font-size: 11px;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.3;
}

.production-bidones-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric .production-bidones-row strong {
  flex: 0 0 auto;
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
}

.production-bidones-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

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

.metric .metric-value-blue {
  color: #1565c0;
}

.metric .metric-value-red {
  color: var(--danger);
}

.metric .metric-value-green {
  color: var(--accent);
}

.metric .metric-value-yellow {
  color: #c58b00;
}

.toast {
  align-items: center;
  background: rgba(9, 18, 22, .30);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  position: fixed;
  z-index: 300;
}

.toast-message {
  background: rgba(23, 38, 45, .94);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  max-width: min(620px, calc(100vw - 40px));
  padding: 20px 24px;
  text-align: center;
}

.error {
  color: var(--danger);
  min-height: 20px;
}

@media (min-width: 1400px) {
  .tab-panel {
    padding: 16px 20px 30px;
  }

  .split {
    gap: 14px;
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .panel {
    padding: 14px;
  }
}

@media (max-width: 1180px) {
  .split {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  }

  .production-layout {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
  }

  .account-header {
    display: grid;
  }

  .account-actions {
    grid-template-columns: minmax(200px, 1fr) minmax(86px, auto) 40px;
  }

  .repartos-filters {
    grid-template-columns: minmax(170px, 220px) fit-content(360px) minmax(130px, 170px) minmax(130px, 170px);
  }

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

  .report-filters {
    grid-template-columns: 110px minmax(160px, 1fr) auto;
  }
}

@media (max-width: 1080px) {
  .split {
    grid-template-columns: 1fr;
  }

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

  .reminder-form {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 12px;
  }

  .tabs {
    padding: 7px 12px;
  }

  .tab-panel {
    padding: 12px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

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

  .client-list {
    max-height: none;
  }

  .date-filters,
  .repartos-filters,
  .report-filters,
  .proveedor-cuenta-filters,
  .global-balance-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .section-title-row.global-balance-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .report-filters button,
  .proveedor-cuenta-filters button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pedido-layout,
  .config-form {
    max-width: none;
  }

  .invoice-preview-meta {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 640px) {
  .delivery-confirmation-sheet {
    max-height: calc(100vh - 20px);
    padding: 15px;
  }

  .delivery-order-summary,
  .delivery-payment-options,
  .delivery-payment-fields,
  .order-item-fields {
    grid-template-columns: 1fr;
  }

  .delivery-payment-options legend {
    grid-column: auto;
  }

  .delivery-confirmation-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .production-maintenance-list {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .production-maintenance-option:last-child:nth-child(odd) {
    grid-column: auto;
    grid-row: auto;
  }

  .arca-connection-summary,
  .arca-csr-form,
  .arca-certificate-form,
  .arca-certificate-detail {
    grid-template-columns: 1fr;
  }

  .arca-action-row button,
  .arca-certificate-form button {
    width: 100%;
  }

  .toast {
    padding: 16px;
  }

  .toast-message {
    font-size: 16px;
    max-width: 100%;
    padding: 18px;
    width: 100%;
  }

  .company-logo-field {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .company-logo-preview {
    width: 96px;
    height: 96px;
  }

  body {
    font-size: 15px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions #logoutBtn {
    flex: 1 1 auto;
  }

  .topbar .notification-bell {
    min-height: 40px;
    width: 40px;
  }

  .notification-panel {
    left: 12px;
    max-height: calc(100vh - 126px);
    position: fixed;
    right: 12px;
    top: 112px;
    width: auto;
  }

  .notification-panel::before {
    display: none;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar button {
    width: 100%;
    min-height: 40px;
  }

  .topbar button.notification-bell {
    width: 40px;
  }

  .tabs {
    gap: 8px;
    padding: 8px 12px;
  }

  .tabs button {
    min-height: 36px;
    padding: 7px 11px;
  }

  .tab-panel {
    padding: 12px;
  }

  .reminders-page-heading,
  .reminders-list-heading {
    align-items: stretch;
    display: grid;
  }

  .reminder-search {
    width: 100%;
  }

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

  .reminder-row {
    align-items: start;
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .reminder-meta,
  .reminder-row-actions {
    grid-column: 2;
  }

  .reminder-row-actions {
    justify-content: flex-start;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cards.dashboard-cards {
    grid-template-columns: 1fr;
  }

  .account-header {
    display: grid;
  }

  .account-balance {
    grid-column: auto;
    grid-row: auto;
    text-align: left;
    width: 100%;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }

  .account-payment-fields {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .account-payment-button {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .whatsapp-button {
    grid-column: auto;
    grid-row: auto;
  }

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

  .account-invoice-toolbar,
  .invoice-preview-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-invoice-toolbar button,
  .invoice-preview-actions button,
  .invoice-preview-actions .button-link {
    width: 100%;
  }

  .invoice-preview-sheet {
    padding: 14px;
  }

  .invoice-preview-parties,
  .invoice-preview-meta,
  .invoice-preview-summary,
  .invoice-preview-authorization {
    grid-template-columns: 1fr;
  }

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

  .section-title-row.global-balance-title-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .global-balance-title-row .results-count {
    grid-column: auto;
    justify-self: start;
  }

  .proveedor-cuenta-filters {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .proveedor-cuenta-filters button {
    width: 100%;
  }

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

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

  .report-filters button {
    width: 100%;
  }

  .subtabs button {
    flex: 1 1 130px;
    min-height: 38px;
  }

  .item-row {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfc;
  }

  .pedido-manual-fields {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .remove-item-button {
    margin-top: 0;
  }

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

  .panel {
    padding: 14px;
  }

  input,
  select,
  textarea {
    padding: 9px 10px;
  }

  button {
    min-height: 38px;
    padding: 8px 14px;
  }

  button.small-button {
    min-height: 34px;
    padding: 6px 9px;
  }

  #clientesLista table {
    min-width: 0;
    table-layout: auto;
  }

  #clientesLista th,
  #clientesLista td,
  #clientesLista th:nth-child(1),
  #clientesLista td:nth-child(1),
  #clientesLista th:nth-child(2),
  #clientesLista td:nth-child(2),
  #clientesLista th:nth-child(3),
  #clientesLista td:nth-child(3),
  #clientesLista th:nth-child(4),
  #clientesLista td:nth-child(4),
  #clientesLista th:nth-child(5),
  #clientesLista td:nth-child(5),
  #clientesLista th:nth-child(6),
  #clientesLista td:nth-child(6),
  #clientesLista th:nth-child(7),
  #clientesLista td:nth-child(7) {
    width: 100%;
  }

  #clientesLista .row-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  #clientesLista .small-button {
    font-size: 11px;
    min-height: 34px;
    padding: 6px 9px;
  }

  #dispensersLista table {
    min-width: 0;
    table-layout: auto;
  }

  #dispensersLista th:nth-child(n),
  #dispensersLista td:nth-child(n) {
    width: 100%;
  }

  .login-panel {
    padding: 22px;
  }

  .metric {
    padding: 14px;
  }

  .metric strong {
    font-size: 23px;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  #localidadesLista table,
  #zonasLista table,
  #tiposClienteLista table,
  #categoriasLista table,
  #rolesLista table {
    min-width: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    word-break: break-word;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  td[data-label=""] {
    grid-template-columns: 1fr;
  }

  td[data-label=""]::before {
    content: none;
  }

  .pedido-observacion-row {
    border-radius: 0 0 8px 8px;
    border-top: 0;
    margin-top: -10px;
  }

  .pedido-observacion-row td {
    display: block;
  }

  .pedido-observacion-content {
    display: block;
  }

  .pedido-observacion-content strong {
    display: block;
    margin-bottom: 3px;
  }

  .production-maintenance-detail-row {
    border-radius: 0 0 8px 8px;
    border-top: 0;
    margin-top: -10px;
  }

  .production-maintenance-detail-row td {
    display: block;
  }

  .production-maintenance-detail-row td::before {
    content: none;
  }

  .production-maintenance-detail-panel ul {
    grid-template-columns: 1fr;
  }

  .client-dispenser-row td {
    display: block;
  }

  .client-dispenser-row td::before {
    content: none;
  }

  .dispenser-editor-head {
    display: none;
  }

  .dispenser-editor-row {
    grid-template-columns: 1fr 148px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }

  .dispenser-editor-row button {
    width: 100%;
  }

  .dispenser-repair-row {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .dispenser-repair-row button {
    grid-column: auto;
  }

  .bonus-line {
    grid-template-columns: 1fr 78px;
  }

  .bonus-line button {
    grid-column: 1 / -1;
    width: 100%;
  }

  td .row-actions,
  td .product-actions {
    justify-content: flex-start;
  }

  td button,
  td select,
  td input {
    min-width: 0;
  }

  #localidadesLista td:last-child,
  #zonasLista td:last-child,
  #tiposClienteLista td:last-child {
    width: 100%;
    white-space: normal;
  }

  #categoriasLista td:last-child {
    width: 100%;
    white-space: normal;
  }

  #localidadesLista td:last-child button,
  #zonasLista td:last-child button,
  #tiposClienteLista td:last-child button {
    justify-self: start;
    width: auto;
  }

  #categoriasLista td:last-child button {
    justify-self: start;
    width: auto;
  }

  .row-actions button,
  .product-actions button {
    flex: 1 1 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-bell.new-arrival {
    animation: none;
  }
}
.tab-button[hidden] {
  display: none !important;
}

.section-spaced {
  margin-bottom: 12px;
}
