/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    /* Nueva Paleta de Colores Grupo Xeclin */
    --primary: #00bcd4;         /* Azul Cyan vibrante */
    --primary-glow: rgba(0, 188, 212, 0.4);
    --primary-dark: #008ba3;
    
    --bg-main: #0b111e;         /* Fondo Azul Marino muy oscuro */
    --bg-card: #151d29;         /* Fondo de tarjetas */
    --text-main: #ffffff;
    --text-muted: #a0aec0;      /* Gris azulado para textos secundarios */
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Variables de estados */
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
}

/* --- BOTONES ESTILO XECLIN --- */
.btn-xeclin {
    background-color: var(--primary);
    color: white !important;
    border: none;
    padding: 12px 24px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-xeclin:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px var(--primary);
    transform: translateY(-2px);
}

/* --- TARJETAS CON EFECTO CRISTAL Y SOPORTE MODO CLARO --- */
.card-glass, .stat-card {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Ajuste de sombras para el modo claro */
[data-theme="light"] .card-glass, 
[data-theme="light"] .stat-card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

.input-xeclin {
    width: 100%;
    padding: 12px;
    margin: 10px 0 20px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    border-radius: 6px;
    transition: all 0.3s;
}

.input-xeclin:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* --- ESTRUCTURA DEL LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #080d16;
    border-right: 1px solid var(--border-color);
    padding: 25px 0;
    display: flex;
    flex-direction: column;
}

/* Ajuste Sidebar Modo Claro */
[data-theme="light"] .sidebar {
    background-color: #ffffff;
}

.sidebar-logo {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 40px;
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.1) 0%, transparent 100%);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.main-content {
    flex: 1;
    padding: 35px;
    background-color: var(--bg-main);
    overflow-y: auto;
}

/* --- TOP HEADER --- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* --- DASHBOARD STATS --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.stat-card:hover { 
    transform: translateY(-5px);
    border-color: var(--primary) !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.stat-title {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main) !important;
    margin-top: 12px;
}

/* --- TABLAS XECLIN CORREGIDAS --- */
.table-xeclin {
    width: 100%;
    border-collapse: collapse; 
    margin-top: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-xeclin th, .table-xeclin td {
    padding: 16px 15px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-xeclin th {
    background-color: rgba(0, 188, 212, 0.05);
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.table-xeclin tr:hover td {
    background-color: rgba(0, 188, 212, 0.03);
}

/* Ajustes Tablas Modo Claro */
[data-theme="light"] .table-xeclin {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

[data-theme="light"] .table-xeclin tr:hover td {
    background-color: #f8fafc;
}

/* --- BOTONES DE ACCIÓN (INVENTARIO/TABLAS) --- */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid transparent;
}

.btn-edit {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary) !important;
    border-color: var(--primary);
}

.btn-edit:hover {
    background: var(--primary);
    color: white !important;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c !important;
    border-color: #e74c3c;
}

.btn-delete:hover {
    background: #e74c3c;
    color: white !important;
}

/* Estilo para los inputs de fecha */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0);
}

/* --- OPTIMIZACIÓN RESPONSIVA (CELULARES Y TABLETAS) --- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column; 
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-logo {
        margin-bottom: 15px;
    }

    .nav-link {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 20px 15px;
    }

    .top-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .table-xeclin {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .btn-xeclin {
        width: 100%;
        margin-bottom: 10px;
    }
}