:root {
    --bg-color: #05140b; /* Very dark green */
    --panel-bg: rgba(10, 31, 18, 0.7);
    --panel-border: rgba(255, 223, 0, 0.15); /* Yellow border hint */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #009c3b; /* Green */
    --primary-hover: #00b946;
    --secondary: #002776; /* Blue */
    --accent-yellow: #ffdf00; /* Yellow */
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --font-family: 'Outfit', sans-serif;
    --shadow-neon: 0 0 20px rgba(255, 223, 0, 0.15);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs for Glassmorphism effect */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 156, 59, 0.25) 0%, rgba(0, 156, 59, 0) 70%);
    filter: blur(60px);
    animation: float 20s infinite alternate;
}

.blob-2 {
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255, 223, 0, 0.15) 0%, rgba(255, 223, 0, 0) 70%);
    filter: blur(60px);
    animation: float 25s infinite alternate-reverse;
}

.bg-flag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120vw;
    opacity: 0.03;
    pointer-events: none;
}

/* Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(5, 20, 11, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.brand img {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 156, 59, 0.5));
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(5px);
}

.sidebar nav a.active {
    background: linear-gradient(90deg, rgba(255, 223, 0, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--accent-yellow);
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(255, 223, 0, 0.3);
}

.sidebar nav a.active i {
    color: var(--accent-yellow);
    filter: drop-shadow(0 0 5px rgba(255, 223, 0, 0.5));
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 156, 59, 0.4);
    border: 2px solid var(--primary);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile .info p {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.user-profile .info span {
    font-size: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.user-profile .info span::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-flag {
    width: 48px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    animation: heartbeat 1.5s infinite;
}

.header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.header p {
    color: var(--text-muted);
}

.actions {
    display: flex;
    gap: 16px;
}

.btn-icon {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: 12px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 156, 59, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 156, 59, 0.6);
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-yellow), var(--secondary));
    opacity: 0.8;
}

.glass-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 223, 0, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrapper.green { background: rgba(0, 156, 59, 0.15); color: var(--primary); }
.icon-wrapper.yellow { background: rgba(255, 223, 0, 0.15); color: var(--accent-yellow); }
.icon-wrapper.blue { background: rgba(0, 39, 118, 0.15); color: #4b8df8; }
.icon-wrapper.orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }

.stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.stat-footer.positive { color: var(--primary-hover); }
.stat-footer.neutral { color: var(--text-muted); }
.stat-footer.negative { color: var(--accent-red); }

/* Charts Area */
.charts-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.badge {
    background: rgba(255, 223, 0, 0.1);
    color: var(--accent-yellow);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 223, 0, 0.2);
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--panel-border);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.status-badge.active {
    background: rgba(0, 156, 59, 0.15);
    color: var(--primary-hover);
    border: 1px solid rgba(0, 156, 59, 0.3);
}
.status-badge.warning {
    background: rgba(255, 223, 0, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(255, 223, 0, 0.3);
}

/* Animations */
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

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

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

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes olaWave {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-12px); border-color: rgba(255, 223, 0, 0.6); box-shadow: 0 15px 30px rgba(0, 156, 59, 0.3); }
    40% { transform: translateY(0); }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
    100% { transform: scale(1); }
}

.slide-in-left { animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.fade-in-up { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.pop-in { 
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, olaWave 3s ease-in-out infinite; 
    opacity: 0; 
}

/* Sequential delays for the Ola wave effect */
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s, 0.6s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.2s, 0.8s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.3s, 1.0s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.4s, 1.2s; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 223, 0, 0.3); }

/* Mobile Header (hidden on desktop) */
.mobile-header {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablet */
@media (max-width: 1024px) {
    .charts-area {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 24px 28px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: max(12px, env(safe-area-inset-top)) 16px 12px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        background: rgba(5, 20, 11, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--panel-border);
        position: sticky;
        top: 0;
        z-index: 80;
    }

    .mobile-logo {
        max-height: 36px;
        width: auto;
        filter: drop-shadow(0 0 8px rgba(0, 156, 59, 0.4));
    }

    .mobile-header-spacer {
        width: 44px;
    }

    .menu-toggle {
        flex-shrink: 0;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .dashboard-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(280px, 85vw);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 100;
        animation: none;
    }

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

    .sidebar-close {
        display: flex;
    }

    .main-content {
        padding: 20px 16px max(32px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        overflow-y: visible;
    }

    .header {
        margin-bottom: 24px;
    }

    .header h2 {
        font-size: 22px;
    }

    .header p {
        font-size: 13px;
    }

    .header-flag {
        width: 36px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .stat-value {
        font-size: 28px;
    }

    .glass-panel {
        padding: 18px;
        border-radius: 16px;
    }

    .glass-panel:hover {
        transform: none;
    }

    .charts-area {
        gap: 16px;
        margin-bottom: 24px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }

    .chart-header h3 {
        font-size: 16px;
    }

    .canvas-wrapper {
        height: 240px;
    }

    .teams-area .canvas-wrapper {
        height: 280px !important;
    }

    .data-table {
        min-width: 520px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .brand img {
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .header-title {
        gap: 10px;
    }

    .header h2 {
        font-size: 20px;
    }

    .stat-header h3 {
        font-size: 13px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-footer {
        font-size: 12px;
    }

    .canvas-wrapper {
        height: 200px;
    }
}
