/* Tipografía Montserrat */
/* === Global Box Sizing === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* === Header principal === */
/* === Header Moderno === */
.main-header {
  background: var(--white);
  padding: 0.75rem 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container img {
  max-height: 45px;
  width: auto;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-name {
  font-weight: 700;
  color: var(--gray-dark);
  font-size: 0.95rem;
}

.user-role {
  font-size: 0.75rem;
  color: #76777A;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 53, 73, 0.2);
}

.btn-secondary {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* === Dashboard Moderno === */
:root {
  --primary: #F93549;
  --primary-dark: #d62839;
  --secondary: #8AB7E9;
  --accent: #F5A623;
  --success: #4CAF50;
  --gray-dark: #2c3e50;
  --gray-light: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --border-radius: 16px;
}

.dashboard-wrapper {
  max-width: 1600px;
  /* Incrementado para tablas anchas */
  margin: 2rem auto;
  padding: 0 5%;
  /* Margen dinámico basado en pantalla */
  animation: fadeIn 0.6s ease;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--secondary) 0%, #6a9ed9 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 24px;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(138, 183, 233, 0.3);
  width: 100%;
  box-sizing: border-box;
}

.welcome-text h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
}

.welcome-text p {
  opacity: 0.95;
  margin-top: 0.6rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.kpi-card {
  background: var(--white);
  padding: 1.8rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-decoration: none;
  cursor: pointer;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.kpi-total {
  border-left: 5px solid #2c3e50;
}

.kpi-creado {
  border-left: 5px solid #76777A;
}

.kpi-confirmado {
  border-left: 5px solid #8AB7E9;
}

.kpi-enviado {
  border-left: 5px solid #F5A623;
}

.kpi-entregado {
  border-left: 5px solid #4CAF50;
}

.kpi-facturado {
  border-left: 5px solid #4CAF50;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  background: #f8faff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-info h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #76777A;
  text-transform: uppercase;
  margin: 0 0 0.3rem 0;
  letter-spacing: 0.5px;
}

.kpi-info p {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gray-dark);
  margin: 0;
}

.dashboard-main-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.chart-card,
.card {
  background: var(--white);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.card-header h3,
.chart-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--gray-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-links-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  background: #f8faff;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.quick-link:hover {
  background: white;
  border-color: var(--secondary);
  transform: translateX(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ql-icon {
  font-size: 1.4rem;
}

.ql-text {
  font-weight: 600;
  color: var(--gray-dark);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .dashboard-main-content {
    grid-template-columns: 1fr;
  }

  .welcome-banner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
}


/* Opcional: agrupar ítems en dropdown para limpiar */
/* --- Dropdown Button y Estilo Menu --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: #fff;
  color: #222;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: 1.5px solid #8AB7E9;
  border-radius: 0.5rem;
  padding: 0.55rem 1.3rem 0.55rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3em;
  box-shadow: 0 1px 4px rgba(138, 183, 233, 0.07);
  transition: border-color 0.16s, box-shadow 0.16s;
  min-width: 122px;
}

.dropdown-btn:hover,
.dropdown-btn:focus {
  border-color: #F93549;
  box-shadow: 0 2px 7px rgba(249, 53, 73, 0.09);
  background: #fafdff;
  outline: none;
}

.dropdown-arrow {
  font-size: 1.1em;
  color: #8AB7E9;
  margin-left: 0.45em;
  transition: color 0.18s;
}

.dropdown-btn:focus .dropdown-arrow,
.dropdown-btn:hover .dropdown-arrow {
  color: #F93549;
}

/* Menu desplegable */
.dropdown ul {
  display: block;
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(138, 183, 233, 0.3);
  border-radius: 12px;
  padding: 0.6rem;
  box-shadow: 0 10px 25px rgba(90, 115, 151, 0.12);
  list-style: none;
  z-index: 111;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: none;
  overflow: hidden;
}

.dropdown:hover ul,
.dropdown:focus-within ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown ul li {
  margin-bottom: 2px;
}

.dropdown ul li:last-child {
  margin-bottom: 0;
}

.dropdown ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
}

.dropdown ul li a:hover {
  background: #F93549;
  color: #fff;
  padding-left: 1.25rem;
}

/* Opcional: flecha más suave */
.dropdown-btn .dropdown-arrow {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dropdown:hover .dropdown-arrow,
.dropdown:focus-within .dropdown-arrow {
  transform: rotate(180deg);
}

/* --- Fin estilos dropdown --- */

/* Responsive: en móvil apilar */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav {
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 0.5rem 0;
  }
}

body {
  font-family: 'Montserrat', sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* === Login Moderno === */
.login-body {
  background: linear-gradient(135deg, #8AB7E9 0%, #F93549 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 3rem 2.5rem;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  text-align: center;
  transition: transform 0.3s ease;
}

.login-card:hover {
  transform: translateY(-5px);
}

.login-card h2 {
  color: #222;
  font-weight: 700;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.login-card .logo {
  width: 140px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.form-floating {
  position: relative;
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-floating label {
  position: absolute;
  top: 12px;
  left: 15px;
  color: #76777A;
  transition: all 0.2s ease;
  pointer-events: none;
  font-size: 0.9rem;
}

.form-floating input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e8ef;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fbff;
  box-sizing: border-box;
}

.form-floating input:focus {
  border-color: #8AB7E9;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(138, 183, 233, 0.15);
}

.form-floating input:focus+label,
.form-floating input:not(:placeholder-shown)+label {
  top: -10px;
  left: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8AB7E9;
  background: #fff;
  padding: 0 5px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #F93549;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(249, 53, 73, 0.3);
  margin-top: 1rem;
}

.login-btn:hover {
  background: #e02e41;
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(249, 53, 73, 0.4);
}

.login-footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #76777A;
}

.login-footer a {
  color: #8AB7E9;
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

.alert-error {
  background: #fff5f5;
  color: #f93549;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #fed7d7;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}


/* Estilos base para todas las tablas del sistema */
.table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.table td {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: #334155;
}


.td-folio:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(249, 53, 73, 0.2);
}

.table td {
  border: 1px solid #eee;
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9em;
}

.estado-creado {
  background: #76777A;
}

.estado-confirmado {
  background: #8AB7E9;
}

.estado-enviado {
  background: #F5A623;
}

.estado-facturado {
  background: #4CAF50;
}

.estado-entregado {
  background: #4CAF50;
}

.kpi-entregado {
  border-left: 5px solid #4CAF50;
}

.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  margin: 0 3px;
}

.btn-icon:hover {
  transform: scale(1.1);
}

/* ——— Modales Modernos ——— */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  border: 2px solid #F93549;
  /* rojo institucional */
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(249, 53, 73, 0.15);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal-content {
  transform: translateY(0) scale(1);
}

/* Header del modal - fijo */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

/* Contenido scrolleable del modal */
.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  max-height: calc(90vh - 140px);
}

/* Footer del modal - fijo en la parte inferior */
.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #f1f5f9;
  background: white;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}


/* Scrollbar personalizado para el modal */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.modal-header h2 {
  font-size: 1.5rem;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Detalle de Pedido Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 1rem;
  color: #334155;
  font-weight: 500;
}

.detail-full {
  grid-column: span 2;
}

/* Forms en Modales */
.form-group-modal {
  margin-bottom: 1.25rem;
}

.form-group-modal label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.input-modal {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s;
  box-sizing: border-box;
}

.input-modal:focus {
  border-color: #8AB7E9;
  outline: none;
  box-shadow: 0 0 0 4px rgba(138, 183, 233, 0.1);
}

/* Grupo de input con botón adjunto */
.input-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.input-with-button .input-modal {
  flex: 1;
}

.input-with-button .btn-action-small {
  padding: 0 1rem;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.input-with-button .btn-action-small:hover {
  background: #e2e8f0;
  color: var(--primary);
  border-color: #cbd5e1;
}

@media (max-width: 600px) {
  .input-with-button {
    flex-direction: column;
  }

  .input-with-button .btn-action-small {
    padding: 0.75rem;
  }
}

/* 2) Evitar que los filtros suban hasta el header */
/* Quita el position: sticky si está causando superposición, y usa margin-top */
.filters-wrapper {
  position: static;
  /* que fluya debajo del header */
  margin: 1rem auto 0;
  /* un margen superior */
  max-width: 1200px;
  padding: 0 1rem;
  background: #f4f4f4;
  z-index: 1;
  /* por debajo del header si sticky */
}

/* grid de filtros alineados a la derecha */
.filters {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-wrapper {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 32px rgba(249, 53, 73, 0.07);
  overflow-x: auto;
  /* LO QUE AGREGA EL STICKY: */
  max-height: 66vh;
  /* O el alto máximo que quieras, ej. 550px */
  overflow-y: auto;
  /* Importante para sticky */
  padding: 0.3rem 0.3rem 0.6rem 0.3rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: table;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: middle;
  display: table-cell;
}

.table thead {
  display: table-header-group;
}

.table tbody {
  display: table-row-group;
}

.table tr:not(.expanded-row) {
  display: table-row;
}

/* Ajusta el ancho de la primera columna y centra los checkboxes */
.table th:first-child,
.table td:first-child {
  width: 2.5rem;
  text-align: center;
  padding: 0.5rem;
}

/* En móvil, reduce rellenos */
@media (max-width: 768px) {

  .table th,
  .table td {
    padding: 0.5rem;
  }
}

/* 1) Tipografía Montserrat en comboboxes y “Cerrar sesión” */
.main-nav select,
.filters select,
.filters input {
  font-family: 'Montserrat', sans-serif;
}

/* “Cerrar sesión” en blanco con hover rojo institucional */
.logout-container a {
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.logout-container a:hover {
  background: #F93549;
  color: #fff;
}

/* 2) Tipografía y color en opciones desplegadas */
.dropdown ul li a {
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

/* 3) Hover sobre opciones */
.dropdown ul li a:hover {
  background: #F93549;
  color: #fff;
}

/* 4) Permitir scroll en el dropdown */
.dropdown {
  position: relative;
}

.dropdown>ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #8AB7E9;
  /* mismo azul header */
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 4px;
  max-height: 200px;
  /* ajusta altura máxima */
  overflow-y: auto;
  /* scroll si hay muchas opciones */
  z-index: 100;
}

.dropdown:hover>ul {
  display: block;
}

/* “Reportes” igual que “Cerrar sesión” */
.nav-reportes {
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.nav-reportes:hover {
  background: #F93549;
  /* rojo institucional */
  color: #fff;
}

.pagination-controls {
  max-width: 1200px;
  margin: 0.5rem auto 2rem;
  text-align: center;
  gap: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination-controls button {
  font-family: 'Montserrat', sans-serif;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  background: #F93549;
  color: #fff;
  cursor: pointer;
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Botón Exportar CSV */
#btnExportCSV {
  font-family: 'Montserrat', sans-serif;
  background: transparent;
  color: #007bff;
  /* o el color que uses para btn-link */
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#btnExportCSV:hover {
  background: #F93549;
  /* rojo institucional */
  color: #fff;
}

#btnExportCSV:hover {
  cursor: pointer;
}

/* Botones de icono sin texto */
.icon-btn {
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: inherit;
  /* hereda el color del texto */
  line-height: 1;
  transition: color 0.2s;
}

.icon-btn svg {
  display: block;
  /* elimina espacios blancos alrededor */
}

.icon-btn:hover {
  color: #F93549;
  /* rojo institucional */
}

/* New Modern Layout Styles */
.dashboard-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f4f7f6;
}

.top-header {
  background: white;
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo-header img {
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-item {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #f8fafc;
  border-color: var(--secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-info-header {
  text-align: right;
}

.user-name-header {
  display: block;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.9rem;
}

.user-role-header {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
}

.btn-salir {
  background: #fff;
  border: 1px solid #fee2e2;
  color: #ef4444;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-salir:hover {
  background: #fef2f2;
}

/* Redesigned Welcome Banner */
.welcome-banner {
  background: #F93549;
  /* Solid red */
  color: white;
  padding: 3rem;
  border-radius: 20px;
  margin: 2rem auto;
  width: 95%;
  max-width: 1200px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-text h1 {
  font-size: 2.5rem;
  margin: 0;
  font-weight: 800;
}

.welcome-text p {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

.btn-banner-action {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.8rem 2rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: all 0.2s;
}

.btn-banner-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Redesigned Stat Cards */
.stat-cards-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  width: 95%;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: none;
  border-left: none;
}

.stat-card-icon {
  width: 45px;
  height: 45px;
  background: #f8fafc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card-info {
  display: flex;
  flex-direction: column;
}

.stat-card-title {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #F93549;
  /* Highlight numbers in red as per design */
}

/* Blue Institutional Footer */
.main-footer {
  background: #8AB7E9;
  padding: 3rem 1rem;
  text-align: center;
  color: white;
  margin-top: auto;
  border-top: 5px solid #F93549;
}

.footer-logo img {
  height: 50px;
  margin-bottom: 1.5rem;
}

.footer-line {
  width: 60px;
  height: 2px;
  background: #F93549;
  margin: 1.5rem auto;
}

.footer-text {
  font-weight: 600;
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .stat-cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .stat-cards-container {
    grid-template-columns: 1fr;
  }

  .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }
}

footer.main-footer {
  padding: 2rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 2rem;
}

.badge-modern {
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.badge-modern.estado-creado {
  background: #f1f5f9;
  color: #475569;
}

.badge-modern.estado-confirmado {
  background: #dbeafe;
  color: #1e40af;
}

.badge-modern.estado-enviado {
  background: #fef3c7;
  color: #92400e;
}

.badge-modern.estado-facturado {
  background: #dcfce7;
  color: #166534;
}

.search-container-modern {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.input-search-small {
  max-width: 250px;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-search-small:focus {
  border-color: var(--primary);
}

.date-filter-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.date-input-modern {
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: #475569;
  outline: none;
  cursor: pointer;
}

.detail-value-bold {
  font-weight: 800;
  color: #1e293b;
}

.modification-notice {
  margin-top: 1.5rem;
  padding: 0.8rem;
  background: #f8fafc;
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.estado-creado {
  background: #e2e8f0;
  color: #475569;
}

.estado-confirmado {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.estado-enviado {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.estado-facturado {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.estado-cancelado {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Estilos para el overlay de éxito */
.success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  border-radius: 24px;
  animation: fadeIn 0.3s ease;
}

.success-card {
  text-align: center;
  padding: 2rem;
}

.checkmark-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #4CAF50;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #4CAF50;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4CAF50;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {

  0%,
  100% {
    transform: none;
  }

  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 40px #fff;
  }
}

.btn-ver:hover {
  color: #76777A;
}

/* gris oscuro */
.btn-edit:hover {
  color: #8AB7E9;
}

/* azul marca */

/* Estilos para el modal de edición */
.edit-modal {
  max-width: 500px;
  width: 90%;
}

/* Grid de 2 columnas en el formulario */
.edit-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
  margin-top: 1rem;
}

/* Cada grupo de etiqueta + campo */
.edit-modal .form-group {
  display: flex;
  flex-direction: column;
}

/* Estilo de los labels e inputs */
.edit-modal .form-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.edit-modal .form-group input,
.edit-modal .form-group select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
}

/* Acciones: botones alineados a la derecha */
.edit-modal .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Botones secundarios vs primario */
.btn-secondary {
  background: #76777A;
  color: #fff;
}

.btn-secondary:hover {
  background: #5a5a5a;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(249, 53, 73, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 53, 73, 0.4);
}

.modal-content button[type="submit"],
.modal-content .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(249, 53, 73, 0.2);
}

.modal-content button[type="submit"]:hover,
.modal-content .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 53, 73, 0.3);
}


.modal-content button[type="button"],
.modal-content .btn-secondary {
  background: #f4f6fa;
  color: #76777A;
}

.modal-content button[type="button"]:hover,
.modal-content .btn-secondary:hover {
  background: #e0e5eb;
  color: #F93549;
}

/* ——— Ajustes de modal alineados a la marca ——— */

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

/* === ELIMINADO: Duplicado de .modal-content que causaba conflictos === */

/* === SOLO para el MODAL Nuevo Pedido === */
#modalNuevoPedido .modal-content form {
  max-width: 600px;
  margin: 0 auto;
}

#modalNuevoPedido .form-cols {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#modalNuevoPedido .form-row {
  display: flex;
  gap: 1.3rem;
  width: 100%;
  align-items: flex-end;
}

#modalNuevoPedido .form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#modalNuevoPedido .form-col label {
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #76777A;
  font-size: 1rem;
}

#modalNuevoPedido .form-col input,
#modalNuevoPedido .form-col select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #8AB7E9;
  border-radius: 0.5rem;
  padding: 0 1em;
  font-size: 1.05em;
  font-family: 'Montserrat', sans-serif;
  background: #fafdff;
  box-sizing: border-box;
}

#modalNuevoPedido .form-col textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1em;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid #8AB7E9;
  background: #fafdff;
  margin-bottom: 0.1rem;
  box-sizing: border-box;
  resize: vertical;
}


/* Input tipo fecha con icono integrado y estilo uniforme */
/* Forzar consistencia en altura y alineación de fecha y hora */
#modalNuevoPedido input[type="date"],
#modalNuevoPedido .horario-col select {
  height: 44px;
  line-height: 44px;
  border: 1.5px solid #8AB7E9;
  border-radius: 0.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05em;
  background: #fafdff;
  box-sizing: border-box;
}

/* Icono del calendario alineado al centro */
#modalNuevoPedido input[type="date"]::-webkit-calendar-picker-indicator {
  margin-right: 6px;
  filter: invert(45%) sepia(25%) saturate(200%) hue-rotate(180deg);
  cursor: pointer;
}

/* Ajustar ancho de selects de hora/minuto/AMPM */
#modalNuevoPedido .horario-col select {
  width: auto;
  min-width: 60px;
  max-width: 80px;
  text-align: center;
  padding: 0 0.5em;
}

/* Centrar los : separadores verticalmente */
#modalNuevoPedido .horario-col span {
  line-height: 44px;
  margin: 0;
}

/* Forzar que fecha y horario estén en la misma fila */
#modalNuevoPedido .form-row.fecha-hora {
  display: flex;
  gap: 1.3rem;
  align-items: flex-end;
}

/* Columna de fecha */
#modalNuevoPedido .form-row.fecha-hora .form-col.fecha-col {
  flex: 1;
}

/* Columna de horario */
#modalNuevoPedido .form-row.fecha-hora .horario-col {
  flex: 1.5;
  /* un poco más ancho que fecha */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Asegurar que fecha y horario ocupen misma altura */
#modalNuevoPedido .form-row.fecha-hora {
  display: flex;
  gap: 1.3rem;
  align-items: flex-end;
}

/* Columna de fecha siempre a 100% dentro de flex */
#modalNuevoPedido .form-row.fecha-hora .form-col.fecha-col input[type="date"] {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  padding: 0 1em;
}

/* Contenedor de horario */
#modalNuevoPedido .form-row.fecha-hora .horario-col>div {
  display: flex;
  align-items: center;
  height: 44px;
}

/* Selects de hora/minuto/AMPM nivelados */
#modalNuevoPedido .form-row.fecha-hora .horario-col select {
  height: 44px;
  line-height: 44px;
  margin: 0;
}



/* === Estilo especial para Total pollos deshabilitado === */
#modalNuevoPedido #npTotal[disabled] {
  background-color: #eef4fb;
  /* más gris-azulado */
  color: #444;
  border: 1.5px solid #8AB7E9;
  font-weight: 600;
  cursor: not-allowed;
}

/* Responsive: en móviles, columnas en vertical */
@media (max-width: 700px) {
  #modalNuevoPedido .form-row {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  #modalNuevoPedido .form-col,
  #modalNuevoPedido .horario-col {
    width: 100%;
    min-width: 0;
  }

  #modalNuevoPedido .horario-col>div {
    flex-wrap: wrap;
    gap: 6px;
  }
}

.exito-check {
  display: none;
  /* <-- Esto lo pone el JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 10;
}

.checkmark {
  width: 72px;
  height: 72px;
  display: block;
}

.checkmark-circle {
  stroke: #4caf50;
  stroke-width: 4;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.7s ease-in-out forwards;
}

.checkmark-check {
  stroke: #4caf50;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s 0.7s ease-in-out forwards;
}

@keyframes stroke {
  to {
    stroke-dashoffset: 0;
  }
}

.msg-exito {
  font-size: 1.2em;
  color: #388e3c;
  margin-top: 12px;
  font-weight: 600;
}

/* ===== SELECT COMBOBOX MODERNO GENERAL ===== */
select {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.06em;
  background: #fafdff;
  color: #222;
  border: 1.5px solid #8AB7E9;
  border-radius: 0.65em;
  padding: 0.55em 2.1em 0.55em 1em;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border 0.18s, box-shadow 0.18s;
  outline: none;
  min-width: 120px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(138, 183, 233, 0.09);
  position: relative;
}

/* Hover y Focus: borde rojo institucional y suave sombra */
select:focus,
select:hover {
  border: 1.5px solid #F93549;
  box-shadow: 0 0 0 2px #f9354925;
}

/* Elimina flecha nativa y agrega personalizada (solo desktop) */
select:not([multiple]) {
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 8l4.5 4 4.5-4' stroke='gray' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1.1em top 55%;
  background-size: 1.2em;
}

/* Opciones desplegadas con mejor padding y contraste */
select option {
  font-family: 'Montserrat', sans-serif;
  padding: 0.7em 1em;
  background: #fff;
  color: #222;
}

/* Header: selects en azul más oscuro (opcional) */
.main-nav select {
  background: #e9f0fa;
  color: #293245;
  border-color: #8AB7E9;
  font-weight: 600;
  min-width: 120px;
}

/* Dropdown hover en header */
.main-nav select:focus,
.main-nav select:hover {
  border-color: #F93549;
  box-shadow: 0 0 0 2px #f9354922;
  background: #fff;
  color: #222;
}

/* Mejor separación visual: Combos header y combos modal */
.main-nav select,
.filters select {
  margin-right: 1em;
}

@media (max-width: 700px) {
  .main-nav select {
    min-width: 90px;
    font-size: 0.95em;
  }

  select {
    min-width: 88px;
    font-size: 1em;
  }
}

/* ===== END COMBOBOX ESTILOS ===== */

.footer-minimal {
  background: var(--secondary);
  padding: 3rem 0;
  text-align: center;
  border-top: 4px solid var(--primary);
  font-family: 'Montserrat', sans-serif;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}


.footer-logo img {
  height: 42px;
  margin-bottom: 0.6rem;
}

.footer-divider {
  width: 80px;
  height: 3px;
  background: #F93549;
  margin: 1rem auto 1.2rem auto;
  border-radius: 2px;
  opacity: 0.8;
}

.footer-copy {
  color: #fff;
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.93;
}

/* ——— Listado de Pedidos Moderno ——— */
.tabla-pedidos-container {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 1rem 0 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

.tabla-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
}

.buscador-tabla {
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: 2px solid #f0f2f5;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  box-sizing: border-box;
}

.buscador-tabla:focus {
  border-color: #8AB7E9;
  background: white;
  box-shadow: 0 0 0 4px rgba(138, 183, 233, 0.1);
  outline: none;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}

.select-modern {
  padding: 0.7rem 1rem;
  border: 2px solid #f0f2f5;
  border-radius: 10px;
  background: white;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  height: 44px;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  width: 100%;
  /* Scroll suave en webkit */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Estilos para scrollbar en webkit */
.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Container fluid para listado de pedidos - Optimizado */
.dashboard-wrapper .container-fluid {
  max-width: 100%;
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

/* === NUEVA IDENTIDAD TABLA PEDIDOS (PREMIUM) - VISTA HÍBRIDA === */
.tabla-pedidos-container {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-top: -30px;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(0, 0, 0, 0.03);
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.pedidos-table,
.usuarios-table {
  width: 100%;
  border-collapse: collapse;
  /* Mejor alineación que separate */
  margin-top: 1rem;
  table-layout: auto;
}

.pedidos-table thead,
.usuarios-table thead {
  display: table-header-group;
}

.pedidos-table tbody tr:not(.expanded-row),
.usuarios-table tbody tr:not(.expanded-row) {
  display: table-row;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.pedidos-table th,
.usuarios-table th {
  padding: 1.2rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-align: left;
  background: transparent;
  border: none;
  white-space: nowrap;
  display: table-cell;
}

.pedidos-table th:first-child,
.pedidos-table td:first-child {
  padding-left: 1.5rem;
}

.pedidos-table th:last-child,
.pedidos-table td:last-child {
  padding-right: 1.5rem;
  text-align: right;
}

/* Configuración de anchos de columna - 6 columnas compactas + indicador de expansión */
.pedidos-table th,
.pedidos-table td,
.usuarios-table td {
  padding: 1.2rem 1.1rem;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.85rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

/* Indicador visual de estado movido al borde del primer td para no romper la tabla */
.pedidos-table td:first-child {
  border-left: 4px solid transparent;
}

.pedidos-table tbody tr:not(.expanded-row):hover td:first-child {
  border-left-color: #3b82f6;
}

.pedidos-table tbody tr:not(.expanded-row).row-expanded td:first-child {
  border-left-color: #10b981;
}

/* Checkbox */
.pedidos-table th:nth-child(1),
.pedidos-table td:nth-child(1) {
  width: 50px;
  padding: 0.5rem;
}

/* Indicador de expansión */
.pedidos-table th:nth-child(2),
.pedidos-table td:nth-child(2) {
  width: 40px;
  text-align: center;
}

/* Folio */
.pedidos-table th:nth-child(3),
.pedidos-table td:nth-child(3) {
  width: 140px;
}

/* Cliente */
.pedidos-table th:nth-child(4),
.pedidos-table td:nth-child(4) {
  width: auto;
  min-width: 180px;
  white-space: normal;
}

/* Cantidad Total */
.pedidos-table th:nth-child(5),
.pedidos-table td:nth-child(5) {
  width: 120px;
  text-align: center;
}

/* Estado */
.pedidos-table th:nth-child(6),
.pedidos-table td:nth-child(6) {
  width: 140px;
  text-align: center;
}

/* Acciones */
.pedidos-table th:nth-child(7),
.pedidos-table td:nth-child(7) {
  width: 120px;
  text-align: right;
}


/* Estilos para la columna Total en vista compacta */
.pedidos-table td[data-label="Total"] {
  font-family: 'Montserrat', sans-serif;
  color: #1e293b;
  font-weight: 700;
}

.td-cantidad {
  padding: 0.8rem !important;
}


/* Accion */


.pedidos-table td:first-child,
.usuarios-table td:first-child {
  border-left: 1px solid #f8fafc;
  border-radius: 12px 0 0 12px;
}

.pedidos-table td:last-child,
.usuarios-table td:last-child {
  border-right: 1px solid #f8fafc;
  border-radius: 0 12px 12px 0;
}

.pedidos-table tbody tr:not(.expanded-row):hover,
.usuarios-table tbody tr:not(.expanded-row):hover {
  transform: scale(1.005) translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  z-index: 2;
}

.pedidos-table tbody tr:not(.expanded-row):hover td,
.usuarios-table tbody tr:not(.expanded-row):hover td {
  background: #fff;
  border-color: #e2e8f0;
}

/* Estilo Folio Moderno */
.td-folio {
  font-weight: 800;
  color: var(--primary);
  background: rgba(249, 53, 73, 0.08);
  padding: 6px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(249, 53, 73, 0.15);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.td-folio::before {
  content: '#';
  opacity: 0.4;
  font-weight: 400;
}

.td-folio:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 53, 73, 0.25);
}

/* Status Badges Premium */
.badge {
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.estado-creado {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* === ESTILOS TABLA USUARIOS === */
.usuarios-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.usuarios-table th,
.usuarios-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}

.usuarios-table th:nth-child(1) {
  width: 120px;
}

/* Usuario */
.usuarios-table th:nth-child(2) {
  width: auto;
  min-width: 180px;
}

/* Nombre */
.usuarios-table th:nth-child(3) {
  width: auto;
  min-width: 150px;
}

/* Email */
.usuarios-table th:nth-child(4) {
  width: 100px;
}

/* Rol */
.usuarios-table th:nth-child(5) {
  width: 150px;
}

/* Cliente */
.usuarios-table th:nth-child(6),
.usuarios-table td:nth-child(6) {
  width: 100px;
  text-align: center;
}

/* Estado */
.usuarios-table th:nth-child(7) {
  width: 160px;
}

/* Último login */
.usuarios-table th:nth-child(8),
.usuarios-table td:nth-child(8) {
  width: 100px;
  text-align: center;
}

/* Acción */

/* === ESTILOS TABLA CLIENTES === */
.clientes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.clientes-table th,
.clientes-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Indicador de expansión */
.clientes-table th:nth-child(1),
.clientes-table td:nth-child(1) {
  width: 30px;
  text-align: center;
}

/* Cliente */
.clientes-table th:nth-child(2) {
  width: auto;
  min-width: 150px;
}

/* RFC */
.clientes-table th:nth-child(3) {
  width: 130px;
}

/* Teléfono */
.clientes-table th:nth-child(4) {
  width: 110px;
}

/* Correo */
.clientes-table th:nth-child(5) {
  width: auto;
  min-width: 150px;
}

/* Dirección Fiscal */
.clientes-table th:nth-child(6) {
  width: auto;
  min-width: 200px;
}

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

/* Acción */

/* Hover general para todas las tablas modernas */
.usuarios-table tbody tr:hover,
.clientes-table tbody tr:hover {
  background-color: #f8fafc;
}

.estado-entregado {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
}


.estado-confirmado {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.estado-enviado {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fef3c7;
}

.estado-facturado {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}

.estado-cancelado {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}





/* Botones de Acción Modernos */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-action {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  color: #64748b;
  font-size: 1.1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.btn-action.view:hover {
  color: #1d4ed8;
  background: #eff6ff;
}

.btn-action.edit:hover {
  color: #d97706;
  background: #fffbeb;
}

.btn-action.delete:hover {
  color: #dc2626;
  background: #fef2f2;
}

/* === SISTEMA DE FILAS EXPANDIBLES === */

/* Indicador de expansión */
.expand-indicator {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  color: #64748b;
}

.expand-indicator:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: scale(1.1);
}

.expand-indicator.expanded {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: rotate(90deg);
}

/* Fila expandida con detalles (Generalizada para todas las tablas) */
tr.expanded-row {
  display: none;
  background: #f8fafc;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.03);
}

tr.expanded-row.show {
  display: table-row;
  animation: expandRow 0.3s ease-out;
}

@keyframes expandRow {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pedidos-table tbody tr.expanded-row td {
  padding: 1.5rem 2rem;
  border: none;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

/* Contenedor de detalles expandidos */
.expanded-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.detail-section {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.detail-section:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-section-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  word-wrap: break-word;
}

/* Iconos para las secciones */
.detail-section-title::before {
  font-size: 1rem;
}

.detail-section.location .detail-section-title::before {
  content: '📍';
}

.detail-section.schedule .detail-section-title::before {
  content: '⏰';
}

.detail-section.farm .detail-section-title::before {
  content: '🏡';
}

.detail-section.delivery-date .detail-section-title::before {
  content: '📅';
}

.detail-section.vehicle .detail-section-title::before {
  content: '🚛';
}

.detail-section.driver .detail-section-title::before {
  content: '👨‍✈️';
}

.detail-section.quantity .detail-section-title::before {
  content: '📊';
}

.detail-section.weight .detail-section-title::before {
  content: '⚖️';
}

/* Estilos para listas dentro de detalles expandidos */
.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-list li {
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.detail-list li:last-child {
  border-bottom: none;
}

.no-data {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.85rem;
}

/* Iconos para secciones de clientes */
.detail-section.users .detail-section-title::before {
  content: '👥';
}

.detail-section.locations .detail-section-title::before {
  content: '📍';
}

/* Detalles de cantidad expandidos */
.cantidad-detalle {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.cantidad-detalle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.cantidad-detalle-item strong {
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.cantidad-detalle-item span {
  color: #1e293b;
  font-weight: 700;
}

/* Detalles de peso */
.peso-detalle {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.peso-detalle-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.peso-detalle-item:last-child {
  border-bottom: none;
  font-weight: 700;
  color: #1e293b;
  padding-top: 0.5rem;
  border-top: 2px solid #e2e8f0;
}

.peso-detalle-item strong {
  color: #64748b;
  font-weight: 600;
}

/* Estado hover de fila principal */
.pedidos-table tbody tr:not(.expanded-row):hover {
  background: #fafbfc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Los estilos de indicador visual han sido movidos a border-left en el primer td */


/* Pagination Modern */
/* Pagination Modern */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.btn-page {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-page:not(:disabled):hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageInfo {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.9rem;
  background: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: 10px;
}


@media (max-width: 768px) {
  .tabla-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: unset;
  }
}


/*NUEVO DISEÑO DE LOGIN*/

body,
html {
  min-height: 100vh;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background: #f4f4f4;
}

.login-main-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f8fb;
}

.login-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 36px 0 rgba(249, 53, 73, 0.10), 0 2px 4px rgba(138, 183, 233, 0.08);
  padding: 2.7rem 2.5rem 2.2rem 2.5rem;
  width: 100%;
  max-width: 370px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo img {
  height: 62px;
  margin-bottom: 0.6rem;
}

.login-card h2 {
  font-size: 1.45rem;
  margin-bottom: 2rem;
  color: #F93549;
  font-weight: 800;
  letter-spacing: -1px;
}

.input-group {
  position: relative;
  width: 100%;
  margin-bottom: 1.4rem;
}

.input-group input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1.5px solid #8AB7E9;
  border-radius: 11px;
  font-size: 1.05rem;
  background: #fafdff;
  transition: border 0.17s;
  font-family: inherit;
}

.input-group input:focus {
  border-color: #F93549;
  background: #fff;
  outline: none;
}

.input-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8AB7E9;
  font-size: 1.14em;
  pointer-events: none;
}

.btn-login {
  width: 100%;
  padding: 0.8em 0;
  border: none;
  border-radius: 11px;
  background: #F93549;
  color: #fff;
  font-size: 1.15em;
  font-weight: 700;
  margin-top: 0.4em;
  margin-bottom: 0.4em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(249, 53, 73, 0.08);
  transition: background 0.19s;
  letter-spacing: 0.03em;
}

.btn-login:hover,
.btn-login:focus {
  background: #8AB7E9;
  color: #fff;
}

.forgot-link {
  margin-top: 0.8em;
  text-align: center;
  width: 100%;
}

.forgot-link a {
  color: #8AB7E9;
  text-decoration: none;
  font-size: 1em;
  transition: color 0.18s;
}

.forgot-link a:hover {
  color: #F93549;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 1.3rem 0.7rem;
    max-width: 99vw;
  }

  .login-logo img {
    height: 48px;
  }

  .login-card h2 {
    font-size: 1.1rem;
  }
}

/*TERMINA LOGIN*/

.btn-azul-tenue {
  background: #e3f0fb;
  color: #2272b9;
  border: none;
  border-radius: 7px;
  padding: 5px 13px;
  font-weight: 600;
  cursor: pointer;
  font-size: .98em;
  transition: background 0.17s;
}

.btn-azul-tenue:hover {
  background: #c7e1f9;
}

/* Ajuste para el grupo de Cliente dentro del form-grid */
#grupoCliente {
  grid-column: span 2;
  /* ocupa todo el ancho de la fila */
}

#grupoCliente .cliente-flex {
  display: flex;
  gap: 0.5rem;
}

#grupoCliente select {
  flex: 1 1 auto;
  /* ocupa todo el espacio libre */
}

#grupoCliente button {
  flex: 0 0 auto;
  /* ancho fijo según contenido */
  white-space: nowrap;
  /* evita salto de texto */
  padding: 0.5rem 0.75rem;
}

/*Inicia Ajuste columnas en listado usuarios */
#tablaUsuarios th:nth-child(1),
#tablaUsuarios td:nth-child(1) {
  width: 12%;
  /* Usuario */
}

#tablaUsuarios th:nth-child(2),
#tablaUsuarios td:nth-child(2) {
  width: 18%;
  /* Nombre completo */
}

#tablaUsuarios th:nth-child(3),
#tablaUsuarios td:nth-child(3) {
  width: 22%;
  /* Email */
}

#tablaUsuarios th:nth-child(4),
#tablaUsuarios td:nth-child(4) {
  width: 12%;
  /* Rol */
}

#tablaUsuarios th:nth-child(5),
#tablaUsuarios td:nth-child(5) {
  width: 12%;
  /* Cliente */
}

#tablaUsuarios th:nth-child(6),
#tablaUsuarios td:nth-child(6) {
  width: 10%;
  /* Estado */
}

#tablaUsuarios th:nth-child(7),
#tablaUsuarios td:nth-child(7) {
  width: 14%;
  /* Último login */
}

#tablaUsuarios th:nth-child(8),
#tablaUsuarios td:nth-child(8) {
  width: 10%;
  /* Acción */
  text-align: center;
}

#tablaUsuarios th,
#tablaUsuarios td {
  text-align: center;
  vertical-align: middle;
}

#tablaUsuarios td:nth-child(1),
#tablaUsuarios td:nth-child(2) {
  text-align: left;
}

#tablaUsuarios td:nth-child(3) {
  max-width: 220px;
  word-break: break-all;
}

/*Finaliza estilo de la tablaUsuarios*/

/*Estilo para la columna estado*/
.badge-success {
  background: #28a745;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-danger {
  background: #dc3545;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
}

/*Añade estilo a los íconos de acción tablaUsuarios*/
.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2em;
  margin: 0 3px;
}

.btn-icon:hover {
  transform: scale(1.2);
}

/*Finaliza estilo*/

/* ==========================
   DASHBOARD ADMIN
   ========================== */
.dashboard-wrapper {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-family: 'Montserrat', sans-serif;
}

.kpi-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #444;
}

.kpi-card p {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #F93549;
  /* Color corporativo para las cifras */
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.chart-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #444;
}

.chart-container {
  max-width: 400px;
  margin: 0 auto;
}

/*FINALIZA DASHBOARD ADMIN*/

/* === TABLA CLIENTE (sin checkbox ni columna cliente) === */
#tablaMisPedidos {
  table-layout: auto;
  width: 100%;
  border-collapse: collapse;
}

#tablaMisPedidos td {
  padding: 1rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

/* ========================================
   RESPONSIVE MÓVIL - LISTADO DE PEDIDOS
   PWA-Friendly Card Layout
   ======================================== */

@media (max-width: 768px) {
  .dashboard-wrapper {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .welcome-banner {
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
  }

  .welcome-text h2 {
    font-size: 1.4rem;
  }

  .welcome-text p {
    font-size: 0.9rem;
  }

  .tabla-pedidos-container {
    padding: 1rem;
    border-radius: 16px;
  }

  .tabla-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .search-container-modern {
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
  }

  .input-search-small {
    max-width: 100%;
    width: 100%;
  }

  .date-filter-container {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .select-modern {
    flex: 1;
  }

  /* Outdated table mobile logic removed - moved to consolidated section at the end of file */

  .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
  }

  .btn-action {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .btn-action svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 2.5px !important;
    flex-shrink: 0 !important;
  }

  .btn-action.view {
    color: #2563eb !important;
    border-color: #bfdbfe;
  }

  .btn-action.edit {
    color: #d97706 !important;
    border-color: #fde68a;
  }

  .btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0;
  }

  .btn-page {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  #pageInfo {
    width: 100%;
    text-align: center;
    order: -1;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .dashboard-wrapper {
    padding: 0 0.5rem;
  }

  .welcome-banner {
    padding: 1.2rem;
    border-radius: 12px;
  }

  .welcome-text h2 {
    font-size: 1.2rem;
  }

  .tabla-pedidos-container {
    padding: 0.8rem;
    border-radius: 12px;
  }

  .pedidos-table tr {
    padding: 0.8rem;
    border-radius: 10px;
  }

  .pedidos-table td {
    font-size: 0.85rem;
    padding: 0.5rem 0;
  }

  .btn-action {
    padding: 0.7rem 1.2rem;
    font-size: 1.1rem;
  }

  .header-actions {
    flex-direction: column;
  }

  .select-modern,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* Header responsivo para móvil PWA */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .logo-container img {
    max-height: 35px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid #f1f5f9;
  }

  .dropdown-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: auto;
  }

  .user-menu {
    gap: 0.8rem;
  }

  .user-info {
    display: none;
  }

  .btn-logout {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .btn-primary {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}

/* Mejoras táctiles PWA */
@media (max-width: 768px) {

  .btn-action,
  .btn-primary,
  .btn-secondary,
  .dropdown-btn,
  .btn-logout,
  .btn-page {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  input,
  select,
  button {
    font-size: 16px;
  }
}

/* =====================================================
   ESTILOS PARA SECCIONES DE EDICIÓN (Transporte y Pesos)
   ===================================================== */

.seccion-edicion {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.seccion-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.seccion-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seccion-header small {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  display: block;
}

.alert-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-info strong {
  color: #1e40af;
}

/* Estilos específicos para campos de peso */
#epPesoNeto {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

/* Responsive para secciones */
@media (max-width: 768px) {
  .seccion-edicion {
    padding: 1rem;
  }

  .seccion-header h3 {
    font-size: 1rem;
  }

  .alert-info {
    font-size: 0.85rem;
  }
}

/* =====================================================
   RESPONSIVE - MODALES
   ===================================================== */

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 100%;
    max-height: 95vh;
    border-radius: 20px 20px 0 0 !important;
    margin-top: auto !important;
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1.25rem;
    max-height: calc(95vh - 120px);
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .modal-footer button {
    width: 100%;
  }

  .modal-footer span[id^="msg"] {
    margin: 0 !important;
    text-align: center;
    width: 100%;
  }

  /* Grid de 1 columna en móvil */
  .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  .detail-full {
    grid-column: span 1 !important;
  }

  /* Formularios más compactos */
  .form-group-modal {
    margin-bottom: 1rem;
  }

  .form-group-modal label {
    font-size: 0.8rem;
  }

  .input-modal {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
  }
}

/* Landscape móvil - solo si hay suficiente altura */
@media (max-width: 850px) and (orientation: landscape) and (min-height: 400px) {
  .modal-content {
    max-height: 85vh;
    margin-top: 5vh !important;
    border-radius: 18px !important;
  }

  .modal-body {
    max-height: calc(85vh - 100px);
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* =====================================================
   MENÚ HAMBURGUESA RESPONSIVE
   ===================================================== */

/* Botón hamburguesa - oculto por defecto en desktop */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-btn span {
  width: 25px;
  height: 3px;
  background: var(--gray-dark);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animación del botón hamburguesa cuando está activo */
.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay oscuro */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive - Tablets y Móviles */
@media (max-width: 1024px) {

  /* Mostrar botón hamburguesa */
  .hamburger-btn {
    display: flex;
  }

  /* Header ajustado */
  .header-container {
    padding: 0 1rem;
  }

  .logo-container img {
    max-height: 40px;
  }

  /* Ocultar user-info en tablets pequeñas */
  .user-info {
    display: none;
  }

  /* Navegación - Menú lateral izquierdo */
  .main-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: calc(100vh - 140px);
    /* Espacio para user-menu */
    background: white;
    flex-direction: column;
    justify-content: flex-start;
    /* Alinear items al inicio (arriba) */
    gap: 0;
    padding: 1rem 0 1rem 0;
    /* Reducir padding superior */
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1000;
    align-items: stretch;
  }

  .main-nav.active {
    left: 0;
  }

  /* Dropdowns en menú lateral */
  .main-nav .dropdown {
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
  }

  .main-nav .dropdown-btn {
    width: 100%;
    padding: 1rem 1.25rem;
    /* Reducir padding */
    text-align: left;
    background: white;
    border: none;
    font-size: 0.95rem;
    /* Reducir tamaño de fuente */
    font-weight: 600;
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .main-nav .dropdown-btn:hover {
    background: #f8fafc;
  }

  .main-nav .dropdown-btn span:first-child {
    font-size: 1.1rem;
    /* Reducir tamaño de emoji */
    margin-right: 0.5rem;
  }

  .main-nav .dropdown ul {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    background: #f8fafc;
    padding: 0;
    display: none;
  }

  .main-nav .dropdown.active ul {
    display: block;
  }

  .main-nav .dropdown ul li {
    border-bottom: 1px solid #e2e8f0;
  }

  .main-nav .dropdown ul li:last-child {
    border-bottom: none;
  }

  .main-nav .dropdown ul li a {
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    /* Reducir padding */
    color: #64748b;
    font-size: 0.9rem;
    /* Reducir tamaño de fuente */
  }

  .main-nav .dropdown ul li a:hover {
    background: white;
    color: var(--primary);
  }

  /* User menu en menú lateral - FIJO EN LA PARTE INFERIOR */
  .user-menu {
    position: fixed;
    bottom: 0;
    left: -320px;
    width: 300px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1rem;
    /* Reducir padding para evitar overflow */
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    /* Mayor z-index para estar sobre main-nav */
    flex-direction: column;
    gap: 0.75rem;
    box-sizing: border-box;
    /* Incluir padding en el ancho total */
  }

  .user-menu.active {
    left: 0;
  }

  .user-menu .user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0.65rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    /* Incluir padding en el ancho */
  }

  .user-menu .user-info .user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .user-menu .user-info .user-role {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .user-menu .btn-logout {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    /* Incluir padding en el ancho */
  }

  .user-menu .btn-logout:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 53, 73, 0.3);
  }
}

/* Móviles pequeños */
@media (max-width: 768px) {

  .main-nav {
    width: 280px;
    left: -300px;
    height: calc(100vh - 130px);
    /* Ajustar para user-menu */
    box-sizing: border-box;
  }

  .user-menu {
    width: 280px;
    left: -300px;
    padding: 0.85rem;
    /* Reducir padding en pantallas pequeñas */
    box-sizing: border-box;
  }

  .main-nav.active,
  .user-menu.active {
    left: 0;
  }

  .logo-container img {
    max-height: 35px;
  }

  .header-container {
    padding: 0 0.75rem;
  }
}

/* Prevenir scroll del body cuando el menú está abierto */
body.menu-open {
  overflow: hidden;
}


/* ========================================
   PWA STYLES & ANIMATIONS
   ======================================== */

/* Botón de instalación PWA */
.btn-install-pwa {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 9998;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  animation: slideInUp 0.5s ease-out;
}

.btn-install-pwa:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.btn-install-pwa:active {
  transform: translateY(-1px);
}

/* Animaciones PWA */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(30px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* Indicador de estado de conexión */
.connection-status {
  position: fixed;
  top: 70px;
  right: 20px;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9997;
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.connection-status.online {
  background: #10b981;
  color: white;
}

.connection-status.offline {
  background: #f59e0b;
  color: white;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

/* Overlay de carga PWA */
.pwa-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.pwa-loading.active {
  opacity: 1;
  visibility: visible;
}

.pwa-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Badge de actualización disponible */
.update-badge {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #667eea;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  animation: slideInUp 0.5s ease-out;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive PWA elements */
@media (max-width: 768px) {
  .btn-install-pwa {
    bottom: 15px;
    right: 15px;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }

  .connection-status {
    top: 60px;
    right: 15px;
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }

  .update-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.875rem;
  }
}

/* Modo standalone (cuando está instalada como PWA) */
@media all and (display-mode: standalone) {
  body {
    /* Ajustes específicos para modo app */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Ocultar elementos específicos del navegador */
  .browser-only {
    display: none !important;
  }

  /* Agregar padding superior para evitar notch en iOS */
  .main-header {
    padding-top: env(safe-area-inset-top);
  }
}

/* Soporte para notch en dispositivos iOS */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  .main-header {
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
  }
}

/* =========================================
   ESTILOS PARA TABLA EXPANDIBLE Y RESPONSIVE (CLIENTE)
   ========================================= */

/* Indicador de expansión (flecha) */
.expand-indicator {
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  color: #8AB7E9;
  /* Azul secundario */
  font-size: 0.8rem;
  background: #f8fafc;
  font-weight: 700;
  user-select: none;
}

.expand-indicator:hover {
  background: #e2e8f0;
  color: #F93549;
  /* Rojo institucional */
}

/* Rotación al estar expandido */
.expand-indicator.expanded {
  transform: rotate(90deg);
  background: #F93549;
  color: white;
}

/* Fila expandida - oculta por defecto */
.expanded-row {
  display: none;
  background-color: #f8fafc;
}

/* Fila expandida - visible */
.expanded-row.show {
  display: table-row;
}

.expanded-row td {
  padding: 0;
  border: none;
}

/* Contenido de la fila expandida */
.expanded-details {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  background: #fdfdfd;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid #f1f5f9;
}

.detail-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.detail-section-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Highlight de la fila principal cuando está expandida */
.row-expanded td {
  background-color: #f1f5f9;
  border-bottom-color: transparent;
  /* Seamless look con la fila expandida */
}

/* Ajustes Responsive para la Tabla */
@media (max-width: 992px) {

  .pedidos-table th,
  .pedidos-table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
  }
}

/* ========================================
   RESPONSIVE MÓVIL - DASHBOARD & TABLAS
   Consolidated & Premium Design
   ======================================== */

@media (max-width: 768px) {

  /* Dashboard General */
  .dashboard-wrapper {
    padding: 0 5px !important;
    margin: 1rem auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .container-fluid {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .welcome-banner {
    padding: 1.5rem !important;
    border-radius: 16px !important;
  }

  .welcome-text h2 {
    font-size: 1.5rem !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .kpi-card {
    padding: 1rem !important;
    flex-direction: column !important;
    text-align: center !important;
  }

  .kpi-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
  }

  /* Table Container & Search */
  .tabla-pedidos-container {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-top: 1.5rem !important;
  }

  .tabla-header {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 5px 1rem 5px !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .header-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .search-container-modern {
    width: 100% !important;
    flex-direction: column !important;
  }

  .search-box,
  .input-search-small,
  .date-filter-container,
  .select-modern {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .table-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* Card View Transformation */
  .pedidos-table,
  .usuarios-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  .pedidos-table thead,
  .usuarios-table thead {
    display: none !important;
  }

  .pedidos-table tbody,
  .pedidos-table tr:not(.expanded-row),
  .usuarios-table tbody,
  .usuarios-table tr {
    display: block !important;
    width: 100% !important;
  }

  /* Each row becomes a card */
  .pedidos-table tr:not(.expanded-row),
  .usuarios-table tr {
    background: #fff !important;
    border-radius: 12px !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .pedidos-table td,
  .usuarios-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.4rem 0.75rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
    min-height: 40px;
  }

  .pedidos-table td:last-child,
  .usuarios-table td:last-child {
    border-bottom: none !important;
  }

  /* Label styling from data-label */
  .pedidos-table td::before,
  .usuarios-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.6rem;
    text-align: left;
    flex: 0 0 100px;
    /* Reducido para ahorrar espacio */
    white-space: nowrap;
    margin-right: 0.5rem;
  }

  /* Value styling */
  .pedidos-table td>span,
  .pedidos-table td>div,
  .usuarios-table td>span,
  .usuarios-table td>div {
    flex: 1;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
  }

  /* Indicator Row (First Child - Checkbox) */
  .pedidos-table td:nth-child(1) {
    background: #f8fafc !important;
    justify-content: center !important;
    padding: 0.3rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  /* Indicator Row (Second Child - Toggle) */
  .pedidos-table td:nth-child(2) {
    background: #ffffff !important;
    justify-content: center !important;
    padding: 1rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .pedidos-table td:nth-child(1)::before,
  .pedidos-table td:nth-child(2)::before {
    display: none !important;
  }

  .expand-indicator {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem;
    color: #F93549 !important;
    /* Rojo institucional */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff !important;
    border: 2px solid #f1f5f9 !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    cursor: pointer !important;
    flex: none !important;
    /* Evitar deformación */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .expand-indicator:active {
    transform: scale(0.9);
  }

  .expand-indicator.expanded {
    transform: rotate(90deg) !important;
    background: #F93549 !important;
    color: #ffffff !important;
    border-color: #F93549 !important;
  }

  /* Pagination controls */
  .pagination-controls {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    padding: 1rem 0 !important;
  }

  #pageInfo {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 0.5rem !important;
    order: -1;
  }

  /* Expanded Row Integration */
  .pedidos-table tr.expanded-row {
    display: none !important;
    background: transparent !important;
    border: none !important;
    margin-top: -1rem !important;
    padding: 0 !important;
  }

  .pedidos-table tr.expanded-row.show {
    display: block !important;
  }

  .pedidos-table tr.expanded-row td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
  }

  .pedidos-table tr.expanded-row td::before {
    display: none !important;
  }

  .expanded-details {
    padding: 1.25rem !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    margin: 0 0 1rem 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    box-sizing: border-box !important;
  }

  .detail-section-title {
    font-size: 0.65rem !important;
    color: #94a3b8 !important;
    text-transform: uppercase;
    font-weight: 700;
  }

  .detail-section-value {
    color: #334155 !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    word-break: break-word;
  }
}

/* === Final Responsive Fixes === */
@media (max-width: 768px) {

  *,
  *::before,
  *::after {
    box-sizing: border-box !important;
  }

  .container-fluid,
  .dashboard-wrapper .container-fluid {
    margin: 0 !important;
    padding: 0 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  body,
  html {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .btn-action {
    padding: 0.4rem 0.5rem !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
  }

  .btn-action svg {
    flex-shrink: 0 !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .btn-action.view svg {
    color: #2563eb !important;
    stroke: #2563eb !important;
    fill: none !important;
  }

  .btn-action.edit svg {
    color: #d97706 !important;
    stroke: #d97706 !important;
    fill: none !important;
  }

  .main-nav {
    display: none !important;
  }

  #buscadorPedidos {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Ocultar cualquier cosa que se salga horizontalmente */
body {
  overflow-x: hidden !important;
}

/* === Notificaciones Dropdown === */
.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 350px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  z-index: 1001;
  display: none;
  flex-direction: column;
  margin-top: 10px;
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

.notif-dropdown.show {
  display: flex;
}

.notif-header {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.notif-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.notif-item {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notif-item:hover {
  background: #f1f5f9;
}

.notif-item.unread {
  background: #fffafa;
  border-left: 4px solid #F93549;
}

.notif-content {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.4;
}

.notif-time {
  font-size: 0.75rem;
  color: #94a3b8;
}

.notif-footer {
  padding: 0.75rem;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.btn-mark-read-all {
  background: none;
  border: none;
  color: #8AB7E9;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.btn-mark-read-all:hover {
  color: #F93549;
  text-decoration: underline;
}

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ajuste móvil para notificaciones */
@media (max-width: 480px) {
  .notif-dropdown {
    width: 280px;
    right: -50px;
  }
}