/* =============================================
   DIRTY OBSESSION - Complete CSS
   Fase 6: PWA, Glassmorphism, Skeletons, Gold FX
   ============================================= */

:root {
    --color-bg: #050508;
    --color-bg-card: #0e0e14;
    --color-bg-elevated: #16161f;
    --color-gold: #CEAE62;
    --color-gold-light: #E5D4A1;
    --color-gold-dark: #8B7642;
    --color-pink: #CEAE62; /* aliased to gold */
    --color-text: #F5F5F7;
    --color-text-muted: #888;
    --color-border: rgba(255,255,255,0.1);
    --color-success: #00D084;
    --color-error: #FF4757;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-display: 'Inter', -apple-system, sans-serif;
    --header-height: 60px;
    --radius: 4px;
    /* Spacing scale */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  12px;
    --space-lg:  16px;
    --space-xl:  20px;
    --space-2xl: 28px;
    --space-3xl: 40px;
    /* Radius scale */
    --radius-sm:  2px;
    --radius-md:  3px;
    --radius-lg:  4px;
    /* Colors aliases */
    --color-text-secondary: rgba(245,245,247,0.7);
    --color-bg-secondary:   rgba(14,14,20,0.6);
    --color-border-hover:   rgba(255,255,255,0.18);
    /* Transitions */
    --transition-base: 0.2s ease;
    /* Fase 6: glassmorphism tokens */
    --glass-bg: rgba(14, 14, 20, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* ── Page-enter fade transition ─────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    -webkit-font-smoothing: antialiased;
    /* La página arranca invisible, JS la hace visible */
    opacity: 0;
    animation: pageEnter 0.35s ease 0.05s forwards;
}

@keyframes pageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
    /* IMPORTANT: NO transform on body — transform on body breaks position:fixed tab-bar */
}

a { color: var(--color-gold); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =============================================
   HEADER — Glassmorphism reforzado
   ============================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* iOS safe area: header starts below the notch/dynamic island */
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    /* Glass: fondo semitransparente + blur */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    /* Transición para el efecto scroll */
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Al hacer scroll, el header se opacifica un poco más */
.site-header.scrolled {
    background: rgba(14, 14, 20, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    /* padding-top on parent handles safe-area; this flex stays fixed height */
}

.logo { display: flex; align-items: center; z-index: 1002; }
.logo img { height: 44px; width: auto; max-width: 180px; object-fit: contain; }

@media (max-width: 768px) {
    .logo img { height: 36px; max-width: 140px; }
}

/* Desktop Nav */
.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--color-gold);
    background: rgba(201, 169, 98, 0.1);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--color-border);
}

.lang-btn { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); padding: 4px 8px; }
.lang-btn.active, .lang-btn:hover { color: var(--color-gold); }
.lang-divider { color: var(--color-border); font-size: 0.75rem; }

/* Mobile Toggle */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    z-index: 1002;
}

.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; transition: all 0.3s ease; }

/* MOBILE STYLES */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(5, 5, 8, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 1001;
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .main-nav a {
        display: block;
        width: 85%;
        max-width: 300px;
        text-align: center;
        padding: 18px 24px;
        font-size: 1.125rem;
        color: #fff;
        background: transparent;
        border-bottom: 1px solid var(--color-border);
        border-radius: 0;
    }

    .main-nav a:first-of-type { border-top: 1px solid var(--color-border); }
    .main-nav a:hover, .main-nav a.active { color: var(--color-gold); background: rgba(206,174,98,0.1); }

    .main-nav .lang-switcher { margin: 30px 0 0 0; padding: 0; border: none; gap: 8px; }
    .main-nav .lang-btn { font-size: 0.875rem; padding: 8px 16px; background: rgba(255,255,255,0.05); border-radius: 6px; }

    .nav-toggle.active svg line:nth-child(1) { transform: translateY(6px) rotate(45deg); transform-origin: center; }
    .nav-toggle.active svg line:nth-child(2) { opacity: 0; }
    .nav-toggle.active svg line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); transform-origin: center; }
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn--primary { background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); color: #000; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(206,174,98,0.3); }
.btn--secondary { background: transparent; color: var(--color-gold); border: 2px solid var(--color-gold); }
.btn--secondary:hover { background: rgba(206,174,98,0.1); }
.btn--full { width: 100%; }
.btn--lg { padding: 16px 28px; font-size: 1rem; }
.btn--sm { padding: 10px 16px; font-size: 0.8125rem; }

/* ── Addiction/Premium: Brillo metálico dorado ────────────────────────── */
/* Clase que se añade al tier card más alto y a CTA de upsell */
.btn--addiction,
.tier-card--addiction .tier-card__btn,
.btn--metallic-gold {
    background: linear-gradient(
        110deg,
        #8B7642 0%,
        #CEAE62 25%,
        #E5D4A1 45%,
        #F0E4B8 50%,
        #E5D4A1 55%,
        #CEAE62 75%,
        #8B7642 100%
    );
    background-size: 300% 100%;
    color: #000;
    animation: goldShimmer 3.5s linear infinite;
}

@keyframes goldShimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.btn--addiction:hover,
.btn--metallic-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 169, 98, 0.4), 0 0 0 1px rgba(229, 212, 161, 0.3);
}

/* ── Ripple en todos los botones ─────────────────────────────────────── */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.btn:active::after {
    opacity: 1;
    transform: scale(2);
    transition: none;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.hero__content { max-width: 600px; }
.hero__logo { margin-bottom: 24px; }
.hero__logo img { max-width: 200px; height: auto; margin: 0 auto; }

@media (max-width: 768px) {
    .hero__logo img { max-width: 150px; }
}

.hero__badge {
    display: inline-flex;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gold);
    background: rgba(206,174,98,0.1);
    border: 1px solid rgba(206,174,98,0.2);
    border-radius: 3px;
    margin-bottom: 20px;
}

.hero__title {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .hero__title { font-size: 1.75rem; }
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle { font-size: 1.125rem; color: var(--color-text-muted); margin-bottom: 32px; }

@media (max-width: 768px) {
    .hero__subtitle { font-size: 1rem; }
}

.hero__cta { display: flex; flex-direction: column; gap: 12px; max-width: 320px; margin: 0 auto; }

@media (min-width: 480px) {
    .hero__cta { flex-direction: row; max-width: none; justify-content: center; }
}

/* =============================================
   SECTIONS
   ============================================= */
.section { padding: 60px 0; }
.section--dark { background: var(--color-bg-card); }
.section__header { text-align: center; margin-bottom: 40px; }
.section__label { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-gold); margin-bottom: 12px; }
.section__title { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 500; }

@media (max-width: 768px) {
    .section__title { font-size: 1.5rem; }
}

/* Cards */
.card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

.feature-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; transition: all 0.3s; }
.feature-card:hover { border-color: rgba(206,174,98,0.3); transform: translateY(-4px); }
.feature-card__icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(206,174,98,0.1); border-radius: 12px; margin-bottom: 16px; }
.feature-card__icon svg { width: 24px; height: 24px; stroke: var(--color-gold); }
.feature-card__title { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
.feature-card__desc { font-size: 0.875rem; color: var(--color-text-muted); }

/* Tiers */
.tiers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }

.tier-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 32px 24px; text-align: center; position: relative; }
.tier-card--featured { border-color: var(--color-gold); background: rgba(206,174,98,0.05); }
.tier-card__badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 6px 16px; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); color: #000; border-radius: 3px; }
.tier-card__name { font-size: 1.25rem; font-weight: 600; color: var(--color-gold); margin-bottom: 8px; }
.tier-card__price { font-family: 'Inter', sans-serif; font-size: 2.5rem; font-weight: 500; margin-bottom: 4px; }
.tier-card__period { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 24px; }
.tier-card__features { list-style: none; margin-bottom: 24px; text-align: left; }
.tier-card__features li { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 0.875rem; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
.tier-card__features li:last-child { border-bottom: none; }
.tier-card__features svg { width: 18px; height: 18px; stroke: var(--color-success); flex-shrink: 0; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 8px; }
.form-input { width: 100%; padding: 14px 16px; font-size: 1rem; font-family: inherit; color: var(--color-text); background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: 10px; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--color-gold); }
.form-input::placeholder { color: rgba(255,255,255,0.3); }

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: 4px; padding: 40px 30px; position: relative; }

@media (max-width: 480px) {
    .auth-card { padding: 30px 20px; }
}

.auth-card__lang { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.auth-card__logo { text-align: center; margin-bottom: 24px; }
.auth-card__logo img { max-width: 140px; height: auto; margin: 0 auto; }
.auth-card__title { font-family: 'Inter', sans-serif; font-size: 1.5rem; text-align: center; margin-bottom: 8px; }
.auth-card__subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 24px; }
.auth-card__footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); font-size: 0.875rem; color: var(--color-text-muted); }

/* Alerts */
.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 0.875rem; }
.alert--error { background: rgba(255,71,87,0.15); border: 1px solid rgba(255,71,87,0.3); color: #ff6b7a; }
.alert--success { background: rgba(0,208,132,0.15); border: 1px solid rgba(0,208,132,0.3); color: var(--color-success); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer { background: var(--color-bg); border-top: 1px solid var(--color-border); padding: 40px 0 24px; }
.footer__content { display: flex; flex-direction: column; gap: 24px; text-align: center; }

@media (min-width: 768px) {
    .footer__content { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
}

.footer__logo img { max-width: 130px; height: auto; margin: 0 auto; }

@media (min-width: 768px) {
    .footer__logo img { margin: 0; }
}

.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.footer__links a { font-size: 0.875rem; color: var(--color-text-muted); }
.footer__links a:hover { color: var(--color-gold); }
.footer__bottom { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); font-size: 0.8125rem; color: var(--color-text-muted); }
.footer__age { color: var(--color-gold); font-weight: 600; margin-bottom: 8px; }

/* Cookie */
.cookie-banner { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(14,14,20,0.98); border-top: 1px solid var(--color-border); padding: 16px; z-index: 9999; }
.cookie-banner.show { display: block; }
.cookie-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }

@media (min-width: 600px) {
    .cookie-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

.cookie-inner p { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0; }

/* =============================================
   ADMIN & APP
   ============================================= */
.admin-layout, .app-layout { min-height: calc(100vh - var(--header-height)); }
.admin-content, .app-content { padding: 24px 20px; }

.page-header { margin-bottom: 24px; }
.page-title { font-family: 'Inter', sans-serif; font-size: 1.75rem; margin-bottom: 8px; }
.page-subtitle { color: var(--color-text-muted); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; }
.stat-card__icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(206,174,98,0.1); border-radius: 10px; margin-bottom: 12px; }
.stat-card__icon svg { width: 20px; height: 20px; stroke: var(--color-gold); }
.stat-card__value { font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 500; color: var(--color-gold); margin-bottom: 4px; }
.stat-card__label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; }

/* Demo */
.demo-panel { background: linear-gradient(135deg, rgba(206,174,98,0.04), rgba(206,174,98,0.08)); border: 1px solid rgba(206,174,98,0.12); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.demo-panel__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.demo-panel__title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.demo-panel__controls { display: flex; gap: 8px; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.status-dot--active { background: var(--color-success); animation: pulse 1.5s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Activity */
.activity-feed { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.activity-header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); font-weight: 600; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.activity-item:last-child { border-bottom: none; }
.activity-item__icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.activity-item__icon svg { width: 18px; height: 18px; stroke: currentColor; }
.activity-item__icon--signup { background: rgba(0,208,132,0.1); color: var(--color-success); }
.activity-item__icon--subscription { background: rgba(206,174,98,0.1); color: var(--color-gold); }
.activity-item__icon--upgrade { background: rgba(206,174,98,0.08); color: var(--color-gold); }
.activity-item__icon--refund { background: rgba(255,71,87,0.1); color: var(--color-error); }
.activity-item__content { flex: 1; min-width: 0; }
.activity-item__text { font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-item__time { font-size: 0.75rem; color: var(--color-text-muted); }
.activity-item__amount { font-weight: 600; }
.activity-item__amount--positive { color: var(--color-success); }
.activity-item__amount--negative { color: var(--color-error); }

/* Tables */
.table-container { overflow-x: auto; background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--color-border); }
.data-table th { font-weight: 600; color: var(--color-text-muted); font-size: 0.75rem; text-transform: uppercase; background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; border-radius: 3px; background: rgba(206,174,98,0.15); color: var(--color-gold); }
.badge--pink { background: rgba(206,174,98,0.10); color: var(--color-gold); border: 1px solid rgba(206,174,98,0.3); }
.status-badge { display: inline-block; padding: 4px 10px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; border-radius: 3px; }
.status-badge--completed, .status-badge--active { background: rgba(0,208,132,0.15); color: var(--color-success); }
.status-badge--pending { background: rgba(255,165,2,0.15); color: #FFA502; }
.status-badge--refunded, .status-badge--cancelled { background: rgba(255,71,87,0.15); color: var(--color-error); }

/* Welcome */
.welcome-card { background: linear-gradient(135deg, var(--color-bg-card), var(--color-bg-elevated)); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.welcome-card__title { font-family: 'Inter', sans-serif; font-size: 1.5rem; margin-bottom: 4px; }
.welcome-card__subtitle { color: var(--color-text-muted); }

/* User Stats */
.user-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.user-stat { flex: 1; background: var(--color-bg-card); border-radius: var(--radius); padding: 16px; text-align: center; }
.user-stat__icon { font-size: 1.5rem; margin-bottom: 8px; }
.user-stat__value { font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; }
.user-stat__label { font-size: 0.6875rem; color: var(--color-text-muted); text-transform: uppercase; }

/* Empty */
.empty-state { text-align: center; padding: 40px 20px; background: var(--color-bg-card); border-radius: var(--radius); }
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state__title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state__text { color: var(--color-text-muted); font-size: 0.875rem; }

/* =============================================
   TAB BAR — Glassmorphism + Badge Pulse
   ============================================= */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Glass: semitransparente + blur para ver el contenido detrás */
    background: rgba(10, 10, 16, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    display: none;
    justify-content: space-around;
    z-index: 1000;
}

@media (max-width: 768px) {
    .tab-bar { display: flex; }
    /* ALL app wrappers need bottom padding so content doesn't hide behind the tab bar */
    .app-layout,
    .dashboard,
    .admin-dashboard,
    .dashboard-layout,
    .chat-page { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    /* Scroll containers inside dashboard layouts */
    .dashboard__main,
    .feed-main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    min-width: 60px;
    position: relative;
    transition: color 0.2s;
}

.tab-item.active { color: var(--color-gold); }

.tab-icon { font-size: 1.375rem; line-height: 1; }

/* ── Tab Badge — con pulsación al aparecer ──────────────────────────── */
.tab-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    background: var(--color-error);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid var(--color-bg);
    line-height: 1;
}

/* Badge activo: pulsa suavemente */
.tab-badge--pulse {
    animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.5); }
    50%       { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
}

/* Profile */
.profile-header { text-align: center; padding: 20px; margin-bottom: 24px; }
.profile-avatar { width: 80px; height: 80px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 600; color: #000; }
.profile-name { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.profile-email { color: var(--color-text-muted); font-size: 0.875rem; }

.profile-menu { background: var(--color-bg-card); border-radius: var(--radius); overflow: hidden; }
.profile-menu-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; color: var(--color-text); text-decoration: none; border-bottom: 1px solid var(--color-border); transition: background 0.2s; }
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: rgba(255,255,255,0.02); }
.profile-menu-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(206,174,98,0.1); border-radius: 10px; }
.profile-menu-icon svg { width: 20px; height: 20px; stroke: var(--color-gold); }
.profile-menu-text { flex: 1; }
.profile-menu-title { font-weight: 500; margin-bottom: 2px; }
.profile-menu-desc { font-size: 0.8125rem; color: var(--color-text-muted); }
.profile-menu-arrow { color: var(--color-text-muted); }
.profile-menu-item.danger { color: var(--color-error); }
.profile-menu-item.danger .profile-menu-icon { background: rgba(255,71,87,0.1); }
.profile-menu-item.danger .profile-menu-icon svg { stroke: var(--color-error); }

/* Utilities */
.text-center { text-align: center; }
.text-gold { color: var(--color-gold); }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.875rem; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.updating { animation: valueUpdate 0.3s ease; }
@keyframes valueUpdate { 0% { transform: scale(1); } 50% { transform: scale(1.05); color: var(--color-gold); } 100% { transform: scale(1); } }

.fade-in { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.admin-sidebar { display: none; }

@media (min-width: 1024px) {
    .admin-layout { display: flex; }
    .admin-sidebar { display: block; width: 260px; background: var(--color-bg-card); border-right: 1px solid var(--color-border); min-height: calc(100vh - var(--header-height)); padding: 24px; }
    .admin-main { flex: 1; padding: 24px; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* =============================================
   SIDEBAR + ADMIN/APP LAYOUT
   ============================================= */
.admin-dashboard,
.dashboard {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
}

@media (max-width: 1023px) {
    .admin-dashboard,
    .dashboard {
        display: block;
    }
    .sidebar {
        display: none;
    }
}

.sidebar__section { margin-bottom: 24px; }
.sidebar__label { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-text-muted); margin-bottom: 8px; padding: 0 8px; display: block; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--color-text-muted); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: background 0.15s, color 0.15s; position: relative; }
.sidebar__link:hover { background: rgba(255, 255, 255, 0.04); color: var(--color-text); }
.sidebar__link.active { background: rgba(201, 169, 98, 0.12); color: var(--color-gold); }
.sidebar__link svg { width: 18px; height: 18px; min-width: 18px; flex-shrink: 0; stroke: currentColor; }

/* Main content */
.dashboard__main { flex: 1; min-width: 0; padding: 24px; overflow-y: auto; }
.dashboard__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dashboard__title { font-family: 'Inter', sans-serif; font-size: 1.75rem; font-weight: 400; color: var(--color-text); margin: 0; }

/* Content grid */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.content-card { position: relative; background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.content-card:hover { transform: translateY(-2px); }
.content-card--locked { opacity: 0.7; }
.content-card__thumb { position: relative; padding-top: 56.25%; background: var(--color-bg-elevated); overflow: hidden; }
.content-card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.content-card__lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: var(--color-text-muted); font-size: 0.75rem; gap: 6px; }
.content-card__lock svg { width: 24px; height: 24px; }
.content-card__duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.6875rem; padding: 2px 6px; border-radius: 4px; }
.content-card__body { padding: 12px; }
.content-card__title { font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.content-card__meta { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--color-text-muted); }

/* =============================================
   FASE 6: SKELETON SCREENS
   ============================================= */

/* Shimmer base */
@keyframes skeletonShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-elevated) 25%,
        rgba(255,255,255,0.06) 50%,
        var(--color-bg-elevated) 75%
    );
    background-size: 800px 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
    border-radius: 6px;
}

/* Bloques de texto */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text--lg { height: 20px; }
.skeleton-text--sm { height: 10px; }
.skeleton-text--title { height: 26px; width: 60%; margin-bottom: 12px; }
.skeleton-text--half { width: 50%; }
.skeleton-text--third { width: 33%; }

/* Card esqueleto */
.skeleton-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.skeleton-card__thumb {
    padding-top: 56.25%;
    position: relative;
}

.skeleton-card__thumb .skeleton {
    position: absolute;
    inset: 0;
    border-radius: 0;
}

.skeleton-card__body {
    padding: 12px;
}

/* Avatar esqueleto */
.skeleton-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

/* Fila de skeleton (tipo lista de usuarios) */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.skeleton-row:last-child { border-bottom: none; }

/* Grid de skeleton para el feed/biblioteca */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* =============================================
   FASE 6: CHAT — Typing Indicator + Media Fallback
   ============================================= */

/* Indicador "está escribiendo..." */
.typing-indicator {
    display: none;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 0 8px;
    align-self: flex-start;
    animation: msgIn 0.2s ease;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.typing-indicator__bubble {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-text-muted);
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.5; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* ── Placeholder elegante para imágenes con error ───────────────────── */
.msg-media img.img-error {
    display: none;
}

.img-error-placeholder {
    display: none;
    width: 200px;
    height: 140px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: default;
}

.img-error-placeholder svg {
    width: 28px;
    height: 28px;
    stroke: var(--color-text-muted);
    opacity: 0.5;
}

.img-error-placeholder.visible {
    display: flex;
}

/* ── Chat image loading skeleton ─────────────────────────────────── */
.msg-media img.img-loading {
    /* Mientras carga, mostrar shimmer */
    background: linear-gradient(
        90deg,
        var(--color-bg-elevated) 25%,
        rgba(255,255,255,0.06) 50%,
        var(--color-bg-elevated) 75%
    );
    background-size: 800px 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
    min-height: 120px;
    min-width: 200px;
}

/* =============================================
   FASE 6: PWA Install Banner
   ============================================= */
.pwa-install-banner {
    display: none;
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-card));
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 14px;
    padding: 14px 16px;
    z-index: 997;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    gap: 12px;
    align-items: center;
}

.pwa-install-banner.visible {
    display: flex;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pwa-banner__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.pwa-banner__text {
    flex: 1;
    min-width: 0;
}

.pwa-banner__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
}

.pwa-banner__sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.pwa-banner__btn {
    background: var(--color-gold);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.15s;
}

.pwa-banner__btn:hover { background: var(--color-gold-light); }

.pwa-banner__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════
   Veltena DESIGN SYSTEM — v1
   Editorial · Rectangular · No pink · Institutional
   ═══════════════════════════════════════════════════════ */

/* Logo */
.logo img {
    height: 44px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}
.footer__logo img {
    filter: brightness(0) invert(1);
    height: 20px;
    max-width: 120px;
    width: auto;
}

/* Typography — editorial weights */
.hero__title, .section__title, .dashboard__title,
.page-title, .auth-card__title {
    font-weight: 300;
    letter-spacing: -0.02em;
}

/* Nav links */
.main-nav a {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 0;
}

/* Hero — left aligned */
.hero { text-align: left; justify-content: flex-start; align-items: flex-start; }
.hero__content { text-align: left; max-width: 680px; }
.hero__cta { justify-content: flex-start; }
.hero__logo { display: none; }
.hero__badge {
    border-radius: 2px;
    border: 1px solid rgba(206,174,98,0.4);
    background: transparent;
    letter-spacing: 0.18em;
    font-size: 0.625rem;
}

/* Sections */
.section__header { text-align: left; }
.section__label { letter-spacing: 0.2em; font-size: 0.625rem; }

/* Buttons */
.btn { border-radius: 3px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.btn--primary { background: var(--color-gold); color: #050508; box-shadow: none; }
.btn--primary:hover { background: #d4b96e; transform: none; box-shadow: none; }
.btn--pink { background: var(--color-gold); color: #050508; border-radius: 3px; }

/* Badges */
.badge {
    border-radius: 2px;
    padding: 2px 7px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(206,174,98,0.3);
    background: rgba(206,174,98,0.08);
    color: var(--color-gold);
}
.status-badge { border-radius: 2px; padding: 2px 7px; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* Tier cards */
.tier-card { text-align: left; border-radius: 3px; border-color: rgba(255,255,255,0.08); }
.tier-card--featured { border-top: 2px solid var(--color-gold); border-color: rgba(206,174,98,0.3); }
.tier-card__name { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.tier-card__price { font-weight: 200; font-size: 3rem; letter-spacing: -0.04em; font-family: 'Inter', sans-serif; }
.tier-card__badge { border-radius: 2px; }

/* Pricing CTA */
.plan-cta--primary, .plan-cta--pink {
    background: var(--color-gold) !important;
    color: #050508 !important;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Cards */
.card, .feature-card, .content-card, .stat-card, .welcome-card,
.activity-feed, .auth-card { border-radius: 3px !important; }
.feature-card__icon { border-radius: 3px; }

/* Sidebar — left accent active */
.sidebar__link { border-radius: 0; border-left: 2px solid transparent; }
.sidebar__link.active {
    background: rgba(206,174,98,0.06);
    color: var(--color-gold);
    border-left: 2px solid var(--color-gold);
    padding-left: 8px;
}

/* Forms */
.form-input { border-radius: 3px; }
.form-input:focus { border-color: rgba(206,174,98,0.6); box-shadow: none; }

/* Stats */
.stat-card__value { font-weight: 200; font-size: 2.2rem; letter-spacing: -0.04em; }
.stat-card__label { letter-spacing: 0.12em; font-size: 0.6rem; text-transform: uppercase; }

/* Tables */
.data-table th { font-size: 0.6rem; letter-spacing: 0.16em; color: rgba(255,255,255,0.25); text-transform: uppercase; }

/* Footer */
.footer__age { color: rgba(255,255,255,0.35); font-size: 0.75rem; }

/* Profile avatar */
.profile-avatar { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }

/* Scrollbar */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 0; }

/* Tab bar text */
.tab-item { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* Demo panel */
.demo-panel {
    background: rgba(206,174,98,0.03) !important;
    border: 1px solid rgba(206,174,98,0.12) !important;
}

/* Auth card */
.auth-card { max-width: 400px; border-radius: 3px !important; }

/* Tier gradient text */
.text-gradient { color: var(--color-gold); -webkit-text-fill-color: var(--color-gold); background: none; }
