:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --text-primary: #343a40;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    --border-color: #dee2e6;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --positive-color: #10b981;
    --negative-color: #ef4444;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --chart-grid: #e9ecef;
    --hover-color: #f8f9fa;
    --warning-color: #f59e0b;
}

[data-theme="dark"] {
    --bg-primary: #1e1e2e;
    --bg-secondary: #292a3e;
    --bg-tertiary: #242536;
    --text-primary: #f8f9fa;
    --text-secondary: #ccd6e0;
    --text-tertiary: #9ca3af;
    --border-color: #3f4354;
    --accent-primary: #60a5fa;
    --accent-secondary: #93c5fd;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --positive-color: #34d399;
    --negative-color: #f87171;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3);
    --chart-grid: #3f4354;
    --hover-color: #2f3044;
    --warning-color: #fbbf24;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.project-filter select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    min-width: 150px;
}

.date-range {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.date-input input {
    border: none;
    background: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    padding: 4px;
}

.date-separator {
    color: var(--text-tertiary);
    margin: 0 8px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    background-color: var(--hover-color);
}

.add-expense-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-expense-btn:hover {
    background-color: var(--accent-secondary);
}

/* Dynamic Header */
.dynamic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dynamic-title h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dynamic-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-btn:hover {
    background-color: var(--hover-color);
}

.action-btn.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--negative-color);
}

.action-btn.danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

.card h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 20px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

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

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

.chart-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* Projects Overview Grid */
.projects-overview {
    margin-bottom: 30px;
}

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

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

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

.project-card-title {
    font-size: 18px;
    font-weight: 600;
}

.project-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.project-status.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--positive-color);
}

.project-status.completed {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.project-status.on-hold {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.project-stat {
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.project-progress {
    margin-top: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Details Section */
.details-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

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

.details-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.department-card {
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    padding: 18px;
    transition: all 0.2s ease;
}

.department-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

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

.department-name {
    font-size: 16px;
    font-weight: 600;
}

.department-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
}

.department-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.department-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.department-progress-fill {
    height: 100%;
    background-color: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Employee Table */
.employees-table {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

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

.table-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.table-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

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

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

tbody tr:hover {
    background-color: var(--hover-color);
}

tbody tr.hidden {
    display: none;
}

.employee-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.department-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.project-badge {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 11px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
    animation: modalSlide 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--hover-color);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-secondary);
}

/* Department Colors */
.dept-dev { background-color: #3b82f6; }
.dept-seo { background-color: #10b981; }
.dept-lb { background-color: #f59e0b; }
.dept-content { background-color: #8b5cf6; }
.dept-socials { background-color: #ec4899; }
.dept-reputation { background-color: #14b8a6; }
.dept-design { background-color: #f97316; }

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .project-filter,
    .date-range,
    .add-expense-btn,
    .theme-toggle {
        width: 100%;
    }
    
    .dynamic-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .quick-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .department-grid {
        grid-template-columns: 1fr;
    }
    
    .employees-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}