:root {
    /* Nueva Paleta Corporativa - Idea Gráfica */
    --primary-blue: #0F2C59;
    /* Navy Blue Corporativo */
    --primary-blue-dark: #071933;
    --secondary-blue: #355C7D;
    --accent-amber: #ffb800;
    /* Mantengo el ambar para highlights */
    --bg-light: #F0F2F5;
    /* Cool Gray Pro */
    --card-bg: #ffffff;
    --border-color: #E2E8F0;
    --text-primary: #1A202C;
    --text-secondary: #718096;

    /* Fuentes */
    --font-titles: 'Barlow', sans-serif;
    --font-main: 'Public Sans', sans-serif;

    /* Layout & Shadow */
    --sidebar-width: 280px;
    --header-height: 70px;
    --max-content-width: 1400px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sombras Antigravity */
    --shadow-sm: 0 1px 2px 0 rgba(15, 44, 89, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 44, 89, 0.1), 0 2px 4px -1px rgba(15, 44, 89, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(15, 44, 89, 0.1), 0 4px 6px -2px rgba(15, 44, 89, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 44, 89, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
}

.dashboard-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    background: var(--primary-blue);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-header {
    padding: 2rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background: var(--accent-amber);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-weight: 800;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    margin: 4px 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid var(--accent-amber);
    border-radius: 0 10px 10px 0;
    margin-left: 0;
    padding-left: 20px;
}

.logout-item {
    margin: 20px 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 24px);
}

/* MAIN CONTENT */
.main-content {
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

@media (max-width: 768px) {
    .dashboard-header {
        height: auto;
        padding: 15px 20px;
        justify-content: space-between;
    }

    .user-info {
        text-align: left;
    }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-amber);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-weight: 800;
}

.content-body {
    padding: 40px 5%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    width: 100%;
}

/* CARDS */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 2rem;
}

.pill-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.pill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-blue);
    opacity: 0;
    transition: var(--transition-smooth);
}

.pill-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pill-card:hover::before {
    opacity: 1;
}

.pill-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-text h3 {
    color: var(--primary-blue-dark);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.pill-text p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* PROCESSING SPECIFIC */
.section-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
}

/* LOGIN SPLIT SCREEN */
.login-split-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: white;
}

.login-visual-pane {
    flex: 1;
    background: var(--primary-blue);
    position: relative;
    display: none;
}

@media (min-width: 1024px) {
    .login-visual-pane {
        display: block;
    }
}

.login-visual-pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    mix-blend-mode: overlay;
}

.login-form-pane {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.1rem;
    color: var(--primary-blue-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.readonly-input {
    background: #f1f5f9 !important;
    border: none !important;
    font-weight: 600;
    color: var(--primary-blue-dark);
    padding: 12px 16px;
    border-radius: 10px;
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

input:not(.readonly-input),
select {
    width: 100%;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-add {
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 1px dashed var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
}

.btn-remove {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.file-upload-box {
    border: 2px dashed var(--border-color);
    padding: 40px;
    text-align: center;
    border-radius: 20px;
    cursor: pointer;
    background: #fdfdfe;
}

.btn-primary {
    background: var(--accent-amber);
    color: var(--primary-blue-dark);
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(255, 184, 0, 0.2);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
    .dashboard-wrapper {
        grid-template-columns: 80px 1fr;
    }

    .sidebar-header h2,
    .nav-item span:not(:first-child),
    .logout-item span {
        display: none;
    }

    .nav-item,
    .logout-item,
    .sidebar-header {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        padding-bottom: 80px;
        /* Espacio para el nav móvil */
    }

    .dashboard-header {
        padding: 0 20px;
    }

    .content-body {
        padding: 24px 20px;
    }

    .action-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 0.7rem;
        font-weight: 700;
        gap: 4px;
        transition: var(--transition-smooth);
    }

    .mobile-nav-item span:first-child {
        font-size: 1.5rem;
    }

    .mobile-nav-item.active {
        color: var(--primary-blue);
    }
}

/* Ocultar nav móvil en desktop */
.mobile-nav {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}