:root {
    /* Light Theme (Default) */
    --bg-color: #f0f2f5;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #d7dde8 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.12);
    --text-color: #1a1a1a;
    --text-muted: #333333;
    --text-ghost: #777777;
    --primary-color: #0062cc; /* Darker blue for better contrast */
    --secondary-color: #495057;
    --success: #1e7e34;
    --warning: #856404;
    --danger: #bd2130;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --sidebar-text: #1a1a1a;
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-text: #111111;

    /* Kanban Colors */
    --approval-color: #856404;
    --approved-color: #0056b3;
    --rejected-color: #bd2130;
    --purchasing-color: #d9480f;
    --purchased-color: #087f5b;
    --done-color: #1e7e34;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #0062cc 0%, #4facfe 100%);
    --secondary-gradient: linear-gradient(135deg, #495057 0%, #adb5bd 100%);
    --danger-gradient: linear-gradient(135deg, #bd2130 0%, #ff4b2b 100%);
    --success-gradient: linear-gradient(135deg, #1e7e34 0%, #00ff87 100%);
}

body.dark-theme {
    /* Dark Theme - Gray/Charcoal tones */
    --bg-color: #0f0f0f;
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #f8f9fa;
    --text-muted: #dee2e6;
    --text-ghost: #adb5bd;
    --primary-color: #4facfe;
    --secondary-color: #dee2e6;
    --success: #00f2fe;
    --warning: #f7b733;
    --danger: #ff4b2b;
    --sidebar-text: #f8f9fa;
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-text: #ffffff;

    /* Kanban Colors (Dark) - More Vibrant */
    --approval-color: #f9d423;
    --approved-color: #4facfe;
    --rejected-color: #ff416c;
    --purchasing-color: #ff9a9e;
    --purchased-color: #00f2fe;
    --done-color: #00ff87;
}

body.dark-theme select option {
    background-color: #333;
    color: #fff;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.btn-glass::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    pointer-events: none;
}

.btn-glass:hover::after {
    left: 100%;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.sidebar .btn-glass {
    justify-content: center;
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.sidebar .btn-glass i {
    transition: transform 0.3s ease;
}

.sidebar .btn-glass:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}

.btn-glass.active {
    background: var(--primary-gradient);
    color: white !important;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0, 98, 204, 0.3);
}

.btn-glass.active i {
    color: white !important;
}

.btn-glass.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: white;
    border-radius: 0 4px 4px 0;
}

.input-glass {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--input-text);
    padding: 0.8rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

.input-glass:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}

.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-radius: 0 16px 16px 0;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
}

.sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 2rem 2rem 0;
    transition: padding 0.3s ease;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1100;
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 85%;
        max-width: 300px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-radius: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        padding: 1rem;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
    }

    .mobile-toggle {
        display: block;
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .header-glass {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-glass div:last-child {
        text-align: left !important;
    }
}

/* Components */
.header-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
}

.task-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

@media (max-width: 1200px) {
    .task-board {
        grid-template-columns: 1fr;
    }
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item.status-Done {
    border-left-color: var(--success);
    opacity: 0.6;
}

.task-item.status-Missed {
    border-left-color: var(--danger);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeIn 0.6s ease forwards;
}

/* Progress bar (dashboard) */
.progress-fill {
    height: 100%;
    background: var(--success);
    width: calc(var(--p, 0) * 1%);
}

/* Budget Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--secondary-color);
}

/* Utilities */
.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Budget Kanban */
.budget-kanban {
    display: grid;
    grid-template-columns: repeat(6, minmax(260px, 1fr));
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

@media (max-width: 1600px) {
    .budget-kanban {
        grid-template-columns: repeat(6, 280px);
    }
}

.budget-col {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: background 0.3s ease;
}


.budget-col {
    padding: 1rem;
}

.budget-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-col-body {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-count {
    opacity: 0.6;
}

.budget-title-todo {
    color: #b5b5b5;
}

.budget-title-build {
    color: var(--primary-color);
}

.budget-title-approval {
    color: var(--warning);
}

.budget-title-done {
    color: var(--success);
}

.budget-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.budget-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
    border-color: var(--primary-color) !important;
}

.budget-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(0.95);
}


.budget-edit {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.budget-edit .btn-glass {
    padding: 0.4rem 0.8rem;
}

.budget-edit-input {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

/* Financial Cards */
.financial-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.financial-card:hover {
    transform: translateY(-5px);
}

.financial-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1;
}

.financial-label {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.financial-progress-container {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.financial-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.financial-progress-bar.usage {
    background: linear-gradient(90deg, var(--primary-color), var(--success));
}

.financial-progress-bar.over {
    background: linear-gradient(90deg, var(--warning), var(--danger));
}

.financial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Weather Widget Enhanced */
.weather-widget {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    margin-top: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

@media (max-width: 992px) {
    .weather-widget {
        padding: 0.8rem;
        margin-top: 1.5rem;
    }

    .sidebar .btn-glass {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        margin-bottom: 0.4rem !important;
    }

    .sidebar h1 {
        font-size: 1.1rem !important;
    }

    .sidebar p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem !important;
    }
}

.weather-widget:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.weather-widget h3 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
    font-weight: 700;
}

.weather-forecast-item {
    text-align: center;
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-logout {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: rgba(189, 33, 48, 0.1) !important;
    color: #ff6b6b !important;
    margin-top: 1rem;
    font-weight: 700;
    border-color: rgba(189, 33, 48, 0.2);
}

.btn-logout:hover {
    background: rgba(189, 33, 48, 0.2) !important;
    border-color: #bd2130 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(189, 33, 48, 0.3);
}