/* BoxPilot - Sistema de Gestión de Gimnasio */
/* ============================================ */
/* Archivo: assets/css/style.css - Estilos Globales Mejorados */

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

/* ─── Variables de Diseño Multitema (Ocean Teal, Obsidian Dark, Crimson Red) ─── */

/* 🌊 TEMA 1: Ocean Teal & Platino Templado (Claro - Favorito) */
:root, html[data-theme="teal"] {
    --bg-dark:       #f8fafc;
    --bg-card:       #ffffff;
    --bg-card-solid: #ffffff;
    --bg-sidebar:    #ffffff;
    --bg-input:      #f1f5f9;

    --border-color:  #cbd5e1;
    --border-hover:  #94a3b8;
    --border-glow:   rgba(13, 148, 136, 0.35);

    --primary:       #0d9488;
    --primary-dark:  #0f766e;
    --primary-glow:  rgba(13, 148, 136, 0.22);
    --primary-bg:    rgba(13, 148, 136, 0.08);

    --orange:        #d97706;
    --orange-glow:   rgba(217, 119, 6, 0.2);
    --orange-bg:     rgba(217, 119, 6, 0.08);

    --green:         #059669;
    --green-glow:    rgba(5, 150, 105, 0.2);
    --green-bg:      rgba(5, 150, 105, 0.08);

    --red:           #dc2626;
    --red-glow:      rgba(220, 38, 38, 0.2);
    --red-bg:        rgba(220, 38, 38, 0.08);

    --purple:        #7c3aed;
    --purple-bg:     rgba(124, 58, 237, 0.08);

    --text-main:     #0f172a;
    --text-muted:    #334155;
    --text-dim:      #64748b;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --shadow-soft: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 4px 20px rgba(13, 148, 136, 0.15);
    --blur: blur(18px);

    --navbar-bg: rgba(255, 255, 255, 0.94);
    --navbar-border: #cbd5e1;
    --brand-text: #0f172a;
    --nav-link-color: #475569;
    --nav-link-hover-bg: rgba(13, 148, 136, 0.06);
    --nav-link-hover-text: #0d9488;
    --heading-color: #0f172a;
    --badge-bg-neutral: #f1f5f9;
}

/* 🌌 TEMA 2: Obsidian Cyber Neon (Oscuro Original) */
html[data-theme="dark"] {
    --bg-dark:       #07090f;
    --bg-card:       rgba(20, 28, 46, 0.90);
    --bg-card-solid: #111826;
    --bg-sidebar:    rgba(10, 15, 30, 0.95);
    --bg-input:      rgba(10, 16, 36, 0.85);

    --border-color:  rgba(255, 255, 255, 0.08);
    --border-hover:  rgba(255, 255, 255, 0.16);
    --border-glow:   rgba(0, 229, 255, 0.35);

    --primary:       #00e5ff;
    --primary-dark:  #00b0cc;
    --primary-glow:  rgba(0, 229, 255, 0.22);
    --primary-bg:    rgba(0, 229, 255, 0.08);

    --orange:        #ff5500;
    --orange-glow:   rgba(255, 85, 0, 0.22);
    --orange-bg:     rgba(255, 85, 0, 0.08);

    --green:         #00e676;
    --green-glow:    rgba(0, 230, 118, 0.22);
    --green-bg:      rgba(0, 230, 118, 0.07);

    --red:           #ff2e55;
    --red-glow:      rgba(255, 46, 85, 0.22);
    --red-bg:        rgba(255, 46, 85, 0.08);

    --purple:        #c084fc;
    --purple-bg:     rgba(192, 132, 252, 0.08);

    --text-main:     #ffffff;
    --text-muted:    #94a3b8;
    --text-dim:      #64748b;

    --shadow-soft: 0 8px 32px -8px rgba(0,0,0,0.55);
    --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.12);

    --navbar-bg: rgba(7, 9, 15, 0.90);
    --navbar-border: rgba(255, 255, 255, 0.08);
    --brand-text: #ffffff;
    --nav-link-color: #8b9ec0;
    --nav-link-hover-bg: rgba(255, 255, 255, 0.06);
    --nav-link-hover-text: #ffffff;
    --heading-color: #ffffff;
    --badge-bg-neutral: rgba(255, 255, 255, 0.06);
}

/* 🔴 TEMA 3: Crimson Energy Pro (Rojo Fuego) */
html[data-theme="red"] {
    --bg-dark:       #0d0608;
    --bg-card:       rgba(32, 14, 20, 0.88);
    --bg-card-solid: #1c0a10;
    --bg-sidebar:    rgba(26, 8, 14, 0.92);
    --bg-input:      rgba(22, 7, 12, 0.85);

    --border-color:  rgba(255, 255, 255, 0.09);
    --border-hover:  rgba(255, 255, 255, 0.18);
    --border-glow:   rgba(239, 68, 68, 0.4);

    --primary:       #ef4444;
    --primary-dark:  #dc2626;
    --primary-glow:  rgba(239, 68, 68, 0.28);
    --primary-bg:    rgba(239, 68, 68, 0.1);

    --orange:        #f97316;
    --orange-glow:   rgba(249, 115, 22, 0.22);
    --orange-bg:     rgba(249, 115, 22, 0.08);

    --green:         #10b981;
    --green-glow:    rgba(16, 185, 129, 0.22);
    --green-bg:      rgba(16, 185, 129, 0.08);

    --red:           #ff2e55;
    --red-glow:      rgba(255, 46, 85, 0.25);
    --red-bg:        rgba(255, 46, 85, 0.1);

    --purple:        #e040fb;
    --purple-bg:     rgba(224, 64, 251, 0.08);

    --text-main:     #ffffff;
    --text-muted:    #cbd5e1;
    --text-dim:      #94a3b8;

    --shadow-soft: 0 8px 32px -8px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 25px rgba(239, 68, 68, 0.2);

    --navbar-bg: rgba(13, 6, 8, 0.90);
    --navbar-border: rgba(255, 255, 255, 0.09);
    --brand-text: #ffffff;
    --nav-link-color: #cbd5e1;
    --nav-link-hover-bg: rgba(239, 68, 68, 0.15);
    --nav-link-hover-text: #ef4444;
    --heading-color: #ffffff;
    --badge-bg-neutral: rgba(255, 255, 255, 0.06);
}

/* ─── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse 60% 50% at 15%  10%, rgba(13, 148, 136, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 85%  85%, rgba(217, 119,   6, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 50%  50%, rgba(124, 58,  237, 0.02) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--heading-color, var(--text-main));
    line-height: 1.25;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
strong { color: var(--text-main); }

/* ─── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Navbar ──────────────────────────────────────────── */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--navbar-border, var(--border-color));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.nav-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
}

.nav-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--brand-text, var(--text-main));
    text-decoration: none;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--orange));
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: transform 0.2s;
}
.brand:hover .brand-icon { transform: rotate(-8deg) scale(1.08); }

.brand-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand:hover .brand-logo-img {
    transform: rotate(-6deg) scale(1.08);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.65);
}

.brand-divider {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.4;
    margin: 0 0.1rem;
}

.indictum-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    background: rgba(238, 79, 35, 0.12);
    border: 1px solid rgba(238, 79, 35, 0.4);
    border-radius: 20px;
    transition: all 0.2s ease;
}
.brand:hover .indictum-brand {
    background: rgba(238, 79, 35, 0.22);
    border-color: #EE4F23;
    box-shadow: 0 0 12px rgba(238, 79, 35, 0.4);
}

.indictum-logo-img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #EE4F23;
    box-shadow: 0 0 8px rgba(238, 79, 35, 0.35);
}

.indictum-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #EE4F23;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    flex: 1;
    justify-content: center;
    overflow: visible !important;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
    padding: 0.32rem 0.55rem;
    border-radius: var(--radius-xs);
    color: var(--nav-link-color, var(--text-muted));
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.18s;
    white-space: nowrap;
}
.nav-link:hover  { color: var(--nav-link-hover-text, var(--primary)); background: var(--nav-link-hover-bg, var(--primary-bg)); }
.nav-link.active { color: var(--primary); background: var(--primary-bg); font-weight: 700; }

/* Menús Agrupados (Dropdowns) */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-btn {
    padding: 0.32rem 0.55rem;
    border-radius: var(--radius-xs);
    color: var(--nav-link-color, var(--text-muted));
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.18s;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav-dropdown-btn:hover,
.nav-dropdown.show .nav-dropdown-btn {
    color: var(--nav-link-hover-text, var(--primary));
    background: var(--nav-link-hover-bg, var(--primary-bg));
}
.nav-dropdown-btn.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 700;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 2500;
    margin-top: 0.2rem;
}

/* Puente invisible para mantener el hover activo sin brechas */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.nav-dropdown.show .nav-dropdown-menu {
    display: block !important;
}
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

.drawer-group-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 0.75rem 1rem 0.25rem 1rem;
    list-style: none;
}
.drawer-sublink {
    padding-left: 1.5rem !important;
}

/* Accordion en el Drawer Móvil */
.drawer-accordion {
    list-style: none;
    margin-bottom: 0.2rem;
}
.drawer-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}
.drawer-accordion-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.drawer-accordion-btn.active {
    color: var(--primary);
    font-weight: 700;
}
.accordion-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.drawer-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}
.drawer-accordion-menu {
    list-style: none;
    padding-left: 0.4rem;
    display: none;
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}
.drawer-accordion.open .drawer-accordion-menu {
    display: block;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* ─── Selector de Temas Visuales en la Navbar ───────── */
.theme-selector-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.35rem;
    border-radius: 50px;
}
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.82rem;
    text-decoration: none;
    transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
    opacity: 0.65;
    cursor: pointer;
}
.theme-btn:hover {
    opacity: 1;
    transform: scale(1.18);
}
.theme-btn.active {
    opacity: 1;
    background: var(--primary-bg);
    border: 1px solid var(--border-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: scale(1.08);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.65rem;
    border-radius: 50px;
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--text-main);
}

/* Role pills */
.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.role-admin         { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(217,119,6,0.35); }
.role-coach         { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(124,58,237,0.35); }
.role-recepcionista { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.role-cliente       { background: var(--primary-bg); color: var(--primary); border: 1px solid var(--border-glow); }

/* ─── Layout ──────────────────────────────────────────── */
.container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title h1  { font-size: 1.9rem; margin-bottom: 0.2rem; color: var(--heading-color, var(--text-main)); }
.page-subtitle  { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ─── Glass Cards ──────────────────────────────────────── */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s, transform 0.2s;
    color: var(--text-main);
}
.glass-card:hover { border-color: var(--border-hover); }
.glass-card.hoverable:hover { transform: translateY(-2px); border-color: var(--border-glow); }

/* ─── Grid Layouts ────────────────────────────────────── */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

@media (max-width: 1100px) { .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px)  { .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; } }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 24px var(--primary-glow); color: #ffffff; }

.btn-orange {
    background: var(--orange);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--orange-glow);
}
.btn-orange:hover { filter: brightness(1.1); box-shadow: 0 6px 24px var(--orange-glow); color: #ffffff; }

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover { background: var(--border-hover); color: var(--text-main); border-color: var(--border-glow); }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-glow);
}
.btn-danger:hover { background: var(--red); color: #ffffff; }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-glow);
}
.btn-success:hover { background: var(--green); color: #ffffff; }

.btn-sm { padding: 0.38rem 0.78rem; font-size: 0.82rem; border-radius: var(--radius-xs); }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.76rem; border-radius: var(--radius-xs); }
.btn-icon { padding: 0.5rem; aspect-ratio: 1; border-radius: var(--radius-xs); }

/* ─── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.38rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem; }
select.form-control option { background: var(--bg-card-solid); color: var(--text-main); }

textarea.form-control { resize: vertical; min-height: 90px; }

/* ─── Stat Cards ──────────────────────────────────────── */
.stat-card { display: flex; align-items: center; gap: 1.1rem; }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.glass-card:hover .stat-icon { transform: scale(1.08); }

.stat-icon.cyan   { background: var(--primary-bg); border: 1px solid var(--primary-glow); }
.stat-icon.orange { background: var(--orange-bg);  border: 1px solid var(--orange-glow); }
.stat-icon.green  { background: var(--green-bg);   border: 1px solid var(--green-glow); }
.stat-icon.purple { background: var(--purple-bg);  border: 1px solid var(--purple-bg); }
.stat-icon.red    { background: var(--red-bg);     border: 1px solid var(--red-glow); }

.stat-val { font-family: 'Outfit', sans-serif; font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--text-main); }
.stat-lbl { color: var(--text-muted); font-size: 0.82rem; font-weight: 500; margin-top: 0.15rem; }
.stat-lbl { color: #475569; font-size: 0.82rem; font-weight: 500; margin-top: 0.15rem; }

/* ─── Tables ──────────────────────────────────────────── */
.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); }

.table { width: 100%; border-collapse: collapse; text-align: left; color: var(--text-main); }

.table th {
    background: var(--bg-input);
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-main);
}

.table tbody tr:hover td { background: var(--primary-bg); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ──────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.6rem;
    border-radius: 50px;
    font-size: 0.74rem;
    font-weight: 700;
}
.badge-success { background: var(--green-bg);  color: var(--green);   border: 1px solid var(--green-glow); }
.badge-danger  { background: var(--red-bg);    color: var(--red);     border: 1px solid var(--red-glow); }
.badge-warning { background: var(--orange-bg); color: var(--orange);  border: 1px solid var(--orange-glow); }
.badge-info    { background: var(--primary-bg);color: var(--primary); border: 1px solid var(--primary-glow); }
.badge-purple  { background: var(--purple-bg); color: var(--purple);  border: 1px solid var(--purple-bg); }

/* ─── Modals ──────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.modal.active { display: flex; opacity: 1; }

.modal-content {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    color: var(--text-main);
    animation: modalIn 0.22s ease;
}

.modal-content.modal-lg { max-width: 860px; }

@keyframes modalIn {
    from { transform: translateY(18px) scale(0.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

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

.modal-close {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-glow); }

/* ─── WOD Calendar ────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.4rem 0;
}

.calendar-cell {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 120px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.18s;
    cursor: default;
}
.calendar-cell:hover { border-color: var(--border-hover); }

.calendar-cell.today {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: inset 0 0 18px var(--primary-glow);
}

.calendar-cell.other-month { opacity: 0.65; background: var(--bg-dark); pointer-events: auto !important; }
.calendar-cell.other-month .day-number { color: var(--text-dim); }

.cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.15rem;
}

.day-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}
.calendar-cell.today .day-number { color: var(--primary); }

.btn-add-wod {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-add-wod:hover { background: var(--primary); color: #ffffff; border-color: var(--primary-dark); }

.wod-item {
    background: var(--bg-input);
    border-left: 3px solid var(--primary);
    border-radius: 5px;
    padding: 0.35rem 0.55rem;
    font-size: 0.76rem;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.15s;
    border: 1px solid var(--border-color);
}
.wod-item:hover { transform: scale(1.02); background: var(--bg-card); border-color: var(--border-hover); }

/* ─── Legend / Heatmap ────────────────────────────────── */
.legend-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.84rem;
    color: var(--text-main);
    flex-wrap: wrap;
    box-shadow: var(--shadow-soft);
}
.legend-item { display: flex; align-items: center; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 0.4rem; flex-shrink: 0; }
.dot-red    { background: var(--red);   box-shadow: 0 0 7px var(--red-glow); }
.dot-green  { background: var(--green); box-shadow: 0 0 7px var(--green-glow); }
.dot-normal { background: var(--text-dim); }

/* ─── Movement Chips (WOD Creator) ───────────────────── */
.movement-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.65rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.movement-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-card); }
.movement-chip.selected { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.movement-chip.red { border-color: var(--red-glow); color: var(--red); background: var(--red-bg); }
.movement-chip.green { border-color: var(--green-glow); color: var(--green); background: var(--green-bg); }

/* ─── Product Cards ───────────────────────────────────── */
.product-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }

.product-img-box {
    width: 100%;
    height: 130px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    margin-bottom: 0.9rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}
.glass-card:hover .product-img-box { transform: scale(1.04); }

.product-price {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

/* ─── Progress Bars ───────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--orange));
    transition: width 0.4s ease;
}
.progress-fill.red   { background: var(--red); }
.progress-fill.green { background: var(--green); }

/* ─── Capacity Badge (Schedule) ─────────────────────── */
.capacity-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* ─── Alert Boxes ─────────────────────────────────────── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--green-bg);  color: var(--green);  border-color: rgba(0,230,118,0.25); }
.alert-danger  { background: var(--red-bg);    color: var(--red);    border-color: rgba(255,46,85,0.25); }
.alert-info    { background: var(--primary-bg);color: var(--primary);border-color: rgba(0,229,255,0.25); }
.alert-warning { background: var(--orange-bg); color: var(--orange); border-color: rgba(255,85,0,0.25); }

/* ─── Dividers ────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border-color); margin: 1.5rem 0; }

/* ─── Section Titles ──────────────────────────────────── */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

/* ─── Toggle Switch (Permisos) ────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 0.65rem; }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── Leaderboard Ranking ─────────────────────────────── */
.rank-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a0a00; box-shadow: 0 0 14px rgba(255,215,0,0.5); }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #888);    color: #0a0a0a; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.rank-n { background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* ─── Footer ──────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-top: auto;
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--primary); }

/* ─── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.anim-in { animation: fadeInUp 0.3s ease forwards; }

/* ─── Modern Mobile Drawer & Responsive User Dropdown System ─── */
.mobile-drawer-toggle {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    line-height: 1;
}
.mobile-drawer-toggle:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.user-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem 0.2rem 0.25rem;
    border-radius: 50px;
    font-size: 0.78rem;
    white-space: nowrap;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.18s;
    height: 30px;
    box-sizing: border-box;
}
.user-badge-btn:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.user-avatar-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}

/* ── Drawer / Lateral Slide-Over ── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-card-solid);
    border-right: 1px solid var(--border-color);
    z-index: 3000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.4);
}
.mobile-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}
.drawer-close-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.drawer-close-btn:hover { color: var(--red); background: var(--red-bg); }

.drawer-user-card {
    padding: 1rem 1.2rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}
.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.drawer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 12px var(--primary-glow);
}

.theme-drawer-btn {
    flex: 1;
    padding: 0.35rem 0.4rem;
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.18s;
}
.theme-drawer-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-drawer-btn.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); font-weight: 800; }

.drawer-links {
    list-style: none;
    padding: 0.75rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.18s;
}
.drawer-link:hover { background: var(--primary-bg); color: var(--primary); }
.drawer-link.active { background: var(--primary); color: #ffffff; font-weight: 700; box-shadow: 0 4px 14px var(--primary-glow); }

.drawer-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-color);
}

/* ── Dropdown Rápido de Usuario ── */
.user-dropdown-menu {
    position: fixed;
    top: 52px;
    right: 0.75rem;
    width: 230px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 2500;
    display: none;
    animation: modalIn 0.18s ease;
}
.user-dropdown-menu.active {
    display: block;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Breakpoints & Navbar Adaptativa ───────────────────── */
@media (max-width: 1150px) {
    .navbar {
        height: auto;
        padding: 0.45rem 0;
    }
    .navbar-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        height: 48px;
        padding: 0 0.75rem;
    }
    .nav-top-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem;
        height: 36px;
    }
    .mobile-drawer-toggle {
        display: inline-flex !important;
    }
    .nav-links {
        display: none !important;
    }
    .desktop-only {
        display: none !important;
    }
    .indictum-text {
        display: none;
    }
}

@media (max-width: 600px) {
    .brand-title {
        font-size: 0.95rem;
    }
    .brand-divider {
        display: none;
    }
    .indictum-brand {
        display: none !important;
    }
    .user-name-text {
        max-width: 48px;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }
    .role-pill {
        padding: 0.08rem 0.25rem;
        font-size: 0.6rem;
    }
}
