:root {
    --bg-dark: #050507;
    --sidebar-bg: #09090b;
    --card-bg: #121214;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-pink: #ec008c;
    --accent-pink-glow: rgba(236, 0, 140, 0.5);
    --border-color: #27272a;
    --font-heading: 'Inter', sans-serif;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-heading);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header {
    margin-bottom: 2rem;
}

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

.logo-icon ion-icon {
    font-size: 1.5rem;
    color: var(--accent-pink);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text span {
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.logo-text strong {
    font-size: 0.9rem;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2a2a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.user-info strong {
    font-size: 0.9rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-item:hover,
.nav-item.active {
    background-color: #27272a;
    color: var(--text-primary);
}

.nav-item ionic-icon {
    font-size: 1.2rem;
}

.nav-text-group {
    display: flex;
    flex-direction: column;
}

.nav-text-group small {
    font-size: 0.7rem;
    color: #52525b;
}

.spacer {
    flex: 1;
}

.logout {
    margin-top: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-dark);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 3rem 4rem;
    background-color: #050510;
    background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 100px);
    min-height: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    max-width: 60%;
}

.hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.hero-content h1 span {
    background: linear-gradient(90deg, #ff00cc, #ec008c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.hero-visuals {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 1;
}

.models-container {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.models-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    display: block;
}

.glow-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 60% 50%, rgba(236, 0, 140, 0.2), transparent 60%);
    pointer-events: none;
    z-index: 2;
}

/* Mockup Elements */
.stat-card {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 3;
    width: 160px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stat-card small {
    display: block;
    color: #a1a1aa;
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card strong {
    font-size: 1.2rem;
    display: block;
    color: white;
}

.graph-line {
    margin-top: 0.5rem;
    height: 20px;
    width: 100%;
    filter: drop-shadow(0 0 4px #ec008c);
}

.graph-line svg {
    width: 100%;
    height: 100%;
}

.graph-line path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-pill {
    position: absolute;
    bottom: 150px;
    right: 400px;
    background: rgba(15, 15, 15, 0.95);
    padding: 0.6rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid rgba(60, 60, 60, 0.5);
    z-index: 3;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 170, 255, 0.2);
}

.icon-circle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #00aaff, #0055ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.pill-text {
    display: flex;
    flex-direction: column;
}

.pill-text strong {
    font-size: 0.8rem;
}

.pill-text span {
    font-size: 0.7rem;
    color: #00aaff;
}

/* Modules Section */
.modules-section {
    padding: 2rem 4rem;
    background-color: #000;
    min-height: calc(100vh - 400px);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 0.9rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.module-card {
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.module-card:hover {
    transform: translateY(-5px);
}

.card-image {
    aspect-ratio: 9/16;
    border-radius: 12px;
    background-color: #1a1a1a;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block;
    position: relative;
    z-index: 1;
}

.module-card:hover .card-image img {
    transform: scale(1.05);
}

/* Remove placeholder items since we have real images */

/* Overlay style */
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to top, rgba(236, 0, 140, 0.6), transparent 50%);
}

.module-tag {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: #ec008c;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(236, 0, 140, 0.6);
}

.card-title h3 {
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 600;
}

.badge {
    display: inline-block;
    background: #ec008c;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    transform: rotate(-5deg);
    margin-top: 5px;
    box-shadow: 0 0 8px rgba(236, 0, 140, 0.5);
}

/* Responsive */
@media (max-width: 1200px) {
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-nav {
        display: none;
        /* Hide nav on mobile for now or make it a burger menu */
    }

    .user-profile {
        display: none;
    }

    .hero {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        min-height: auto;
        padding-bottom: 100px;
        padding-top: 6rem;
        /* Mais espaço no topo */
        /* Space for the image */
        overflow: visible;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .hero-content h1 {
        font-size: 1.4rem;
        margin-top: 1rem;
    }

    .hero-visuals {
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 250px;
        margin-top: 0;
        justify-content: center;
    }

    .models-container {
        width: 100%;
        height: 100%;
        right: 0;
        border-radius: 0;
        mask-image: linear-gradient(to top, black 20%, transparent 100%);
        -webkit-mask-image: linear-gradient(to top, black 20%, transparent 100%);
        opacity: 0.6;
    }

    .modules-grid {
        grid-template-columns: repeat(1, 1fr);
        /* Uma coluna por linha */
        gap: 2rem;
        padding-bottom: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-image {
        aspect-ratio: 16/9;
        /* Mais horizontal no mobile para ocupar menos altura */
        background-position: top center;
    }

    .card-image img {
        object-position: top center;
    }

    .card-image {
        aspect-ratio: 16/9;
        /* Mais horizontal no mobile para ocupar menos altura */
        background-position: top center;
    }

    .card-image img {
        object-position: top center;
    }

    .stat-card {
        display: none;
    }

    .notification-pill {
        position: relative;
        bottom: auto;
        right: auto;
        transform: none;
        margin: 0 auto 1.5rem auto;
        width: max-content;
        max-width: 90%;
        order: -1;
    }
}

/* Refund Page Styles */
.refund-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #050510;
    background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 100px);
}

.refund-container {
    width: 100%;
    max-width: 500px;
}

.refund-header {
    margin-bottom: 3rem;
    text-align: center;
}

.refund-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #ff00cc, #ec008c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

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

.input-wrapper {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 2px rgba(236, 0, 140, 0.2);
}

.input-wrapper ion-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-right: 0.8rem;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem 0;
    color: white;
    font-size: 1rem;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #555;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(90deg, #e91e63, #9c27b0);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 1rem;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #18181b;
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.modal-highlight {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-highlight strong {
    color: white;
}

.btn-secondary {
    margin-top: 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: #555;
}
/* MOBILE OVERRIDE FORCE - CAROUSEL & HERO */
@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; height: auto; overflow-y: auto; }
    .sidebar { width: 100%; height: auto; padding: 1rem; flex-direction: row; align-items: center; justify-content: space-between; }
    .sidebar-nav, .user-profile, .stat-card, .models-container { display: none !important; }
    
    .hero {
        flex-direction: column;
        padding: 6rem 1.5rem 0 1.5rem !important;
        text-align: center;
        min-height: auto;
        overflow: visible;
        display: flex;
        gap: 0;
    }
    .hero-content { order: 2; margin-bottom: 2rem; width: 100%; max-width: 100%; }
    .hero-content h1 { font-size: 1.5rem !important; line-height: 1.2 !important; margin-top: 0.5rem; }
    
    .hero-visuals {
        position: relative !important;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 0;
        order: 1;
    }
    
    .notification-pill {
        position: relative !important;
        bottom: auto !important; right: auto !important; transform: none !important;
        margin: 0 auto 1rem auto !important;
        background: rgba(15, 15, 15, 0.95) !important;
        z-index: 10;
        width: max-content;
        max-width: 90%;
    }

    /* CAROUSEL LOGIC */
    .modules-section { padding: 1rem 0 !important; overflow: hidden; }
    .section-header { padding: 0 1.5rem; }
    .modules-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 1rem;
        overflow-x: auto;
        padding: 1rem 1.5rem 2rem 1.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .module-card {
        min-width: 140px; width: 140px;
        scroll-snap-align: start;
        margin-bottom: 0;
    }
    .card-image {
        aspect-ratio: 9/16 !important;
        height: auto;
        margin-bottom: 0.5rem;
    }
}

/* --- FINAL MOBILE FIXES --- */
/* Mobile Header */
.mobile-header {
    display: none; /* Desktop hidden */
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000;
    display: flex; justify-content: flex-end;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mobile-menu-overlay.active {
    opacity: 1; pointer-events: all;
}
.mobile-menu-content {
    width: 80%; max-width: 300px; background: #09090b; height: 100%;
    padding: 2rem; transform: translateX(100%); transition: transform 0.3s;
    border-left: 1px solid #333;
}
.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}
.close-menu-btn {
    background: none; border: none; color: white; font-size: 2rem;
    position: absolute; top: 1rem; right: 1rem; cursor: pointer;
}
.mobile-nav { display: flex; flex-direction: column; gap: 1rem; margin-top: 3rem; }
.mobile-nav .nav-item { padding: 1rem; background: #1a1a1a; border-radius: 8px; justify-content: flex-start; }

@media (max-width: 768px) {
    /* Show Mobile Header */
    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 1rem 1.5rem; background: rgba(5,5,7,0.95);
        position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
        border-bottom: 1px solid #222; backdrop-filter: blur(10px);
    }
    .mobile-menu-btn { background: none; border: none; color: white; font-size: 2rem; cursor: pointer; }

    /* Hide Sidebar Completely */
    .sidebar { display: none !important; }

    /* Adjust Dashboard Padding for Header */
    .dashboard-container { padding-top: 60px; }

    /* Hero Fixes: VISUALS FIRST! */
    .hero {
        flex-direction: column;
        padding: 1rem 1.5rem 0 1.5rem !important;
        display: flex;
        gap: 0;
        min-height: auto;
    }

    .hero-visuals {
        position: relative !important;
        order: 1 !important; /* Visuals FIRST */
        height: 280px; /* Space for image */
        width: 100%;
        margin-bottom: 1rem;
        display: flex; justify-content: center; align-items: flex-end;
    }
    
    .models-container {
        display: block !important; /* Show models */
        position: absolute; bottom: 0; right: 0; width: 100%; height: 100%;
        opacity: 0.8 !important;
        mask-image: linear-gradient(to top, black 40%, transparent 100%);
        -webkit-mask-image: linear-gradient(to top, black 40%, transparent 100%);
    }
    .models-container img { object-position: center top !important; transform: scale(1.1); }

    .notification-pill {
        position: absolute !important; /* Floating over image */
        bottom: 10px !important; left: 50% !important; transform: translateX(-50%) !important;
        width: 90%; margin: 0 !important;
        z-index: 20;
    }

    .hero-content {
        order: 2 !important; /* Text SECOND */
        margin-top: 0; padding-bottom: 2rem;
    }
    .hero-content h1 { font-size: 1.6rem !important; }
    .hero-content p { font-size: 0.95rem; }

    /* Carousel Polish */
    .modules-grid {
        padding-right: 20px !important; /* Allow peek */
        gap: 15px;
    }
    
    /* Reveal first card edge fix */
    .module-card:first-child {
        margin-left: 0;
    }
}

/* --- REFINAMENTOS V3 (STATS + TEXT + CAROUSEL) --- */
@media (max-width: 768px) {
    /* 1. Show Stat Card (Vendas) */
    .stat-card {
        display: block !important;
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        transform: scale(0.8); /* Make it smaller for mobile */
        transform-origin: top right;
        z-index: 25;
        width: auto;
        max-width: 140px;
    }

    /* 2. Fix Text Layout (Prevent orphans) */
    .hero-content {
        padding: 0 0.5rem !important; /* Reduce padding side */
        width: 100% !important;
        box-sizing: border-box;
    }
    .hero-content h1 {
        font-size: 1.4rem !important; /* Slightly smaller to fit more words */
        word-wrap: break-word;
    }

    /* 3. Carousel Scrolling Fix */
    .dashboard-container {
        height: auto !important;
        overflow-y: visible !important; /* Let body scroll */
    }
    .main-content {
        overflow: visible !important;
    }
    
    .modules-grid {
        padding-right: 40px !important; /* More peek space */
        padding-left: 20px !important;
    }
    
    /* Ensure Header is always on top */
    .mobile-header {
        z-index: 9999 !important;
    }
}

/* --- FINAL SCROLL FIX V3 (ABSOLUTE PRIORITY) --- */
@media (max-width: 768px) {
    html {
        height: auto !important;
        overflow-y: scroll !important;
        min-height: 100vh !important;
    }
    
    body {
        height: auto !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        position: relative !important;
        min-height: 100vh !important;
    }

    .dashboard-container {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding-top: 70px !important; /* Ensure header doesn't cover */
    }

    .main-content {
        height: auto !important;
        overflow: visible !important;
        flex: none !important;
    }
    
    .modules-section {
        padding-bottom: 50px !important;
    }

    /* Fix header z-index just in case */
    .mobile-header {
        position: fixed !important;
        top: 0; left: 0; width: 100%;
        z-index: 10000 !important;
    }
}

/* --- REAL CAROUSEL FIX (PADDING LEFT) --- */
@media (max-width: 768px) {
    .modules-section {
        padding: 2rem 0 !important; /* Remove horizontal padding from section */
        overflow: hidden !important;
    }
    
    .modules-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 1rem 0 2rem 20px !important; /* Left padding 20px */
        gap: 15px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .module-card {
        flex: 0 0 auto !important; /* Don't shrink */
        width: 150px !important;
        min-width: 150px !important;
        scroll-snap-align: start;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    /* Ensure last item has space */
    .module-card:last-child {
        margin-right: 20px !important;
    }
}

/* --- SPACER FIX (VOID ELEMENT) --- */
@media (max-width: 768px) {
    .modules-grid::before {
        content: '';
        display: block;
        flex: 0 0 20px; /* Spacer width */
        width: 20px;
        height: 1px;
    }
    
    .modules-grid {
        padding-left: 0 !important; /* Managed by spacer now */
        padding-right: 20px !important;
    }
}

/* --- MARGIN FIX (THE DEFINITIVE SPACER) --- */
@media (max-width: 768px) {
    .modules-grid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        scroll-padding-left: 20px !important;
    }
    
    /* Force space on the items themselves */
    .module-card:first-child {
        margin-left: 20px !important;
    }
    
    .module-card:last-child {
        margin-right: 20px !important;
    }
}

/* --- NOTIFICATION PILL FIX --- */
@media (max-width: 768px) {
    .notification-pill {
        width: auto !important;        /* Let content dictate width */
        max-width: 90% !important;     /* Cap at 90% of screen */
        display: inline-flex !important; /* Shrink to wrap */
        padding: 0.6rem 1.2rem !important; /* Moderate padding */
        gap: 0.8rem !important;
        margin: 0 auto 1rem auto !important; /* Center and spacing */
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        bottom: auto !important;
        position: relative !important;
    }
}

/* --- FINAL PILL POSITION (LEFT-BOTTOM) --- */
@media (max-width: 768px) {
    .notification-pill {
        position: absolute !important;
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        margin: 0 !important;
        transform: none !important;
        z-index: 20 !important;
        width: auto !important;
        max-width: 80% !important;
        background: rgba(15, 15, 15, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

/* --- STAT CARD FIX (SINGLE LINE) --- */
@media (max-width: 768px) {
    .stat-card strong {
        white-space: nowrap !important;
        font-size: 1.1rem !important; /* Slightly smaller to fit */
        display: inline-block !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .stat-card {
        width: auto !important;
        min-width: 160px !important; /* Ensure enough width */
        padding: 0.8rem !important;
    }
}
