:root {
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  --card-bg: #ffffff;
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --secondary: #5f6368;
  --success: #1e8e3e;
  --error: #d93025;
  --text-main: #202124;
  --border-color: #dee2e6;
}

.behavior-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 18px 16px 26px;
}

.behavior-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.behavior-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.behavior-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.behavior-refresh-btn {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(26, 115, 232, 0.18);
}

.behavior-refresh-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.behavior-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

.behavior-excel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid #b8e2c6;
  border-radius: 12px;
  background: #eaf8ef;
  color: #107c41;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(16, 124, 65, 0.12);
}

.behavior-excel-btn:hover {
  background: #ddf3e5;
  transform: translateY(-1px);
}

.behavior-excel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: 6px;
  background: #107c41;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.behavior-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.behavior-legend span,
.behavior-legend-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 9px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.behavior-legend-filter {
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.behavior-legend-filter:hover,
.behavior-legend-filter.active {
  border-color: rgba(26, 115, 232, 0.45);
  background: #eaf2ff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.12);
}

.behavior-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  display: inline-block;
}

.behavior-activation,
.behavior-cell-activation {
  background: #0b4f8f;
}

.behavior-payment,
.behavior-cell-payment {
  background: #16a05d;
}

.behavior-credit,
.behavior-cell-credit {
  background: #f5c542;
}

.behavior-mixed,
.behavior-cell-mixed {
  background: linear-gradient(135deg, #16a05d 0 50%, #f5c542 50% 100%);
}

.behavior-cell-activation-payment {
  background: linear-gradient(135deg, #0b4f8f 0 50%, #16a05d 50% 100%);
}

.behavior-cell-activation-credit {
  background: linear-gradient(135deg, #0b4f8f 0 50%, #f5c542 50% 100%);
}

.behavior-cell-activation-mixed {
  background:
    linear-gradient(135deg, transparent 0 33%, #16a05d 33% 66%, transparent 66% 100%),
    linear-gradient(90deg, #0b4f8f 0 50%, #f5c542 50% 100%);
}

.behavior-filters {
  display: grid;
  grid-template-columns: 155px minmax(190px, 1fr);
  gap: 8px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  margin-bottom: 10px;
}

.behavior-filters label {
  display: block;
}

.behavior-filters span {
  display: block;
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.behavior-filters input,
.behavior-filters select {
  width: 100%;
  height: 34px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fafc;
  color: #1f2937;
  font: inherit;
  font-size: 12px;
  padding: 0 10px;
}

.behavior-summary {
  margin: 6px 0 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.behavior-table-wrap {
  max-height: calc(100vh - 255px);
  overflow: auto;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #fff;
}

.behavior-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.behavior-table th,
.behavior-table td {
  border: 1px solid #e5edf6;
  height: 22px;
  padding: 0 4px;
  white-space: nowrap;
}

.behavior-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.behavior-client-head,
.behavior-client-cell {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 285px;
  min-width: 285px;
  max-width: 285px;
  background: #fff;
  text-align: left;
  box-shadow: 8px 0 14px rgba(15, 23, 42, 0.06);
}

.behavior-client-head {
  z-index: 8;
  background: #f1f5f9;
}

.behavior-client-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
}

.behavior-client-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.behavior-client-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.behavior-date-head,
.behavior-day-cell {
  width: 29px;
  min-width: 29px;
  max-width: 29px;
  text-align: center;
  padding: 0 !important;
}

.behavior-day-cell {
  background-color: #fff;
  cursor: help;
}

.behavior-day-cell:hover {
  outline: 2px solid #111827;
  outline-offset: -2px;
  filter: brightness(0.96);
}

.behavior-total-head,
.behavior-total-cell {
  position: sticky;
  right: 0;
  z-index: 5;
  width: 154px;
  min-width: 154px;
  max-width: 154px;
  background: #fff;
  text-align: center;
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.06);
}

.behavior-total-head {
  z-index: 8;
  background: #f1f5f9;
}

.behavior-total-cell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: center;
  padding: 2px !important;
  font-size: 10px;
  font-weight: 900;
}

.behavior-total-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: center;
  padding: 2px !important;
}

.behavior-total-cell span {
  display: block;
  border-radius: 4px;
  background: #f4f7fb;
  color: #0b74de;
  padding: 2px 0;
}

.behavior-total-cell .behavior-total-money {
  color: #1f2937;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.behavior-empty {
  text-align: center;
  color: #64748b;
  font-weight: 800;
  height: 52px !important;
}

@media (max-width: 860px) {
  .behavior-shell {
    padding: 14px 10px 22px;
  }

  .behavior-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .behavior-head h2 {
    font-size: 18px;
  }

  .behavior-refresh-btn {
    width: 100%;
  }

  .behavior-head-actions {
    width: 100%;
  }

  .behavior-excel-btn {
    width: 42px;
    flex: 0 0 42px;
    justify-content: center;
  }

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

  .behavior-table-wrap {
    max-height: calc(100vh - 310px);
  }

  .behavior-client-head,
  .behavior-client-cell {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: inherit;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-gradient);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.app-shell {
  width: 100%;
}

.app-shell.app-locked {
  display: none;
}

.login-shell {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card-bg);
  border-radius: 24px;
  padding: 30px 24px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.login-remember input {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
}

.app-header {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 12px 10px;
  position: relative;
}

.app-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.app-logo img {
  max-width: 200px;
  height: auto;
  object-fit: contain;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 14px;
  right: 12px;
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.session-bar button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  padding: 4px 6px;
}

.mobile-menu-btn,
.mobile-menu-backdrop {
  display: none;
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 7px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: var(--text-main);
}

.app-tabs {
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.9);
}

.app-tab {
  border: 0;
  background: transparent;
  color: var(--secondary);
  border-radius: 0;
  min-height: 34px;
  padding: 0 12px 9px;
  flex: 1 1 auto;
  max-width: none;
  min-width: max-content;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.app-tab[hidden],
.app-tab[style*="display: none"] {
  display: none !important;
}

.app-tab.active {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  box-shadow: none;
}

.app-tab.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 99px 99px 0 0;
}

.app-tab + .app-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 11px;
  width: 1px;
  background: rgba(203, 213, 225, 0.9);
}

.app-tab[hidden] + .app-tab::before,
.app-tab[style*="display: none"] + .app-tab::before {
  display: none;
}

#tabContent > .tab-panel { display: none !important; }
#tabContent > .tab-panel.active { display: block !important; }

.container,
.payment-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  border-radius: 0;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
  min-height: calc(100vh - 50px);
  margin: 0 auto;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-container img {
  max-width: 120px;
  height: auto;
  object-fit: contain;
}

h2 {
  color: var(--text-main);
  font-size: 20px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
}

.payment-head-row {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.payment-head-row h2 {
  margin: 0;
}

.return-work-container {
  width: 100%;
  margin: 0;
}

.return-work-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--primary);
  padding: 0 18px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.08);
}

.return-work-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.group { margin-bottom: 16px; }

label,
.route-search-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background-color: #f8fafc;
  transition: all 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.15);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover,
.password-toggle.is-visible {
  color: var(--primary);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.password-toggle path,
.password-toggle circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.media-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.media-box.active-upload {
  border-color: var(--success);
  background: #f0fdf4;
}

.input-file-nativo {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  margin-top: 6px;
}

.btn-gps {
  width: 100%;
  padding: 14px;
  border: none;
  background: #e8f0fe;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.btn-gps.checked {
  background: #e6f4ea;
  color: var(--success);
}

#mapWrapper {
  display: none;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

#mapContainer {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  position: relative;
}

.registro-map-info {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  color: var(--text-main);
  font-size: 11px;
  text-align: center;
}

.registro-map-info span {
  color: var(--secondary);
}

.registro-map-info a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.progress-container {
  display: none;
  margin: 20px 0 10px;
  animation: fadeIn 0.3s ease;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 6px;
  text-align: center;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1a73e8 0%, #34a853 100%);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.status-banner {
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  margin-top: 16px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.status-info { background: #fff3e0; color: #b06000; }
.status-success { background: #e6f4ea; color: var(--success); }
.status-error { background: #fce8e6; color: var(--error); }

.btn-submit {
  background: var(--primary);
  color: white;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.btn-submit:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.print-statement { margin: 0 0 16px; }

.required-mark {
  color: var(--error);
  margin-left: 2px;
}

.routes-shell {
  width: min(1180px, calc(100% - 24px));
  min-height: calc(100vh - 62px);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  grid-template-rows: minmax(520px, 68vh) auto;
  background: #fff;
  border-radius: 18px;
  overflow: visible;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.routes-sidebar {
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  padding: 20px;
  overflow: auto;
}

.route-search {
  margin-bottom: 8px;
}

.route-reset {
  width: 100%;
  border: 0;
  background: #e8f0fe;
  color: var(--primary);
  border-radius: 12px;
  min-height: 38px;
  padding: 0 12px;
  margin-bottom: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.route-search-hint {
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.leyenda-contenedor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.vendedor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vendedor-item.active {
  border-color: var(--primary);
  background: #eef5ff;
  color: var(--primary);
}

.route-empty {
  color: var(--secondary);
  font-size: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.color-indicador {
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.route-visit-list {
  position: relative;
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 14px 12px;
  background: #ffffff;
  border: 0;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 18px 18px;
}

.routes-sidebar .route-visit-list {
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.route-visit-overlay {
  position: absolute;
  top: 76px;
  left: 14px;
  z-index: 4;
  width: min(230px, calc(100% - 28px));
  max-height: min(62vh, calc(100% - 28px));
  margin-top: 0;
  overflow: auto;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.route-visit-toggle {
  position: absolute;
  top: 76px;
  left: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(26, 115, 232, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.route-visit-toggle:hover {
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
}

.route-visit-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-visit-toggle.active {
  transform: rotate(180deg);
}

.route-visit-toggle[hidden] {
  display: none;
}

.route-visit-list h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 10px;
  padding-right: 0;
}

.route-visit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.route-order-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  margin-left: auto;
}

.route-order-recalc {
  flex: 1;
  min-height: 28px;
  border: 1px solid rgba(26, 115, 232, 0.22);
  border-radius: 8px;
  background: #eef5ff;
  color: var(--primary);
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.route-order-edit {
  position: static;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.route-order-edit svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-edit-pencil {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.route-edit-pencil::before {
  content: "";
  position: absolute;
  width: 11px;
  height: 3px;
  left: 1px;
  top: 6px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}

.route-edit-pencil::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 1px;
  width: 5px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.route-visit-list ol {
  margin: 0;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 2px 10px;
}

.route-visit-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  color: var(--secondary);
  font-size: 8px;
  min-height: 20px;
}

.route-order-number {
  width: 18px;
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.route-order-move {
  display: inline-flex;
  gap: 3px;
}

.route-order-move button {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.route-order-move button:hover {
  background: #eef5ff;
  border-color: var(--primary);
}

.route-order-draggable {
  cursor: grab;
}

.route-order-draggable:active {
  cursor: grabbing;
}

.route-order-draggable.is-dragging {
  opacity: 0.45;
}

.route-order-save {
  width: 100%;
  min-height: 30px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.route-visit-list a {
  display: block;
  color: var(--text-main);
  font-size: 8px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.route-visit-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.route-visit-list small {
  display: block;
  margin-top: 2px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 600;
}

.route-map-wrap {
  position: relative;
}

#routeMap {
  width: 100%;
  height: 100%;
}

#loading {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

.payments-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(320px, 1fr);
  gap: 18px;
}

.statement-column {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}

.statement-card {
  width: 100%;
  background: #fff;
  padding: 24px;
  border-radius: 24px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
  align-self: stretch;
}

.statement-print-head h2 {
  margin-bottom: 6px;
}

.statement-print-head h3 {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 16px;
  text-align: center;
}

.statement-print-head p {
  margin: 0 0 16px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.statement-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.statement-summary div {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
}

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

.statement-summary span {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.statement-summary strong {
  margin-top: 4px;
  color: var(--primary);
  font-size: 18px;
}

.portfolio-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
}

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

.report-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.portfolio-head h2 {
  margin: 0;
}

.portfolio-filters {
  display: grid;
  gap: 12px;
}

.audit-filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin: 18px 0 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

#tab-bitacora {
  padding: 18px 14px 40px;
}

.audit-shell {
  max-width: 1380px;
}

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

.audit-head h2 {
  margin: 0;
  font-size: 22px;
}

.audit-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}

.audit-refresh-btn {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.audit-summary {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef5ff;
  color: #1557b0;
  font-size: 12px;
  font-weight: 700;
}

.audit-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.audit-table-wrap .portfolio-table {
  min-width: 1240px;
}

.audit-table-wrap thead th {
  background: #f8fafc;
}

#tab-bitacora td small {
  display: block;
  color: #64748b;
  margin-top: 2px;
  font-size: 8px;
}

.audit-location-btn {
  border: 0;
  background: #eef5ff;
  color: var(--primary);
  padding: 5px 7px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.15;
}

.audit-location-btn:hover {
  background: #dbeafe;
  color: #1557b0;
}

.work-filters .route-work-field {
  grid-column: 1 / -1;
  max-width: none;
  width: 100%;
  min-width: 0;
}

.route-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.work-route-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.work-route-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #ffffff;
  color: #4b5563;
  padding: 0 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.work-route-chip:hover {
  border-color: #9ec5fe;
  color: var(--primary);
  background: #f8fbff;
}

.work-route-chip.active {
  border-color: var(--primary);
  background: #eaf2ff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.12);
}

.work-route-all {
  background: #f8fafc;
  color: #1f2937;
}

.work-route-empty {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.work-filter-row {
  display: grid;
  grid-template-columns: minmax(150px, 170px) minmax(220px, 280px) minmax(200px, 240px);
  gap: 12px;
  align-items: end;
}

.compact-date-field input {
  min-height: 46px;
  padding-inline: 12px;
}

.work-collector-field select:disabled {
  color: #1f2937;
  background: #f8fafc;
  opacity: 1;
  cursor: default;
}

.excel-download,
.pdf-download,
.refresh-download {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.work-cut-action {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.work-cut-action-bottom {
  margin: 14px 0 0;
}

.daily-cut-download {
  min-height: 46px;
  height: 46px;
  border-radius: 14px;
  padding: 0 18px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.08);
}

.daily-cut-download:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.mobile-visit-filter {
  display: none;
  min-height: 40px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-visit-filter.active {
  background: #dbeafe;
  border-color: #93c5fd;
}

.excel-download {
  border: 1px solid #b7dfc7;
  background: #f3fbf6;
  color: #107c41;
}

.pdf-download {
  border: 1px solid #f1b6b6;
  background: #fff5f5;
  color: #c02626;
}

.refresh-download {
  border: 1px solid #bfdbfe;
  background: #f3f8ff;
  color: var(--primary);
}

.excel-download:hover {
  background: #e8f6ee;
  border-color: #85c99f;
}

.pdf-download:hover {
  background: #fee2e2;
  border-color: #f08b8b;
}

.refresh-download:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.refresh-download svg {
  width: 18px;
  height: 18px;
}

.refresh-download path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-download.is-refreshing svg {
  animation: refreshSpin 0.85s linear infinite;
}

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

.excel-icon,
.pdf-icon {
  width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #107c41;
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.excel-icon {
  background: #107c41;
}

.pdf-icon {
  background: #c02626;
}

.portfolio-table-wrap {
  margin-top: 6px;
  overflow-x: auto;
}

.portfolio-table {
  min-width: 1060px;
}

.portfolio-table td {
  vertical-align: top;
}

.cut-shell {
  max-width: 920px;
}

.cut-filters {
  grid-template-columns: repeat(3, minmax(180px, 220px));
}

.cut-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 6px;
}

.portfolio-daily-summary {
  margin-top: 12px;
}

.cut-summary div {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
}

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

.cut-summary span {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cut-summary strong {
  margin-top: 5px;
  color: var(--primary);
  font-size: 20px;
}

.cut-table {
  min-width: 520px;
}

.cut-table tfoot th {
  color: var(--primary);
  font-size: 13px;
}

.money-cell {
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.balance-due-cell {
  color: #dc2626;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.location-head {
  text-align: center;
}

.pin-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--secondary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.pin-icon::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--secondary);
}

.map-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.map-link:hover {
  text-decoration: underline;
}

.inline-action-link {
  min-height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: var(--primary);
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.inline-action-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

.inline-action-link:disabled,
.inline-action-link.is-disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.visit-action-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: #ecfdf5;
  color: #15803d;
  padding: 0 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.visit-action-btn span {
  display: inline-block;
  color: inherit;
}

.visit-action-btn:hover {
  background: #dcfce7;
}

.visit-action-btn.is-done {
  background: #dcfce7;
}

.admin-action-cell {
  white-space: nowrap;
}

.admin-action-cell .route-edit-btn {
  margin-right: 6px;
}

.admin-delete-btn {
  color: #dc2626;
}

.admin-delete-btn:hover {
  background: #fee2e2;
}

.mobile-action-text {
  display: none;
}

.location-icon-link {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #eef5ff;
  color: var(--primary);
  cursor: pointer;
}

.location-icon-link:hover {
  background: #dbeafe;
}

.location-icon-link svg {
  width: 17px;
  height: 17px;
}

.location-icon-link path,
.location-icon-link circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-check {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: transparent;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 900;
}

.work-check.is-done {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}

.work-visit-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.work-visit-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  line-height: 1.1;
  white-space: nowrap;
}

.work-visit-status > span:last-child {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
}

.work-visit-status.is-today {
  color: #15803d;
}

.work-visit-status.is-empty {
  color: var(--secondary);
  font-weight: 700;
}

.work-row-done {
  background: #fbfffd;
}

.visit-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.44);
}

.visit-modal.is-open {
  display: flex;
}

.visit-modal-box {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.visit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.visit-modal-actions .btn {
  min-width: 150px;
}

.visit-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.44);
}

.visit-modal.is-open {
  display: flex;
}

.visit-modal-box {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.visit-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.visit-modal-head > div:first-child {
  min-width: 0;
}

.visit-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.visit-modal-head span {
  display: block;
  margin-bottom: 5px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visit-modal-head h3 {
  margin: 0;
  font-size: 24px;
}

.visit-modal-head p {
  margin: 6px 0 0;
  color: var(--secondary);
  font-weight: 700;
}

.visit-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.visit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.visit-modal label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.visit-modal label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.visit-modal select,
.visit-modal textarea,
.visit-modal input[type="text"],
.visit-modal input[type="date"] {
  width: 100%;
  border: 1px solid #dbe2eb;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  transition: all .18s ease;
}

.visit-modal select {
  min-height: 48px;
  padding: 0 14px;
}

.visit-modal textarea {
  min-height: 90px;
  padding: 14px;
  resize: vertical;
}

.visit-modal select:focus,
.visit-modal textarea:focus,
.visit-modal input:focus {
  outline: none;
  border-color: #1a73e8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(26,115,232,.12);
}

.visit-modal input[type="file"] {
  width: 100%;
  min-height: 48px;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px;
}

.visit-modal input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  background: #1a73e8;
  color: #fff;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.visit-photo-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 7px;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: #f8fbff;
}

.visit-modal .visit-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.visit-modal .visit-photo-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.visit-modal .visit-photo-button span {
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
}

.visit-modal .visit-photo-button strong {
  font-size: 12px;
  text-transform: uppercase;
}

.visit-photo-name {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
  text-transform: none !important;
  white-space: nowrap;
}

.visit-location-card {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.visit-location-head {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.visit-location-head strong,
.visit-location-head span {
  display: inline;
}

.visit-location-head strong {
  color: inherit;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.visit-location-head div > span,
#visitLocationDetail {
  display: none !important;
}

.visit-location-check {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: currentColor;
  position: relative;
  font-size: 0;
  flex: 0 0 auto;
}

.visit-location-check::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: absolute;
  left: 1px;
  top: 0;
}

.visit-location-check::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  left: 6px;
  top: 5px;
}

.visit-location-card.is-ready,
.visit-location-card.is-loading,
.visit-location-card.is-waiting {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #15803d;
}

.visit-location-card.is-ready #visitLocationStatus::after {
  content: none !important;
}

.visit-location-card.is-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.visit-location-map {
  width: 100%;
  height: 145px;
  border-top: 1px solid rgba(134, 239, 172, 0.7);
}

.visit-notes-group {
  width: 100%;
  margin-top: 16px;
}

.visit-notes-group textarea {
  width: 100%;
  min-height: 90px;
}

.visit-progress {
  margin: 6px 0 14px;
}

.visit-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.visit-modal-actions .btn-submit {
  margin-top: 0;
  box-shadow: 0 10px 20px rgba(26, 115, 232, 0.16);
}

.visit-modal-actions .btn,
.visit-modal-actions button {
  width: 100%;
  min-height: 72px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visit-modal-actions .btn {
  min-height: 48px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 12px;
  font-size: 12px;
}

#visitPayBtn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: none;
}

#visitPayBtn:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.receipt-file-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.receipt-file-link:hover {
  text-decoration: underline;
}

.receipt-empty {
  color: #94a3b8;
}

.visit-progress {
  margin: 6px 0 14px;
}

.visit-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.visit-modal-actions .btn-submit {
  margin-top: 0;
}

.visit-modal-actions .btn,
.visit-modal-actions button {
  width: 100%;
  min-height: 72px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visit-modal-actions .btn {
  min-height: 48px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 12px;
  font-size: 12px;
}

#visitPayBtn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: none;
}

#visitPayBtn:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.visit-modal-actions .btn-submit {
  box-shadow: 0 10px 20px rgba(26, 115, 232, 0.16);
}

.btn-light {
  background: #f8fafc;
  color: #475569;
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.route-edit-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-edit-btn {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-edit-btn:hover {
  background: transparent;
  color: #1557b0;
}

.route-edit-btn svg {
  width: 11px;
  height: 11px;
}

.route-edit-btn path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-inline-editor {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto auto;
  gap: 5px;
  align-items: center;
}

.route-inline-editor input {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
}

.route-inline-editor button {
  min-height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 8px;
}

.route-inline-editor button:first-of-type {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.admin-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
}

.admin-card h2 {
  margin: 0 0 18px;
  text-align: center;
}

.admin-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.admin-type-btn {
  min-height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-type-btn.active {
  border-color: var(--primary);
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary);
}

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

.route-admin-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 360px);
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.route-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.route-add-row input {
  min-height: 38px;
  padding: 8px 10px;
}

.route-add-row button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: #e8f0fe;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 12px;
}

.route-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  min-height: 58px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.route-chip {
  cursor: pointer;
}

.route-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.route-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: #fff;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.editable-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.editable-route-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.route-chip input:checked + span {
  border-color: var(--primary);
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary);
}

.admin-route-order-permission {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.admin-route-order-permission input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.admin-route-order-permission:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-actions {
  display: grid;
  gap: 12px;
}

.admin-cancel-edit {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-cancel-edit:hover {
  color: var(--primary);
}

.admin-list {
  padding: 20px 22px;
}

.admin-table {
  min-width: 720px;
  table-layout: fixed;
}

.admin-col-name { width: 8%; }
.admin-col-user { width: 8%; }
.admin-col-type { width: 8%; }
.admin-col-key { width: 6%; }
.admin-col-credit { width: 10%; }
.admin-col-routes { width: 36%; }
.admin-col-route-order { width: 9%; }
.admin-col-active { width: 7%; }
.admin-col-actions { width: 8%; }

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  white-space: normal;
  overflow-wrap: anywhere;
}

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

th,
td {
  border-bottom: 1px solid var(--border-color);
  padding: 9px 5px;
  text-align: left;
}

th {
  color: var(--secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.table-sort {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table-sort::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.35;
}

.table-sort[data-direction="asc"]::after {
  border-bottom: 5px solid currentColor;
}

.table-sort[data-direction="desc"]::after {
  border-top: 5px solid currentColor;
}

.table-sort[data-direction="filter"]::after {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 1;
}

.table-sort.active {
  color: var(--primary);
}

.gm-style .gm-style-iw-c {
  padding: 8px !important;
  border-radius: 10px !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
}

.gm-ui-hover-effect {
  display: none !important;
}

.map-route-editor {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
}

.map-route-editor label {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.4px;
}

.map-route-editor input,
.map-route-editor select {
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
}

.map-route-editor button {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: #e8f0fe;
  color: var(--primary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.map-order-actions {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 6px;
}

.map-route-editor .map-next-order-btn {
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.RC-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
}

.RC-modal.is-open {
  display: flex;
}

.RC-modal-box {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.RC-modal-box h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.RC-modal-box p {
  margin: 0 0 18px;
  color: var(--secondary);
  line-height: 1.4;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 481px) {
  body {
    padding: 0 24px 24px;
  }

  .container,
  .payment-card {
    min-height: auto;
    border-radius: 24px;
  }
}

@media (max-width: 860px) {
  #tab-bitacora {
    padding: 10px 8px 28px;
  }

  .audit-head {
    align-items: flex-start;
  }

  .audit-refresh-btn {
    min-width: 92px;
    padding: 0 12px;
  }

  .audit-filters {
    padding: 12px;
  }

  #tab-bitacora .audit-shell {
    padding: 14px 12px;
    border-radius: 18px;
  }

  #tab-bitacora .audit-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #tab-bitacora .audit-head h2 {
    font-size: 18px;
  }

  #tab-bitacora .audit-refresh-btn {
    width: 100%;
  }

  #tab-bitacora .audit-filters {
    grid-template-columns: 1fr;
    margin: 12px 0;
    padding: 10px;
  }

  #tab-bitacora .audit-table-wrap,
  #tab-bitacora .audit-table-wrap .portfolio-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
  }

  #tab-bitacora .audit-table thead {
    display: none;
  }

  #tab-bitacora .audit-table tbody,
  #tab-bitacora .audit-table tbody tr,
  #tab-bitacora .audit-table tbody td {
    display: block;
    width: 100%;
  }

  #tab-bitacora .audit-table tbody tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
  }

  #tab-bitacora .audit-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 0;
    font-size: 11px;
    line-height: 1.25;
    text-align: right;
  }

  #tab-bitacora .audit-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 92px;
    color: var(--secondary);
    font-size: 8px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  #tab-bitacora .audit-table td[data-label="Detalle"] {
    display: block;
    text-align: left;
  }

  #tab-bitacora .audit-table td[data-label="Detalle"]::before {
    display: block;
    margin-bottom: 3px;
  }

  #tab-bitacora .audit-table tbody tr.audit-empty-row td {
    display: block;
    text-align: center;
    color: #64748b;
    font-weight: 700;
  }

  #tab-bitacora .audit-table tbody tr.audit-empty-row td::before {
    display: none;
  }

  #tab-bitacora .audit-location-btn {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .routes-shell,
  .payments-shell,
  .portfolio-filters,
  .work-filter-row,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .work-filters .route-work-field {
    max-width: none;
  }

  .work-route-chips {
    gap: 7px;
  }

  .work-route-chip {
    min-height: 32px;
    padding: 0 11px;
    font-size: 11px;
  }

  .work-cut-action {
    min-height: auto;
    justify-content: stretch;
  }

  .daily-cut-download {
    width: 100%;
  }

  .mobile-visit-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .route-admin-head {
    grid-template-columns: 1fr;
  }

  .cut-summary {
    grid-template-columns: 1fr;
  }

  .routes-shell {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto;
  }

  .route-map-wrap {
    height: 58vh;
    min-height: 360px;
  }

  .route-visit-overlay {
    top: 72px;
    left: 10px;
    width: min(220px, calc(100% - 20px));
    max-height: 42%;
  }

  .route-visit-toggle {
    top: 72px;
    left: 10px;
  }

  .routes-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .app-header {
    padding: 12px 54px 12px;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: flex;
    position: absolute;
    top: 16px;
    left: 10px;
    z-index: 1002;
  }

  .app-logo img {
    max-width: 148px;
  }

  .app-logo {
    margin: 0;
  }

  .session-bar {
    position: absolute;
    top: 15px;
    right: 10px;
    max-width: 116px;
    justify-content: flex-end;
    gap: 5px;
    margin: 0;
    font-size: 9px;
    line-height: 1.15;
    text-align: right;
  }

  .session-bar span {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-bar button {
    padding: 2px 0;
    font-size: 10px;
  }

  .app-tabs {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1001;
    width: min(290px, 82vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 72px 16px 18px;
    background: #ffffff;
    border: 0;
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.2);
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }

  .app-shell.mobile-menu-open .app-tabs {
    transform: translateX(0);
  }

  .app-shell.mobile-menu-open .mobile-menu-btn span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .app-shell.mobile-menu-open .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
  }

  .app-shell.mobile-menu-open .mobile-menu-btn span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .app-tab {
    max-width: none;
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 4px;
    text-align: left;
    font-size: 12px;
    white-space: normal;
  }

  .app-tab + .app-tab::before,
  .app-tab.active::after {
    display: none;
  }

  .app-tab.active {
    color: var(--primary);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.28);
    cursor: pointer;
  }

  .app-shell.mobile-menu-open .mobile-menu-backdrop {
    display: block;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 10px 18px;
    overflow-x: hidden;
  }

  .portfolio-daily-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0 4px;
  }

  .portfolio-daily-summary div {
    border-radius: 12px;
    padding: 10px 8px;
  }

  .portfolio-daily-summary span {
    font-size: 8px;
    line-height: 1.2;
  }

  .portfolio-daily-summary strong {
    margin-top: 4px;
    font-size: 15px;
  }

  .portfolio-shell,
  .admin-card,
  .payment-card,
  .statement-card {
    border-radius: 18px;
    padding: 16px;
  }

  .admin-shell,
  .payments-shell,
  .portfolio-shell,
  .portfolio-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .payments-shell {
    gap: 12px;
  }

  .payment-card {
    min-height: auto;
    margin-bottom: 0;
  }

  .payment-head-row {
    min-height: 78px;
    align-items: flex-start;
    padding-top: 38px;
  }

  .return-work-container {
    width: 100%;
    margin-top: 12px;
  }

  .return-work-btn {
    width: 100%;
  }

  .payment-card .btn-submit {
    margin-bottom: 0;
  }

  .admin-card h2,
  .portfolio-head h2 {
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .route-picker {
    overflow-x: hidden;
  }

  .route-chip span {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .responsive-table,
  .admin-table,
  .cut-table {
    min-width: 0;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tbody tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .work-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-bottom: 12px;
    padding: 14px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
  }

  .work-table tbody tr.work-empty-row {
    display: block;
    padding: 10px 0 8px;
    border-bottom: 0;
  }

  .work-table tbody tr.work-empty-row td {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
  }

  .work-table tbody tr.work-empty-row td::before {
    display: none;
  }

  .responsive-table tbody td {
    border-bottom: 0;
    padding: 3px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    text-align: right;
    font-size: 12px;
  }

  .responsive-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 82px;
    color: var(--secondary);
    font-size: 9px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .work-table tbody td[data-label="ID"],
  .work-table tbody td[data-label="Cliente"] {
    display: none;
  }

  .work-table tbody td[data-label="Ruta"],
  .work-table tbody td[data-label="Orden"] {
    justify-content: flex-start;
    gap: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
  }

  .work-table tbody td[data-label="Ruta"]::before,
  .work-table tbody td[data-label="Orden"]::before {
    flex: 0 0 auto;
  }

  .work-table tbody td[data-label="Negocio"] {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
    font-size: 12px;
    font-weight: 900;
    padding: 2px 0 5px;
  }

  .work-table tbody td[data-label="Negocio"]::before {
    display: none;
  }

  .work-table tbody td[data-label="Accion"],
  .work-table tbody td[data-label="Ultima atencion"],
  .work-table tbody td[data-label="Ubicacion"] {
    display: inline-flex;
    width: auto;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding-top: 5px;
  }

  .work-table tbody td[data-label="Accion"]::before,
  .work-table tbody td[data-label="Ultima atencion"]::before,
  .work-table tbody td[data-label="Ubicacion"]::before {
    flex: 0 0 auto;
  }

  .work-table tbody td[data-label="Accion"] {
    justify-content: flex-end;
    grid-column: 2;
  }

  .work-table tbody td[data-label="Ultima atencion"] {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    overflow: visible;
  }

  .work-table tbody td[data-label="Ultima atencion"] .work-visit-status {
    min-width: 0;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    text-align: right;
    white-space: normal;
  }

  .work-table tbody td[data-label="Ultima atencion"] .work-visit-status > span:last-child {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .work-table tbody td.balance-due-cell {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    background: #fff7f7;
    font-size: 14px;
    line-height: 1.15;
    text-align: center !important;
  }

  .work-table tbody td.balance-due-cell::before {
    flex: 0 0 auto;
    width: auto;
    text-align: center;
  }

  .work-table tbody td[data-label="Ultima atencion"] {
    padding: 9px 10px;
    border-radius: 12px;
    background: #f8fafc;
  }

  .work-table tbody td[data-label="Ultimo recibo de pago"],
  .work-table tbody td[data-label="Ubicacion"] {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 4px;
    text-align: left;
  }

  .work-table tbody td[data-label="Ultimo recibo de pago"]::before,
  .work-table tbody td[data-label="Ubicacion"]::before {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .work-table tbody td[data-label="Ubicacion"] {
    align-items: flex-end;
    text-align: right;
  }

  .work-table tbody td[data-label="Accion"] {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 2px;
  }

  .work-table tbody td[data-label="Accion"]::before {
    display: none;
  }

  .work-table .inline-action-link {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #bfdbfe;
    border-radius: 11px;
    background: #1a73e8;
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 8px 16px rgba(26, 115, 232, 0.16);
  }

  .work-table .inline-action-link:disabled,
  .work-table .inline-action-link.is-disabled {
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
  }

  .visit-action-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 11px;
  }

  .work-visit-cell {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .visit-modal {
    align-items: flex-end;
    padding: 0 6px;
    overflow-x: hidden;
  }

  .visit-modal-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 96vh;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
    padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .visit-modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: start;
    gap: 10px 12px;
    margin-bottom: 14px;
    min-width: 0;
    width: 100%;
  }

  .visit-modal-head > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .visit-head-right {
    display: contents;
  }

  .visit-close {
    grid-column: 2;
    grid-row: 1;
    width: 40px;
    height: 40px;
    display: block;
  }

  .visit-location-card {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-radius: 12px;
  }

  .visit-location-head {
    display: flex;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
  }

  .visit-location-head strong {
    white-space: normal;
  }

  .visit-modal-head span {
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1.2;
  }

  .visit-modal-head h3 {
    font-size: 25px;
    line-height: 1.1;
  }

  .visit-modal-head p {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.3;
  }

  .visit-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .visit-modal select {
    min-height: 44px;
  }

  .visit-notes-group {
    margin-top: 12px;
  }

  .visit-notes-group textarea,
  .visit-modal textarea {
    min-height: 70px;
    padding: 11px 12px;
  }

  .visit-photo-picker {
    gap: 9px;
    min-height: 48px;
  }

  .visit-modal .visit-photo-button {
    min-height: 36px;
    padding: 0 11px;
  }

  .visit-modal-actions {
    position: sticky;
    bottom: -14px;
    z-index: 2;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px -2px -2px;
    padding: 10px 2px 2px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 9px);
    min-width: 0;
    width: calc(100% + 4px);
  }

  .visit-modal-actions .btn,
  .visit-modal-actions button {
    min-width: 0;
    min-height: 48px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .visit-modal-actions > :last-child {
    grid-column: 1 / -1;
    min-height: 40px;
  }

  .desktop-action-text {
    display: none;
  }

  .mobile-action-text {
    display: inline;
  }

  .responsive-table tfoot tr {
    display: block;
    padding-top: 10px;
  }

  .responsive-table tfoot th {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    text-align: right;
    padding: 5px 0;
  }

  .responsive-table tfoot th[colspan] {
    justify-content: flex-end;
    color: var(--secondary);
    font-size: 11px;
    text-transform: uppercase;
  }

  .responsive-table tfoot th[data-label]::before {
    content: attr(data-label);
    color: var(--secondary);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  #tab-bitacora {
    padding: 8px 0 22px;
  }

  #tab-bitacora .audit-shell {
    padding: 14px 12px;
    border-radius: 18px;
  }

  #tab-bitacora .audit-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #tab-bitacora .audit-head h2 {
    font-size: 18px;
  }

  #tab-bitacora .audit-refresh-btn {
    width: 100%;
  }

  #tab-bitacora .audit-filters {
    grid-template-columns: 1fr;
    margin: 12px 0;
    padding: 10px;
  }

  #tab-bitacora .audit-table-wrap,
  #tab-bitacora .audit-table-wrap .portfolio-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
  }

  #tab-bitacora .audit-table tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
  }

  #tab-bitacora .audit-table tbody td {
    padding: 4px 0;
    font-size: 11px;
    line-height: 1.25;
  }

  #tab-bitacora .audit-table tbody td::before {
    flex: 0 0 92px;
    font-size: 8px;
  }

  #tab-bitacora .audit-table td[data-label="Detalle"] {
    display: block;
    text-align: left;
  }

  #tab-bitacora .audit-table td[data-label="Detalle"]::before {
    display: block;
    margin-bottom: 3px;
  }

  #tab-bitacora .audit-location-btn {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .route-inline-editor {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .route-visit-overlay {
    left: 10px;
    right: auto;
    top: 68px;
    width: min(210px, calc(100% - 20px));
    max-height: 38%;
  }

  .route-visit-toggle {
    top: 68px;
    left: 10px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .statement-card,
  .statement-card * {
    visibility: visible;
  }

  .statement-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 18mm;
    border-radius: 0;
    box-shadow: none;
  }

  .print-statement {
    display: none;
  }
}

html,
body,
button,
input,
select,
textarea,
option,
label,
table,
th,
td,
a,
span,
div,
p,
h1,
h2,
h3,
h4,
h5,
h6,
::placeholder {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

input[type="file"]::file-selector-button {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

@media (min-width: 861px) {
  #tab-bitacora .audit-table {
    table-layout: fixed;
    font-size: 9.5px;
  }

  #tab-bitacora .audit-table th,
  #tab-bitacora .audit-table td {
    padding: 6px 5px;
    line-height: 1.15;
    vertical-align: middle;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #tab-bitacora .audit-table th {
    font-size: 8px;
    letter-spacing: 0.15px;
  }

  #tab-bitacora .audit-table th:nth-child(1),
  #tab-bitacora .audit-table td:nth-child(1) { width: 8%; text-align: center; }
  #tab-bitacora .audit-table th:nth-child(2),
  #tab-bitacora .audit-table td:nth-child(2) { width: 8%; text-align: center; }
  #tab-bitacora .audit-table th:nth-child(3),
  #tab-bitacora .audit-table td:nth-child(3) { width: 12%; }
  #tab-bitacora .audit-table th:nth-child(4),
  #tab-bitacora .audit-table td:nth-child(4) { width: 8%; }
  #tab-bitacora .audit-table th:nth-child(5),
  #tab-bitacora .audit-table td:nth-child(5) { width: 7%; text-align: center; }
  #tab-bitacora .audit-table th:nth-child(6),
  #tab-bitacora .audit-table td:nth-child(6) { width: 18%; }
  #tab-bitacora .audit-table th:nth-child(7),
  #tab-bitacora .audit-table td:nth-child(7) { width: 22%; }
  #tab-bitacora .audit-table th:nth-child(8),
  #tab-bitacora .audit-table td:nth-child(8) { width: 10%; text-align: center; }
  #tab-bitacora .audit-table th:nth-child(9),
  #tab-bitacora .audit-table td:nth-child(9) { width: 7%; text-align: center; }
}

@media (min-width: 481px) {

  /* Tabla cartera compacta sin scroll horizontal */
  .portfolio-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 10px;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 3px 3px;
    line-height: 1;
    vertical-align: middle;
  }

  .portfolio-table th {
    font-size: 8.5px;
    letter-spacing: 0.1px;
  }

  /* Columnas angostas */
  .portfolio-table th:nth-child(1),
  .portfolio-table td:nth-child(1) {
    width: 42px;
    text-align: center;
  }

  .portfolio-table th:nth-child(2),
  .portfolio-table td:nth-child(2) {
    width: 46px;
    text-align: center;
  }

  .portfolio-table th:nth-child(3),
  .portfolio-table td:nth-child(3) {
    width: 58px;
    text-align: center;
  }

  /* Negocio visible */
  .portfolio-table th:nth-child(4),
  .portfolio-table td:nth-child(4) {
    width: 230px;
  }

  /* Dinero */
  .portfolio-table th:nth-child(5),
  .portfolio-table td:nth-child(5),
  .portfolio-table th:nth-child(6),
  .portfolio-table td:nth-child(6),
  .portfolio-table th:nth-child(7),
  .portfolio-table td:nth-child(7) {
    width: 78px;
    text-align: right;
  }

  /* Visita */
  .portfolio-table th:nth-child(8),
  .portfolio-table td:nth-child(8) {
    width: 138px;
    text-align: left;
    padding-left: 10px;
  }

  .portfolio-table td:nth-child(8) .work-visit-status {
    min-height: 18px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    font-size: 8.5px;
    line-height: 1;
    white-space: nowrap;
  }

  /* Recibo */
  .portfolio-table th:nth-child(9),
  .portfolio-table td:nth-child(9) {
    width: 82px;
    text-align: center;
  }

  /* Ubicación */
  .portfolio-table th:nth-child(10),
  .portfolio-table td:nth-child(10) {
    width: 42px;
    text-align: center;
  }

  /* Acción */
  .portfolio-table th:nth-child(11),
  .portfolio-table td:nth-child(11) {
    width: 108px;
    text-align: center;
  }

  /* Evitar que se vea desbordado */
  .portfolio-table td {
    overflow: hidden;
  }

  .portfolio-table td:nth-child(4) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    line-height: 1.15;
  }

  /* Botones/iconos más compactos */
  .work-check {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  .work-visit-status {
    gap: 4px;
    font-size: 10px;
    white-space: nowrap;
  }

  .receipt-file-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    max-width: 76px;
    margin: 0 auto;
    white-space: nowrap;
  }

  .visit-action-btn {
    min-height: 26px;
    padding: 0 10px;
    font-size: 10px;
    border-radius: 11px;
    white-space: nowrap;
  }

  /* Alinear TOTAL con las mismas columnas de la tabla */
  .portfolio-table tfoot th {
    padding: 6px 3px !important;
    font-size: 10px;
    line-height: 1.1;
    vertical-align: middle;
  }

  .portfolio-table tfoot th[colspan="4"] {
    text-align: center;
    text-transform: uppercase;
    font-weight: 800;
  }

  .portfolio-table tfoot th:nth-child(2),
  .portfolio-table tfoot th:nth-child(3),
  .portfolio-table tfoot th:nth-child(4) {
    text-align: right;
    font-size: 10px;
    font-weight: 700;
  }

  .portfolio-table tfoot th:last-child {
    width: calc(138px + 82px + 42px + 108px);
  }

  .portfolio-total-empty {
    padding: 0 !important;
  }
}

/* Refuerzo final: mapa comportamiento clientes tipo Excel */
#tab-mapa .behavior-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px !important;
}

#tab-mapa .behavior-table th,
#tab-mapa .behavior-table td {
  border: 1px solid #e5edf6;
  height: 18px !important;
  padding: 0 2px !important;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 9px !important;
  line-height: 1.05 !important;
}

#tab-mapa .behavior-client-head,
#tab-mapa .behavior-client-cell {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 285px;
  min-width: 285px;
  max-width: 285px;
  background: #fff;
  text-align: left;
}

#tab-mapa .behavior-client-head {
  z-index: 8;
  background: #f1f5f9;
}

#tab-mapa .behavior-date-head,
#tab-mapa .behavior-day-cell {
  width: 29px;
  min-width: 29px;
  max-width: 29px;
  padding: 0 !important;
  text-align: center;
}

#tab-mapa .behavior-total-head,
#tab-mapa .behavior-total-cell {
  position: sticky;
  right: 0;
  z-index: 5;
  width: 154px;
  min-width: 154px;
  max-width: 154px;
  background: #fff;
}

#tab-mapa .behavior-total-head {
  z-index: 8;
  background: #f1f5f9;
}

#tab-mapa .behavior-day-cell.behavior-cell-activation {
  background: #0b4f8f !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-payment {
  background: #16a05d !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-credit {
  background: #f5c542 !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-mixed {
  background: linear-gradient(135deg, #16a05d 0 50%, #f5c542 50% 100%) !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-activation-payment {
  background: linear-gradient(135deg, #0b4f8f 0 50%, #16a05d 50% 100%) !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-activation-credit {
  background: linear-gradient(135deg, #0b4f8f 0 50%, #f5c542 50% 100%) !important;
}

#tab-mapa .behavior-day-cell.behavior-cell-activation-mixed {
  background:
    linear-gradient(135deg, transparent 0 33%, #16a05d 33% 66%, transparent 66% 100%),
    linear-gradient(90deg, #0b4f8f 0 50%, #f5c542 50% 100%) !important;
}

/* Ajustes finales mapa comportamiento: ancho, sticky y alto */
#tab-mapa .behavior-shell {
  width: min(1120px, 100%);
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#tab-mapa .behavior-table-wrap {
  max-height: calc(100vh - 205px) !important;
}

#tab-mapa .behavior-table th {
  background-clip: padding-box;
}

#tab-mapa .behavior-client-head,
#tab-mapa .behavior-date-head,
#tab-mapa .behavior-total-head {
  top: -1px;
  border-top-color: #dbe4ef !important;
  box-shadow: inset 0 1px 0 #dbe4ef, inset 0 -1px 0 #dbe4ef;
}

#tab-mapa .behavior-client-head {
  left: -1px;
}

#tab-mapa .behavior-total-head {
  right: 0;
}

#tab-cartera .portfolio-daily-summary div {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 92px;
}

#tab-cartera .portfolio-daily-summary span,
#tab-cartera .portfolio-daily-summary strong {
  width: 100%;
  text-align: center !important;
}

#tab-cartera .portfolio-daily-summary strong {
  margin-top: 6px !important;
}

#tab-cartera .mobile-business-name {
  display: none;
}

/* Ajuste final hoja de trabajo: saldo por pagar unificado */
#tab-cartera .balance-due-cell {
  color: #dc2626 !important;
  font-size: inherit !important;
  font-weight: 700 !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  font-variant-numeric: inherit !important;
}

@media (max-width: 480px) {
  #tab-cartera .work-table tbody tr {
    gap: 5px 9px !important;
    margin-bottom: 8px !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
  }

  #tab-cartera .work-table tbody td {
    padding: 3px 0 !important;
    font-size: 11px !important;
    line-height: 1.12 !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ruta"],
  #tab-cartera .work-table tbody td[data-label="Orden"] {
    font-size: 10px !important;
    gap: 6px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Negocio"] {
    font-size: 12px !important;
    line-height: 1.15 !important;
    padding: 5px 0 3px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Negocio"] {
    font-size: 12px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Negocio"] .desktop-business-name {
    display: none !important;
  }

  #tab-cartera .work-table tbody td[data-label="Negocio"] .mobile-business-name {
    display: inline !important;
  }

  #tab-cartera .work-table tbody td.balance-due-cell {
    grid-column: 1 / -1 !important;
    justify-content: space-between !important;
    min-height: 0 !important;
    padding: 6px 8px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  #tab-cartera .work-table tbody td.balance-due-cell,
  #tab-cartera .work-table tbody td.balance-due-cell * {
    font-weight: 700 !important;
  }

  #tab-cartera .work-table tbody td.balance-due-cell::before {
    text-align: left !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultima atencion"] {
    padding: 6px 8px !important;
    border-radius: 10px !important;
    min-height: 0 !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultimo recibo de pago"],
  #tab-cartera .work-table tbody td[data-label="Ubicacion"] {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  #tab-cartera .work-table .work-check {
    width: 18px !important;
    height: 18px !important;
    flex-basis: 18px !important;
  }

  #tab-cartera .work-table .work-visit-status {
    gap: 5px !important;
    font-size: 11px !important;
  }

  #tab-cartera .work-table .inline-action-link,
  #tab-cartera .work-table .visit-action-btn {
    min-height: 32px !important;
    padding: 0 12px !important;
    font-size: 11px !important;
    border-radius: 10px !important;
  }

  #tab-cartera .map-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultima atencion"] {
    grid-column: 1 !important;
    width: 100% !important;
    display: block !important;
    justify-content: initial !important;
    text-align: left !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultima atencion"]::before {
    display: block !important;
    margin-bottom: 4px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultimo recibo de pago"] {
    grid-column: 2 !important;
    display: block !important;
    width: 100% !important;
    text-align: left !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultimo recibo de pago"]::before {
    display: block !important;
    margin-bottom: 4px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ultima atencion"] .work-visit-status {
    justify-content: flex-start !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ubicacion"] {
    grid-column: 1 !important;
    display: flex !important;
    width: 100% !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: left !important;
    gap: 8px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Ubicacion"]::before {
    display: inline-flex !important;
    margin: 0 !important;
    width: auto !important;
  }

  #tab-cartera .work-table tbody td[data-label="Accion"] {
    grid-column: 2 !important;
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 0 !important;
    padding-top: 2px !important;
  }

  #tab-cartera .work-table tbody td[data-label="Accion"]::before {
    display: none !important;
  }

#tab-cartera .work-table tbody td[data-label="ID"] {
    display: none !important;
  }
}

/* Cierre visual mapa comportamiento: tarjeta blanca tipo bitacora */
#tab-mapa {
  padding: 18px 14px 40px !important;
}

#tab-mapa .behavior-shell {
  width: min(1120px, 100%) !important;
  margin: 0 auto !important;
  background: #ffffff !important;
  border-radius: 24px !important;
  padding: 24px !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05) !important;
}

#tab-mapa .behavior-table-wrap {
  height: min(680px, calc(100vh - 245px)) !important;
  max-height: none !important;
  min-height: 430px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
}

#tab-mapa .behavior-filters {
  margin-bottom: 12px !important;
}

#tab-mapa .behavior-summary {
  margin: 12px 0 !important;
}

@media (max-width: 860px) {
  #tab-mapa {
    padding: 10px 8px 28px !important;
  }

  #tab-mapa .behavior-shell {
    padding: 14px 12px !important;
    border-radius: 18px !important;
  }

  #tab-mapa .behavior-table-wrap {
    height: min(620px, calc(100vh - 280px)) !important;
    min-height: 360px !important;
  }
}

/* Mapa comportamiento: tabla mas alta sin agrandar informacion */
#tab-mapa .behavior-table-wrap {
  height: min(760px, calc(100vh - 205px)) !important;
  min-height: 520px !important;
}

@media (max-width: 860px) {
  #tab-mapa .behavior-table-wrap {
    height: min(660px, calc(100vh - 245px)) !important;
    min-height: 430px !important;
  }
}

/* Corte diario: tabla mas legible y alineada */
#tab-corte .cut-shell {
  width: min(1180px, 100%) !important;
  max-width: 1180px !important;
}

#tab-corte .cut-summary {
  width: 100% !important;
  align-items: stretch !important;
}

#tab-corte .cut-summary div {
  min-width: 0 !important;
}

#tab-corte .portfolio-table-wrap {
  margin-top: 12px !important;
}

#tab-corte .cut-table {
  width: 100% !important;
  min-width: 900px !important;
  table-layout: fixed !important;
}

#tab-corte .cut-col-id {
  width: 12%;
}

#tab-corte .cut-col-business {
  width: 34%;
}

#tab-corte .cut-col-paid,
#tab-corte .cut-col-credit {
  width: 13%;
}

#tab-corte .cut-col-method,
#tab-corte .cut-col-collector {
  width: 14%;
}

#tab-corte .cut-table th,
#tab-corte .cut-table td {
  padding: 10px 14px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  word-break: normal !important;
  vertical-align: middle !important;
  text-align: center !important;
}

#tab-corte .cut-table th:nth-child(2),
#tab-corte .cut-table td:nth-child(2) {
  text-align: left !important;
}

#tab-corte .cut-table .cut-total-row td {
  border-top: 1px solid var(--border-color) !important;
  color: var(--primary) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

#tab-corte .cut-table .cut-total-row .money-cell {
  color: var(--primary) !important;
  font-variant-numeric: tabular-nums !important;
  text-transform: none !important;
}

/* Mapa comportamiento: mostrar conteos e importes en la columna final */
#tab-mapa .behavior-total-head,
#tab-mapa .behavior-total-cell {
  display: table-cell !important;
  right: 0 !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  padding: 2px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#tab-mapa .behavior-total-grid {
  display: grid !important;
  grid-template-columns: 32px 32px 70px 70px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#tab-mapa .behavior-total-head .behavior-total-grid {
  min-height: 28px !important;
}

#tab-mapa .behavior-sort-head {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: 900 !important;
  text-transform: inherit !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 0 !important;
  cursor: pointer !important;
}

#tab-mapa .behavior-client-head .behavior-sort-head {
  justify-content: flex-start !important;
}

#tab-mapa .behavior-sort-icon {
  color: #7b8794 !important;
  font-style: normal !important;
  font-size: 9px !important;
  line-height: 1 !important;
}

#tab-mapa .behavior-sort-icon.active {
  color: #006fe6 !important;
}

#tab-mapa .behavior-total-cell .behavior-total-grid {
  min-height: 18px !important;
}

#tab-mapa .behavior-head-filter {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px !important;
  min-width: 0 !important;
}

#tab-mapa .behavior-excel-filter {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
}

#tab-mapa .behavior-excel-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  height: 17px !important;
  min-width: 18px !important;
  max-width: 100% !important;
  border: 1px solid #d8e0ea !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 0 3px !important;
  cursor: pointer !important;
  overflow: hidden !important;
}

#tab-mapa .behavior-excel-filter-btn.is-active {
  border-color: #0d6efd !important;
  background: #eaf3ff !important;
  color: #006fe6 !important;
}

#tab-mapa .behavior-excel-filter-btn span {
  display: inline !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#tab-mapa .behavior-excel-filter-btn i {
  font-style: normal !important;
  font-size: 8px !important;
  line-height: 1 !important;
}

#tab-mapa .behavior-total-head .behavior-total-grid > span {
  overflow: visible !important;
}

#tab-mapa .behavior-total-head .behavior-excel-filter-btn {
  width: 100% !important;
}

#tab-mapa .behavior-excel-filter-menu {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 3px) !important;
  left: 0 !important;
  z-index: 40 !important;
  min-width: 150px !important;
  max-width: 260px !important;
  max-height: 240px !important;
  overflow: auto !important;
  padding: 5px !important;
  border: 1px solid #d8e0ea !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16) !important;
}

#tab-mapa .behavior-total-head .behavior-excel-filter-menu {
  right: 0 !important;
  left: auto !important;
  min-width: 90px !important;
}

#tab-mapa .behavior-excel-filter.is-open .behavior-excel-filter-menu {
  display: grid !important;
  gap: 2px !important;
}

#tab-mapa .behavior-filter-option {
  width: 100% !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #1f2937 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-align: left !important;
  padding: 5px 6px !important;
  cursor: pointer !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#tab-mapa .behavior-filter-option:hover,
#tab-mapa .behavior-filter-option.active {
  background: #eaf3ff !important;
  color: #006fe6 !important;
}

#tab-mapa .behavior-total-grid span {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  height: 15px !important;
  padding: 0 2px !important;
  border-radius: 5px !important;
  background: #f1f5f9 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#tab-mapa .behavior-total-grid .behavior-total-count {
  color: #006fe6 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
}

#tab-mapa .behavior-total-cell .behavior-total-money {
  color: #1f2937 !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
}

#tab-mapa .behavior-client-link,
#tab-mapa .behavior-client-cell,
#tab-mapa .behavior-date-head,
#tab-mapa .behavior-day-cell,
#tab-mapa .behavior-total-head,
#tab-mapa .behavior-total-cell {
  font-size: 9px !important;
}
.leaflet-route-marker {
  background: transparent;
  border: 0;
}

.leaflet-route-marker span {
  display: block;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.map-popup-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 7px;
}

.map-popup-actions a,
.map-popup-actions button {
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: #1a73e8;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex: 1 1 0;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.2;
  min-height: 25px;
  min-width: 0;
  padding: 5px 6px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.map-popup-actions button {
  background: #e6f4ea;
  color: #16833a;
}

.emergency-map-placeholder {
  align-items: center;
  background: #f8fbff;
  border: 1px dashed #bfd7f5;
  border-radius: 18px;
  color: #475569;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 6px;
  height: 100%;
  justify-content: center;
  min-height: 110px;
  padding: 14px;
  text-align: center;
}

.emergency-map-placeholder strong {
  color: #1f2937;
}

.emergency-map-placeholder a {
  color: #0072f0;
  font-weight: 700;
  text-decoration: none;
}

.demo-ribbon {
  align-self: center;
  background: #111827;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
  padding: 6px 10px;
}

.demo-login-help {
  color: #5f6b7a;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 18px;
  text-align: center;
}

.demo-notice {
  background: #eef7ff;
  border-bottom: 1px solid #c9e4ff;
  color: #23415f;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 18px;
  text-align: center;
}

