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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #f6ad55;
    --danger: #f56565;
    --gray-light: #2a2a2a;
    --gray-medium: #3a3a3a;
    --gray-dark: #e0e0e0;
    --text: #e0e0e0;
    --bg-dark: #1a1a1a;
    --card-bg: #252525;
    --input-bg: #3a3a3a;
    --border-dark: #404040;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    color: var(--text);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid #404040;
}

.logo {
    padding: 0 20px 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.logo h2 {
    font-size: 24px;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--text);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h1 {
    margin: 0;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
    border: 1px solid var(--border-dark);
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--gray-dark);
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary p {
    font-size: 14px;
    color: #a0a0a0;
}

.amount {
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--gray-medium);
    color: var(--gray-dark);
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-edit {
    background: var(--warning);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #ed8936;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-input {
    padding: 10px 15px;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text);
}

/* Transactions Table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead {
    background: var(--gray-medium);
}

.transactions-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border-dark);
}

.transactions-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text);
}

.transactions-table tr:hover {
    background: var(--gray-medium);
}

.type-income {
    color: var(--success);
    font-weight: 600;
}

.type-expense {
    color: var(--danger);
    font-weight: 600;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    border: 1px solid var(--border-dark);
}

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

.project-card.completed {
    border-left-color: var(--success);
}

.project-card.on_hold {
    border-left-color: var(--warning);
}

.project-card h3 {
    margin-bottom: 10px;
    color: var(--gray-dark);
}

.project-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.status-planning {
    background: #bee3f8;
    color: #2c5282;
}

.status-in_progress {
    background: #c6f6d5;
    color: #22543d;
}

.status-completed {
    background: #c6f6d5;
    color: #22543d;
}

.status-on_hold {
    background: #fed7d7;
    color: #742a2a;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
}

/* Tasks Container */
.tasks-container {
    display: grid;
    gap: 15px;
}

.task-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid var(--border-dark);
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-card.completed {
    opacity: 0.7;
    border-left-color: var(--success);
}

.task-info h4 {
    margin-bottom: 5px;
    color: var(--gray-dark);
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 5px;
}

.priority-high {
    color: var(--danger);
    font-weight: 600;
}

.priority-medium {
    color: var(--warning);
    font-weight: 600;
}

.priority-low {
    color: #48bb78;
    font-weight: 600;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-dark);
    color: var(--text);
}

.task-item-info {
    flex: 1;
}

.task-item-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.task-item-due {
    font-size: 12px;
    color: #a0a0a0;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: block;
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--gray-dark);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--gray-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text);
}

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

#finance-form,
#project-form,
#task-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 0;
    }

    .logo {
        padding: 0 15px 15px;
        margin-bottom: 15px;
    }

    .logo h2 {
        font-size: 18px;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .nav-link {
        flex: 1;
        min-width: 120px;
        padding: 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
    }

    .nav-link.active {
        border-left: none;
        border-bottom-color: white;
    }

    .main-content {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-wrap: wrap;
    }

    .filter-input {
        flex: 1;
        min-width: 150px;
    }
}
