:root {
    --bg-dark: #121212;
    --bg-card: rgba(30, 30, 30, 0.8);
    --glass: rgba(255, 255, 255, 0.05);
    --primary: #4CAF50; /* Verde Gimnasio */
    --accent: #2196F3; /* Azul */
    --text-main: #E0E0E0;
    --text-muted: #A0A0A0;
    --border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Glassmorphism Cards */
.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

input, select, textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

select option {
    background-color: #1e1e1e;
    color: #ffffff;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background: #43A047;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; gap: 10px; }
.justify-between { justify-content: space-between; }
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}
.badge-posted { background: rgba(76, 175, 80, 0.2); color: #81C784; }
.badge-draft { background: rgba(255, 193, 7, 0.2); color: #FFD54F; }

/* ==========================================
   SISTEMA RESPONSIVO Y SOPORTE MÓVIL
   ========================================== */

/* Contenedor de Tabla Responsiva */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.table-responsive table {
    margin-top: 0 !important;
}

/* Barra Superior Móvil */
.mobile-topbar {
    display: none;
    height: 60px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-sizing: border-box;
}
.menu-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.8em;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}
.mobile-logo-text {
    font-weight: bold;
    font-size: 1.15em;
    color: var(--primary);
}

/* Capa de Superposición */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.sidebar-overlay.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Botón de Cerrar en Sidebar Móvil */
.sidebar-mobile-header {
    display: none;
    justify-content: flex-end;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}
.close-btn {
    font-size: 2em;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

/* Media Query Móvil */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    /* Mostrar Topbar y Elementos de Navegación Móvil */
    .mobile-topbar {
        display: flex;
    }
    .sidebar-mobile-header {
        display: flex;
    }

    /* Convertir Sidebar en Cajón Flotante (Off-canvas Drawer) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
        border-right: 1px solid var(--border);
        box-sizing: border-box;
    }
    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .main-header {
        display: none !important; /* Ocultar el saludo grande duplicado en móvil */
    }

    /* Pilas Flex Inteligentes */
    .flex:not(.no-stack) {
        flex-direction: column;
        gap: 10px;
    }
    .flex:not(.no-stack) button,
    .flex:not(.no-stack) a:not(.badge) {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* Reducción de fuentes generales en móvil */
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.4em; }
    h3 { font-size: 1.2em; }
    
    th, td {
        padding: 8px;
        font-size: 0.85em;
    }
}

/* Grillas Responsivas */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
@media (max-width: 480px) {
    .grid-2-mobile-1 {
        grid-template-columns: 1fr !important;
    }
    .grid-2-mobile-1 > div {
        grid-column: span 1 !important;
    }
}

/* Tooltips CSS Premium */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* Arriba del elemento */
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: rgba(18, 18, 18, 0.96);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal; /* Permite saltos si es largo */
    width: max-content;
    max-width: 250px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    z-index: 9999;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

