/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
html{line-height:1.15;-webkit-text-size-adjust:100%}
body{margin:0}

/* =========================================
   1. VARIABLES DE DISEÑO Y COLOR
   ========================================= */
:root {
  /* Colores Base */
  --color-primary: #667eea;
  --color-secondary: #764ba2;
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #fbbf24;

  /* Degradados */
  --primary-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  /* Fondos y Texto */
  --bg-dark: #1a1d29;
  --bg-light: #f7fafc;
  --bg-card: #ffffff;
  --text-primary: #2d3748;
  --text-light: #718096;
  --border-color: #e2e8f0;

  /* Sombras y Radios */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 15px rgba(102, 126, 234, 0.2);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* =========================================
   2. ESTILOS GLOBALES Y RESET
   ========================================= */
html{
  font-size:62.5%; /* 1rem = 10px */
  box-sizing:border-box;
  height:100%;
  scroll-behavior: smooth;
}

*,*::before,*::after{box-sizing:inherit}

body{
  min-height:100%;
  display:flex;
  flex-direction:column;
  /* El fondo degradado se aplica solo al login, el app principal usa bg-light */
  background: var(--bg-light); 
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size:1.6rem;
  line-height: 1.6;
}

a{
  color: var(--color-primary);
  text-decoration:none;
  transition: all 0.3s ease;
}

a:hover{
  color: var(--color-secondary);
  text-decoration: underline;
}

img{
  max-width:100%;
  border-style:none;
  border-radius: var(--radius-sm);
}

/* =========================================
   3. LAYOUT PRINCIPAL DE LA APLICACIÓN
   ========================================= */

.contenedor{
  width: 100%;
  max-width: 120rem; /* Ancho máximo para contenido dentro del dashboard */
  margin: 0 auto;
  padding: 3rem 2rem;
}

@media (min-width: 768px){
  .contenedor{
    padding: 4rem 3rem;
  }
}

.contenedor-app{
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  gap: 0;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Columna izquierda - Imagen/Decoración (Oculta en la aplicación principal) */
.contenedor-app .imagen{
  display: none;
}

/* Columna derecha - Panel Principal */
.contenedor-app .app{
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-light);
  overflow-y: auto;
  min-height: 100vh;
}

/* =========================================
   4. TIPOGRAFÍA Y ENCABEZADOS
   ========================================= */
h1, h2, h3{
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: -0.5px;
  position: relative;
}

h1{
  font-size: 4.2rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2{
  font-size: 3.6rem;
  text-align: left; /* Títulos de sección alineados a la izquierda */
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

h3{
  font-size: 2.8rem;
  text-align: left;
}

/* =========================================
   5. BOTONES
   ========================================= */
.boton, .boton-eliminar{
  display: inline-block;
  padding: 1.4rem 3.2rem;
  margin: 1rem 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: var(--radius-md);
  letter-spacing: 0.5px;
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.boton::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.boton:hover::before {
  width: 300px;
  height: 300px;
}

.boton:hover{
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.boton-eliminar{
  background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.boton-eliminar:hover{
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.boton--secundario{
  background: var(--success-gradient) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.boton--secundario:hover{
  box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.boton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================
   6. BARRA DE NAVEGACIÓN Y TABS
   ========================================= */

.barra{
  margin: 3rem 0 5rem;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@media (min-width:768px){
  .barra{
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.barra-servicios{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 4rem;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.barra-servicios .boton{
  flex: 1 1 180px;
  margin: 0;
}

/* Tabs */
.tabs{
  display: flex;
  gap: 0;
  margin-bottom: 0;
  background: var(--bg-card);
  padding: 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tabs button{
  flex: 1;
  padding: 2rem 2rem;
  border: none;
  background: transparent;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.5rem;
  border-radius: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  letter-spacing: 0.5px;
  border-bottom: 3px solid transparent;
}

.tabs button:hover{
  background: var(--bg-light);
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tabs button.actual{
  background: var(--primary-gradient);
  color: white;
  box-shadow: none;
  border-bottom: 3px solid var(--color-secondary);
}

/* =========================================
   7. SECCIONES Y ANIMACIONES
   ========================================= */
.seccion{
  padding: 2rem 0;
  display: none;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.mostrar{ display: block; }
.ocultar{ display: none; }

/* =========================================
   8. CARDS DE SERVICIOS / PRODUCTOS
   ========================================= */
.listado-servicios{
  display: grid;
  gap: 2.5rem;
  margin: 3rem 0;
}

@media (min-width:768px){
  .listado-servicios{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width:1024px){
  .listado-servicios{
    grid-template-columns: repeat(3, 1fr);
  }
}

.listado-servicios .servicio{
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.listado-servicios .servicio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.listado-servicios .servicio:hover{
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.listado-servicios .servicio:hover::before {
  transform: scaleX(1);
}

.listado-servicios .servicio p{
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-weight: 500;
  font-size: 1.7rem;
}

.listado-servicios .servicio .precio-servicio{
  color: var(--color-primary);
  font-weight: 700;
  font-size: 3.2rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.listado-servicios .servicio.seleccionado{
  background: var(--primary-gradient);
  border-color: var(--color-primary);
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.listado-servicios .servicio.seleccionado::before {
  transform: scaleX(1);
  background: rgba(255, 255, 255, 0.3);
}

.listado-servicios .servicio.seleccionado p{
  color: white;
}

.listado-servicios .servicio.seleccionado .precio-servicio{
  color: white;
  -webkit-text-fill-color: white;
}


/* =========================================
   9. FORMULARIOS Y CAMPOS DE ENTRADA
   ========================================= */
.formulario{
  margin-top: 4rem;
  width: 100%;
  background: var(--bg-card);
  padding: 3.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.campo{
  display: flex;
  flex-direction: column;
  margin-bottom: 2.5rem;
  position: relative;
}

@media (min-width: 768px) {
  .campo{
    flex-direction: row;
    align-items: center;
  }
}

.campo label{
  flex: 0 0 14rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

@media (min-width: 768px) {
  .campo label{
    margin-bottom: 0;
    margin-right: 2rem;
  }
}

.campo input, .campo select, .campo textarea{
  flex: 1;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.4rem 1.8rem;
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 1.5rem;
  transition: all 0.3s ease;
  width: 100%; /* Asegura que select y textarea ocupen el 100% del flex item */
  font-family: inherit; /* Hereda la fuente principal */
}

.campo input:focus, .campo select:focus, .campo textarea:focus{
  outline: none;
  border-color: var(--color-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.campo input:disabled{
  background: var(--border-color);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.campo input::placeholder, .campo textarea::placeholder{
  color: var(--text-light);
}

/* =========================================
   10. ALERTAS Y MENSAJES
   ========================================= */

.alerta{
  width: 100%;
  display: block;
  text-align: center;
  padding: 1.6rem 2rem;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1.5rem;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-sm);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.alerta.error{
  background: #fed7d7;
  border-left: 4px solid var(--color-error);
  color: #c53030;
}

.alerta.exito{
  background: #c6f6d5;
  border-left: 4px solid var(--color-success);
  color: #22543d;
}

.alerta.warning {
  background: #fefcbf;
  border-left: 4px solid var(--color-warning);
  color: #8a632d;
}

/* =========================================
   11. TABLAS Y PAGINACIÓN
   ========================================= */
.tabla-responsive{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin: 2rem 0;
}

.tabla-responsive table{
  min-width: 720px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* Estilos de tabla... (Se mantienen los estilos de tabla profesional) */
.tabla-responsive thead{
  background: var(--primary-gradient);
  color: white;
}

.tabla-responsive thead th{
  padding: 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tabla-responsive thead th:first-child{
  border-top-left-radius: var(--radius-sm);
}

.tabla-responsive thead th:last-child{
  border-top-right-radius: var(--radius-sm);
}

.tabla-responsive tbody tr{
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.tabla-responsive tbody tr:hover{
  background: var(--bg-light);
  transform: scale(1.005);
}

.tabla-responsive tbody td{
  padding: 1.5rem;
  color: var(--text-primary);
}

.table-actions{
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Paginación */
.paginacion{
  padding: 4rem 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

@media (min-width:480px){ 
  .paginacion{
    justify-content: space-between;
  } 
}

.paginacion button{
  padding: 1.2rem 2.5rem;
  background: var(--bg-card);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.paginacion button:hover{
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.paginacion button:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =========================================
   14. TABLAS RESPONSIVAS
   ========================================= */

/* Contenedor Responsivo */
.tabla-responsiva {
    /* Asegura que el contenedor no tenga un ancho fijo y pueda desbordarse */
    width: 100%; 
    /* Permite el desplazamiento horizontal cuando el contenido se desborda */
    overflow-x: auto; 
    /* Opcional: mejora la apariencia del desplazamiento en algunos navegadores */
    -webkit-overflow-scrolling: touch; 
    /* Establece un pequeño margen inferior para separar del contenido siguiente */
    margin-bottom: 2rem;
}

/* Estilos de la tabla (ajustes para la responsividad) */
.tabla-responsiva table {
    /* Mantiene el ancho mínimo de la tabla, permitiendo que sea más grande que el contenedor */
    width: 100%;
    /* Asegura que el texto no se ajuste en celdas muy estrechas, forzando el scroll */
    white-space: nowrap; 
    /* Colapsa los bordes para un look limpio */
    border-collapse: collapse; 
}

/* Opcional: Estilo para la barra de desplazamiento (solo si deseas personalizarla) */
.tabla-responsiva::-webkit-scrollbar {
    height: 8px;
}

.tabla-responsiva::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

