:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    padding-bottom: 70px; /* Space for Mobile Navigation Bar */
}

/* Header Navbar */
.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #dbeafe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* Main Layout Responsive */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
}

.welcome-card {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-card p {
    font-size: 13px;
    opacity: 0.85;
}

/* Quick Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

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

.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.metric-card i {
    font-size: 20px;
    margin-bottom: 8px;
    display: inline-block;
}

.metric-card.blue i { color: #2563eb; }
.metric-card.green i { color: #10b981; }
.metric-card.orange i { color: #f59e0b; }
.metric-card.purple i { color: #9333ea; }

.metric-card h3 {
    font-size: 18px;
    font-weight: 700;
}

.metric-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Section Controls & Tests List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.test-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 600px) {
    .test-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.test-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.test-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.test-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Badges & Buttons */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-live { background: #d1fae5; color: #065f46; }
.badge-upcoming { background: #fef3c7; color: #92400e; }
.badge-completed { background: #e0f2fe; color: #075985; }

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 50%;
}

@media (min-width: 600px) {
    .btn { width: auto; }
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--text-main); }

/* Bottom Mobile Nav Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.nav-item i {
    font-size: 18px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}
/* =========================================================================
   DESKTOP RESPONSIVE EXTENSIONS (Hides Bottom Nav on Desktop, Adds Desktop Nav)
   ========================================================================= */

.desktop-nav {
    display: none;
}

@media (min-width: 900px) {
    body {
        padding-bottom: 0px; /* Remove mobile bottom nav space */
    }

    .bottom-nav {
        display: none !important; /* Hide mobile bottom navigation on desktop */
    }

    .app-header {
        padding: 14px 40px;
    }

    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 24px;
        margin-left: 40px;
    }

    .desktop-nav-item {
        text-decoration: none;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: color 0.2s;
    }

    .desktop-nav-item:hover, .desktop-nav-item.active {
        color: var(--primary);
    }

    .container {
        max-width: 1100px;
        padding: 24px;
    }

    /* Test Engine Desktop Split View */
    .test-engine-layout {
        display: grid;
        grid-template-columns: 2.8fr 1.2fr;
        gap: 20px;
        align-items: start;
    }

    .palette-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}