/* ========================================
   UTT CAMPUS - ESTILOS FUTURISTAS
   Colores: #005461, #0C7779, #249E94, #3BC1A8
   ======================================== */

/* ===== VARIABLES CSS ===== */
:root {
    /* Colores principales - Coherentes */
    --color-primary: #0C7779;
    --color-primary-dark: #005461;
    --color-primary-light: #249E94;
    --color-accent: #3BC1A8;
    --color-accent-bright: #5EFFCC;
    --color-gradient-1: #0C7779;
    --color-gradient-2: #3BC1A8;
    --color-gradient-3: #5EFFCC;
    
    /* Tema Oscuro (Default) - Fondos oscuros, textos claros */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3f;
    --bg-card: rgba(26, 31, 46, 0.95);
    --bg-overlay: rgba(15, 20, 25, 0.98);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f0f4f8;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: rgba(59, 193, 168, 0.25);
    --border-hover: rgba(59, 193, 168, 0.5);
    
    /* Sombras mejoradas */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 30px rgba(59, 193, 168, 0.4);
    --shadow-glow-strong: 0 0 50px rgba(59, 193, 168, 0.6);
    --shadow-inner: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    
    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Tamaños */
    --navbar-height: 70px;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
}

/* Tema Claro - Fondos claros, textos oscuros */
html.light-theme,
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-overlay: rgba(255, 255, 255, 0.98);
    --bg-glass: rgba(0, 0, 0, 0.04);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: rgba(12, 119, 121, 0.25);
    --border-hover: rgba(12, 119, 121, 0.5);
    
    --shadow-sm: 0 2px 8px rgba(0, 84, 97, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 84, 97, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 84, 97, 0.15);
    --shadow-glow: 0 0 20px rgba(12, 119, 121, 0.25);
}

/* Overrides para elementos con colores fijos en tema claro */
html.light-theme .input-field,
body.light-theme .input-field {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: rgba(12, 119, 121, 0.25);
}

html.light-theme .input-field::placeholder,
body.light-theme .input-field::placeholder {
    color: var(--text-muted);
}

html.light-theme .input-field:-webkit-autofill,
html.light-theme .input-field:-webkit-autofill:hover,
html.light-theme .input-field:-webkit-autofill:focus,
body.light-theme .input-field:-webkit-autofill,
body.light-theme .input-field:-webkit-autofill:hover,
body.light-theme .input-field:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0px 1000px #e9ecef inset;
}

html.light-theme .input-field:focus,
body.light-theme .input-field:focus {
    background: var(--bg-secondary);
    border-color: var(--color-accent);
}

html.light-theme .filters-bar,
body.light-theme .filters-bar {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--shadow-md);
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== TEXTURA GLOBAL BODY ===== */
body::after {
    content: '';
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Ccircle cx='3' cy='3' r='1' fill='%233BC1A8' fill-opacity='0.04'/%3E%3Cpath d='M28 14H0M14 28V0' stroke='%233BC1A8' stroke-opacity='0.03' stroke-width='0.6'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 28px 28px;
}

/* ===== ANIMACIÓN DE FONDO MEJORADA ===== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-primary);
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.background-animation::before,
.background-animation::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 25s infinite ease-in-out;
}

.background-animation::before {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 193, 168, 0.22) 0%, rgba(12, 119, 121, 0.12) 40%, transparent 70%);
    top: -250px;
    left: -200px;
    animation: float 22s infinite ease-in-out;
}

.background-animation::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(94, 255, 204, 0.15) 0%, rgba(59, 193, 168, 0.1) 40%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation-delay: 11s;
}

/* Tercer y cuarto orb vía elementos adicionales */
.background-animation .orb-extra-1,
.background-animation .orb-extra-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.background-animation .orb-extra-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(12, 119, 121, 0.18) 0%, transparent 70%);
    top: 40%; left: 55%;
    animation: float 18s ease-in-out infinite 6s;
}
.background-animation .orb-extra-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(59, 193, 168, 0.14) 0%, transparent 70%);
    top: 15%; right: 5%;
    animation: float 14s ease-in-out infinite 3s reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, 80px) scale(1.08); }
    50% { transform: translate(-40px, 40px) scale(0.93); }
    75% { transform: translate(80px, -40px) scale(1.04); }
}

/* ===== GLOW LINE NAVBAR ===== */
.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(59,193,168,.5) 30%, rgba(94,255,204,.7) 50%, rgba(59,193,168,.5) 70%, transparent 100%);
    opacity: 0.6;
}
.navbar { position: relative; }

/* ===== NAVBAR SIMPLE ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-accent);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-brand:hover {
    transform: scale(1.05);
    color: var(--color-accent-bright);
}

.logo-small {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(59, 193, 168, 0.3);
    transition: all var(--transition-fast);
}

.logo-small:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 193, 168, 0.5);
}

.logo-orion {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.logo-orion:hover {
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 3px;
    transition: var(--transition-normal);
}

.orion-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.orion-nav-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.orion-nav-cart-btn:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.orion-nav-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--color-accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    order: -1;   /* en desktop aparece antes de la campana */
}

/* En desktop el .theme-toggle dentro del nav no debe ser fixed */
.nav-menu .theme-toggle {
    position: static;
    bottom: auto;
    right: auto;
    margin-left: 8px;
}

.nav-menu .theme-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
    overflow: visible;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--color-accent);
    background: rgba(59, 193, 168, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--color-accent);
    background: rgba(59, 193, 168, 0.15);
    box-shadow: 0 0 15px rgba(59, 193, 168, 0.3);
}

.nav-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-accent);
}

.nav-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 8px;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: 40px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.container-landing {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 20px 88px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 22px;
    z-index: 1;
}

.landing-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(7, 12, 20, 0.88), rgba(10, 28, 32, 0.78)),
        radial-gradient(circle at top left, rgba(59, 193, 168, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(12, 119, 121, 0.2), transparent 40%);
}

body.landing-page.custom-bg .landing-backdrop {
    background:
        linear-gradient(135deg, rgba(7, 12, 20, 0.72), rgba(10, 28, 32, 0.72)),
        var(--landing-bg-image, none);
    background-size: cover;
    background-position: center;
}

/* ===== PÁGINA LANDING ===== */
.landing-header {
    animation: fadeInUp 1s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.landing-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 3s infinite;
    box-shadow: 0 0 40px rgba(59, 193, 168, 0.5);
}

.logo-text {
    font-size: 3rem;
    font-weight: 900;
    color: white;
}

.logo-landing {
    width: 72px;
    height: 72px;
    object-fit: contain;
    animation: none;
    filter: drop-shadow(0 6px 16px rgba(12, 119, 121, 0.22));
}

.main-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.subtitle {
    font-size: 0.98rem;
    color: var(--text-secondary);
    margin-top: 0;
}

.landing-hero-panel {
    width: 100%;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(94, 255, 204, 0.14);
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.82), rgba(12, 18, 29, 0.88));
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    text-align: left;
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(94, 255, 204, 0.08);
    border: 1px solid rgba(94, 255, 204, 0.2);
    color: var(--color-accent-bright);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.landing-hero-title {
    font-size: 2rem;
    line-height: 1.15;
    color: var(--text-primary);
}

.landing-lead {
    max-width: 680px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
}

.landing-section-header,
.section-kicker {
    display: none;
}

.landing-cta-buttons {
    width: 100%;
    max-width: none;
}

.landing-bottom-actions {
    margin-top: 2px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(59, 193, 168, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(59, 193, 168, 0.7); }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 193, 168, 0.12);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    animation: fadeInUp 0.8s ease;
    box-shadow: none;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 193, 168, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 1.55rem;
    margin-bottom: 8px;
    display: inline-block;
    color: var(--color-primary-light);
    transition: all var(--transition-normal);
}

.feature-card:hover .feature-icon {
    transform: none;
    color: var(--color-accent-bright);
}

.feature-card h3 {
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

.feature-card p {
    display: none;
}

/* ===== BOTONES ===== */
.cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    position: relative;
    padding: 14px 32px;
    border-radius: var(--border-radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    transition: all var(--transition-normal);
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 193, 168, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 193, 168, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: rgba(59, 193, 168, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 193, 168, 0.3);
    border-color: var(--color-accent-bright);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover .btn-glow {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 2;
}

/* ===== LOADER ===== */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== TEMA TOGGLE ===== */
.theme-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1000;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 0 14px;
    height: 46px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-accent), #0fa8ab);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    letter-spacing: .3px;
    box-shadow: 0 4px 18px rgba(12,119,121,.5);
    transition: transform .25s ease, box-shadow .25s ease;
    white-space: nowrap;
}

.theme-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 28px rgba(12,119,121,.65);
}

.theme-btn .theme-icon {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    transition: transform .35s ease;
}

.theme-btn:hover .theme-icon {
    transform: rotate(22deg) scale(1.15);
}

.theme-btn .theme-label {
    font-size: 13px;
}

/* Tooltip visual en pantallas pequeñas: mostrar solo ícono */
@media (max-width: 400px) {
    .theme-btn {
        padding: 0;
        width: 46px;
        justify-content: center;
    }
    .theme-btn .theme-label { display: none; }
}

/* ===== FORMULARIOS ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(59,193,168,0.08);
    animation: fadeInUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: translateX(-5px);
}

.auth-header h1 {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    background: rgba(240, 245, 248, 0.92);
    backdrop-filter: blur(10px) saturate(120%);
    border: 2px solid rgba(59, 193, 168, 0.2);
    border-radius: var(--border-radius);
    color: #1a2b35;
    caret-color: var(--color-accent);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8);
    /* Eliminar ícono de ojo nativo del navegador */
    -webkit-appearance: none;
    appearance: none;
}

/* Edge/IE nativo */
.input-field::-ms-reveal,
.input-field::-ms-clear { display: none; }

/* Chrome nativo */
.input-field::-webkit-credentials-auto-fill-button,
.input-field::-webkit-contacts-auto-fill-button { display: none !important; visibility: hidden; }

.input-field::placeholder {
    color: rgba(90, 115, 130, 0.65);
}

/* Fix autocomplete background */
.input-field:-webkit-autofill,
.input-field:-webkit-autofill:hover,
.input-field:-webkit-autofill:focus {
    -webkit-text-fill-color: #1a2b35;
    -webkit-box-shadow: 0 0 0px 1000px rgba(240, 245, 248, 0.98) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #ffffff;
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 
        0 0 25px rgba(59, 193, 168, 0.2),
        0 4px 15px rgba(59, 193, 168, 0.1),
        inset 0 1px 3px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.4s ease;
}

.input-field:focus + .input-line {
    width: 100%;
}

/* Validación de correo en tiempo real */
.input-field.input-error,
.input-field.input-error:focus {
    border-color: #e53935 !important;
    box-shadow:
        0 0 0 3px rgba(229, 57, 53, 0.15),
        inset 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    transform: none;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toggle-password:hover {
    opacity: 1;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== TERMS MODAL ===== */
.terms-modal-content {
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.terms-body {
    padding: 0 25px 10px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) transparent;
}

.terms-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-top: 6px;
    margin-bottom: 2px;
}

.terms-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.terms-updated {
    font-size: 0.78rem !important;
    color: var(--text-secondary);
    opacity: 0.6;
    font-style: italic;
    margin-bottom: 4px;
}

/* ===== TERMS ROW ===== */
.terms-row {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 14px 18px;
    background: rgba(59, 193, 168, 0.06);
    border: 2px solid rgba(59, 193, 168, 0.35);
    border-radius: 14px;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.terms-row:hover {
    border-color: rgba(59, 193, 168, 0.6);
    background: rgba(59, 193, 168, 0.1);
}

.terms-dot {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid var(--color-accent);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
    font-size: 16px;
    color: transparent;
}

.terms-checked .terms-dot {
    background: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(59, 193, 168, 0.22);
    color: #fff;
}

.terms-checked {
    border-color: var(--color-accent);
    background: rgba(59, 193, 168, 0.13);
}

/* === Legacy checkbox-wrapper (mantener por si acaso) === */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.checkbox-wrapper input[type="checkbox"] { display: none; }
.checkmark { display: none; }

.link-text {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.link-text:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s ease;
}

.alert-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    margin-top: 0;
    max-width: min(92vw, 430px);
    box-shadow: var(--shadow-lg);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Toast sólido (alert-toast + alert-success/error) */
.alert-toast.alert-success {
    background: #0C7779;
    border: none;
    color: #fff;
}

.alert-toast.alert-error {
    background: #dc2626;
    border: none;
    color: #fff;
}

.alert-toast .alert-icon-circle.is-success {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.alert-toast .alert-icon-circle.is-error {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.alert-toast .alert-message {
    color: #fff;
    font-weight: 600;
}

/* ===== FLOATING ALERT (toast global) ===== */
.floating-alert {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 13px 22px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 6px 28px rgba(0,0,0,0.45);
    animation: floatingAlertIn 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    border: none;
    color: #fff;
}

.floating-alert.alert-success {
    background: #0C7779;
    color: #fff;
    border: none;
}

.floating-alert.alert-error {
    background: #dc2626;
    color: #fff;
    border: none;
}

.floating-alert.alert-warning {
    background: #d97706;
    color: #fff;
    border: none;
}

@keyframes floatingAlertIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.alert-icon {
    font-size: 1.3rem;
}

.alert-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon-circle.is-success {
    background: #22c55e;
    color: #ffffff;
}

.alert-icon-circle.is-error {
    background: #ef4444;
    color: #ffffff;
}

.alert-icon-circle .alert-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ===== VERIFICACIÓN DE CÓDIGO ===== */
.verification-info {
    text-align: center;
    margin-bottom: 30px;
}

.verification-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.verification-info h3 {
    color: var(--color-accent);
    margin-bottom: 10px;
}

.email-display {
    color: var(--color-primary-light);
    font-weight: 600;
    margin-top: 10px;
}

.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.code-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(59, 193, 168, 0.3);
    transform: scale(1.1);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.4s ease;
    border-radius: 2px;
}

.strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

/* ===== PÁGINA HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--color-accent);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
}

.home-video-section {
    margin-bottom: 28px;
}

.home-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: clamp(240px, 58vh, 780px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
}

.home-video-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.home-video-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 100%);
    color: #ffffff;
    pointer-events: none;
}

.home-video-overlay h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 800;
}

.home-video-overlay p {
    margin: 6px 0 0;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    color: rgba(255, 255, 255, 0.92);
}

/* ===== FILTROS ===== */
.filters-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(26, 31, 46, 0.6);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(59, 193, 168, 0.18);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 193, 168, 0.4);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 45px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(59, 193, 168, 0.2);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
}

.select-filter {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-filter:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ===== ESTADÍSTICAS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--border-radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 0 1px rgba(59,193,168,0.25);
    border-color: var(--color-accent);
    border-left-color: var(--color-accent-bright);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== CARDS ===== */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.quick-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.quick-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(59,193,168,0.08) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.quick-card:hover::before { opacity: 1; }

.quick-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 193, 168, 0.45);
    background: var(--bg-tertiary);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(59,193,168,0.2);
}

.quick-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.quick-card h3 {
    font-size: 1.3rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.quick-badge {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== INSTALL PROMPT ===== */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px 30px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideUp 0.5s ease;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(59,193,168,0.1);
    animation: slideDown 0.4s ease;
}

.modal-content > form {
    padding: 25px;
}

.modal-content > form .form-group {
    margin-bottom: 18px;
}

.modal-content > form .form-row {
    margin-bottom: 18px;
}

.modal-content > form .form-row .form-group {
    margin-bottom: 0;
}

.modal-content > form .modal-actions {
    margin: 10px -25px -25px;
}

.modal-large {
    max-width: 800px;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--color-accent);
}

.close-modal {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-modal:hover {
    background: var(--color-accent);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.modal-actions {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        order: 2;  /* toggle siempre después de la campana en mobile */
    }

    .notif-bell-wrapper {
        order: 1;
        /* margin-left:auto ya está en la regla global, no hace falta repetir */
    }

    .nav-menu {
        position: fixed;
        top: var(--navbar-height);
        right: -100%;
        left: auto;
        width: 250px;
        height: calc(100vh - var(--navbar-height));
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
    }

    .nav-menu .theme-toggle {
        position: static;
        inset: auto;
        width: 100%;
        margin-top: 12px;
    }

    .nav-menu .theme-btn {
        width: 100%;
        height: 44px;
        border-radius: 12px;
        justify-content: flex-start;
        gap: 10px;
        padding: 0 14px;
    }

    .nav-menu .theme-btn::after {
        content: 'Cambiar tema';
        color: var(--text-secondary);
        font-size: 0.95rem;
        font-weight: 500;
    }

    .nav-menu .theme-btn:hover {
        transform: translateY(-1px);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .container-landing {
        justify-content: flex-start;
        gap: 18px;
        padding: 22px 12px 96px;
    }

    .main-title {
        font-size: 2.1rem;
        line-height: 1.05;
    }

    .subtitle {
        font-size: 1rem;
    }

    .landing-header {
        margin-top: 8px;
    }

    .landing-hero-panel {
        width: 100%;
        padding: 14px 16px;
        gap: 10px;
    }

    .landing-section-header {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .landing-section-header h2 {
        font-size: 1.15rem;
    }

    .features-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
    }

    .feature-card {
        padding: 12px 8px;
        min-height: 110px;
        text-align: center;
        align-items: center;
        border-radius: 16px;
    }

    .feature-icon {
        font-size: 1.7rem;
        margin-bottom: 8px;
    }

    .feature-card h3 {
        font-size: 0.78rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .feature-card p {
        display: none;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .theme-toggle {
        bottom: 16px;
        right: 16px;
        top: auto;
    }

    .theme-btn {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .logo-landing {
        width: 112px;
        height: 112px;
    }

    .main-title {
        font-size: 1.95rem;
    }

    .landing-lead {
        font-size: 0.95rem;
    }

    .feature-card {
        min-height: 98px;
        padding: 10px 6px;
    }

    .feature-icon {
        font-size: 1.45rem;
        margin-bottom: 6px;
    }

    .feature-card h3 {
        font-size: 0.72rem;
    }

    .code-input {
        width: 40px;
        height: 50px;
        font-size: 1.2rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* ===== TAREAS ===== */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-lists-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.task-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.task-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(59, 193, 168, 0.08);
}

.task-section-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.task-section-count {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.task-section-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    min-height: 86px;
    transition: background 0.2s ease;
}

.task-section-list.drag-over {
    background: rgba(59, 193, 168, 0.08);
}

.task-section-empty {
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
}

.task-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.4s ease;
    cursor: grab;
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.55;
    transform: scale(0.99);
}

.task-card.touch-selected {
    border-left-color: var(--color-accent-bright);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.task-card:hover {
    transform: translateY(-2px);
    border-left-color: var(--color-accent-bright);
    box-shadow: var(--shadow-lg);
}

.task-card.completed {
    opacity: 0.7;
    border-left-color: #22c55e;
}

.task-card.priority-alta {
    border-left-color: #ef4444;
}

.task-card.priority-media {
    border-left-color: #f59e0b;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.task-title {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.task-description {
    margin-top: 6px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.task-checkbox {
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.task-tag,
.task-priority,
.task-date,
.task-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    border-radius: 999px;
    padding: 5px 10px;
}

.task-tag {
    background: rgba(59, 193, 168, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.task-status {
    background: rgba(59, 193, 168, 0.12);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.task-date {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.task-date.overdue {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
}

.task-section.urgent .task-section-header {
    background: rgba(239, 68, 68, 0.12);
}

.task-section-header.touch-move-target {
    cursor: pointer;
    background: rgba(59, 193, 168, 0.18);
    border-bottom-color: var(--color-accent);
}

.tasks-filters-bar .task-filter-group {
    gap: 8px;
}

.tasks-filters-bar {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.task-mobile-filter-menu {
    display: none;
    width: 100%;
    position: relative;
    z-index: 25;
}

.task-mobile-filter-trigger {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
}

.task-mobile-filter-options {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 120;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    gap: 8px;
}

.task-mobile-filter-menu.open .task-mobile-filter-options {
    display: flex;
    flex-direction: column;
}

.task-mobile-filter-option {
    width: 100%;
    justify-content: flex-start;
}

.stats-grid {
    position: relative;
    z-index: 1;
}

/* Tasks page header con buscador integrado */
.tasks-page-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.tasks-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tasks-header-actions .search-box {
    min-width: 0;
    width: 200px;
    flex: none;
}

.tasks-header-actions .search-box input {
    padding: 8px 14px 8px 38px;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .tasks-page-header {
        flex-wrap: wrap;
    }

    .tasks-page-header h1 {
        flex: 1 1 100%;
    }

    .tasks-header-actions {
        width: 100%;
    }

    .tasks-header-actions .search-box {
        flex: 1;
    }
}

/* Stats compactos en fila para Tareas */
.tasks-stats-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    margin-bottom: 20px;
}

.tasks-stats-row .stat-card {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 10px;
    border-left: none;
    border-bottom: 3px solid var(--color-accent);
    border-radius: 12px;
    text-align: center;
    min-width: 0;
}

.tasks-stats-row .stat-card:hover {
    transform: translateY(-3px);
}

.tasks-stats-row .stat-value {
    font-size: 1.6rem;
    line-height: 1;
}

.tasks-stats-row .stat-label {
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .tasks-filters-bar {
        padding: 14px;
        gap: 10px;
        margin-bottom: 18px;
    }

    .tasks-filters-bar .task-filter-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tasks-filters-bar .task-filter-group-desktop {
        display: none;
    }

    .task-mobile-filter-menu {
        display: block;
    }

    .tasks-filters-bar .filter-btn {
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 0.84rem;
        font-weight: 600;
        line-height: 1.1;
    }

    .tasks-filters-bar .search-box {
        width: 100%;
        min-width: 0;
    }

    .tasks-filters-bar .search-box input {
        padding: 9px 14px 9px 40px;
        font-size: 0.92rem;
    }

    .home-video-frame,
    .home-video-player {
        min-height: 48vh;
        height: 48vh;
    }

    .home-video-overlay {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .home-video-frame {
        aspect-ratio: 16 / 10;
        min-height: 220px;
        height: auto;
    }

    .home-video-player {
        height: 100%;
        min-height: 220px;
        object-fit: contain;
        background: #000;
    }

    .home-video-overlay {
        padding: 12px;
    }

    .home-video-overlay h2 {
        font-size: 1rem;
    }

    .home-video-overlay p {
        font-size: 0.85rem;
    }

    .task-header {
        flex-wrap: wrap;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.task-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.task-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.1);
}

.task-info {
    display: block;
    flex: 1;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== FORO ===== */
.create-post-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.create-post-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img,
.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
}

.create-post-input {
    flex: 1;
    padding: 12px 18px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.4s ease;
    transition: all var(--transition-normal);
}

.post-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 5px;
    transition: color var(--transition-fast);
}

.post-menu-btn:hover {
    color: var(--color-accent);
}

.post-content {
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.post-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.post-image:hover {
    transform: scale(1.05);
}

.post-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    align-items: center;
}

/* Wrapper relativo para el picker flotante */
.reaction-wrapper {
    position: relative;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.post-action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.post-action-btn.active {
    background: rgba(12, 119, 121, 0.12);
    border-color: var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
}

/* Picker flotante de emojis */
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 100;
    animation: picker-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes picker-pop {
    from { opacity: 0; transform: scale(0.75) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Flecha del picker */
.reaction-picker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.reaction-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-btn:hover {
    transform: scale(1.45) translateY(-4px);
    background: var(--bg-tertiary);
}

.reaction-btn[data-active="true"] {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(12,119,121,0.6));
}

/* Tooltip del emoji */
.r-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 0.68rem;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.reaction-btn:hover .r-tooltip {
    opacity: 1;
}

/* Burbuja de reacciones estilo Facebook */
.reactions-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 3px 10px 3px 6px;
    cursor: default;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.r-emoji-stack {
    display: flex;
    align-items: center;
}

.r-emoji {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-block;
    margin-right: -5px; /* overlap */
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
    transition: transform 0.15s;
}

.r-emoji:last-child {
    margin-right: 0;
}

.reactions-bubble:hover .r-emoji {
    margin-right: 1px;
}

.r-total {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding-left: 2px;
}

/* Botón "X comentarios" clickable */
.comments-count-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.comments-count-btn:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Preview del último comentario */
.comment-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    margin: 10px 0 4px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-left: 2px solid var(--color-accent);
}

.comment-preview:hover {
    background: color-mix(in srgb, var(--bg-tertiary) 80%, var(--color-accent));
}

.comment-preview-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.comment-preview-user {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent);
}

.comment-preview-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón de responder */
.reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color var(--transition-fast);
}

.reply-btn:hover {
    color: var(--color-accent);
}

/* Input de respuesta inline */
.reply-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    animation: fadeInUp 0.2s ease;
}

.reply-input-field {
    font-size: 0.85rem;
    padding: 7px 12px 7px 36px !important;
}

/* Respuestas anidadas */
.comment-replies {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reply-item {
    margin-bottom: 0 !important;
}

.reply-item .comment-content {
    background: color-mix(in srgb, var(--bg-tertiary) 70%, transparent);
}
    min-height: 120px;
    resize: vertical;
}

.comment-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.comment-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.comment-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
}

.comment {
    animation: fadeInUp 0.25s ease;
}

.comment-content {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 10px 14px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.comment-username {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.1;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.4;
}

.comment-author {
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 5px;
}

/* ===== DOCUMENTACIÓN ===== */
.documents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* Lista de documentos rediseñada */
.docs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 14px 18px;
    transition: all var(--transition-fast);
    animation: fadeInUp 0.25s ease;
}

.doc-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
    transform: translateX(3px);
}

.doc-item-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.doc-file-emoji { line-height: 1; }

.doc-item-body {
    flex: 1;
    min-width: 0;
}

.doc-item-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.doc-item-title {
    font-weight: 700;
    font-size: 0.97rem;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.doc-item-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.doc-type-tarea    { background: rgba(59,193,168,0.18); color: var(--color-accent); }
.doc-type-apuntes  { background: rgba(99,102,241,0.18); color: #818cf8; }
.doc-type-libros   { background: rgba(251,191,36,0.18);  color: #fbbf24; }
.doc-type-otros    { background: rgba(107,114,128,0.18); color: var(--text-secondary); }

.doc-item-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.doc-item-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.doc-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.doc-dl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-icon-danger { color: #ef4444 !important; }
.btn-icon-danger:hover { background: rgba(239,68,68,0.12) !important; }

@media (max-width: 600px) {
    .doc-item { flex-wrap: wrap; gap: 12px; }
    .doc-item-actions { width: 100%; justify-content: flex-end; }
    .doc-item-title { max-width: 200px; }
    .doc-item-meta { gap: 8px; }
}

/* mantener compatibilidad */
.document-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
}

.doc-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 15px;
}

.doc-title { font-weight: 600; color: var(--text-primary); margin-bottom: 8px; font-size: 1.1rem; }

.doc-meta { display: flex; flex-direction: column; gap: 5px; color: var(--text-secondary); font-size: 0.85rem; }

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    transition: all var(--transition-fast);
}

.file-upload-area:hover {
    border-color: var(--color-accent);
    background: rgba(59, 193, 168, 0.05);
}

.file-info {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.file-name {
    font-weight: 600;
    color: var(--color-accent);
    display: block;
    margin-bottom: 5px;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== MARKETPLACE ===== */
.store-role-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.store-shop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.store-cart-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 18px;
    position: sticky;
    top: 90px;
}

.store-cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.store-cart-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.store-cart-item-info {
    flex: 1;
    min-width: 0;
}

.store-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 6px;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover {
    background: var(--accent);
    color: #fff;
}

.qty-value {
    min-width: 22px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-top: 8px;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
    color: #fff;
}

.btn-whatsapp i {
    font-size: 1.2rem;
}

.btn-whatsapp-inline {
    margin-top: 0;
    padding: 8px 12px;
}

.store-cart-item strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.store-cart-item p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.store-cart-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.store-cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.store-admin-panel {
    margin-bottom: 24px;
}

.store-stats-grid {
    margin-bottom: 18px;
}

.store-admin-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.store-admin-item,
.store-order-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.moderation-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.moderation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.moderation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.moderation-actions,
.store-order-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.status-badge.disponible,
.status-badge.confirmado,
.status-badge.entregado {
    background: rgba(34, 197, 94, 0.16);
    color: #22c55e;
}

.status-badge.agotado,
.status-badge.cancelado {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
}

.status-badge.pendiente {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.product-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    animation: fadeInUp 0.4s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.product-image.img-loading {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, color-mix(in srgb, var(--bg-tertiary) 60%, white) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: orion-shimmer 1.4s infinite;
}

.product-image.img-loading img {
    opacity: 0;
}

.product-image.img-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.product-image.img-error::after {
    content: '\eacd';
    font-family: 'boxicons';
    font-size: 2rem;
    color: var(--text-muted);
}

.product-image.img-error img {
    display: none;
}

@keyframes orion-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-icon {
    font-size: 2.2rem;
    color: var(--text-muted);
}

.image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

.product-body {
    padding: 20px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
    white-space: nowrap;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.product-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.product-seller {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.product-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-details {
    padding: 20px;
}

.product-detail-view {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.main-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.detail-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 2px solid transparent;
    object-fit: cover;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.preview-open-btn {
    align-self: flex-start;
}

#main-gallery-image,
.image-preview-item img {
    cursor: zoom-in;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.detail-top h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.product-price-large {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

.product-section {
    background: rgba(59, 193, 168, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 14px;
}

.product-section h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.45;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.seller-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.seller-info span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.product-meta-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-meta-detail span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, 0.82);
    backdrop-filter: blur(4px);
}

.image-preview-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 95vw);
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#image-preview-main {
    width: 100%;
    height: min(70vh, 640px);
    object-fit: contain;
    background: rgba(6, 10, 20, 0.85);
}

.image-preview-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

#image-preview-counter {
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 64px;
    text-align: center;
}

.image-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2;
}

.image-preview-close:hover {
    background: rgba(0, 0, 0, 0.72);
}

@media (max-width: 768px) {
    .store-shop-layout {
        grid-template-columns: 1fr;
    }

    .store-cart-panel {
        position: static;
    }

    .store-admin-columns {
        grid-template-columns: 1fr;
    }

    .store-admin-item,
    .store-order-item {
        flex-direction: column;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .product-detail-view {
        grid-template-columns: 1fr;
    }

    .detail-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .image-preview-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Cámara */
.camera-section {
    margin: 20px 0;
}

.camera-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.camera-preview {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 15px;
}

#camera-video {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.remove-image-btn:hover {
    transform: scale(1.1);
}

.images-counter {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1.1rem;
}

.input-with-prefix .input-field {
    padding-left: 35px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    color: var(--color-accent);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* ===== MODERACIÓN ===== */
.moderator-badge {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 193, 168, 0.4);
}

.tabs-container {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    gap: 5px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 193, 168, 0.4);
}

.tab-content {
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 700;
}

.moderation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.moderation-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all var(--transition-fast);
}

.moderation-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.users-table {
    overflow-x: auto;
}

.analytics-note {
    margin-top: 8px;
    color: var(--text-secondary);
    max-width: 860px;
    line-height: 1.6;
}

.analytics-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.analytics-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
    padding: 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.analytics-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-filter-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.analytics-date-input {
    min-height: 44px;
}

.analytics-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-kpi-card,
.analytics-panel {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.82));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-md);
}

.light-theme .analytics-kpi-card,
.light-theme .analytics-panel {
    background: rgba(255, 255, 255, 0.92);
}

.analytics-kpi-label,
.analytics-kpi-meta {
    display: block;
}

.analytics-kpi-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.analytics-kpi-value {
    display: block;
    color: var(--text-primary);
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 8px;
}

.analytics-kpi-meta {
    color: var(--color-accent);
    font-size: 0.9rem;
}

.analytics-chart-grid,
.analytics-table-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.analytics-panel-wide {
    grid-column: 1 / -1;
}

.analytics-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.analytics-panel-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.analytics-panel-header span {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.analytics-panel canvas {
    width: 100% !important;
    height: 320px !important;
}

.analytics-mini-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analytics-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.analytics-mini-head {
    background: transparent;
    border-style: dashed;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

.analytics-mini-row strong {
    display: block;
    color: var(--text-primary);
}

.analytics-mini-row small {
    color: var(--text-secondary);
}

.analytics-mini-metrics {
    text-align: right;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px;
    background: var(--bg-tertiary);
    color: var(--color-accent);
    font-weight: 600;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background: var(--bg-tertiary);
}

/* ===== ANUNCIOS ===== */
.announcements-section {
    margin-bottom: 40px;
}

.orion-highlight-section {
    margin-bottom: 24px;
}

.orion-highlight-card {
    border-left: 4px solid var(--color-accent-bright);
    background: linear-gradient(135deg, rgba(59, 193, 168, 0.12), rgba(36, 158, 148, 0.08));
}

.orion-highlight-card .announcement-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.announcements-carousel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.announcement-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.5s ease;
    transition: all var(--transition-normal);
}

.announcement-card:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--color-accent-bright);
}

.announcement-card.urgente {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.announcement-card.importante {
    border-left-color: #f59e0b;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.announcement-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-accent);
}

.announcement-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== ACTIVIDAD RECIENTE ===== */
.recent-activity-section {
    margin-bottom: 40px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.activity-item:hover {
    border-color: var(--color-accent);
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-primary);
    margin-bottom: 3px;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== SKELETON LOADERS ===== */
.announcement-skeleton,
.activity-skeleton {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short {
    width: 60%;
}

@media (max-width: 900px) {
    .analytics-chart-grid,
    .analytics-table-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analytics-toolbar {
        grid-template-columns: 1fr;
    }

    .analytics-filter-actions,
    .analytics-export-actions {
        width: 100%;
    }

    .analytics-filter-actions .btn,
    .analytics-export-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .analytics-panel canvas {
        height: 260px !important;
    }

    .analytics-mini-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-mini-metrics {
        text-align: left;
    }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== PERFIL DE USUARIO ===== */
.profile-header {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary), var(--color-accent));
    position: relative;
}

.profile-info-header {
    padding: 0 30px 30px;
    display: flex;
    align-items: flex-end;
    gap: 25px;
    margin-top: -60px;
    position: relative;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--bg-primary);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-large i {
    font-size: 60px;
    color: var(--color-accent);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-basic-info {
    flex: 1;
    min-width: 0;
    padding-top: 70px;
}

.profile-basic-info h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.profile-matricula {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.profile-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.profile-tag i {
    font-size: 1rem;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.profile-section h2 i {
    font-size: 1.5rem;
    color: var(--color-accent);
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.profile-bio {
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.profile-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.profile-contact-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-contact-item i {
    font-size: 1.3rem;
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .profile-cover {
        height: 150px;
    }

    .profile-info-header {
        padding: 0 20px 20px;
        margin-top: -48px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .profile-avatar-large {
        width: 110px;
        height: 110px;
        border-width: 4px;
    }

    .profile-avatar-large i {
        font-size: 48px;
    }

    .profile-basic-info {
        padding-top: 0;
    }

    .profile-basic-info h1 {
        font-size: 1.75rem;
        line-height: 1.1;
        margin-bottom: 10px;
    }

    .profile-tags {
        gap: 8px;
    }

    .profile-info-header .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .profile-header {
        margin-bottom: 24px;
    }

    .profile-info-header {
        padding: 0 16px 16px;
    }

    .profile-avatar-large {
        width: 96px;
        height: 96px;
    }

    .profile-basic-info h1 {
        font-size: 1.5rem;
    }

    .profile-tag {
        width: 100%;
        border-radius: 14px;
    }

    .profile-contact-item {
        align-items: flex-start;
    }

    .profile-card {
        padding: 16px;
    }
}

/* Editar Perfil */
.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.profile-photo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-preview i {
    font-size: 40px;
    color: var(--color-accent);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-photo-adjust {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.profile-photo-adjust label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#profile-photo-zoom {
    width: 100%;
    accent-color: var(--color-accent);
}

.modal-large {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ===== NOTIFICACIONES ===== */
.notif-bell-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    order: 1;          /* en desktop siempre al extremo derecho */
    margin-left: auto; /* empuja la campana al extremo derecho */
}

.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.notif-bell-btn:hover {
    background: var(--bg-tertiary);
    color: var(--color-accent);
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    animation: notif-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes notif-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2000;
    backdrop-filter: blur(12px);
    transform-origin: top right;
    animation: notif-panel-open 0.2s ease;
}

.notif-panel.notif-panel-open {
    display: flex;
}

@keyframes notif-panel-open {
    from { opacity: 0; transform: scale(0.92) translateY(-6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}

.notif-panel-header span {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.notif-mark-all-btn {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.notif-mark-all-btn:hover {
    background: var(--bg-tertiary);
}

.notif-list {
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.notif-empty i {
    font-size: 2rem;
    opacity: 0.5;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--bg-tertiary);
}

.notif-item.notif-unread {
    background: color-mix(in srgb, var(--color-accent) 8%, var(--bg-card));
}

.notif-item.notif-unread:hover {
    background: color-mix(in srgb, var(--color-accent) 14%, var(--bg-card));
}

.notif-avatar {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    overflow: visible;
}

.notif-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-type-icon {
    position: absolute;
    bottom: -3px;
    right: -3px;
    font-size: 0.9rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.4;
}

.notif-text strong {
    font-weight: 700;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-dot {
    width: 9px;
    height: 9px;
    background: var(--color-accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .notif-panel {
        position: fixed;
        top: calc(var(--navbar-height) + 10px);
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .notif-panel-header {
        gap: 10px;
        align-items: flex-start;
    }

    .notif-panel-header span {
        flex: 1;
    }

    .notif-mark-all-btn {
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    .notif-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }
}
