/* ==========================================================================
   PORTAL AVA - DESIGN SYSTEM & STYLES
   Modern Glassmorphism & High-End EdTech Experience
   ========================================================================== */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --secondary-light: #ecfeff;

    --accent: #f59e0b;
    --accent-light: #fef3c7;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --bg-dark: #0f172a;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 30px -10px rgba(79, 70, 229, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   LOGIN SCREEN STYLING
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.08) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(248, 250, 252, 1) 100%), #f8fafc;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.login-bg-decor {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.login-bg-decor-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    transition: var(--transition);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.login-brand-logo {
    max-height: 56px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
}

.login-brand-icon-box {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px var(--primary-glow);
    margin-bottom: 16px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.brand-badge svg {
    width: 16px;
    height: 16px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn-primary {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #312e81 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--border-subtle);
    border-color: #cbd5e1;
    color: var(--primary);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   PORTAL DASHBOARD NAVBAR & HEADER
   ========================================================================== */
.portal-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 32px;
    box-sizing: border-box;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon-box {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-logo-img {
    max-height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: inline-block;
    vertical-align: middle;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* GRUPOS DE NAVEGAÇÃO NA NAVBAR */
.nav-group-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-student {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-admin {
    position: relative;
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
}

/* BOTÕES DE NAVEGAÇÃO */
.btn-nav-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-nav-action:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-nav-action.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.2);
}

.btn-ava-link {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.btn-ava-link:hover {
    background: #e0e7ff;
    box-shadow: var(--shadow-sm);
}

/* DROPDOWN DE ADMINISTRAÇÃO */
.admin-dropdown-container {
    position: relative;
}

.btn-admin-dropdown-toggle {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid rgba(79, 70, 229, 0.25);
    color: var(--primary);
    font-weight: 700;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-admin-dropdown-toggle:hover,
.admin-dropdown-container.open .btn-admin-dropdown-toggle {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.admin-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
}

.admin-role-tag {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
    border-radius: var(--radius-full);
}

.dropdown-chevron-icon {
    transition: transform 0.2s ease;
}

.admin-dropdown-container.open .dropdown-chevron-icon {
    transform: rotate(180deg);
}

.admin-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 8px;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-dropdown-container.open .admin-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.admin-dropdown-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 6px;
}

.admin-dropdown-header-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.admin-dropdown-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.admin-dropdown-item:hover {
    background: var(--primary-light);
    transform: translateX(3px);
}

.admin-dropdown-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.admin-dropdown-item:hover .admin-dropdown-item-icon {
    background: var(--primary);
    color: #ffffff;
}

.admin-dropdown-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-dropdown-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.admin-dropdown-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.2;
}

.admin-item-arrow {
    color: var(--text-light);
    opacity: 0;
    transform: translateX(-4px);
    transition: var(--transition);
}

.admin-dropdown-item:hover .admin-item-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary);
}

/* PERFIL DO USUÁRIO */
.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    background: var(--border-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.25);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.badge-role-admin {
    color: #6366f1;
}

.badge-role-student {
    color: #059669;
}

.btn-logout {
    color: var(--danger);
    background: transparent;
}

.btn-logout:hover {
    background: var(--danger-light);
}

/* ==========================================================================
   BARRA DE ACESSO RÁPIDO DO ADMINISTRADOR NO DASHBOARD
   ========================================================================== */
.admin-quick-bar {
    background: linear-gradient(90deg, #1e1b4b 0%, #1e293b 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    color: #ffffff;
}

.admin-quick-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-quick-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-quick-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.35);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e0e7ff;
}

.admin-quick-text {
    font-size: 0.88rem;
    color: #e2e8f0;
}

.admin-quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-quick-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-quick-admin-action:hover {
    background: #ffffff;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   DASHBOARD HERO BANNER
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e293b 100%);
    color: #ffffff;
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    top: -300px;
    right: 5%;
    border-radius: 50%;
    pointer-events: none;
}

.hero-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 32px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.hero-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.hero-content p {
    color: #cbd5e1;
    font-size: 1.05rem;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 16px;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue {
    background: rgba(79, 70, 229, 0.3);
    color: #818cf8;
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.3);
    color: #67e8f9;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* ==========================================================================
   MAIN CONTENT & TABS
   ========================================================================== */
.main-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 28px 32px 60px;
    box-sizing: border-box;
    flex: 1;
}

.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn .badge-count {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    background: #cbd5e1;
    color: var(--text-main);
}

.tab-btn.active .badge-count {
    background: var(--primary-light);
    color: var(--primary);
}

.search-box {
    position: relative;
    min-width: 280px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: #ffffff;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* ==========================================================================
   COURSES GRID & CARDS (COMPACT & MODERN)
   ========================================================================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.course-card-cover,
.course-card-header {
    height: 125px;
    position: relative;
    background: #0f172a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-card-cover.has-custom-img {
    background: #0f172a;
}

.course-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-card:hover .course-cover-img {
    transform: scale(1.06);
}

.course-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.6) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Ilustração de Engrenagens e Equipamentos Técnicos (Fallback) */
.gear-fallback-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gear-fallback-wrapper.card-color-1 { background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%); }
.gear-fallback-wrapper.card-color-2 { background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 50%, #38bdf8 100%); }
.gear-fallback-wrapper.card-color-3 { background: linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%); }
.gear-fallback-wrapper.card-color-4 { background: linear-gradient(135deg, #78350f 0%, #d97706 50%, #f59e0b 100%); }
.gear-fallback-wrapper.card-color-5 { background: linear-gradient(135deg, #581c87 0%, #7c3aed 50%, #c084fc 100%); }

.gear-svg-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.course-card:hover .gear-svg-illustration {
    transform: scale(1.05);
}

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

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

.gear-rot-slow {
    transform-origin: center;
    animation: gearSpinSlow 36s linear infinite;
}

.gear-rot-rev {
    transform-origin: center;
    animation: gearSpinRev 24s linear infinite;
}

/* 3 Itens Metadados Abaixo da Imagem */
.course-meta-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px 0;
    flex-wrap: wrap;
}

.category-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

.status-tag.enrolled {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-tag.available {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.course-shortcode-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.2px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.course-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.45;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-light);
    gap: 8px;
    flex-wrap: wrap;
}

.course-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-actions {
    display: flex;
    gap: 8px;
}

.btn-card-action {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.btn-card-access {
    background: var(--primary);
    color: #ffffff;
}

.btn-card-access:hover {
    background: var(--primary-hover);
}

.btn-card-enrol {
    background: var(--secondary-light);
    color: var(--secondary-hover);
    border: 1.5px solid #a5f3fc;
}

.btn-card-enrol:hover {
    background: var(--secondary);
    color: #ffffff;
    border-color: var(--secondary);
}

/* ==========================================================================
   EMPTY STATE & SKELETON
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    grid-column: 1 / -1;
}

.empty-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto 20px;
}

/* ==========================================================================
   FOOTER GERENCIÁVEL
   ========================================================================== */
.portal-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: auto;
    font-size: 0.875rem;
}

.footer-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
}

.footer-col-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-copyright {
    font-weight: 600;
    color: var(--text-main);
}

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

.footer-col-right {
    display: flex;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 32px 0;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-nav {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   WIDGET DE CHAT FLUTUANTE AVA
   ========================================================================== */
.ava-chat-widget-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Botão Flutuante */
.ava-chat-toggle-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ava-chat-toggle-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.55);
}

.ava-chat-toggle-btn.active {
    background: #1e293b;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

.chat-toggle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    letter-spacing: 0.5px;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Janela do Chat */
.ava-chat-box {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Cabeçalho do Chat */
.chat-box-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-bot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.chat-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.chat-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-top: 2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-chat-action {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-chat-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Corpo de Mensagens */
.chat-box-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 0.875rem;
}

.chat-msg-bot, .chat-msg-user {
    display: flex;
    flex-direction: column;
    animation: fadeInMsg 0.25s ease-out;
}

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

.chat-msg-user {
    align-items: flex-end;
}

.chat-msg-bot {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 86%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-bubble p {
    margin: 0 0 8px 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.bot-bubble {
    background: #ffffff;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.user-bubble {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Tópicos no Chat */
.chat-topics-wrapper {
    margin-top: 4px;
}

.topics-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.topics-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-card {
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
}

.topic-header {
    margin-bottom: 4px;
}

.topic-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-block;
}

.badge-ai {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
}

.badge-qa {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.topic-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.topic-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Perguntas P&R em botões */
.qa-questions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.qa-question-btn {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.qa-question-btn:hover {
    background: var(--primary-light);
    border-color: #c7d2fe;
}

.qa-answer-box {
    background: #f8fafc;
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.ai-response-content {
    position: relative;
}

.ai-badge-reply {
    font-size: 0.65rem;
    font-weight: 800;
    color: #9333ea;
    background: #f3e8ff;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.btn-chat-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: var(--transition);
}

.btn-chat-back:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.qa-followup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Indicador de Digitação */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingPulse 1.2s infinite ease-in-out;
}

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

@keyframes typingPulse {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Área de Input do Chat */
.chat-box-input-area {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.chat-input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   PAINÉIS ADMINISTRATIVOS (CONFIGURAÇÃO & RELATÓRIOS)
   ========================================================================== */
.btn-admin-shortcut {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.btn-admin-shortcut:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.admin-header-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 36px 0;
}

.admin-header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.admin-header-section h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.admin-header-section p {
    color: #94a3b8;
    font-size: 0.95rem;
    max-width: 720px;
    margin: 0;
}

/* Cards de Configuração */
.config-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.config-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.config-card-header.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.config-section-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-section-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.config-section-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.config-card-body {
    padding: 24px;
}

.toggle-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.switch-card:hover {
    border-color: var(--primary);
    background: #f0f4ff;
}

.switch-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-content strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.switch-content span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.custom-switch {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Configuração de Tópicos */
.topics-config-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topic-config-box {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.topic-box-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topic-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-topic-type {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.btn-remove-topic {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-remove-topic:hover {
    background: var(--danger-light);
}

.topic-box-body {
    padding: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

/* Editor de Perguntas e Respostas */
.qa-editor-area {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #cbd5e1;
}

.qa-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.qa-editor-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.qa-items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-item-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.qa-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-remove-qa {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-remove-qa:hover {
    background: #fca5a5;
}

.ai-info-box {
    margin-top: 16px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    padding: 14px 18px;
}

.ai-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6d28d9;
    font-size: 0.85rem;
}

.config-submit-bar {
    position: sticky;
    bottom: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 30px;
    z-index: 100;
}

/* ==========================================================================
   CARDS DE INDICADORES (KPI) & RELATÓRIOS
   ========================================================================== */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.blue .kpi-icon { background: #eff6ff; color: #2563eb; }
.kpi-card.green .kpi-icon { background: #ecfdf5; color: #059669; }
.kpi-card.purple .kpi-icon { background: #f5f3ff; color: #7c3aed; }
.kpi-card.amber .kpi-icon { background: #fffbeb; color: #d97706; }

.kpi-data {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 2px 0 4px 0;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: #64748b;
}

/* Tabela de Relatórios */
.report-table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.report-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: #fafafa;
}

.report-card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-main);
}

.report-card-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.report-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
}

.report-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.report-data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    vertical-align: middle;
}

.report-data-table tr:hover td {
    background: #f8fafc;
}

.student-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-avatar-mini {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-user-login {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-count-courses {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
}

.status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-block;
}

.status-pill.active { background: #dcfce7; color: #15803d; }
.status-pill.suspended { background: #fee2e2; color: #b91c1c; }

.badge-access {
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-access.recent { color: #059669; font-weight: 700; }
.badge-access.week { color: #2563eb; }
.badge-access.older { color: #64748b; }
.badge-access.never { color: #dc2626; font-style: italic; font-weight: 500; }

/* ==========================================================================
   PAINEL LATERAL DE ACESSIBILIDADE WCAG / e-MAG & ATALHOS
   ========================================================================== */
.a11y-floating-wrapper {
    position: fixed;
    top: 45%;
    left: 0;
    transform: translateY(-50%);
    z-index: 9990;
}

.a11y-floating-trigger {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-left: none;
    border-radius: 0 16px 16px 0;
    padding: 14px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.a11y-floating-trigger:hover {
    padding-right: 15px;
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    box-shadow: 6px 0 25px rgba(79, 70, 229, 0.4);
}

.a11y-trigger-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c7d2fe;
}

/* BACKDROP OVERLAY */
.a11y-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9995;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.a11y-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* GAVETA / DRAWER LATERAL */
.a11y-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 100vh;
    background: #ffffff;
    box-shadow: 12px 0 45px rgba(0, 0, 0, 0.25);
    z-index: 9998;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.a11y-sidebar-drawer.open {
    transform: translateX(0);
}

.a11y-drawer-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.a11y-drawer-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.a11y-drawer-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a11y-drawer-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

.a11y-drawer-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}

.btn-a11y-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-a11y-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.a11y-drawer-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 1;
}

.a11y-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-quick-skip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    transition: var(--transition);
}

.a11y-quick-skip:hover, .a11y-quick-skip:focus {
    background: var(--primary-light);
    border-color: var(--primary);
}

.a11y-btn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.a11y-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition);
}

.a11y-action-btn .a11y-icon-symbol {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary);
}

.a11y-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.a11y-action-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.a11y-action-btn.active .a11y-icon-symbol {
    color: #ffffff;
}

.a11y-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.a11y-feature-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.a11y-feature-card:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.a11y-feature-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.a11y-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.a11y-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.a11y-card-icon.contrast { background: #fef08a; color: #854d0e; }
.a11y-card-icon.dark { background: #e2e8f0; color: #0f172a; }
.a11y-card-icon.reading { background: #e0e7ff; color: #4338ca; }
.a11y-card-icon.dyslexia { background: #fce7f3; color: #9d174d; }

.a11y-card-text {
    display: flex;
    flex-direction: column;
}

.a11y-card-text strong {
    font-size: 0.88rem;
    color: var(--text-main);
}

.a11y-card-text span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.a11y-status-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    transition: var(--transition);
    flex-shrink: 0;
}

.a11y-feature-card.active .a11y-status-indicator {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.btn-a11y-reset {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-a11y-reset:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.a11y-save-notice {
    font-size: 0.72rem;
    color: #64748b;
    text-align: center;
    margin-top: 10px;
}

/* MODOS DE ACESSIBILIDADE */
html.high-contrast {
    filter: contrast(140%);
}

html.high-contrast body {
    background-color: #000000 !important;
    color: #ffffff !important;
}

html.high-contrast .portal-navbar,
html.high-contrast .admin-card,
html.high-contrast .course-card,
html.high-contrast .login-card,
html.high-contrast .stat-badge,
html.high-contrast .controls-bar,
html.high-contrast .a11y-sidebar-drawer {
    background: #121212 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

html.high-contrast a,
html.high-contrast .btn-primary,
html.high-contrast .btn-card-action {
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

html.high-contrast .btn-primary {
    background: #ffff00 !important;
    color: #000000 !important;
    font-weight: 900 !important;
}

html.theme-dark body {
    background-color: #0b0f19 !important;
    color: #f1f5f9 !important;
}

html.theme-dark .portal-navbar,
html.theme-dark .a11y-sidebar-drawer {
    background: #111827 !important;
    border-color: #1f2937 !important;
}

html.theme-dark .portal-navbar .brand-title,
html.theme-dark .user-name {
    color: #f8fafc !important;
}

html.theme-dark .course-card,
html.theme-dark .admin-card,
html.theme-dark .login-card,
html.theme-dark .stat-badge,
html.theme-dark .controls-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .a11y-action-btn,
html.theme-dark .a11y-feature-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .a11y-card-text strong {
    color: #ffffff !important;
}

html.theme-dark .course-title,
html.theme-dark .stat-number,
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3 {
    color: #ffffff !important;
}

html.theme-dark .course-description,
html.theme-dark .stat-label,
html.theme-dark .text-muted {
    color: #94a3b8 !important;
}

html.theme-dark .form-control {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* TAMANHOS DE FONTE DINÂMICOS */
html.font-sm { font-size: 14px; }
html.font-md { font-size: 16px; }
html.font-lg { font-size: 18px; }
html.font-xl { font-size: 20px; }
html.font-2xl { font-size: 22px; }

/* MODO LEITURA */
html.reading-mode body {
    font-family: 'Georgia', 'Times New Roman', serif !important;
    line-height: 1.85 !important;
    letter-spacing: 0.3px !important;
}

/* FONTE PARA DISLEXIA */
html.dyslexia-mode body {
    font-family: 'Comic Sans MS', 'OpenDyslexic', -apple-system, sans-serif !important;
    letter-spacing: 0.8px !important;
    word-spacing: 2px !important;
}

/* ==========================================================================
   BANNER QUICK TOGGLE NO PORTAL
   ========================================================================== */
.banner-quick-control {
    background: transparent;
    padding: 8px 0 0;
}

.banner-quick-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 32px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
}

.btn-banner-toggle {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-banner-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}



/* ==========================================================================
   PAINEL ADMINISTRATIVO DE LAYOUT, CORES E PERFIS
   ========================================================================== */
.admin-layout-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 20px 0 0 0;
    padding: 0 32px 80px;
    box-sizing: border-box;
}

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-header-badge span {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-glow);
}

.admin-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.admin-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.admin-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-main);
    border-color: var(--border-color);
}

.admin-tab-btn.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.admin-tab-btn.active svg {
    stroke: #ffffff;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeInTab 0.25s ease-out;
}

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

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.admin-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.btn-outline-preset {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline-preset:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 44px;
    height: 42px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* MATRIZ DE PERFIS */
.profile-matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.profile-matrix-table th,
.profile-matrix-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.profile-matrix-table th {
    background: var(--bg-main);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.profile-matrix-table .text-center {
    text-align: center;
}

.profile-matrix-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* MENU ITEM ROW */
.menu-item-row {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.menu-col-enabled {
    padding-top: 6px;
}

.menu-col-fields {
    flex: 1;
}

/* ORDEM DOS BLOCOS */
.block-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.block-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-main);
}

.drag-handle {
    color: var(--text-muted);
    cursor: grab;
    font-size: 1.1rem;
}

/* ==========================================================================
   PAINEL DE PRÉ-VISUALIZAÇÃO EM TEMPO REAL (LIVE PREVIEW)
   ========================================================================== */
.preview-card-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    overflow: hidden;
}

.preview-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.preview-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: liveDotPulse 1.6s infinite ease-in-out;
}

@keyframes liveDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
}

.preview-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-preview-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-preview-toggle:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.preview-stage-container {
    margin-top: 18px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.preview-window-frame {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--prev-radius, 12px);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 1. Navbar Simulada */
.sim-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.sim-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-brand-icon {
    width: 34px;
    height: 34px;
    background: var(--prev-primary, #4f46e5);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sim-brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.sim-brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.sim-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-nav-btn {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--text-muted);
}

.sim-nav-btn.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--prev-primary, #4f46e5);
}

.sim-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
}

.sim-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--prev-primary, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
}

/* 2. Hero Banner Simulado */
.sim-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #1e293b 100%);
    color: #ffffff;
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.sim-hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--prev-primary, #4f46e5) 0%, rgba(255,255,255,0) 70%);
    top: -150px;
    right: 0;
    opacity: 0.3;
    pointer-events: none;
}

.sim-hero-content h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.sim-hero-content p {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin: 0;
}

.sim-stat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
}

.sim-stat-icon {
    font-size: 1.2rem;
}

.sim-stat-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.sim-stat-label {
    font-size: 0.68rem;
    color: #94a3b8;
}

/* 3. Seção e Card */
.sim-body-area {
    padding: 20px;
    background: #f8fafc;
}

.sim-tabs-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.sim-tab-item {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.sim-tab-item.active {
    background: #ffffff;
    color: var(--prev-primary, #4f46e5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sim-tab-item:not(.active) {
    color: var(--text-muted);
}

.sim-grid-sample {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sim-course-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--prev-radius, 12px);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.sim-card-cover {
    height: 110px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--prev-primary, #4f46e5) 0%, var(--prev-sec, #06b6d4) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sim-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sim-cat-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    text-transform: uppercase;
}

.sim-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.9);
}

.sim-code {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.9;
}

.sim-card-body {
    padding: 14px;
}

.sim-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.sim-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 12px;
}

.sim-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.sim-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sim-btn-access {
    background: var(--prev-primary, #4f46e5);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
}

/* ==========================================================================
   BOTÃO COMPACTO DE SALVAMENTO À DIREITA
   ========================================================================== */
.admin-save-bar-compact {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.btn-save-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.btn-save-compact:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #312e81 100%);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.55);
}

.btn-save-compact:active {
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
.btn-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 110;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.btn-mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.btn-mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.btn-mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 992px) {
    .btn-mobile-toggle {
        display: flex;
    }

    .navbar-actions {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
        padding: 20px 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        display: none;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .navbar-actions.mobile-open {
        display: flex;
        animation: fadeInMobile 0.25s ease-out;
    }

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

    .nav-group-section {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-group-admin {
        padding-left: 0;
        border-left: none;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
    }

    .btn-nav-action {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .admin-dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid var(--border-subtle);
        background: var(--bg-main);
        margin-top: 8px;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .admin-dropdown-container.open .admin-dropdown-menu {
        display: block;
    }

    .user-profile-menu {
        width: 100%;
        border-radius: var(--radius-md);
        padding: 10px 14px;
    }

    .admin-quick-bar-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-quick-actions {
        width: 100%;
    }

    .btn-quick-admin-action {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   ADMIN 2-COLUMN SPLIT LAYOUT (ABAS À ESQUERDA, VISUALIZAÇÃO À DIREITA)
   ========================================================================== */
.admin-layout-split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(420px, 520px);
    gap: 32px;
    align-items: start;
}

.admin-forms-col {
    min-width: 0;
}

.admin-preview-col-sticky {
    position: sticky;
    top: 75px;
    z-index: 20;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.admin-preview-col-sticky .preview-card-wrapper {
    margin-bottom: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.admin-preview-col-sticky .preview-stage-container {
    margin-top: 12px;
    padding: 14px;
}

.preview-contextual-stage {
    display: none;
}

.preview-contextual-stage.active {
    display: block;
    animation: fadeInTab 0.25s ease-out;
}

@media (max-width: 1200px) {
    .admin-layout-split {
        grid-template-columns: minmax(0, 1fr) 420px;
        gap: 18px;
    }
}

@media (max-width: 992px) {
    .admin-layout-split {
        grid-template-columns: 1fr;
    }
    .admin-preview-col-sticky {
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-top: 24px;
    }
}

/* Miniaturas e Imagens dos Itens de Menu */
.nav-item-custom-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.admin-menu-item-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.admin-menu-item-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.admin-menu-thumb-preview {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-menu-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sim-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sim-nav-btn img,
.sim-nav-btn .nav-item-custom-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 3px;
}

.admin-dropdown-item-icon img,
.admin-dropdown-item-icon .nav-item-custom-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
}

/* ==========================================================================
   CONSOLE DE DIAGNÓSTICO E DEPURAÇÃO (EXCLUSIVO USUÁRIO DK8)
   ========================================================================== */
.dk8-debug-console {
    margin-top: 48px;
    margin-bottom: 24px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    color: #f1f5f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

.dk8-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 12px;
}

.dk8-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dk8-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dk8-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.dk8-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.dk8-console-title {
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.dk8-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.dk8-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.dk8-badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.dk8-badge-info {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.dk8-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.dk8-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dk8-btn-action {
    background: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.dk8-btn-action:hover {
    background: #475569;
    border-color: #64748b;
    color: #ffffff;
}

.dk8-tabs-bar {
    display: flex;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    overflow-x: auto;
}

.dk8-tab-btn {
    padding: 10px 16px;
    background: transparent;
    color: #94a3b8;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.dk8-tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
}

.dk8-tab-btn.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

.dk8-tab-panels {
    padding: 18px;
}

.dk8-tab-panel {
    display: none;
}

.dk8-tab-panel.active {
    display: block;
}

.dk8-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .dk8-grid-2 {
        grid-template-columns: 1fr;
    }
}

.dk8-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.dk8-card h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #38bdf8;
    font-weight: 600;
}

.dk8-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dk8-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #334155;
}

.dk8-table tr:last-child td {
    border-bottom: none;
}

.dk8-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
}

.dk8-list li {
    margin-bottom: 4px;
}

.dk8-text-success { color: #34d399; }
.dk8-text-danger { color: #f87171; }
.dk8-text-warning { color: #fbbf24; }
.dk8-text-muted { color: #94a3b8; }

.dk8-code-box {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 12px;
    font-size: 11px;
    max-height: 280px;
    overflow-y: auto;
    color: #cbd5e1;
    margin: 0;
}

.dk8-log-stream {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    background: #090d16;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #1e293b;
}

.dk8-log-entry {
    font-size: 11px;
    line-height: 1.5;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid #64748b;
}

.dk8-log-entry.dk8-log-db_init { border-left-color: #38bdf8; }
.dk8-log-entry.dk8-log-db_save { border-left-color: #10b981; }
.dk8-log-entry.dk8-log-db_get { border-left-color: #a855f7; }
.dk8-log-entry.dk8-log-db_error,
.dk8-log-entry.dk8-log-db_fatal { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.dk8-log-entry.dk8-log-db_warn { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }

.dk8-log-time {
    color: #64748b;
    margin-right: 6px;
}

.dk8-log-cat {
    color: #38bdf8;
    font-weight: 700;
    margin-right: 6px;
}

.dk8-log-msg {
    color: #e2e8f0;
}

.dk8-log-data {
    margin: 4px 0 0 0;
    font-size: 10px;
    color: #94a3b8;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    border-radius: 4px;
}

/* ==========================================================================
   BOTÃO FLUTUANTE DE SALVAR (CANTO INFERIOR DIREITO)
   ========================================================================== */
.admin-floating-save-bar {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    align-items: center;
    pointer-events: none; /* Apenas o botão recebe cliques */
}

.btn-floating-save {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--primary-hover, #4338ca) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px -3px rgba(79, 70, 229, 0.45), 0 4px 12px -2px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.btn-floating-save:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 32px -4px rgba(79, 70, 229, 0.55), 0 6px 16px -2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary-hover, #4338ca) 0%, var(--primary-color, #4f46e5) 100%);
    color: #ffffff;
}

.btn-floating-save:active {
    transform: translateY(1px) scale(0.98);
}

.btn-floating-save svg {
    flex-shrink: 0;
}

.floating-save-shortcut {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

.btn-floating-save.saving {
    background: #475569 !important;
    cursor: wait !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .admin-floating-save-bar {
        bottom: 16px;
        right: 16px;
    }

    .btn-floating-save {
        padding: 12px 18px;
        font-size: 0.88rem;
    }

    .floating-save-shortcut {
        display: none;
    }
}

