/* ==========================================================================
   SISTEMA DE DISEÑO CORPORATIVO PREMIUM - MEDIACIÓN
   ========================================================================== */

:root {
    /* Paleta de Colores (Blanco puro lateral + Azul) */
    --bg-main: #EEF2F6; /* Fondo azulado fresco */
    --bg-sidebar: #FFFFFF; 
    --bg-card: #FFFFFF;
    --text-primary: #2C2825;
    --text-secondary: #5C554D;
    
    /* Color de Acento (Azul puro) */
    --primary-color: #0000FF; 
    --primary-light: rgba(0, 0, 255, 0.1);
    --primary-shadow: rgba(0, 0, 255, 0.3);

    /* Colores de Estado */
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;

    /* Tipografía */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Playfair Display', serif;
    
    /* Sombras Neumórficas/Cristal */
    --shadow-soft: 10px 10px 20px rgba(200, 190, 175, 0.4), -10px -10px 20px rgba(255, 255, 255, 1);
    --shadow-inset: inset 4px 4px 10px rgba(200, 190, 175, 0.3), inset -4px -4px 10px rgba(255, 255, 255, 1);
    --radius-lg: 24px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   1. ESTRUCTURA SPA (Sidebar y Contenido Principal)
   ========================================================================== */

#sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.05);
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 5px;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.5);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.nav-item.active {
    background-color: #FFFFFF;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(200, 190, 175, 0.4);
}

#main-content {
    margin-left: 280px;
    flex: 1;
    padding: 3rem;
    min-height: 100vh;
}

/* ==========================================================================
   2. COMPONENTES GLOBALES (Tarjetas, Botones)
   ========================================================================== */

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid #FFFFFF;
    margin-bottom: 2rem;
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-primary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 15px rgba(200, 190, 175, 0.4), -5px -5px 15px rgba(255, 255, 255, 1);
    background: linear-gradient(135deg, #FDFBF7, #F3EBE1);
}

.btn-primary:hover {
    box-shadow: var(--shadow-inset);
    transform: translateY(1px);
}

/* ==========================================================================
   3. TÚNEL DE FASES (Stepper Visual)
   ========================================================================== */

.stepper-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 2rem 0;
    padding: 2rem 0;
    width: 100%;
}

.stepper-line {
    position: absolute;
    top: 50%; 
    left: 45px;
    right: 45px;
    height: 3px;
    background: #D8D0C5;
    z-index: 1;
    transform: translateY(-50%);
}

.stepper-line-progress {
    position: absolute;
    top: 50%;
    left: 45px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, rgba(0,0,255,0.5) 100%);
    width: 25%; 
    transition: width 0.5s ease;
    z-index: 1;
    transform: translateY(-50%);
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 120px;
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid #FFFFFF;
    box-shadow: 6px 6px 15px rgba(200, 190, 175, 0.4), -6px -6px 15px rgba(255, 255, 255, 1);
    transition: all 0.4s ease;
    gap: 6px;
}

.step-circle {
    width: 38px;
    height: 38px;
    background: #F5F5F5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    box-shadow: inset 3px 3px 6px rgba(200,190,175,0.5), inset -3px -3px 6px rgba(255,255,255,1);
    margin-bottom: 2px;
}

.step-number {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.step-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.1;
    padding: 0 4px;
}

/* Estados del Paso */
.step-item.completed .step-circle {
    background: linear-gradient(135deg, #0000FF, #3333FF);
    color: white;
    box-shadow: 0 6px 12px var(--primary-shadow);
}

.step-item.active {
    background: linear-gradient(145deg, #FDFBF7, #F3EBE1);
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.15), 10px 10px 20px rgba(200, 190, 175, 0.4), -10px -10px 20px rgba(255, 255, 255, 1);
    transform: scale(1.05);
    height: 130px;
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, #0000FF, #1111FF);
    color: white;
    box-shadow: 0 0 15px rgba(0,0,255,0.4), 0 5px 10px var(--primary-shadow);
    transform: scale(1.1);
    position: relative;
}

.step-item.active .step-circle::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 1.5px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.5;
}

.step-item.active .step-number,
.step-item.active .step-title {
    color: var(--text-primary);
    font-weight: 700;
}

/* ==========================================================================
   DASHBOARD PRINCIPAL (STATS Y TABLAS)
   ========================================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 255, 0.08);
    border: 1px solid rgba(0, 0, 255, 0.1);
}

/* Iconos vibrantes para cada tarjeta */
.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), #3333FF);
}
.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #00C6FF, #0072FF);
}
.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #F2994A, #F2C94C);
}
.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #11998E, #38EF7D);
}

.stat-icon {
    width: 38px;
    height: 38px;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

/* Tabla Elegante */
.table-container {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    padding: 1.5rem;
    overflow-x: auto;
}

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 1.2rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), #3333FF);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid #E2E8F0;
    color: #334155;
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Zebra striping para la tabla */
tbody tr:nth-child(even) {
    background-color: #F8FAFC;
}
tbody tr:nth-child(odd) {
    background-color: #FFFFFF;
}

tr:hover td {
    background-color: #F0F4FF;
}

/* Iconos de Acción en Tablas */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.icon-edit {
    background: rgba(0, 0, 255, 0.1);
    color: var(--primary-color);
}

.icon-edit:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 255, 0.2);
}

.icon-delete {
    background: rgba(220, 53, 69, 0.1);
    color: #DC3545;
}

.icon-delete:hover {
    background: #DC3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #F0F4F8;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.step-item.active .step-title {
    color: var(--text-primary);
    font-weight: 700;
}
