:root {
  --rt-accent: #0d6efd;
  --rt-accent-2: #198754;
  --rt-warn: #fd7e14;
  --rt-danger: #dc3545;
  --rt-surface: #f4f6f9;
}

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(13, 110, 253, 0.25), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(25, 135, 84, 0.18), transparent 55%),
    linear-gradient(160deg, #0b1220 0%, #152238 45%, #1c2b44 100%);
}

.login-card-custom {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.login-brand {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.kpi-card {
  border: 0;
  border-radius: 0.9rem;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
}

.chart-card,
.table-card {
  border: 0;
  border-radius: 0.9rem;
}

.badge-estado {
  text-transform: capitalize;
}

.placeholder-hero {
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.08)),
    #fff;
  border: 1px dashed rgba(13, 110, 253, 0.25);
}

.app-sidebar .brand-text {
  font-weight: 700 !important;
  font-size: 1.1rem;
}

.dt-buttons { margin-bottom: 0.75rem; }

/* Campos de texto en mayúsculas (excepto password/email/números/fechas) */
input.form-control:not([type="password"]):not([type="email"]):not([type="number"]):not([type="date"]):not([type="datetime-local"]):not([type="time"]):not([type="month"]):not([type="week"]):not([type="file"]):not([type="url"]):not([type="color"]):not([type="range"]):not([type="hidden"]):not(.no-upper),
textarea.form-control:not(.no-upper),
select.form-select:not(.no-upper) {
  text-transform: uppercase;
}

input.form-control::placeholder,
textarea.form-control::placeholder {
  text-transform: none;
}

/* Mapa de daños recepción */
.damage-svg { max-height: 180px; }
.damage-svg .car-body { fill: #e9ecef; stroke: #6c757d; stroke-width: 2; }
.damage-svg .car-glass { fill: #cfe2ff; stroke: #6ea8fe; stroke-width: 1; }
.damage-svg .car-wheel { fill: #343a40; }
.damage-svg .car-hub { fill: #adb5bd; }
.damage-svg .car-light { fill: #fff3cd; stroke: #ffc107; stroke-width: 1; }
.damage-svg .car-grille { fill: #dee2e6; stroke: #adb5bd; stroke-width: 1; }
.damage-zone {
  fill: rgba(13, 110, 253, 0.08);
  stroke: rgba(13, 110, 253, 0.35);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.damage-map:not(.is-readonly) .damage-zone:hover {
  fill: rgba(13, 110, 253, 0.22);
}
.damage-zone.is-rayon { fill: rgba(255, 193, 7, 0.55); stroke: #ffc107; stroke-width: 2; }
.damage-zone.is-golpe { fill: rgba(220, 53, 69, 0.5); stroke: #dc3545; stroke-width: 2; }
.damage-zone.is-roto { fill: rgba(33, 37, 41, 0.45); stroke: #212529; stroke-width: 2; }
.damage-map.is-readonly .damage-zone { cursor: default; }

/* Calendario de fechas */
.datepicker-wrap {
  position: relative;
  display: block;
}
.datepicker-wrap .datepicker-visible,
.datepicker-wrap .form-control {
  padding-right: 2.4rem;
}
.datepicker-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #0d6efd;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
  font-size: 1.05rem;
}
.flatpickr-calendar {
  font-family: "Source Sans 3", system-ui, sans-serif;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  border-radius: 10px;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #0d6efd;
  border-color: #0d6efd;
}

/* SweetAlert2 */
.swal2-container {
  z-index: 20000 !important;
}
.rt-swal-toast {
  font-size: 0.95rem;
}
.swal2-popup {
  font-family: "Source Sans 3", system-ui, sans-serif;
}

/* Buscador de catálogo (cotizaciones) */
.catalogo-picker .modal-body {
  padding-top: 0.75rem;
}
.catalogo-search-wrap {
  position: relative;
}
.catalogo-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
}
.catalogo-search-input {
  padding-left: 2.5rem;
  padding-right: 3.25rem;
  border-radius: 0.75rem;
  border: 1px solid #d0d7de;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.catalogo-search-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}
.catalogo-search-hint {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #6c757d;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
}
.catalogo-results-wrap {
  max-height: min(420px, 55vh);
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  overflow: auto;
}
.catalogo-results thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
  background: #f8f9fa !important;
}
.catalogo-row {
  cursor: pointer;
}
.catalogo-row.is-active,
.catalogo-row:hover {
  background: rgba(13, 110, 253, 0.08);
}
.catalogo-row.is-active td:first-child {
  box-shadow: inset 3px 0 0 #0d6efd;
}

/* Selector con buscador modal (cliente / vehículo / proveedor) */
.entity-picker-group .entity-picker-display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bs-body-bg, #fff);
  cursor: pointer;
}
.entity-picker-group .entity-picker-display:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}
.entity-picker-label.is-placeholder {
  font-weight: 400;
}
.entity-picker.is-invalid .entity-picker-display {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}
.entity-picker-meta {
  font-weight: 400;
  font-size: 0.9em;
}

/* =========================================================
   MULTIPLATAFORMA — Desktop ≥1200 · Tablet 768–1199 · Móvil <768
   ========================================================= */
:root {
  --rt-touch: 44px;
  --rt-mobile-max: 767.98px;
  --rt-tablet-max: 1199.98px;
}

/* Controles táctiles mínimos */
@media (max-width: 1199.98px) {
  .btn:not(.btn-sm):not(.btn-lg),
  .app-header .nav-link,
  .entity-picker-open,
  .entity-picker-clear {
    min-height: var(--rt-touch);
  }
  .form-control,
  .form-select {
    min-height: var(--rt-touch);
    font-size: 16px; /* evita zoom iOS */
  }
  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }
  .app-content-header h3 {
    font-size: 1.25rem;
  }
}

/* Listas como tarjetas en móvil (en vez de scroll horizontal) */
.rt-mobile-list {
  display: none;
}
.rt-desktop-table {
  display: block;
}
@media (max-width: 767.98px) {
  .rt-mobile-list {
    display: block;
  }
  .rt-desktop-table {
    display: none !important;
  }
  .rt-desktop-only {
    display: none !important;
  }
  .rt-mobile-only {
    display: block !important;
  }

  .app-main {
    padding-bottom: 1.5rem;
  }

  .card-header .btn-sm,
  .card-body .btn-sm {
    min-height: var(--rt-touch);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  /* KPI / dashboard */
  .kpi-value {
    font-size: 1.35rem;
  }
  .rt-dash-charts,
  .rt-dash-secondary {
    display: none !important;
  }

  /* Nav tabs scrollables (ficha vehículo, portal) */
  .nav-tabs,
  .portal-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .nav-tabs .nav-link,
  .portal-nav .nav-link {
    white-space: nowrap;
    min-height: var(--rt-touch);
    display: inline-flex;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .rt-mobile-only {
    display: none !important;
  }
}

/* Tarjeta de lista móvil */
.rt-mcard {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.85rem;
  background: var(--bs-body-bg, #fff);
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.65rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
a.rt-mcard:active {
  background: rgba(13, 110, 253, 0.06);
}
.rt-mcard-title {
  font-weight: 650;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}
.rt-mcard-meta {
  color: #6c757d;
  font-size: 0.9rem;
}
.rt-mcard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Líneas OT / detalle en tarjeta móvil */
.rt-line-card {
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}
.rt-line-card .rt-line-title {
  font-weight: 600;
}
.rt-line-card .rt-line-muted {
  color: #6c757d;
  font-size: 0.875rem;
}

/* QC táctil: tabla → tarjetas en móvil */
@media (max-width: 767.98px) {
  .qc-responsive-table thead {
    display: none;
  }
  .qc-responsive-table,
  .qc-responsive-table tbody,
  .qc-responsive-table tr,
  .qc-responsive-table td {
    display: block;
    width: 100%;
  }
  .qc-responsive-table tr.qc-touch-item-row {
    border: 1px solid #dee2e6;
    border-radius: 0.85rem;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    background: #fff;
  }
  .qc-responsive-table td {
    border: 0 !important;
    padding: 0.25rem 0 !important;
  }
  .qc-responsive-table td.qc-touch-label {
    font-weight: 650;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
  }
  .qc-responsive-table .form-select,
  .qc-responsive-table .form-control {
    min-height: var(--rt-touch);
    font-size: 16px;
  }
}


/* Checklist recepción más táctil */
@media (max-width: 991.98px) {
  .rt-check-item {
    min-height: var(--rt-touch);
    padding: 0.75rem !important;
  }
  .rt-check-item .form-check-label {
    font-size: 1rem;
  }
}

/* Captura de fotos */
.rt-photo-capture {
  position: relative;
}
.rt-photo-capture .form-control {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.rt-photo-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.35rem;
}

/* Firma táctil */
#firmaCanvas,
.rt-firma-canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto;
  min-height: 180px;
  touch-action: none;
  background: #fff;
  border-radius: 0.75rem;
}
@media (max-width: 767.98px) {
  #firmaCanvas,
  .rt-firma-canvas {
    min-height: 220px;
  }
}

/* Chat OT (taller + portal) */
.ot-chat-thread {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem 0.15rem;
}
.ot-chat-bubble {
  max-width: min(92%, 28rem);
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.ot-chat-bubble.is-taller {
  align-self: flex-start;
  background: #eef2f7;
}
.ot-chat-bubble.is-cliente {
  align-self: flex-end;
  background: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.18);
}
.ot-chat-meta {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.2rem;
}
.ot-chat-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Campanita de notificaciones */
#rtNotifBell > .nav-link {
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rt-notif-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  font-size: 0.68rem;
  min-width: 1.15rem;
  line-height: 1.15rem;
  padding: 0 0.3em;
  border-radius: 999px;
  transform: none;
  box-shadow: 0 0 0 2px var(--bs-body-bg, #fff);
}
.rt-notif-badge:not(.d-none) {
  display: inline-block;
}
.rt-notif-menu {
  width: min(360px, 92vw);
  padding: 0;
  max-height: min(70vh, 480px);
  overflow: hidden;
}
.rt-notif-menu.show {
  display: flex;
  flex-direction: column;
}
.rt-notif-head {
  background: #f8f9fa;
  flex: 0 0 auto;
}
.rt-notif-list {
  overflow-y: auto;
  max-height: min(58vh, 400px);
}
.rt-notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.rt-notif-item:hover {
  background: rgba(13, 110, 253, 0.06);
}
.rt-notif-item.is-unread {
  background: rgba(13, 110, 253, 0.05);
}
.rt-notif-item.is-unread .rt-notif-title {
  font-weight: 650;
}
.rt-notif-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d6efd;
  flex: 0 0 auto;
}
.rt-notif-title {
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}
.rt-notif-msg {
  font-size: 0.82rem;
  color: #6c757d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rt-notif-time {
  font-size: 0.72rem;
  color: #98a2b3;
  margin-top: 0.25rem;
}









