/* ===== RESET Y ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  min-height: 100vh;
  font-family: 'Poppins', 'Segoe UI', Roboto, sans-serif;
  background: url('../img/imagenfondo4.jpg') no-repeat center center fixed;
  background-size: cover;
  position: relative;
  overflow-x: hidden;
}

/* Overlay suave para legibilidad */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(3px);
  z-index: -1;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container-fluid {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 40px;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.3),
    0 0 0 2px #ff8a37 inset;
  margin: 30px auto;
  padding: 30px 25px !important;
  max-width: 1600px;
  width: 98%;
  transition: all 0.3s;
  border: 1px solid rgba(255, 138, 55, 0.3);
}

/* ===== PESTAÑAS (TABS) ===== */
.nav-tabs {
  border-bottom: 3px solid #ff8a37;
  gap: 8px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-tabs .nav-link {
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 40px 40px 0 0;
  color: #333;
  font-weight: 600;
  padding: 12px 22px;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.nav-tabs .nav-link i {
  margin-right: 6px;
  color: #ff8a37;
}

.nav-tabs .nav-link:hover {
  background: #ff8a37;
  color: white;
  transform: translateY(-3px);
}

.nav-tabs .nav-link:hover i {
  color: white;
}

.nav-tabs .nav-link.active {
  background: #ff8a37;
  color: white;
  border-bottom: 3px solid #dc3545;
}

.nav-tabs .nav-link.active i {
  color: white;
}

/* ===== TÍTULOS ===== */
h1,
h2 {
  color: #ff8a37;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  border-left: 6px solid #dc3545;
  padding-left: 20px;
  margin: 20px 0 30px;
  font-size: 2.2rem;
}

h2 {
  font-size: 1.8rem;
  border-left-width: 4px;
}

/* ===== FORMULARIOS ===== */
.form-control,
.form-select,
textarea,
select {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 2px solid #ff8a37 !important;
  border-radius: 20px !important;
  padding: 12px 15px !important;
  font-size: 0.95rem;
  transition: all 0.3s;
  color: #333;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
select:focus {
  border-color: #dc3545 !important;
  box-shadow:
    0 0 0 4px rgba(220, 53, 69, 0.15),
    0 5px 15px rgba(0, 0, 0, 0.1) !important;
  outline: none;
  background: white !important;
  transform: scale(1.01);
}

label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.required-field::after {
  content: ' *';
  color: #dc3545;
  font-weight: bold;
}

/* Estilo para selects con select2 */
.select2-container--default .select2-selection--single {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 2px solid #ff8a37 !important;
  border-radius: 20px !important;
  height: 48px !important;
  padding: 8px 15px;
  font-size: 0.95rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 28px !important;
  color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px !important;
  right: 10px;
}

.select2-dropdown {
  border: 2px solid #ff8a37 !important;
  border-radius: 15px !important;
  overflow: hidden;
  background: white;
}

/* Botones generales */
.btn {
  border-radius: 40px !important;
  padding: 10px 25px;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(45deg, #ff8a37, #dc3545);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 25px rgba(255, 138, 55, 0.4);
  background: linear-gradient(45deg, #dc3545, #ff8a37);
}

.btn-success {
  background: #28a745;
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
  background: #6c757d;
}

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

/* ===== TARJETAS DEL DASHBOARD (REDUCIDAS) ===== */
.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 25px; /* un poco más pequeño */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  overflow: hidden;
  border-left: 4px solid #ff8a37; /* borde más fino */
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: rgba(255, 138, 55, 0.2) !important;
  border-bottom: 1px solid #ff8a37;
  font-weight: 600;
  color: #2c3e50;
  padding: 10px 15px; /* padding reducido */
  font-size: 0.9rem;
}

.card-header i {
  color: #ff8a37;
  margin-right: 5px;
  font-size: 1rem;
}

.card-body {
  padding: 12px 15px; /* padding interior más compacto */
}

.card-title {
  font-size: 1.8rem; /* número más pequeño */
  font-weight: 700;
  color: #ff8a37;
  margin: 0;
  line-height: 1.2;
}

/* Ajuste específico para las tarjetas de colores */
.bg-success .card-header {
  background: rgba(40, 167, 69, 0.2) !important;
  border-left-color: #28a745;
}
.bg-primary .card-header {
  background: rgba(0, 123, 255, 0.2) !important;
  border-left-color: #007bff;
}
.bg-info .card-header {
  background: rgba(23, 162, 184, 0.2) !important;
  border-left-color: #17a2b8;
}
.bg-warning .card-header {
  background: rgba(255, 193, 7, 0.2) !important;
  border-left-color: #ffc107;
}
.bg-dark .card-header {
  background: rgba(52, 58, 64, 0.2) !important;
  border-left-color: #343a40;
}

/* Canvas de gráficos más pequeño */
canvas {
  max-height: 180px; /* altura máxima reducida */
  width: 100% !important;
  height: auto !important;
}

/* ===== TABLAS (sin cambios) ===== */
.table-responsive {
  border-radius: 30px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
  padding: 5px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.table {
  background: transparent !important;
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 0;
}

.table thead th {
  background: #ff8a37 !important;
  color: white;
  font-weight: 600;
  padding: 15px 10px;
  border: none;
  white-space: nowrap;
}

.table tbody tr {
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.7);
}

.table tbody tr:hover {
  background: rgba(255, 138, 55, 0.15) !important;
  cursor: pointer;
}

.table tbody tr.selected {
  background: rgba(220, 53, 69, 0.2) !important;
  border-left: 4px solid #dc3545;
}

.table td,
.table th {
  vertical-align: middle;
  padding: 12px 8px;
  border-color: #ff8a37;
  color: #333;
}

/* ===== CAMPOS DE FIRMA (CANVAS) ===== */
canvas {
  background: white;
  border-radius: 25px !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  max-width: 100%;
  height: auto;
  border: 3px solid #ff8a37 !important;
}

canvas:hover {
  box-shadow: 0 15px 30px rgba(255, 138, 55, 0.3);
}

/* ===== SPINNER ===== */
.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #ff8a37;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

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

/* ===== MODALES ===== */
.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 40px;
  border: 2px solid #ff8a37;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.modal-header {
  border-bottom: 2px solid #ff8a37;
  background: rgba(255, 138, 55, 0.1);
  border-radius: 40px 40px 0 0;
  padding: 20px 25px;
}

.modal-title {
  color: #ff8a37;
  font-weight: 700;
}

.modal-footer {
  border-top: 2px solid #ff8a37;
  padding: 20px 25px;
}

/* ===== PREVIEW DE IMAGEN ===== */
#previewTelefonos {
  background: white;
  border-radius: 20px;
  padding: 15px;
  border: 2px dashed #ff8a37;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewTelefonos img {
  border-radius: 15px;
  max-width: 100%;
  max-height: 200px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== BOTONES DE ACCIÓN EN TABLAS ===== */
.btn-sm {
  padding: 5px 12px !important;
  font-size: 0.8rem;
  border-radius: 30px !important;
}

/* ===== AJUSTES RESPONSIVE ===== */
@media (max-width: 1200px) {
  .container-fluid {
    width: 95%;
    padding: 25px 20px !important;
  }
}

@media (max-width: 992px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.6rem;
  }
  .card-title {
    font-size: 1.6rem;
  } /* ajustado */
}

@media (max-width: 768px) {
  .container-fluid {
    border-radius: 30px;
    padding: 20px 15px !important;
    margin: 15px auto;
  }

  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.4rem;
  }

  .nav-tabs .nav-link {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .card-title {
    font-size: 1.5rem;
  } /* más pequeño en móvil */

  .table thead th {
    font-size: 0.8rem;
    padding: 10px 5px;
  }

  .table td {
    font-size: 0.8rem;
    padding: 8px 5px;
  }

  canvas {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  h2 {
    font-size: 1.3rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .card-title {
    font-size: 1.3rem;
  }
}
