/* =============================================================================
   Duwest Mobility — Custom Styles
   Version: 1.0.0
   ============================================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --dw-primary: #1B5E20;
  --dw-secondary: #4CAF50;
  --dw-accent: #FF8F00;
  --dw-dark: #1a1a2e;
  --dw-light: #f8f9fa;
  --dw-text: #333333;
  --dw-sidebar-width: 260px;
  --dw-sidebar-bg: #1a1a2e;
  --dw-sidebar-hover: rgba(255, 255, 255, 0.08);
  --dw-sidebar-active: rgba(76, 175, 80, 0.15);
  --dw-transition: 0.25s ease;
}

/* ---------- Global ---------- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--dw-text);
  background-color: var(--dw-light);
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #b0bec5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #90a4ae;
}

/* ---------- Login Page ---------- */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dw-primary) 0%, var(--dw-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--dw-primary);
}

.login-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: #6c757d;
  letter-spacing: 2px;
}

.login-card .btn-primary {
  background-color: var(--dw-primary);
  border-color: var(--dw-primary);
}

.login-card .btn-primary:hover {
  background-color: #2E7D32;
  border-color: #2E7D32;
}

.login-footer {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--dw-sidebar-width);
  height: 100vh;
  background-color: var(--dw-sidebar-bg);
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--dw-transition);
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffffff;
}

.sidebar-brand-sub {
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all var(--dw-transition);
  text-decoration: none;
}

.sidebar-nav .nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  color: #ffffff;
  background-color: var(--dw-sidebar-hover);
}

.sidebar-nav .nav-link.active {
  color: var(--dw-secondary);
  background-color: var(--dw-sidebar-active);
  border-left-color: var(--dw-secondary);
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--dw-sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--dw-transition);
}

/* ---------- Top Navbar ---------- */
.top-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 0.6rem 1.5rem;
}

.top-navbar .navbar-toggler {
  border: none;
  color: var(--dw-text);
  font-size: 1.3rem;
  padding: 0.25rem 0.5rem;
}

.top-navbar .navbar-toggler:focus {
  box-shadow: none;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.6rem;
  padding: 0.2rem 0.4rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--dw-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- KPI Cards ---------- */
.kpi-card {
  border: none;
  border-radius: 10px;
  transition: box-shadow var(--dw-transition), transform var(--dw-transition);
}

.kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dw-text);
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 400;
}

/* ---------- Section Containers ---------- */
.content-section {
  display: none;
  padding: 1.5rem;
}

.content-section.active {
  display: block;
}

/* ---------- Data Tables ---------- */
.table > thead > tr > th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  border-bottom-width: 1px;
  white-space: nowrap;
}

/* Sortable columns */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--dw-transition);
}
.table th.sortable:hover {
  color: var(--dw-primary);
}
.table th.sortable .sort-icon {
  font-size: 0.7rem;
  margin-left: 4px;
  opacity: 0.35;
}
.table th.sortable.sort-asc .sort-icon,
.table th.sortable.sort-desc .sort-icon {
  opacity: 1;
  color: var(--dw-primary);
}
.table th.sortable.sort-asc .sort-icon::before {
  content: "\f148"; /* bi-arrow-up */
}
.table th.sortable.sort-desc .sort-icon::before {
  content: "\f128"; /* bi-arrow-down */
}

.table > tbody > tr {
  transition: background-color 0.15s ease;
}

.table > tbody > tr:hover {
  background-color: rgba(76, 175, 80, 0.04);
}

.table td {
  vertical-align: middle;
  font-size: 0.875rem;
}

/* ---------- Product Cards ---------- */
.product-card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  transition: box-shadow var(--dw-transition), transform var(--dw-transition);
  overflow: hidden;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.product-img-placeholder {
  height: 160px;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 3rem;
}

/* ---------- Visit Card ---------- */
.visit-card {
  border-left: 4px solid var(--dw-secondary);
  border-radius: 0 8px 8px 0;
  transition: box-shadow var(--dw-transition);
}

.visit-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.visit-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dw-primary);
  min-width: 60px;
}

/* ---------- FAB Button ---------- */
.fab-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--dw-primary);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.4);
  transition: all var(--dw-transition);
  z-index: 1030;
}

.fab-btn:hover {
  background-color: #2E7D32;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(27, 94, 32, 0.5);
}

/* ---------- Calendar ---------- */
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
}
.cal-month-grid .cal-header {
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: #6c757d;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
}
.cal-month-grid .cal-day {
  min-height: 90px;
  padding: 4px 6px;
  border-right: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-month-grid .cal-day:hover {
  background-color: #f0faf0;
}
.cal-month-grid .cal-day.other-month {
  background-color: #fafafa;
  color: #ccc;
}
.cal-month-grid .cal-day.today {
  background-color: rgba(76, 175, 80, 0.08);
}
.cal-day-number {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.cal-day.today .cal-day-number {
  background: var(--dw-primary);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-event {
  font-size: 0.68rem;
  padding: 1px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
/* Multi-day events: visualizacion tipo barra continua. */
.cal-event-multi.cal-event-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -2px;
}
.cal-event-multi.cal-event-mid {
  border-radius: 0;
  margin-left: -2px;
  margin-right: -2px;
  opacity: 0.92;
}
.cal-event-multi.cal-event-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -2px;
  opacity: 0.92;
}

.cal-week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-top: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
}
.cal-week-grid .cal-header {
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: #6c757d;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
}
.cal-week-grid .cal-hour {
  padding: 4px 6px;
  font-size: 0.7rem;
  color: #999;
  text-align: right;
  border-right: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  min-height: 48px;
}
.cal-week-grid .cal-slot {
  border-right: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  min-height: 48px;
  padding: 2px;
  position: relative;
}
.cal-week-grid .cal-slot:hover {
  background-color: #f0faf0;
}
.cal-week-grid .cal-slot.today-col {
  background-color: rgba(76, 175, 80, 0.04);
}

.cal-day-grid {
  border-top: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
}
.cal-day-grid .cal-day-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  border-bottom: 1px solid #e9ecef;
}
.cal-day-grid .cal-hour {
  padding: 4px 6px;
  font-size: 0.7rem;
  color: #999;
  text-align: right;
  border-right: 1px solid #e9ecef;
  min-height: 48px;
}
.cal-day-grid .cal-slot {
  min-height: 48px;
  padding: 2px 6px;
  border-right: 1px solid #e9ecef;
}
.cal-day-grid .cal-slot:hover {
  background-color: #f0faf0;
}

/* ---------- Calendar drag & drop ---------- */
.cal-event[draggable="true"],
.cal-event-row[draggable="true"] {
  cursor: grab;
}
.cal-event-dragging {
  opacity: 0.45;
}
.cal-slot-dragover,
.cal-day.cal-slot-dragover {
  outline: 2px dashed #4CAF50;
  outline-offset: -2px;
  background-color: rgba(76, 175, 80, 0.08) !important;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  padding: 1rem 1.25rem;
}

/* ---------- Tab Overrides ---------- */
.nav-tabs .nav-link {
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-tabs .nav-link.active {
  color: var(--dw-primary);
  font-weight: 600;
}

/* ---------- Sidebar Backdrop (mobile) ---------- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  /* Tight header on tablet */
  .top-navbar {
    padding: 0.5rem 1rem;
  }
}

/* Tablet & small laptop ≤ 767.98px */
@media (max-width: 767.98px) {
  .content-section {
    padding: 1rem 0.75rem;
  }

  .content-section h4 {
    font-size: 1.15rem;
  }

  /* KPI cards: shrink text */
  .kpi-card .kpi-value {
    font-size: 1.1rem;
  }
  .kpi-card .kpi-label {
    font-size: 0.7rem;
  }
  .kpi-card .card-body {
    padding: 0.6rem 0.5rem !important;
  }

  /* Tables: readable on small screens, allow horizontal scroll */
  .table-responsive {
    font-size: 0.8rem;
  }
  .table td, .table th {
    padding: 0.5rem 0.5rem;
    white-space: nowrap;
  }
  .table > thead > tr > th {
    font-size: 0.7rem;
  }

  /* Filter bar: compact padding */
  .filter-bar {
    padding: 0.75rem 0.75rem;
  }

  /* Action cards (modal): smaller + 2 cols */
  .action-card {
    height: 92px;
    padding: 0.75rem 0.4rem;
  }
  .action-card .fs-3 {
    font-size: 1.3rem !important;
  }
  .action-card .small {
    font-size: 0.7rem;
  }
  .action-card .action-card-sub {
    font-size: 0.6rem;
    bottom: 4px;
  }

  /* Client avatar shrink in modal */
  .client-avatar-lg {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
  .client-avatar-lg .fs-4 {
    font-size: 1rem !important;
  }

  /* Top navbar: hide user email on small phones */
  .top-navbar .dropdown-toggle .fw-medium,
  .top-navbar .dropdown .text-muted {
    display: none !important;
  }
  .top-navbar #pageTitle {
    font-size: 0.95rem;
  }

  /* Notification badge slimmer */
  .notification-badge {
    font-size: 0.55rem;
  }

  /* FAB smaller and closer to edge */
  .fab-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    bottom: 1rem;
    right: 1rem;
  }

  /* Modals: use full viewport width */
  .modal-dialog:not(.modal-sm) {
    margin: 0.5rem;
  }
  .modal-body {
    padding: 1rem !important;
  }
  .modal-header {
    padding: 0.75rem 1rem;
  }
  .modal-header .modal-title {
    font-size: 0.95rem;
  }

  /* Pagination smaller */
  .pagination-sm .page-link {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
  }

  /* Calendar: more compact */
  .cal-month-grid .cal-day {
    min-height: 70px !important;
    padding: 4px !important;
    font-size: 0.75rem !important;
  }
}

/* Medium breakpoint: hide secondary balance columns */
@media (max-width: 991.98px) {
  .hide-md {
    display: none !important;
  }
}

/* Phone ≤ 575.98px */
@media (max-width: 575.98px) {
  .content-section {
    padding: 0.75rem 0.5rem;
  }

  /* Sidebar: full width when open */
  .sidebar {
    width: 85vw;
    max-width: 300px;
  }
  :root {
    --dw-sidebar-width: 260px;
  }

  /* Top navbar title */
  .top-navbar #pageTitle {
    display: none;
  }
  .top-navbar {
    padding: 0.4rem 0.75rem;
  }

  /* KPI cards in 2-col at most */
  .kpi-card .card-body {
    padding: 0.5rem !important;
  }
  .kpi-card .kpi-value {
    font-size: 1rem;
  }

  /* Hide some table columns (marked with .hide-sm) to avoid squish */
  .hide-sm {
    display: none !important;
  }

  /* Modal action buttons: keep consistent height */
  .action-card {
    height: 84px;
  }

  /* Login card: edge-to-edge friendly */
  .login-card {
    border-radius: 8px;
    margin: 0 0.5rem;
  }
  .login-logo {
    font-size: 2rem;
  }

  /* Buttons stack full width */
  .btn-full-sm {
    width: 100%;
  }
}

/* Touch-friendly tap targets everywhere */
@media (hover: none) and (pointer: coarse) {
  .nav-link, .action-card, .page-link {
    min-height: 44px;
  }
}

/* ---------- Utility ---------- */
.text-dw-primary {
  color: var(--dw-primary);
}

.text-dw-accent {
  color: var(--dw-accent);
}

.bg-dw-primary {
  background-color: var(--dw-primary);
}

.bg-dw-accent {
  background-color: var(--dw-accent);
}

/* Hover refuerzo para botones primarios de "crear/nuevo/guardar" (.bg-dw-primary):
   antes en hover quedaban claritos porque Bootstrap no aplicaba estado activo.
   Ahora se oscurecen + sombra verde + leve elevacion para feedback claro. */
.btn.bg-dw-primary {
  border-color: var(--dw-primary);
  transition: background-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn.bg-dw-primary:hover,
.btn.bg-dw-primary:focus,
.btn.bg-dw-primary:active {
  background-color: #0f3d14 !important;
  border-color: #0f3d14 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.45) !important;
  transform: translateY(-1px);
}
.btn.bg-dw-primary:hover i,
.btn.bg-dw-primary:focus i,
.btn.bg-dw-primary:active i {
  color: #fff !important;
}

/* Equivalente para .bg-dw-accent (botones secundarios naranjas) */
.btn.bg-dw-accent {
  border-color: var(--dw-accent);
  transition: background-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn.bg-dw-accent:hover,
.btn.bg-dw-accent:focus,
.btn.bg-dw-accent:active {
  background-color: #cc7300 !important;
  border-color: #cc7300 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(255, 143, 0, 0.45) !important;
  transform: translateY(-1px);
}
.btn.bg-dw-accent:hover i,
.btn.bg-dw-accent:focus i,
.btn.bg-dw-accent:active i {
  color: #fff !important;
}

/* ---------- Client Cards (Cartera) ---------- */
.client-card {
  border-radius: 12px;
  border: 1px solid #e9ecef;
  transition: box-shadow var(--dw-transition), transform var(--dw-transition);
  cursor: pointer;
}

.client-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.client-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-avatar-lg {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Action Cards (Client Modal) ---------- */
.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  border-radius: 12px;
  border: 2px solid;
  cursor: pointer;
  transition: all var(--dw-transition);
  text-align: center;
  height: 110px;
}

/* PROMOTOR: modal angosta y todo centrado, sin sobrar espacio.
   - El dialog tiene un ancho fijo chico y se centra en pantalla.
   - El body con padding reducido.
   - Los cards toman todo el ancho disponible (sin max-width extra), centrados. */
.modal-dialog-promotor {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.modal-dialog-promotor .modal-body { padding: 0.75rem; }
.modal-dialog-promotor .row.g-3 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }

.promotor-actions { width: 100%; }
.promotor-actions .row { justify-content: center; }
.promotor-actions .action-card {
  height: auto;
  min-height: 110px;
  aspect-ratio: 1 / 1;
  padding: 0.5rem 0.4rem;
  border-width: 1px;
  border-radius: 10px;
}
.promotor-actions .action-card .fs-3 {
  margin-bottom: 0.25rem !important;
}

/* Sub-label (e.g. "(sin deuda)") floats at bottom without changing card size */
.action-card .action-card-sub {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  font-size: 0.65rem;
  line-height: 1;
  color: #6c757d;
}

/* Client Actions modal — compact width */
.modal-client-actions {
  max-width: 420px;
}
.modal-client-actions .client-avatar-lg {
  width: 48px;
  height: 48px;
  min-width: 48px;
}
.modal-client-actions .client-avatar-lg .fs-4 {
  font-size: 1rem !important;
}
.modal-client-actions h5 {
  font-size: 1rem;
}
.modal-client-actions .action-card {
  height: 92px;
  padding: 0.75rem 0.4rem;
}
.modal-client-actions .action-card .fs-3 {
  font-size: 1.3rem !important;
}
.modal-client-actions .action-card .small {
  font-size: 0.7rem;
}
/* Client Actions modal — compact action grid */
#clientActionsModal .row.g-2 {
  --bs-gutter-x: 0.3rem;
  --bs-gutter-y: 0.3rem;
}
#clientActionsModal .action-card {
  height: 69px;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  border-width: 1px;
}
#clientActionsModal .action-card .fs-3 {
  font-size: 0.95rem !important;
  margin-bottom: 0 !important;
}
#clientActionsModal .action-card .fw-semibold.small {
  font-size: 0.6rem;
  line-height: 1.1;
}
#clientActionsModal .action-card .action-card-sub {
  font-size: 0.5rem;
  bottom: 2px;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.action-card.disabled,
.action-card[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
  background-color: #f8f9fa;
}
.action-card.disabled:hover,
.action-card[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}

.action-card-blue {
  border-color: #1976D2;
  color: #1976D2;
}
.action-card-blue:hover {
  background-color: #E3F2FD;
}

.action-card-green {
  border-color: #2E7D32;
  color: #2E7D32;
}
.action-card-green:hover {
  background-color: #E8F5E9;
}

.action-card-amber {
  border-color: #FF8F00;
  color: #FF8F00;
}
.action-card-amber:hover {
  background-color: #FFF8E1;
}

.action-card-whatsapp {
  border-color: #25D366;
  color: #25D366;
}
.action-card-whatsapp:hover {
  background-color: #E8F8ED;
}

.action-card-teal {
  border-color: #00897B;
  color: #00897B;
}
.action-card-teal:hover {
  background-color: #E0F2F1;
}

.action-card-yellow {
  border-color: #F9A825;
  color: #F9A825;
}
.action-card-yellow:hover {
  background-color: #FFFDE7;
}

.action-card-red {
  border-color: #e53935;
  color: #e53935;
}
.action-card-red:hover {
  background-color: #FFEBEE;
}

/* ---------- Price currency prefix (half size, subtle) ---------- */
.price-cur {
  font-size: 0.5em;
  font-weight: normal;
  opacity: 0.7;
  margin-right: 3px;
  letter-spacing: 0.02em;
}

/* ---------- Audio Recorder (DuwyEngine-style) ---------- */
[data-audio-panel] button,
[data-audio-panel] button:hover,
[data-audio-panel] button:focus,
[data-audio-panel] button:active,
[data-audio-panel] button[disabled] {
  opacity: 1 !important;
  visibility: visible !important;
}
[data-audio-panel] button[disabled].btn-danger {
  opacity: 0.85 !important;
  animation: rec-pulse 1.4s ease-in-out infinite;
}
[data-audio-panel] button[disabled].btn-danger .rec-dot {
  animation: rec-blink 0.9s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Prevent any button content from becoming invisible on hover (defensive) */
.btn:hover,
.btn:focus,
.btn:active {
  opacity: 1 !important;
  visibility: visible !important;
}
.btn:hover i,
.btn:hover span,
.btn:focus i,
.btn:focus span {
  opacity: 1 !important;
  color: inherit;
}

/* ---------- Hover refuerzo: que los botones resalten mas fuerte ---------- */
/* Outline buttons: en hover Bootstrap pone bg solido + texto blanco; reforzamos
   con shadow + leve scale para que sea evidente que esta hovereado. */
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover,
.btn-outline-dark:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
  transform: translateY(-1px);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-outline-primary:hover i,
.btn-outline-secondary:hover i,
.btn-outline-danger:hover i,
.btn-outline-success:hover i,
.btn-outline-warning:hover i,
.btn-outline-info:hover i,
.btn-outline-dark:hover i {
  color: #fff !important;
}

/* Link buttons (los iconos en celdas de acciones de tabla): en hover, fondo
   suave + color saturado del icono para que NO desaparezcan al hovearlos. */
.btn-link:hover {
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  text-decoration: none;
}
.btn-link.text-primary:hover,
.btn-link.text-primary:hover i { color: #0a58ca !important; }
.btn-link.text-warning:hover,
.btn-link.text-warning:hover i { color: #b46900 !important; }
.btn-link.text-danger:hover,
.btn-link.text-danger:hover i  { color: #b02a37 !important; }
.btn-link.text-success:hover,
.btn-link.text-success:hover i { color: #146c43 !important; }
.btn-link.text-info:hover,
.btn-link.text-info:hover i    { color: #087990 !important; }
.btn-link.text-secondary:hover,
.btn-link.text-secondary:hover i { color: #495057 !important; }

/* ---------- Collapsible sections (modal Nueva Cotizacion / Detalle, etc.) ---------- */
.section-toggle {
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  min-height: 40px; /* tap target en mobile */
  gap: .5rem;
}
.section-toggle:focus { outline: none; box-shadow: none; }
.section-toggle:hover { background-color: rgba(0, 0, 0, 0.03); }
.section-toggle .section-toggle-icon {
  transition: transform .2s ease;
  flex-shrink: 0;
}
.section-toggle[aria-expanded="false"] .section-toggle-icon {
  transform: rotate(-90deg);
}
.section-toggle > span {
  flex: 1 1 auto;
  min-width: 0;
}
/* Toggles de primer nivel (GENERAL / PRODUCTOS / RESUMEN del modal Nueva Cotizacion). */
.section-toggle.section-toggle-lvl1 {
  min-height: 48px;
  background-color: rgba(0, 0, 0, 0.04);
}
.section-toggle.section-toggle-lvl1:hover {
  background-color: rgba(0, 0, 0, 0.07);
}

/* ---------- Print ---------- */
@media print {
  .sidebar,
  .top-navbar,
  .fab-btn {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }
}

/* ---------- Cotizaciones vencidas: tramado diagonal rojo claro ---------- */
/* Se usa background-image en cada <td> para que el patron quede visible
   incluso con la regla table-hover de Bootstrap (que pinta background-color
   en hover; el image queda por encima). */
.cotiz-row-expired > td {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(220, 53, 69, 0.10) 0,
    rgba(220, 53, 69, 0.10) 6px,
    rgba(220, 53, 69, 0.18) 6px,
    rgba(220, 53, 69, 0.18) 12px
  );
}
.table-hover > tbody > tr.cotiz-row-expired:hover > td {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(220, 53, 69, 0.16) 0,
    rgba(220, 53, 69, 0.16) 6px,
    rgba(220, 53, 69, 0.26) 6px,
    rgba(220, 53, 69, 0.26) 12px
  );
}

/* ---------- Toast / Popup notifications (window.showToast) ---------- */
.dw-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.dw-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--dw-primary);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .25s ease, transform .25s ease;
  overflow: hidden;
}
.dw-toast.dw-toast-show {
  opacity: 1;
  transform: translateX(0);
}
.dw-toast.dw-toast-hide {
  opacity: 0;
  transform: translateX(24px);
}
.dw-toast-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #ffffff;
  background: var(--dw-primary);
}
.dw-toast-body {
  flex: 1 1 auto;
  min-width: 0;
}
.dw-toast-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1a1a2e;
  margin-bottom: 2px;
  line-height: 1.2;
}
.dw-toast-message {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.35;
  white-space: pre-line;
  word-break: break-word;
}
.dw-toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: #99a;
  font-size: 1.05rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background .15s ease, color .15s ease;
}
.dw-toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}
.dw-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--dw-primary);
  width: 100%;
  transform-origin: left center;
  animation: dwToastProgress linear forwards;
  opacity: .85;
}
@keyframes dwToastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.dw-toast-success { border-left-color: #198754; }
.dw-toast-success .dw-toast-icon { background: #198754; }
.dw-toast-success .dw-toast-progress { background: #198754; }
.dw-toast-danger  { border-left-color: #dc3545; }
.dw-toast-danger  .dw-toast-icon { background: #dc3545; }
.dw-toast-danger  .dw-toast-progress { background: #dc3545; }
.dw-toast-warning { border-left-color: #f59e0b; }
.dw-toast-warning .dw-toast-icon { background: #f59e0b; }
.dw-toast-warning .dw-toast-progress { background: #f59e0b; }
.dw-toast-info    { border-left-color: #0d6efd; }
.dw-toast-info    .dw-toast-icon { background: #0d6efd; }
.dw-toast-info    .dw-toast-progress { background: #0d6efd; }

@media (max-width: 575.98px) {
  .dw-toast-container { top: 8px; right: 8px; left: 8px; width: auto; }
}

/* ---------- DwCombobox: typeahead dropdown mobile-friendly ---------- */
.dw-combo-wrap {
  position: relative;
}
.dw-combo-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1070;
  display: none;
}
.dw-combo-menu.show {
  display: block;
}
.dw-combo-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.875rem;
  line-height: 1.3;
}
.dw-combo-item:last-child {
  border-bottom: 0;
}
.dw-combo-item:hover,
.dw-combo-item.active {
  background: #e8f5e9;
}
.dw-combo-item-main {
  font-weight: 500;
  color: #212529;
}
.dw-combo-item-sub {
  font-size: 0.72rem;
  color: #6c757d;
  margin-top: 1px;
}
.dw-combo-empty {
  padding: 14px;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
}
.dw-combo-empty-hint {
  font-size: 0.7rem;
  color: #bbb;
  margin-top: 3px;
}
.dw-combo-icon-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  color: #6c757d;
  font-size: 0.7rem;
  cursor: pointer;
  z-index: 2;
  border: 0;
  padding: 0;
  display: none;
}
.dw-combo-wrap.has-value .dw-combo-icon-clear {
  display: flex;
}
.dw-combo-icon-clear:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}
/* En el input-group, el clear queda dentro del control. */
.input-group .dw-combo-wrap.has-value > input {
  padding-right: 28px;
}
.dw-combo-wrap.has-value > input {
  padding-right: 28px;
}
/* Mobile: touch targets mas grandes, menu mas alto. */
@media (max-width: 768px) {
  .dw-combo-menu {
    max-height: 60vh;
  }
  .dw-combo-item {
    padding: 12px;
    font-size: 0.95rem;
  }
  .dw-combo-item-sub {
    font-size: 0.78rem;
  }
}

/* ---------- Offline banner (window.ConnectionStatus) ---------- */
.dw-offline-banner {
  position: sticky;
  top: 0;
  z-index: 1080;
  padding: 8px 14px;
  background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dw-offline-banner.d-none { display: none !important; }
.dw-offline-banner .bi { font-size: 1rem; }

/* ---------- Productos sin stock (oculto temporalmente) ---------- */
/* Las reglas visuales para marcar productos sin stock quedan
   comentadas. El JS sigue consultando el inventario y aplicando la
   clase .product-no-stock — al destrabar bastara con descomentar este
   bloque para reactivar el rayado.
.product-no-stock > td {
  background: repeating-linear-gradient(
    45deg,
    rgba(220, 53, 69, 0.06),
    rgba(220, 53, 69, 0.06) 8px,
    rgba(220, 53, 69, 0.14) 8px,
    rgba(220, 53, 69, 0.14) 16px
  ) !important;
}
.product-no-stock .product-stock-btn {
  border-color: #B71C1C;
  color: #B71C1C;
}
.product-no-stock .product-stock-btn:hover {
  background-color: #B71C1C;
  color: #fff;
}
*/
