/* ===== VARIÁVEIS ===== */
:root {
    --bg-primary: #0b0c10;
    --bg-secondary: #111318;
    --bg-tertiary: #1a1d24;
    --surface: #252931;
    --surface-hover: #2f343e;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a5b3;
    --text-tertiary: #6f7482;
    
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-pink: #ec4899;
    --accent-yellow: #eab308;
    --accent-cyan: #06b6d4;
    
    --gradient-1: linear-gradient(135deg, #8b5cf6, #3b82f6);
    --gradient-2: linear-gradient(135deg, #ec4899, #f59e0b);
    --gradient-3: linear-gradient(135deg, #10b981, #06b6d4);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.2s ease;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --surface: #e2e8f0;
    --surface-hover: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader__container {
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.loader__logo {
    margin-bottom: 3rem;
    position: relative;
}

.loader__logo-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulseGlow 2s infinite;
}

.loader__logo-icon i {
    font-size: 3.5rem;
    color: white;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    animation: floatIcon 3s infinite;
}

.loader__logo-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 50%;
    opacity: 0.3;
    animation: ringPulse 2s infinite;
}

.loader__logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s infinite;
    position: relative;
    display: inline-block;
}

.loader__year {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    margin-left: 0.5rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

.loader__stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.loader__stat {
    text-align: center;
}

.loader__stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    display: block;
    margin-bottom: 0.25rem;
}

.loader__stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loader__progress-container {
    margin: 2rem 0;
}

.loader__progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.loader__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue), var(--accent-pink));
    background-size: 200% 200%;
    animation: gradientShift 2s infinite;
    transition: width 0.3s ease;
    position: relative;
}

.loader__progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 1.5s infinite;
}

.loader__progress-percent {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.loader__tip-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.loader__tip-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue), var(--accent-pink));
    animation: gradientShift 2s infinite;
}

.loader__tip-icon {
    color: var(--accent-purple);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.loader__tip-title {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.loader__tip-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    animation: fadeInOut 3s infinite;
}

.loader__particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.loader__particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-radius: 50%;
    opacity: 0.3;
    animation: float 3s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3),
                    0 0 40px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.5),
                    0 0 60px rgba(59, 130, 246, 0.3);
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.7;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stats Cards no Loader */
.loader__stats-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem;
    display: inline-block;
    animation: fadeInScale 0.5s ease-out forwards;
    opacity: 0;
    transform: scale(0.9);
}

.loader__stats-card:nth-child(1) { animation-delay: 0.1s; }
.loader__stats-card:nth-child(2) { animation-delay: 0.2s; }
.loader__stats-card:nth-child(3) { animation-delay: 0.3s; }
.loader__stats-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== APP ===== */
.app {
    display: flex;
    height: 100vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.app.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--surface);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s;
    box-shadow: var(--shadow-md);
}

.sidebar__header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar__logo i {
    font-size: 2rem;
    color: var(--accent-purple);
}

.sidebar__logo span {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar__year {
    background: var(--accent-purple);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

.sidebar__close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar__nav {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar__group {
    margin-bottom: 2rem;
}

.sidebar__group-title {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.sidebar__item i {
    width: 1.25rem;
}

.sidebar__item:hover {
    background: var(--surface);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar__item.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-sm);
}

.sidebar__badge {
    margin-left: auto;
    background: var(--surface);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.sidebar__item.active .sidebar__badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar__footer {
    padding: 1.5rem;
    border-top: 1px solid var(--surface);
    background: var(--bg-secondary);
}

.sidebar__progress {
    margin-bottom: 1rem;
}

.sidebar__progress-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.sidebar__progress-bar {
    height: 4px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sidebar__progress-fill {
    height: 100%;
    background: var(--gradient-1);
    transition: width 0.3s;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar__avatar i {
    font-size: 2rem;
    color: var(--accent-purple);
}

.sidebar__user-info {
    flex: 1;
    min-width: 0; /* Importante para overflow no mobile */
}

.sidebar__user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-streak {
    color: var(--accent-orange);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.sidebar__user-streak i {
    margin-right: 0.25rem;
}

.sidebar__theme {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar__theme:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    margin-left: 280px;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* ===== HEADER ===== */
/* ===== HEADER ESTILO APP ===== */
.header {
    background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 280px; /* largura do sidebar no desktop */
    right: 0;
    z-index: 500;
    border-bottom: 1px solid var(--surface);
    box-shadow: var(--shadow-sm);
    min-height: 56px;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s ease;
    will-change: transform;
}
.header--hidden {
    transform: translateY(-100%);
}

/* Grupo esquerdo: hambúrguer + título */
.header__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header__menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}

.header__menu:hover {
    background: var(--surface);
}

.header__title {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

/* Chips contextuais no centro */
.header__context {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
    overflow: hidden;
}

.header__ctx-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 2rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    white-space: nowrap;
    border: 1px solid var(--surface);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header__ctx-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* acesso/limite badge */
#accessBadge {
    background: var(--accent-orange);
    color: white;
    border-color: transparent;
}

#accessBadge.success {
    background: var(--accent-green);
}
#accessBadge.warning {
    background: var(--accent-red);
}
#accessBadge.error {
    background: var(--accent-red);
}

/* Mantém acesso ao .access-badge usado por updateAuthUI */
.access-badge { display: none; }

.header__ctx-date i {
    color: var(--accent-purple);
    font-size: 0.65rem;
}

/* Grupo direito: avatar */
.header__user {
    flex-shrink: 0;
}

.header__avatar-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s ease;
}

.header__avatar-btn:hover,
.header__avatar-btn:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-purple) 35%, transparent);
}

/* ===== AVATAR CIRCLE ===== */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.15s;
    border: 2px solid transparent;
}

.header__avatar-btn:hover .avatar-circle {
    transform: scale(1.06);
    border-color: var(--accent-purple);
}

.avatar-circle--xl {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

.avatar-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-secondary);
}

/* ===== AVATAR DROPDOWN ===== */
.avatar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 299;
}

.avatar-overlay.active {
    display: block;
}

.avatar-dropdown {
    display: none;
    position: fixed;
    top: 62px;
    right: 0.75rem;
    width: min(300px, calc(100vw - 1.5rem));
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    z-index: 300;
    overflow: hidden;
    animation: dropIn 0.18s ease;
}

.avatar-dropdown.active {
    display: block;
}

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

.avatar-dropdown__guest,
.avatar-dropdown__user {
    padding: 1rem;
}

.avatar-dropdown__hero {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.avatar-dropdown__hero p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

.avatar-dropdown__hero strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.avatar-dropdown__perks {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent-orange) 8%, transparent);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.avatar-dropdown__perks li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.avatar-dropdown__perks li i {
    color: var(--accent-green);
    font-size: 0.75rem;
}

.avatar-dropdown__guest .btn + .btn {
    margin-top: 0.5rem;
}

.avatar-dropdown__profile {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.avatar-dropdown__info strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.avatar-dropdown__expiry-tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
}

.avatar-dropdown__divider {
    height: 1px;
    background: var(--surface);
    margin: 0.5rem 0;
}

.avatar-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.avatar-dropdown__item:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.avatar-dropdown__item i {
    width: 16px;
    text-align: center;
    color: var(--accent-purple);
    flex-shrink: 0;
}

.avatar-dropdown__item--admin i {
    color: var(--accent-orange);
}

.avatar-dropdown__item--danger {
    color: var(--accent-red);
}

.avatar-dropdown__item--danger i {
    color: var(--accent-red);
}

.avatar-dropdown__item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

/* btn--block para o botão de login no dropdown */
.btn--block {
    width: 100%;
    justify-content: center;
}

/* Mantém os estilos legados de access-badge para updateAuthUI (sidebar) */
.access-badge {
    display: none;
}
.sidebar .access-badge,
#accessBadge {
    display: inline-flex;
}

/* ===== HEADER REFRESH (legacy, oculto) ===== */
.header__refresh {
    display: none;
}

.header__access {
    display: none;
}

.header__date {
    display: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== CONTENT ===== */
.content {
    padding: 2rem;
    padding-top: calc(56px + 1.5rem); /* 56px = altura do header fixo */
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.section__header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .section__header {
        flex-direction: column;
        align-items: stretch;
    }
    .section__header .btn {
        width: 100%;
        justify-content: center;
    }
}

.section__title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.section__subtitle {
    color: var(--text-secondary);
}

/* ===== GOAL ===== */
.goal {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
}

.goal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}

.goal__info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.goal__icon {
    font-size: 1.15rem;
    color: var(--accent-purple);
}

.goal__info h3 {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

.goal__info p {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.goal__bar {
    height: 6px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.goal__fill {
    height: 100%;
    background: var(--gradient-1);
    transition: width 0.3s;
}

.goal__message {
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.82rem;
    min-height: 0;
}

.goal__message:empty {
    margin-top: 0;
}

@media (max-width: 640px) {
    .goal { padding: 0.65rem 0.85rem; }
    .goal__header { margin-bottom: 0.4rem; }
    .goal__info h3 { font-size: 0.8rem; }
    .goal__info p { font-size: 0.72rem; }
}

.goal__message.success {
    color: var(--accent-green);
    animation: pulse 1s;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.9rem;
}

.btn--primary {
    background: var(--gradient-1);
    color: white;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--accent-purple);
}

.btn--primary:active,
.btn--outline:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--surface);
    color: var(--text-primary);
}

.btn--outline:hover {
    background: var(--surface);
    border-color: color-mix(in srgb, var(--accent-purple) 30%, var(--surface));
}

.btn--icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    justify-content: center;
}

.btn--danger {
    background: var(--accent-red);
    color: white;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn--full {
    width: 100%;
    justify-content: center;
}

/* ===== QUESTION ===== */
.question {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.question__header {
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question__tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question__tag {
    background: var(--accent-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.question__subject {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.question__number {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.question__content {
    padding: 2rem;
}

.question__text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.question__options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s cubic-bezier(0.4,0,0.2,1), box-shadow 0.18s ease;
}

.option:hover {
    background: var(--surface);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.option.selected {
    border-color: var(--accent-purple);
    border-width: 2px;
    background: rgba(139, 92, 246, 0.16);
    box-shadow: 0 0 0 1px var(--accent-purple);
}

.option.selected .option-letter {
    background: var(--accent-purple);
    color: white;
}

.option.correct {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    animation: optionPulse 0.35s ease;
}

.option.incorrect {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    animation: optionShake 0.35s ease;
}

@keyframes optionPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

@keyframes optionShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.option-letter {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

.option.correct .option-letter {
    background: var(--accent-green);
    color: white;
}

.option.incorrect .option-letter {
    background: var(--accent-red);
    color: white;
}

.question__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.question__explanation {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--accent-green);
    border-radius: var(--radius-md);
    display: none;
}

.question__explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-green);
    font-weight: 600;
    margin-bottom: 1rem;
}

.question__explanation-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== CATEGORIES ===== */
.categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.category {
    background: var(--bg-secondary);
    border: 2px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.category.active {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
}

.category__icon {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.category__info {
    flex: 1;
    min-width: 0;
}

.category__info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category__info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category__count {
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-purple);
    flex-shrink: 0;
}

/* ===== FLASHCARD VIEWER ===== */
.flashcard-viewer {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.flashcard-viewer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.flashcard-viewer__header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.flashcard-viewer__counter {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.flashcard-viewer__controls {
    display: flex;
    gap: 0.5rem;
}

.flashcard-viewer__control {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.flashcard-viewer__control:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--accent-purple);
}

.flashcard-viewer__control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flashcard-viewer__card {
    width: 100%;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
}

.flashcard-viewer__card.flipped {
    transform: rotateY(180deg);
}

.flashcard-viewer__front,
.flashcard-viewer__back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-1);
    color: white;
    word-break: break-word;
}

.flashcard-viewer__back {
    transform: rotateY(180deg);
    background: var(--gradient-2);
}

.flashcard-viewer__hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.7);
}

.flashcard-viewer__actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== CREATOR ===== */
.creator {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
}

.creator__summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-purple);
    font-weight: 500;
    list-style: none;
}

.creator__summary::-webkit-details-marker {
    display: none;
}

.creator__summary:hover {
    background: var(--surface);
}

.creator__form {
    padding: 1.5rem;
    border-top: 1px solid var(--surface);
    display: grid;
    gap: 1rem;
}

.creator__select,
.creator__textarea {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    width: 100%;
}

.creator__select:focus,
.creator__textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.creator__textarea {
    resize: vertical;
    min-height: 80px;
}

.creator__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== AUDIOBOOKS ===== */
.audiobooks {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.audiobooks__filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
}

.audiobooks__search {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.audiobooks__search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.audiobooks__search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.audiobooks__filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audiobooks__filter {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.audiobooks__filter:hover,
.audiobooks__filter.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

.audiobooks__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ===== PLAYER ===== */
.player {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    bottom: 1rem;
    z-index: 910;
    backdrop-filter: blur(10px);
}
@media (max-width: 1024px) {
    .player {
        bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 0.5rem);
    }
}

.player__track {
    margin-bottom: 1rem;
}

.player__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player__info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.player__info span {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.player__progress {
    cursor: pointer;
}

.player__progress-bar {
    height: 4px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.player__progress-fill {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
    transition: width 0.1s;
}

.player__controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.player__btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.player__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px -5px var(--accent-purple);
}

.player__speed {
    flex: 1;
    min-width: 80px;
}

.player__speed-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.player__speed-btn:hover {
    background: var(--surface);
}

.player__volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.player__volume i {
    color: var(--text-secondary);
}

.player__volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.player__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-purple);
    border-radius: 50%;
    cursor: pointer;
}

/* ===== SPECS ===== */
.specs {
    display: grid;
    gap: 2rem;
}

.specs__block {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.specs__block h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-purple);
}

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

.specs__card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.specs__card--center {
    text-align: center;
}

.specs__card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.specs__card-header i {
    color: var(--accent-purple);
}

.specs__card-header h3 {
    font-size: 1.1rem;
}

.specs__card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.specs__card ul {
    list-style: none;
}

.specs__card li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.specs__card li::before {
    content: "•";
    color: var(--accent-purple);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* ===== STATS ===== */
.stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===== STATS GRID — responsivo: 2 cols mobile / 3-4 tablet / 4 desktop ===== */
.stats__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .stats__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
    .stats__grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

.stats__card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats__icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stats__icon--purple { background: var(--accent-purple); }
.stats__icon--blue { background: var(--accent-blue); }
.stats__icon--green { background: var(--accent-green); }
.stats__icon--red { background: var(--accent-red); }
.stats__icon--pink { background: var(--accent-pink); }
.stats__icon--orange { background: var(--accent-orange); }
.stats__icon--yellow { background: var(--accent-yellow); }
.stats__icon--cyan { background: var(--accent-cyan); }

.stats__info {
    flex: 1;
    min-width: 0;
}

.stats__label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.stats__value {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats__chart {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stats__chart h3 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.stats__bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats__bar-label {
    width: 100px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stats__bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 100px;
}

.stats__bar-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: var(--radius-sm);
    transition: width 0.3s;
}

.stats__bar-value {
    width: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-purple);
    text-align: right;
}

.stats__details {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stats__details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 600px) {
    .stats__details-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}

@media (min-width: 900px) {
    .stats__details-grid { grid-template-columns: repeat(6, 1fr); }
}

.stats__detail {
    text-align: center;
}

.stats__detail-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.stats__detail-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-purple);
}

.stats__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== SETTINGS ===== */
.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.settings__card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings__card:hover {
    border-color: color-mix(in srgb, var(--accent-purple) 25%, var(--surface));
    box-shadow: var(--shadow-sm);
}

.settings__card h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface);
}

.settings__item {
    margin-bottom: 1.5rem;
}

.settings__item label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.settings__control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings__control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.settings__control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-purple);
    border-radius: 50%;
    cursor: pointer;
}

.settings__control span {
    min-width: 2rem;
    text-align: center;
    color: var(--accent-purple);
    font-weight: 600;
}

.settings__input {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings__input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-purple) 20%, transparent);
}

.settings__control input[type="range"]::-webkit-slider-thumb {
    transition: transform 0.15s ease;
}

.settings__control input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.15);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-purple);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    z-index: 10001;
    animation: slideIn 0.3s;
}

.toast.show {
    display: flex;
}

.toast.success {
    border-left-color: var(--accent-green);
}

.toast.error {
    border-left-color: var(--accent-red);
}

.toast.warning {
    border-left-color: var(--accent-orange);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal__content {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s;
}

.modal__content h3 {
    margin-bottom: 1.5rem;
}

.modal__actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

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

.modal--large .modal__content {
    max-width: min(960px, 96vw);
}

/* Admin modal: sem padding global, cada seção define o próprio */
.modal__content.admin-modal-content {
    padding: 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
}

/* ===== LOGIN, ADMIN, LGPD, FOOTER ===== */

/* Login e Acesso */
.sidebar__login {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent-orange) 10%, var(--bg-tertiary)), var(--bg-tertiary));
    border: 1px solid color-mix(in srgb, var(--accent-orange) 25%, var(--surface));
}

.sidebar__login-teaser {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sidebar__login-price {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.sidebar__login-price b {
    color: var(--accent-orange);
    font-size: 0.85rem;
}

/* Selo/CTA premium — usado em toda a experiência de visitante */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn--premium {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px -3px color-mix(in srgb, var(--accent-orange) 55%, transparent);
}

.btn--premium:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 24px -6px color-mix(in srgb, var(--accent-orange) 60%, transparent);
}

.btn--premium:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.sidebar__logout {
    margin-top: 1rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-group small {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Login: upsell de compra dentro do modal de login */
.login-upsell {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    text-align: center;
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent-orange) 14%, var(--bg-tertiary)), var(--bg-tertiary));
    border: 1px solid color-mix(in srgb, var(--accent-orange) 30%, var(--surface));
}

.login-upsell__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--accent-orange);
    margin-bottom: 0.5rem;
}

.login-upsell__text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.login-upsell__text strong {
    color: var(--accent-orange);
}

/* Modal de Compra */
.buy-modal__header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.buy-modal__subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.buy-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.buy-card {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.buy-card--featured {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--bg-tertiary), var(--bg-tertiary)) padding-box,
        linear-gradient(135deg, var(--accent-orange), var(--accent-pink)) border-box;
    box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--accent-orange) 45%, transparent);
}

.buy-card__ribbon {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--accent-orange) 55%, transparent);
}

.buy-card__header {
    margin-bottom: 1.5rem;
}

.buy-card__header h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.buy-card__price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.6rem;
}

.buy-card__price-old {
    color: var(--text-tertiary);
    text-decoration: line-through;
    font-size: 1.05rem;
}

.buy-card__price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-orange);
    line-height: 1.2;
}

.buy-card__period {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.buy-card__features ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.buy-card__features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.buy-card__features li i {
    color: var(--accent-green);
}

.buy-card__guarantee {
    margin: 1rem 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.buy-card__guarantee i {
    color: var(--accent-green);
}

/* Rodapé */
/* Footer mínimo — apenas referências legais, sem bloco institucional */
.footer {
    border-top: 1px solid var(--surface);
    margin-top: 2rem;
}

.footer__mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.footer__mini-links {
    display: flex;
    gap: 1rem;
}

.footer__mini-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer__mini-links a:hover {
    color: var(--accent-purple);
}

/* LGPD Banner */
.lgpd-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-purple);
    padding: 1rem;
    z-index: 9998;
    box-shadow: var(--shadow-lg);
    display: none;
}

.lgpd-banner.show {
    display: block;
    animation: slideUp 0.3s;
}

.lgpd-banner__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.lgpd-banner__icon {
    font-size: 2rem;
    color: var(--accent-purple);
    flex-shrink: 0;
}

.lgpd-banner__text {
    flex: 1;
}

.lgpd-banner__text strong {
    color: var(--accent-purple);
    display: block;
    margin-bottom: 0.25rem;
}

.lgpd-banner__text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lgpd-banner__text a {
    color: var(--accent-purple);
    text-decoration: none;
}

.lgpd-banner__text a:hover {
    text-decoration: underline;
}

.lgpd-banner__actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Alertas do Sistema */
.alerts-container {
    margin: 1rem 2rem;
}

.system-alert {
    background: var(--accent-purple);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideIn 0.3s;
}

.system-alert.warning {
    background: var(--accent-orange);
}

.system-alert.error {
    background: var(--accent-red);
}

.system-alert.success {
    background: var(--accent-green);
}

.system-alert__content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.system-alert__content i {
    font-size: 1.25rem;
}

.system-alert__close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.8;
    transition: var(--transition);
}

.system-alert__close:hover {
    opacity: 1;
}

/* Admin — regras base aqui, sobrepostas pelas do painel admin profissional abaixo */
.admin-search input {
    flex: 1;
    min-width: 200px;
}

.admin-stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.admin-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.admin-stat-card i {
    font-size: 1.5rem;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
}

.admin-stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--surface);
    color: var(--text-primary);
}

.admin-table tr:hover td {
    background: var(--surface);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.status-badge.suspended {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.status-badge.expired {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-tertiary);
}

.expiry-badge {
    font-weight: 600;
}

.expiry-badge.critical {
    color: var(--accent-red);
}

.expiry-badge.warning {
    color: var(--accent-orange);
}

.expiry-badge.good {
    color: var(--accent-green);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.action-btn:hover {
    background: var(--surface);
    color: var(--accent-purple);
}

.action-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

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

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

/* Admin Alertas */
.admin-alerts-list {
    margin-top: 1rem;
}

.admin-alert-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-alert-item__content {
    flex: 1;
    min-width: 250px;
}

.admin-alert-item__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-alert-item__title i.info { color: var(--accent-blue); }
.admin-alert-item__title i.success { color: var(--accent-green); }
.admin-alert-item__title i.warning { color: var(--accent-orange); }
.admin-alert-item__title i.error { color: var(--accent-red); }

.admin-alert-item__message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.admin-alert-item__meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.admin-alert-item__actions {
    display: flex;
    gap: 0.5rem;
}

/* Configurações do Site */
.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.config-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.config-section h4 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface);
    color: var(--accent-purple);
}

.config-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.config-row label {
    width: 120px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.config-row input,
.config-row select {
    flex: 1;
    min-width: 200px;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--gradient-1);
    border: 1px solid var(--surface);
}

/* Alertas Superiores */
.alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    width: calc(100% - 40px);
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-purple);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
}

.alert-notification.info {
    border-left-color: var(--accent-blue);
}

.alert-notification.success {
    border-left-color: var(--accent-green);
}

.alert-notification.warning {
    border-left-color: var(--accent-orange);
}

.alert-notification.error {
    border-left-color: var(--accent-red);
}

.alert-notification__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.alert-notification__header i {
    font-size: 1.25rem;
}

.alert-notification.info .alert-notification__header i {
    color: var(--accent-blue);
}

.alert-notification.success .alert-notification__header i {
    color: var(--accent-green);
}

.alert-notification.warning .alert-notification__header i {
    color: var(--accent-orange);
}

.alert-notification.error .alert-notification__header i {
    color: var(--accent-red);
}

.alert-notification__header h4 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.alert-notification__close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.alert-notification__close:hover {
    color: var(--text-primary);
}

.alert-notification__content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    padding-left: 2rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Admin FAB oculto — acesso ao painel via avatar dropdown */
.mobile-admin-btn-container,
.mobile-admin-btn {
    display: none !important;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-purple);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar__close {
        display: block;
    }
    .main {
        margin-left: 0;
    }
    /* Header: no mobile não há sidebar, cobre a tela toda */
    .header {
        left: 0;
    }
    .lgpd-banner__content {
        flex-direction: column;
        text-align: center;
    }
    /* Grids responsivos já definidos via min-width acima */
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header__actions {
        gap: 0.5rem;
    }
    
    .header__date {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .header__date span {
        display: inline;
    }
    
    .header__refresh {
        width: 2rem;
        height: 2rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    /* Mobile: visual de app — sem subtitle, header compacto */
    .section__subtitle {
        display: none;
    }
    .section__header {
        margin-bottom: 1rem;
    }
    .section__title {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .audiobooks__filters {
        flex-direction: column;
    }
    
    .audiobooks__search {
        width: 100%;
        min-width: auto;
    }
    
    .audiobooks__filter-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .question__actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .settings {
        grid-template-columns: 1fr;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        min-width: auto;
        bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 1rem);
    }
    
    .stats__bar {
        flex-wrap: wrap;
    }
    .stats__bar-label {
        width: 100%;
    }
    .stats__bar-value {
        width: 100%;
        text-align: right;
    }
    .stats__actions {
        flex-direction: column;
    }
    .admin-search {
        flex-direction: column;
    }
    .admin-search input {
        width: 100%;
    }
    
    .lgpd-banner__actions {
        width: 100%;
        justify-content: center;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .config-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .config-row label {
        width: 100%;
    }
    
    .config-row input,
    .config-row select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header__context {
        gap: 0.25rem;
    }

    .header__ctx-date {
        display: none;
    }

    .question__content {
        padding: 1rem;
    }
    
    .question__text {
        font-size: 1rem;
    }
    
    .option {
        padding: 0.75rem 1rem;
    }
    
    .flashcard-viewer__card {
        height: 180px;
    }
    
    .flashcard-viewer__front p,
    .flashcard-viewer__back p {
        font-size: 0.9rem;
    }
    
    .player__controls {
        flex-wrap: wrap;
    }
    
    .player__speed {
        width: 100%;
        order: 3;
    }
    
    .player__speed-btn {
        width: 100%;
    }
    
    .goal__header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .goal__info {
        width: 100%;
    }
    
    .btn--small {
        width: 100%;
    }
    
    .modal__actions {
        flex-direction: column;
    }
    
    .modal__actions .btn {
        width: 100%;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .admin-alert-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-alert-item__actions {
        width: 100%;
        justify-content: flex-end;
    }
    
}

/* Utilitários */
.text-secondary {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}























   
  /* ===== FILTROS MELHORADOS (sem mudar HTML) ===== */

/* Container principal */
.filters-bar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

/* Header clicável */
.filters-bar__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.filters-bar__header:hover {
    background: var(--bg-tertiary);
}

.filters-bar__header i:first-child {
    color: var(--accent-purple);
    font-size: 1rem;
}

.filters-bar__header span {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.filters-badge {
    background: var(--accent-purple);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-weight: 600;
}

.filters-arrow {
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.filters-arrow.open {
    transform: rotate(180deg);
}

/* Painel que abre/fecha */
.filters-panel {
    padding: 1.25rem;
    border-top: 1px solid var(--surface);
    background: var(--bg-secondary);
}

/* Cada linha de filtro */
.filter-row {
    margin-bottom: 1.25rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chips (botões de filtro) organizados em grade */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Estilo dos chips */
.chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.chip:hover {
    background: var(--surface);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.chip.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.chip .count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    font-size: 0.65rem;
    margin-left: 0.25rem;
}

.chip.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* Mensagem de login para visitantes */
.filter-login-message {
    background: rgba(139, 92, 246, 0.08);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.filter-login-message i {
    color: var(--accent-purple);
    font-size: 1rem;
}

.filter-login-message a {
    color: var(--accent-purple);
    font-weight: 600;
    text-decoration: none;
}

.filter-login-message a:hover {
    text-decoration: underline;
}

/* Animação de abertura */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filters-panel {
    animation: slideDown 0.2s ease;
}

/* Responsivo */
@media (max-width: 768px) {
    .filters-bar__header {
        padding: 0.7rem 1rem;
    }
    
    .filters-panel {
        padding: 1rem;
    }
    
    .chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .filter-chips {
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .filter-chips {
        flex-direction: column;
    }
    
    .chip {
        width: 100%;
        justify-content: center;
    }
}

/* Adicione no style dinâmico */
.countdown-warning {
    color: var(--accent-orange) !important;
    font-weight: 600;
}

.countdown-danger {
    color: var(--accent-red) !important;
    font-weight: 700;
}

.countdown-success {
    color: var(--accent-green) !important;
}













































































































/* ===== BOTÃO DE COPIAR CREDENCIAIS (NOVO) ===== */
.copy-creds-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.copy-creds-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.copy-creds-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Toast para feedback de cópia (não conflita com o existente) */
.copy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10001;
    animation: copyToastFadeInUp 0.3s ease, copyToastFadeOut 0.3s ease 2s forwards;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: 'Space Grotesk', sans-serif;
}

.copy-toast.error {
    background: #ef4444;
}

@keyframes copyToastFadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes copyToastFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Modal de pré-visualização das credenciais */
.creds-preview-modal .modal__content {
    max-width: 550px;
}

.creds-preview-content {
    background: var(--bg-tertiary, #f1f5f9);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--surface, #e2e8f0);
    max-height: 400px;
    overflow-y: auto;
}

.creds-preview-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.creds-preview-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Badge de cópia no modal de novo usuário */
.copy-creds-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

/* ===== AUDIOBOOK CARDS (movido do JS para evitar injeção de estilo) ===== */
.audiobook-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.audiobook-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-lg);
}

.audiobook-card.playing {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.audiobook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.audiobook-icon {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.audiobook-category {
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    border-radius: 1rem;
    font-size: 0.8rem;
}

.audiobook-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.audiobook-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.audiobook-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--surface);
}

.audiobook-duration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Badge de acesso */
.access-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface);
    color: var(--text-primary);
}

.access-badge.warning {
    background: var(--accent-red);
    color: white;
}

.access-badge.success {
    background: var(--accent-green);
    color: white;
}

.access-badge.error {
    background: var(--accent-red);
    color: white;
}

/* Animação de rotação para refresh */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.rotating i {
    animation: rotate 1s linear infinite;
}

/* ===== BOTTOM NAVIGATION BAR — 6 itens fixos, centralizado ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--surface);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.bottom-nav__track {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: 62px;
    width: 100%;
}

@media (max-width: 1024px) {
    .bottom-nav {
        display: flex;
        align-items: stretch;
    }
    .main {
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    }
    /* Hamburger oculto — navegação exclusivamente pela barra inferior */
    .header__menu {
        display: none !important;
    }
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 0.35rem 0.25rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.56rem;
    font-weight: 500;
    position: relative;
    transition: color 0.18s ease, background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
}

.bottom-nav__item i {
    font-size: 1.05rem;
    transition: transform 0.18s ease;
    display: block;
    line-height: 1;
}

.bottom-nav__item span {
    font-size: 0.56rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav__item.active {
    color: var(--accent-purple);
}

.bottom-nav__item.active i {
    transform: translateY(-2px);
}

.bottom-nav__item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2.5px;
    background: var(--gradient-1);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent-purple) 60%, transparent);
    animation: bottomNavPop 0.25s ease;
}

@keyframes bottomNavPop {
    from { transform: scaleX(0.3); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

.bottom-nav__item:active {
    background: var(--surface);
}

/* ===== PLAYER DE ÁUDIO MELHORADO ===== */
.player__seek {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.player__time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    text-align: center;
    flex-shrink: 0;
}

.player__progress-bar {
    flex: 1;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.player__progress-bar:hover .player__seek-thumb {
    opacity: 1;
    transform: scale(1);
}

.player__seek-thumb {
    position: absolute;
    top: 50%;
    right: calc(100% - var(--progress, 0%));
    width: 14px;
    height: 14px;
    background: var(--accent-purple);
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.15s ease, opacity 0.15s ease;
    opacity: 0;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    pointer-events: none;
    margin-left: -7px;
}

.player__btn--rewind,
.player__btn--forward {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    flex-direction: column;
    gap: 0;
}

.player__btn--rewind span,
.player__btn--forward span {
    font-size: 0.5rem;
    font-weight: 700;
    position: absolute;
    bottom: 5px;
}

.player__btn--rewind:hover,
.player__btn--forward:hover {
    background: var(--accent-purple);
    color: white;
}

.player__btn--play {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.1rem;
}

/* ===== SWIPE HINTS E ANIMAÇÕES — FLASHCARDS ===== */
@keyframes swipeLeft {
    0%   { transform: translateX(0); opacity: 1; }
    40%  { transform: translateX(-12px); opacity: 0.7; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes swipeRight {
    0%   { transform: translateX(0); opacity: 1; }
    40%  { transform: translateX(12px); opacity: 0.7; }
    100% { transform: translateX(0); opacity: 1; }
}

.flashcard-viewer__card.swipe-left {
    animation: swipeLeft 0.3s ease;
}

.flashcard-viewer__card.swipe-right {
    animation: swipeRight 0.3s ease;
}

/* Dica de swipe visível na primeira vez */
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    animation: fadeInOut 3s ease 1s both;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80%  { opacity: 1; }
}

/* ===== MELHORIAS GERAIS DE RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    /* Contador de questão mais compacto */
    .question__number {
        font-size: 0.75rem;
    }

    /* Explicação com destaque visual */
    .question__explanation {
        border-left: 3px solid var(--accent-purple);
        margin-top: 1rem;
    }

    /* Flashcard viewer maior no mobile */
    .flashcard-viewer__card {
        min-height: 200px;
    }

    /* Player compacto */
    .player__btn--rewind,
    .player__btn--forward {
        width: 2.25rem;
        height: 2.25rem;
    }

    /* Bottom nav ajuste de fonte */
    .bottom-nav__item span {
        font-size: 0.55rem;
    }
}

/* ===== ACESSIBILIDADE — FOCO VISÍVEL ===== */
.sidebar__item:focus-visible,
.bottom-nav__item:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.option:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* ===== TEMA LIGHT — CORREÇÕES ===== */
[data-theme="light"] .bottom-nav {
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .player__btn--rewind,
[data-theme="light"] .player__btn--forward {
    background: var(--surface);
    color: var(--text-primary);
}

/* ===== BOTÃO SUCCESS (WhatsApp) ===== */
.btn--success {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
}

.btn--success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(37, 211, 102, 0.4);
}

/* ===== AVATAR DROPDOWN — LIGHT THEME ===== */
[data-theme="light"] .avatar-dropdown {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===== HEADER — RESPONSIVO ===== */
@media (max-width: 1024px) {
    .header__menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Telas muito pequenas: comprime os chips do header */
@media (max-width: 380px) {
    .header__ctx-date {
        display: none;
    }
    .header__title {
        font-size: 0.95rem;
    }
}

/* Desktop: esconde hamburger (sidebar sempre visível) */
@media (min-width: 1025px) {
    .header__menu {
        display: none;
    }
    .avatar-dropdown {
        top: 68px;
        right: 1.5rem;
    }
}

/* Tablet landscape: bottom nav com scroll suave */
@media (min-width: 601px) and (max-width: 1024px) {
    .bottom-nav__item {
        min-width: 80px;
        padding: 0.4rem 1rem;
    }
}

/* Footer oculto na bottom-nav quando mobile (evita dupla área morta) */
@media (max-width: 1024px) {
    .footer {
        margin-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    }
    .footer__mini-links {
        gap: 0.75rem;
    }
}

/* Chip de acesso no header — variantes de cor */
.header__ctx-chip.success {
    background: rgba(var(--accent-green-rgb, 34, 197, 94), 0.15);
    color: var(--accent-green);
    border-color: transparent;
}
.header__ctx-chip.warning {
    background: rgba(var(--accent-red-rgb, 239, 68, 68), 0.15);
    color: var(--accent-red);
    border-color: transparent;
}
.header__ctx-chip.error {
    background: var(--accent-red);
    color: white;
    border-color: transparent;
}

/* ======================================================
   ADMIN MODAL — PROFISSIONAL
   ====================================================== */

.admin-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--surface);
    flex-shrink: 0;
}

.admin-header__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-header__icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.admin-header__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.admin-header__subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Abas scrolláveis no mobile */
.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--surface);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    padding: 0 1rem;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s, border-color 0.18s;
}

.admin-tab i { font-size: 0.9rem; }

.admin-tab:hover { color: var(--text-primary); }

.admin-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.admin-tab-content {
    display: none;
    padding: 1.25rem 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.admin-tab-content.active { display: block; }

/* Toolbar de admin (search + botão) */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
    flex-wrap: wrap;
}

.admin-search > i {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Cards de stat com cores */
.admin-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    border-top: 3px solid var(--surface);
}

.admin-stat-card i { font-size: 1.25rem; color: var(--accent-purple); }
.admin-stat-card--purple { border-top-color: var(--accent-purple); }
.admin-stat-card--purple i { color: var(--accent-purple); }
.admin-stat-card--green { border-top-color: #22c55e; }
.admin-stat-card--green i { color: #22c55e; }
.admin-stat-card--red { border-top-color: #ef4444; }
.admin-stat-card--red i { color: #ef4444; }
.admin-stat-card--orange { border-top-color: #f97316; }
.admin-stat-card--orange i { color: #f97316; }
.admin-stat-card--blue { border-top-color: var(--accent-blue); }
.admin-stat-card--blue i { color: var(--accent-blue); }
.admin-stat-card--pink { border-top-color: #ec4899; }
.admin-stat-card--pink i { color: #ec4899; }
.admin-stat-card--cyan { border-top-color: #06b6d4; }
.admin-stat-card--cyan i { color: #06b6d4; }
.admin-stat-card--yellow { border-top-color: #f59e0b; }
.admin-stat-card--yellow i { color: #f59e0b; }

.admin-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: block;
}

.admin-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Paginação */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Tabela admin */
.admin-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.admin-table { width: 100%; border-collapse: collapse; min-width: 520px; }

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
    border-bottom: 2px solid var(--surface);
}

.admin-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--surface);
    font-size: 0.85rem;
    vertical-align: middle;
}

.admin-table tr:hover td { background: var(--surface); }

.user-name-cell {
    font-weight: 500;
    max-width: 120px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Analytics */
.analytics-section { margin-top: 1.5rem; }
.analytics-section h4 { margin-bottom: 1rem; font-size: 0.95rem; color: var(--text-secondary); }
.admin-analytics-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem; }

.usage-bars { display: flex; flex-direction: column; gap: 0.75rem; }
.usage-bar-item { display: flex; align-items: center; gap: 0.75rem; }
.usage-bar-label { width: 90px; font-size: 0.82rem; color: var(--text-secondary); flex-shrink: 0; }
.usage-bar-track { flex: 1; height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--accent-purple); border-radius: 4px; transition: width 0.6s ease; }
.usage-bar-fill--blue { background: var(--accent-blue); }
.usage-bar-fill--green { background: #22c55e; }
.usage-bar-fill--orange { background: #f97316; }
.usage-bar-val { width: 40px; text-align: right; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }

/* Alertas layout */
.admin-alerts-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.admin-alerts-layout h4 { font-size: 0.9rem; margin-bottom: 1rem; }
.admin-alerts-list-panel { max-height: 400px; overflow-y: auto; }

@media (max-width: 600px) {
    .admin-alerts-layout { grid-template-columns: 1fr; }
}

/* Feedback */
.admin-feedback-list { display: flex; flex-direction: column; gap: 1rem; }

.feedback-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.feedback-item__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.feedback-item__type {
    background: var(--accent-purple);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.feedback-item__user { font-size: 0.8rem; color: var(--text-secondary); margin-left: auto; }
.feedback-item__date { font-size: 0.75rem; color: var(--text-tertiary); }
.feedback-item__message { font-size: 0.87rem; margin-bottom: 0.75rem; }
.feedback-item__reply {
    background: var(--surface);
    border-left: 3px solid var(--accent-purple);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.feedback-item__actions { display: flex; gap: 0.5rem; }

/* Apostilas admin grid */
.admin-apostilas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.admin-apostilas-info { margin-bottom: 1rem; }

.apostila-admin-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.apostila-admin-card__header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.apostila-admin-card__icon {
    width: 36px;
    height: 36px;
    background: rgba(239,68,68,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    flex-shrink: 0;
}
.apostila-admin-card__meta { flex: 1; overflow: hidden; }
.apostila-admin-card__title { display: block; font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apostila-admin-card__cat { font-size: 0.72rem; color: var(--text-secondary); }
.apostila-admin-card__desc { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.apostila-admin-card__path { display: block; font-size: 0.7rem; color: var(--accent-blue); word-break: break-all; margin-bottom: 0.75rem; }
.apostila-admin-card__actions { display: flex; gap: 0.5rem; }

/* Questões admin */
.admin-questions-info { margin-bottom: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.admin-flashcards-info { margin-bottom: 1rem; }

/* Botão extra sm */
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn--block { width: 100%; }

/* Status badge extras */
.status-badge.active { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-badge.inactive { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-badge.info { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.status-badge.warning { background: rgba(249,115,22,0.15); color: #f97316; }

/* ======================================================
   USER STATS — METAS E EVOLUÇÃO
   ====================================================== */

.stats__goals-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.stats__goal-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 0.9rem;
}

.stats__goal-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-purple);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.stats__goal-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.stats__goal-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
#pageTitle {
    display: none !important;
}

/* =====================================================
   NOVOS ESTILOS — CHAT, POMODORO, FAVORITOS, NOTIF
   ===================================================== */

/* ===== SEÇÃO FAVORITOS / REVISÃO ===== */
.favorites-section, .revisao-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.favorites-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.favorites-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.4;
}
.favorites-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.fav-question-card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.fav-question-card__num {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-purple);
    background: rgba(139,92,246,0.12);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}
.fav-question-card__text {
    flex: 1;
    font-size: 0.87rem;
    line-height: 1.4;
    color: var(--text-primary);
}
.fav-question-card__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
.fav-question-card__actions button {
    background: none;
    border: 1px solid var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.fav-question-card__actions button:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}
.revisao-stats-banner {
    background: var(--gradient-1);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}
.revisao-stats-banner i { font-size: 1.5rem; opacity: 0.9; }
.revisao-stats-banner strong { font-size: 1.1rem; display: block; }
.revisao-stats-banner span { font-size: 0.85rem; opacity: 0.85; }

/* ===== POMODORO WIDGET (FLUTUANTE) ===== */
.pomodoro-btn {
    position: fixed;
    right: 1.25rem;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 1rem);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 800;
    box-shadow: 0 4px 20px rgba(139,92,246,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}
.pomodoro-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(139,92,246,0.6); }
.pomodoro-btn.active { background: var(--accent-red); box-shadow: 0 4px 20px rgba(239,68,68,0.5); }
.pomodoro-btn .pom-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
@media (min-width: 1025px) {
    .pomodoro-btn { bottom: 1.25rem; }
}

.pomodoro-panel {
    position: fixed;
    right: 1.25rem;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 70px);
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 800;
    overflow: hidden;
    display: none;
    animation: slideUp 0.2s ease;
}
.pomodoro-panel.open { display: block; }
@media (min-width: 1025px) {
    .pomodoro-panel { bottom: 80px; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pomodoro-panel__header {
    background: var(--gradient-1);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}
.pomodoro-panel__header strong { font-size: 0.95rem; }
.pomodoro-panel__header span { font-size: 0.75rem; opacity: 0.85; }
.pomodoro-panel__close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    opacity: 0.8;
}
.pomodoro-panel__close:hover { opacity: 1; }
.pomodoro-panel__body { padding: 1rem; }
.pom-mode-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}
.pom-mode-tab {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    color: var(--text-secondary);
    transition: var(--transition);
}
.pom-mode-tab.active {
    background: var(--bg-secondary);
    color: var(--accent-purple);
    box-shadow: var(--shadow-sm);
}
.pom-timer-display {
    text-align: center;
    margin: 0.75rem 0;
}
.pom-timer-clock {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    line-height: 1;
}
.pom-timer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
.pom-timer-bar {
    height: 4px;
    background: var(--surface);
    border-radius: 10px;
    margin: 0.75rem 0;
    overflow: hidden;
}
.pom-timer-bar-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 0.5s linear;
    width: 100%;
}
.pom-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.pom-controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}
.pom-btn-play { background: var(--gradient-1); color: white; }
.pom-btn-play:hover { transform: scale(1.1); }
.pom-btn-reset { background: var(--surface); color: var(--text-secondary); }
.pom-btn-reset:hover { background: var(--surface-hover); }
.pom-btn-skip { background: var(--surface); color: var(--text-secondary); }
.pom-btn-skip:hover { background: var(--surface-hover); }
.pom-sessions {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.pom-session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface);
    transition: var(--transition);
}
.pom-session-dot.done { background: var(--accent-purple); }
.pom-daily-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.pom-daily-info strong { color: var(--text-primary); }
.pom-settings-toggle {
    width: 100%;
    background: none;
    border: 1px solid var(--surface);
    border-radius: var(--radius-md);
    padding: 0.4rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.pom-settings-toggle:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.pom-settings {
    margin-top: 0.75rem;
    border-top: 1px solid var(--surface);
    padding-top: 0.75rem;
    display: none;
}
.pom-settings.open { display: block; }
.pom-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.pom-setting-row input[type="number"] {
    width: 52px;
    padding: 0.3rem 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: center;
}

/* ===== NOTIFICAÇÃO BELL ===== */
.header__notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.header__notif-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
    display: none;
    animation: fadeDown 0.15s ease;
}
.notif-dropdown.open { display: block; }
@media (max-width: 400px) {
    .notif-dropdown { right: -70px; width: 290px; }
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.notif-dropdown__header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
}
.notif-dropdown__mark-all {
    background: none;
    border: none;
    color: var(--accent-purple);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}
.notif-dropdown__list { max-height: 340px; overflow-y: auto; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--surface);
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-tertiary); }
.notif-item.unread { background: rgba(139,92,246,0.06); }
.notif-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.notif-item__icon--mention { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.notif-item__icon--reply  { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.notif-item__icon--update { background: rgba(249,115,22,0.15); color: var(--accent-orange); }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.15rem; }
.notif-item__content { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item__time { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 0.15rem; }
.notif-dropdown__empty { padding: 2rem; text-align: center; color: var(--text-tertiary); font-size: 0.85rem; }

/* ===== CHAT ===== */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 400px;
    gap: 0;
}
@media (max-width: 1024px) {
    .chat-layout { height: calc(100vh - 190px); }
}
.chat-channels {
    display: flex;
    gap: 0.4rem;
    padding: 0 0 0.75rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.chat-channels::-webkit-scrollbar { display: none; }
.chat-channel-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    background: var(--surface);
    border: 1.5px solid transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-channel-tab:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.chat-channel-tab.active {
    background: rgba(139,92,246,0.12);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}
.chat-channel-tab.admin-only { border-color: var(--accent-orange); }
.chat-channel-tab.admin-only.active { background: rgba(245,158,11,0.12); color: var(--accent-orange); border-color: var(--accent-orange); }
.chat-channel-tab i { font-size: 0.75rem; }
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid var(--surface);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}
.chat-loading, .chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.88rem;
}
.chat-empty i { font-size: 2.5rem; opacity: 0.3; }
.chat-msg {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    max-width: 100%;
    animation: msgIn 0.15s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.own { flex-direction: row-reverse; }
.chat-msg__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.chat-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg__body { flex: 1; min-width: 0; max-width: 80%; }
.chat-msg.own .chat-msg__body { align-items: flex-end; display: flex; flex-direction: column; }
.chat-msg__header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}
.chat-msg.own .chat-msg__header { flex-direction: row-reverse; }
.chat-msg__name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-purple);
}
.chat-msg__name.admin-name { color: var(--accent-orange); }
.chat-msg__time { font-size: 0.65rem; color: var(--text-tertiary); }
.chat-msg__edited { font-size: 0.6rem; color: var(--text-tertiary); font-style: italic; }
.chat-msg__reply-preview {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-purple);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    max-width: 100%;
}
.chat-msg__reply-preview span { color: var(--accent-purple); font-weight: 600; }
.chat-msg__bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.45;
    position: relative;
    max-width: 100%;
}
.chat-msg.own .chat-msg__bubble {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
}
.chat-msg__bubble .mention { color: var(--accent-blue); font-weight: 600; }
.chat-msg.own .chat-msg__bubble .mention { color: rgba(255,255,255,0.9); font-weight: 700; }
.chat-msg__actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.3rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.chat-msg:hover .chat-msg__actions { opacity: 1; }
.chat-msg__actions button {
    background: none;
    border: 1px solid var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.68rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.chat-msg__actions button:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.chat-msg__actions .del-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }
.chat-msg__reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.3rem;
}
.reaction-pill {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--surface);
    border-radius: 12px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}
.reaction-pill:hover, .reaction-pill.own { border-color: var(--accent-purple); background: rgba(139,92,246,0.1); }
.reaction-picker {
    display: flex;
    gap: 0.3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    position: absolute;
    z-index: 1200;
    box-shadow: var(--shadow-lg);
    animation: fadeDown 0.1s ease;
}
.reaction-picker button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: transform 0.1s;
    line-height: 1;
}
.reaction-picker button:hover { transform: scale(1.3); }

/* Animação de reação na tela */
.reaction-float {
    position: fixed;
    pointer-events: none;
    font-size: 2.5rem;
    z-index: 9999;
    animation: floatUp 1.2s ease forwards;
}
@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    80%  { opacity: 0.8; transform: translateY(-120px) scale(1.3); }
    100% { opacity: 0; transform: translateY(-180px) scale(0.8); }
}

/* Chat input area */
.chat-input-area {
    padding: 0.75rem 0 0 0;
    flex-shrink: 0;
}
.chat-reply-preview {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--surface);
    border-bottom: none;
}
.chat-reply-preview strong { color: var(--accent-purple); }
.chat-reply-preview button { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 0.9rem; }
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
}
.chat-input-row:focus-within { border-color: var(--accent-purple); }
.chat-input-row.has-reply { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.chat-input-row input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.chat-input-row input::placeholder { color: var(--text-tertiary); }
.chat-input-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input-btn:hover { color: var(--accent-purple); }
.chat-send-btn {
    background: var(--gradient-1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.08); }
.chat-login-bar {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.83rem;
    color: var(--text-secondary);
    border: 1px dashed var(--surface);
}
.chat-login-bar a { color: var(--accent-purple); font-weight: 600; text-decoration: none; }

/* Emoji picker */
.emoji-picker-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    z-index: 1200;
    box-shadow: var(--shadow-lg);
    width: 280px;
    animation: fadeDown 0.15s ease;
}
.emoji-picker-panel.open { display: grid; }
.emoji-picker-panel button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: transform 0.1s;
    line-height: 1;
}
.emoji-picker-panel button:hover { transform: scale(1.3); background: var(--bg-tertiary); }
/* Em telas pequenas, o picker usa posição fixa para não sair da tela */
@media (max-width: 480px) {
    .emoji-picker-panel {
        position: fixed;
        bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 60px);
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-height: 200px;
        overflow-y: auto;
    }
}

/* Admin canal chat */
.chat-admin-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

/* ===== PERFIL — FOTO + TROCA DE SENHA ===== */
.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}
.profile-avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}
.profile-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    overflow: hidden;
}
.profile-avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-upload-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    background: var(--accent-purple);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar-info strong { display: block; font-size: 1rem; margin-bottom: 0.2rem; }
.profile-avatar-info span { font-size: 0.8rem; color: var(--text-secondary); }

/* ===== PARCEIROS / ANUNCIANTES (ADMIN + USUÁRIO) ===== */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.partner-card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}
.partner-card:hover { border-color: var(--accent-purple); transform: translateY(-2px); }
.partner-card__logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.5rem;
}
.partner-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.partner-card__name { font-weight: 600; font-size: 0.88rem; }
.partner-card__desc { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.3; }
.partner-card.youtube .partner-card__logo { background: rgba(239,68,68,0.1); color: #ef4444; }

/* Admin partners table */
.admin-partner-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--surface);
}
.admin-partner-row:last-child { border-bottom: none; }
.admin-partner-type-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}
.admin-partner-type-badge.anunciante { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.admin-partner-type-badge.parceiro   { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.admin-partner-type-badge.youtube    { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ===== CONFIRMAÇÃO INLINE DE EDIÇÃO NO CHAT ===== */
.chat-edit-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--accent-purple);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    resize: none;
}
.chat-edit-btns {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.3rem;
}
.chat-edit-btns button {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}
.chat-edit-save { background: var(--accent-purple); color: white; }
.chat-edit-cancel { background: var(--surface); color: var(--text-secondary); }

/* Revisão de erros — seção no questoes */
.revisao-list { display: flex; flex-direction: column; gap: 0.5rem; }
.revisao-q-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(239,68,68,0.3);
    border-left: 3px solid var(--accent-red);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.revisao-q-card button {
    background: none;
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}
.revisao-q-card button:hover { background: var(--accent-purple); color: white; }

/* ===== SETTINGS — NOVOS CARDS ===== */
.settings__card--danger { border-color: rgba(239,68,68,0.3); }
.settings__card--danger h3 { color: var(--accent-red); }

/* ===== MODAL REVISÃO DE QUESTÃO ===== */
/* Pode ser aberto por cima de outro modal já ativo (ex: resultado do
   simulado), então precisa de um z-index maior pra não ficar escondido atrás. */
#questionReviewModal {
    z-index: 10000;
}
#questionReviewModal .modal__content {
    max-height: 85vh;
    overflow-y: auto;
}
#questionReviewOptions button {
    width: 100%;
    text-align: left;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--surface);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
#questionReviewOptions button:hover:not(:disabled) {
    border-color: var(--accent-purple);
    background: rgba(139,92,246,0.06);
}

/* Responsivo geral para novas funcionalidades */
@media (max-width: 600px) {
    .pomodoro-panel { width: calc(100vw - 2.5rem); right: 1.25rem; }
    .chat-msg__bubble { font-size: 0.84rem; }
    .notif-dropdown { width: 280px; }
    .partners-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== SECTION PARTNERS BANNER ===== */
.section-partners-banner {
    margin-top: 2rem;
}
.partners-banner-inner {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--surface);
    background: var(--bg-secondary);
    max-width: 860px;   /* não estica demais em telas largas */
    margin-left: auto;
    margin-right: auto;
}

/* Label de seção (Parceiros / Outros Mundos) */
.pb-ads-label, .pb-yt-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    padding: 0.6rem 1rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.pb-yt-label .fab { color: #ef4444; }
.pb-ads-label .fas { color: var(--accent-purple); }

/* Bloco de anúncios */
.pb-ads-section {
    padding-bottom: 0.6rem;
}

/* Imagem de banner retangular — proporção fixa, sem distorção */
.pb-banner-link {
    display: block;
    margin: 0 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
    transition: opacity 0.2s, box-shadow 0.2s;
    line-height: 0;
    /* Proporção fixa: ideal para banners horizontais (aprox 6:1) */
    width: calc(100% - 2rem);
    aspect-ratio: 6 / 1;
    min-height: 60px;
}
.pb-banner-link:hover { opacity: 0.92; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.pb-banner-img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* sem corte — toda a imagem visível */
    display: block;
}
.pb-banner-placeholder {
    width: 100%;
    height: 100%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
}

/* Carrossel — mesma proporção que o banner simples */
.pb-carousel {
    position: relative;
    margin: 0 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
    width: calc(100% - 2rem);
    aspect-ratio: 6 / 1;
    min-height: 60px;
}
.pb-carousel-item {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
    line-height: 0;
}
.pb-carousel-item.active {
    opacity: 1;
    pointer-events: auto;
}
.pb-carousel-item .pb-banner-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: none;
}
.pb-carousel-item .pb-banner-placeholder {
    height: 100%;
}

/* YouTube channels row */
.pb-yt-section {
    border-top: 1px solid var(--surface);
    padding-bottom: 0.75rem;
}
.pb-yt-scroll {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 1rem 0.1rem;
    scroll-behavior: smooth;
}
.pb-yt-scroll::-webkit-scrollbar { display: none; }
.pb-yt-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    flex-shrink: 0;
    width: 58px;
    transition: transform 0.2s;
}
.pb-yt-channel:hover { transform: translateY(-2px); }
.pb-yt-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(239,68,68,0.3);
    flex-shrink: 0;
}
.pb-yt-logo img { width: 100%; height: 100%; object-fit: cover; }
.pb-yt-initial {
    font-size: 1rem;
    font-weight: 700;
    color: #ef4444;
}
.pb-yt-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    width: 58px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Admin: lista de parceiros */
.admin-partner-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: 0.4rem;
    border: 1px solid var(--surface);
}
.admin-partner-type-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    font-weight: 600;
    flex-shrink: 0;
}
.admin-partner-type-badge.anunciante { background: rgba(59,130,246,0.15); color: #3b82f6; }
.admin-partner-type-badge.parceiro   { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.admin-partner-type-badge.youtube    { background: rgba(239,68,68,0.15); color: #ef4444; }

@media (max-width: 480px) {
    .pb-banner-link,
    .pb-carousel { margin: 0 0.6rem; min-height: 46px; max-height: 72px; }
    .pb-yt-logo { width: 38px; height: 38px; }
    .pb-yt-channel { width: 50px; }
    .pb-yt-name { width: 50px; font-size: 0.6rem; }
    .pb-ads-label, .pb-yt-label { padding: 0.45rem 0.75rem 0.2rem; }
    .pb-yt-scroll { padding: 0 0.6rem 0.1rem; }
}































