@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-primary: #008442;
    --brand-primary-hover: #005c2e;
    --brand-primary-light: #e2f6ed;
    --brand-accent: #00b359;
    
    --bg-main: #f4f7f5;
    --bg-card: #ffffff;
    --border-color: #d8ece2;
    
    --text-primary: #11281c;
    --text-secondary: #4a6256;
    --text-light: #8fa69b;
    
    --error: #e02424;
    --error-bg: #fde8e8;
    --success: #057a55;
    --success-bg: #def7ec;
    --warning: #c27803;
    --warning-bg: #fdf6b2;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 84, 42, 0.06), 0 4px 6px -2px rgba(0, 84, 42, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 84, 42, 0.1), 0 10px 10px -5px rgba(0, 84, 42, 0.04);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-primary-hover);
}

/* ==========================================================================
   Contenedor de Login (Pantalla de Acceso)
   ========================================================================== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #008442 0%, #005c2e 100%);
    position: relative;
    overflow: hidden;
}

/* Decoraciones de fondo */
.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}
.login-wrapper::before {
    top: -200px;
    left: -200px;
}
.login-wrapper::after {
    bottom: -200px;
    right: -200px;
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-height: 70px;
    width: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================================================
   Componentes de Formularios
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    background-color: #fafdfb;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--brand-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 132, 66, 0.1);
}

/* ==========================================================================
   Botones Premium
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 132, 66, 0.15);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 132, 66, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Alertas e Indicadores
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border-color: rgba(224, 36, 36, 0.2);
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-color: rgba(5, 122, 85, 0.2);
}

/* ==========================================================================
   Estructura Principal de la Aplicacion (Dashboard / Internas)
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar de Navegación */
.sidebar {
    width: 280px;
    background-color: var(--text-primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.sidebar-logo {
    max-height: 45px;
    width: auto;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    overflow-y: auto;
}

.menu-item {
    margin-bottom: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-link:hover,
.menu-item.active .menu-link {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.menu-item.active .menu-link {
    background-color: var(--brand-primary);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.1);
}

.user-info {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.user-role {
    font-size: 12px;
    color: var(--text-light);
}

/* Area de Contenido Principal */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    background-color: var(--bg-main);
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 20px;
}

.content-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-primary);
}

/* Tarjetas Informativas / Metricas (Dashboard) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-primary);
}

/* ==========================================================================
   Tablas de Datos
   ========================================================================== */
.table-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 15px;
}

.data-table th {
    background-color: var(--brand-primary-light);
    color: var(--brand-primary-hover);
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--border-color);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: #fafdfc;
}

/* ==========================================================================
   Badge/Etiquetas de Estado
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-error { background-color: var(--error-bg); color: var(--error); }
.badge-info { background-color: #e1effe; color: #1e429f; }

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

/* Responsividad para Moviles */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .app-layout {
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

/* ==========================================================================
   Reports Submenu Styles
   ========================================================================== */
.submenu-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 8px;
}
.submenu-item {
    margin-bottom: 4px;
}
.submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-light);
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.submenu-link:hover,
.submenu-item.active .submenu-link {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}
.submenu-item.active .submenu-link {
    background-color: var(--brand-primary);
    color: #ffffff;
}
