:root {
    /* Dark Theme Variables (Default) */
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary-color: #1e293b;
    --accent-color: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.8);
    --danger-color: #ef4444;
    --success-color: #10b981;
}

[data-theme="light"] {
    /* Light Theme Variables */
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --primary-color: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.3);
    --secondary-color: #ffffff;
    --accent-color: #6d28d9;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(241, 245, 249, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.5rem;
}

/* Main Content */
#app-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: 5rem; /* space for bottom nav */
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 100;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.8rem;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

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

.nav-item.active {
    opacity: 1;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    transform: translateY(-2px);
}

/* Form Elements */
.futuristic-input {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

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

.futuristic-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.futuristic-btn:active {
    transform: scale(0.98);
}

/* Login Container */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 70vh;
    max-width: 400px;
    margin: 0 auto;
}

.login-card {
    width: 100%;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.login-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px var(--primary-glow);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.8rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

th {
    background: rgba(0,0,0,0.05);
    font-weight: 600;
    color: var(--primary-color);
}

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

/* Cards & Layouts */
.page-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.combo-box {
    position: relative;
}

.combo-box select {
    appearance: none;
}

.combo-box::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--primary-color);
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Stats */
.chart-container {
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

/* Loading */
.loader {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.5; transform: scale(0.9); }
}
