/* ===== VARIABLES CSS ===== */
:root {
  --primary-color: #00A270;
  --primary-dark: #008A5F;
  --primary-light: #33B584;
  --secondary-color: #10b981;
  --secondary-dark: #059669;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --warning-color: #f97316;
  --success-color: #22c55e;
  --info-color: #3b82f6;
  
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #f1f5f9;
  
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ===== MODO OSCURO ===== */
[data-theme="dark"] {
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-light: #9ca3af;
  
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-accent: #374151;
  
  --border-color: #374151;
  --border-light: #4b5563;
}

/* ===== TIPOGRAFÍA POPPINS ===== */
* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg-secondary);
  min-height: 100vh;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container {
  max-width: 1200px;
}

/* ===== NAVBAR MEJORADA Y MÁS PEQUEÑA ===== */
.navbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0; /* Reducido de 1rem a 0.5rem */
  min-height: 60px; /* Altura fija más pequeña */
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem; /* Reducido de 1.25rem */
  transition: all 0.3s ease;
}

.brand-text {
  font-size: 1rem; /* Tamaño específico para el texto */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-brand:hover {
  transform: translateY(-1px); /* Reducido el efecto */
}

.nav-link {
  font-weight: 500;
  font-size: 0.9rem; /* Reducido */
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0.75rem; /* Reducido padding */
}

.nav-link:hover {
  transform: translateY(-1px);
  color: var(--primary-light) !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-light);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

/* ===== INFORMACIÓN DE EMPRESA MÁS PEQUEÑA ===== */
.company-info {
  font-size: 0.8rem !important; /* Más pequeño */
  opacity: 0.9;
}

/* ===== TOGGLE TEMA ===== */
.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: transparent;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: scale(1.1);
}

/* ===== LOGO MEJORADO Y MÁS PEQUEÑO ===== */
.logo-circle {
  height: 35px; /* Reducido de 45px */
  width: auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
  max-width: 150px; /* Reducido de 200px */
  transition: all 0.3s ease;
}

.logo-circle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* ===== TARJETAS MODERNAS ===== */
.card {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  background: var(--bg-primary);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.card-body {
  padding: 2rem;
  background: var(--bg-primary);
}

/* ===== BOTONES DINÁMICOS ===== */
.btn {
  font-weight: 500;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-color) 100%);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-2px);
}

/* ===== FORMULARIOS MEJORADOS ===== */
.form-control, .form-select {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-weight: 400;
  transition: all 0.3s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 162, 112, 0.25);
  transform: translateY(-2px);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ===== PILLS MEJORADAS ===== */
.option-pill {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.option-pill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.option-pill.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== SECCIONES ===== */
fieldset.section {
  border: none;
  border-top: 2px solid var(--border-light);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
}

fieldset.section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

/* ===== BADGES MEJORADAS ===== */
.badge {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== TABLAS MEJORADAS ===== */
.table {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.table th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem;
}

.table td {
  vertical-align: middle;
  padding: 1rem;
  border-color: var(--border-light);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: var(--bg-accent);
  transform: scale(1.01);
}

/* ===== UTILIDADES ===== */
.select-placeholder {
  color: var(--text-light);
}

.print-only {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* ===== RESPONSIVE MÓVIL MEJORADO ===== */
@media (max-width: 768px) {
  /* Layout móvil reorganizado */
  .navbar {
    padding: 0.5rem 0;
    min-height: auto;
  }
  
  .navbar-brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin: 0;
  }
  
  /* Logo arriba en móvil */
  .navbar .logo-circle {
    height: 40px;
    max-width: 150px;
    margin-bottom: 0.5rem;
  }
  
  /* Texto "Libro de Reclamaciones" abajo del logo */
  .brand-text {
    font-size: 0.9rem;
    order: 2;
    margin-top: 0.25rem;
  }
  
  /* Botones en las esquinas */
  .navbar-nav {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    flex-direction: row;
    gap: 0.5rem;
  }
  
  .theme-toggle {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    width: 32px;
    height: 32px;
  }
  
  /* Ocultar logo duplicado en el contenido */
  .card-header .logo-circle {
    display: none !important;
  }
  
  /* Reorganizar contenido del negocio */
  .card-header .d-flex {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .card-header .fw-bold {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }
  
  .card-header .text-muted {
    font-size: 0.9rem;
  }
  
  /* Mejorar formulario en móvil */
  .card-body {
    padding: 1rem;
  }
  
  .row.g-3 {
    gap: 1rem;
  }
  
  .col-md-6, .col-md-4 {
    width: 100%;
    margin-bottom: 0.75rem;
  }
  
  /* Botones más grandes en móvil */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Fieldsets más compactos */
  .section {
    margin-bottom: 1.5rem;
  }
  
  .section legend {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Inputs más grandes para móvil */
  .form-control, .form-select {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  /* Pills de opciones en móvil */
  .option-pill {
    padding: 1rem;
    margin-bottom: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 576px) {
  /* Ajustes para pantallas muy pequeñas */
  .navbar {
    padding: 0.25rem 0;
  }
  
  .navbar .logo-circle {
    height: 35px;
    max-width: 120px;
  }
  
  .brand-text {
    font-size: 0.8rem;
  }
  
  .theme-toggle {
    width: 28px;
    height: 28px;
  }
  
  .card-header .fw-bold {
    font-size: 1rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
  }
}

/* ===== MEJORAS ESPECÍFICAS PARA EL HEADER MÓVIL ===== */
@media (max-width: 768px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    border-radius: 0 0 1rem 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    margin-top: 0.5rem;
  }
  
  .navbar-toggler {
    border: none;
    padding: 0.25rem;
    font-size: 0.8rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
}

/* ===== MEJORAS PARA ICONOS DE ACCIONES ===== */
.btn-sm i {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
}

/* Tooltips personalizados */
.tooltip {
  font-size: 0.8rem;
}

.tooltip-inner {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--text-primary);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: var(--text-primary);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: var(--text-primary);
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: var(--text-primary);
}

/* Hover effects para iconos */
.btn-sm:hover i {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Espaciado entre botones de acción */
.text-end .btn {
  margin-right: 0.25rem;
}

.text-end .btn:last-child {
  margin-right: 0;
}
