:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --sidebar-width: 260px;
    --sidebar-bg: #1a252f;
    --sidebar-hover: #2c3e50;
    --sidebar-text: #ecf0f1;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Layout Principal */
.app-container {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    width: calc(100% - var(--sidebar-width));
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    margin: 0;
}

/* Tipografía y Enlaces */
h1 {
    color: var(--primary-color);
    margin-top: 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Botones y Utilidades */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Centrado para Login (Helper) */
.centered-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--primary-color);
}

/* -------------------------------------------
   RESPONSIVIDAD (MÓVILES)
------------------------------------------- */

@media (max-width: 768px) {
    .app-container {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .container {
        padding: 15px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Contenedor específico para forzar scroll en tablas */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        display: block;
    }

    .data-table {
        min-width: 800px;
        /* Forzar ancho mínimo más grande para evitar aplastamiento */
    }

    /* Ajustar contenedores tipo row a column */
    div[style*="justify-content: space-between"][style*="align-items: center"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    /* Ajustar botones responsivos */
    .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    div[style*="display: flex; gap: 10px;"] {
        flex-direction: column;
        width: 100%;
    }
}