body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6rem;
}

/* Main layout */
.container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #3949ab, #5c6bc0);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 1rem;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 12px 12px 0;
}

.sidebar h2 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.sidebar button {
    width: 100%;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border: none;
    background: #f1f1f1;
    color: #5c6bc0;
    border-radius: 8px;
    text-align: left;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.sidebar button:hover {
    background: #e0e0e0;
    transform: translateX(4px);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Sections */
.section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.section h2 {
    margin-top: 0;
    color: #3949ab;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Top Buttons in Projects */
.projects-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.projects-top button,
.projects-top select {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.projects-top button:hover,
.projects-top select:hover {
    background: #e3e7fc;
    border-color: #3949ab;
}

/* Project Details */
.project-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.details {
    padding: 1rem;
    background: #f1f3ff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.details h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #2c387e;
}

.progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.progress-bar {
    flex: 1;
    background: #dbe2ff;
    height: 14px;
    border-radius: 12px;
    overflow: hidden;
}

#progressFill {
    height: 100%;
    width: 0%;
    background: #3949ab;
    border-radius: 12px;
    transition: width 0.3s ease;
}

#progressPercent {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Budget info */
.details p {
    margin: 0;
    font-size: 0.95rem;
}

/* Tasks & Expenses */
.tasks,
.expenses,
.permit-section,
.shopping {
    padding: 1rem;
    background: #f9f9ff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tasks button,
.expenses button,
.permit-section button,
.shopping button {
    background: #3949ab;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.tasks button:hover,
.expenses button:hover,
.permit-section button:hover,
.shopping button:hover {
    background: #5c6bc0;
}

/* Lists */
.project-list,
#taskList,
#expenseList,
#permitList,
#shoppingList {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.project-list li,
#taskList li,
#expenseList li,
#permitList li,
#shoppingList li {
    background: #fff;
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.project-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Export & Delete Buttons */
.project-extras button,
#deleteProjectBtn {
    background: #f44336;
    color: #fff;
    border: none;
    margin-bottom: 5px;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
}

.project-extras button:hover,
#deleteProjectBtn:hover {
    background: #d32f2f;
}

/* Hidden helper class */
.hidden {
    display: none;
}

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

/* Hide modal by default */
.modal.hidden {
    display: none;
}

/* Modal Content */
.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modal Heading */
.modal-content h3 {
    margin-top: 0;
    font-size: 1.6rem;
    color: #3949ab;
}

.modal-content .form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Labels */
.modal-content label {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    flex: 1;
    color: #333;
}

/* Inputs and Selects */
.modal-content input,
.modal-content select {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    flex: 2;
    box-sizing: border-box;
    transition: border 0.2s ease;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #3949ab;
}

/* Modal Buttons */
.modal-content button {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.modal-content button#saveProject,
.modal-content button#saveTask,
.modal-content button#saveExpense {
    background: #3949ab;
    color: #fff;
    margin-top: 0.5rem;
}

.modal-content button#saveProject:hover,
.modal-content button#saveTask:hover,
.modal-content button#saveExpense:hover {
    background: #5c6bc0;
}

.modal-content button[onclick] {
    background: #f44336;
    color: #fff;
    margin-top: 0.5rem;
}

.modal-content button[onclick]:hover {
    background: #d32f2f;
}


/* Tablets */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-radius: 0 0 12px 12px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .sidebar button {
        width: 48%;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .main-content {
        padding: 1.5rem;
    }

    .projects-top {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content .form-row {
        flex-wrap: wrap;
    }

    .modal-content label {
        flex-basis: 100%;
    }

    .modal-content input,
    .modal-content select {
        flex-basis: 100%;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .sidebar {
        flex-direction: column;
        width: 100%;
        border-radius: 0;
    }

    .sidebar button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .projects-top {
        flex-direction: column;
    }

    .project-details,
    .tasks,
    .expenses,
    .permit-section,
    .shopping {
        padding: 0.8rem;
    }

    .details h3 {
        font-size: 1.2rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .projects-top button,
    .projects-top select {
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.2rem;
    }

    .modal-content h3 {
        font-size: 1.3rem;
    }

    .modal-content input,
    .modal-content select,
    .modal-content button {
        font-size: 0.9rem;
    }
}