/* ==========================================================================
   BIENESTAR 2026 - SISTEMA DE GESTIÓN INSTITUCIONAL
   Hoja de Estilos Principal - Diseño Profesional, Sobrio y Moderno
   ========================================================================== */

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

:root {
    /* Paleta Institucional Mexicana Moderna */
    --brand-primary: #111e33;
    --brand-wine: #8B1E3F;
    --brand-wine-hover: #9c2247;
    --brand-wine-glow: rgba(139, 30, 63, 0.28);
    --brand-gold: #c59b27;
    --brand-gold-subtle: rgba(197, 155, 39, 0.12);

    /* Escala de Fondo y Superficies */
    --bg-app: #090f1d;
    --bg-surface: #111c2e;
    --bg-surface-elevated: #16243b;
    --bg-surface-card: rgba(19, 31, 51, 0.85);
    --bg-surface-hover: #1c2c47;
    
    /* Bordes y Líneas */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-accent: rgba(139, 30, 63, 0.4);
    --border-focus: #c59b27;

    /* Tipografía y Textos */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Semántica y Estados */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-info: #0284c7;
    --color-info-bg: rgba(2, 132, 199, 0.12);

    /* Sombras y Efectos */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.5);
    --shadow-wine: 0 4px 16px var(--brand-wine-glow);

    /* Radios y Espaciado */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Normalización */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(139, 30, 63, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(197, 155, 39, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ==========================================================================
   NAVEGACIÓN SUPERIOR (BARRA INSTITUCIONAL)
   ========================================================================== */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(17, 28, 46, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1.5rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-shrink: 0;
}

.brand-badge {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--brand-wine) 0%, #5e1128 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px var(--brand-wine-glow);
    letter-spacing: -0.5px;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-year {
    color: var(--brand-gold);
    font-weight: 800;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

/* Enlaces de Navegación */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    flex-shrink: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: #ffffff;
    background: var(--bg-surface-elevated);
}

.nav-link.active {
    color: #ffffff;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--brand-gold);
    box-shadow: 0 0 8px var(--brand-gold);
}

.nav-counter {
    background: var(--brand-wine);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* Área de Usuario en Navbar */
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-surface-elevated);
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-gold);
}

.user-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}

.role-admin {
    color: var(--brand-gold);
}

.role-gestor {
    color: var(--color-success);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

/* Botón Menú Móvil */
.btn-mobile-menu {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.4rem;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem 1.5rem;
}

/* Encabezado de Página */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.page-title-box h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.page-title-box p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
.app-footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}
