body {
    background-color: #111827;
    color: #f9fafb;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 32px;
    padding-bottom: 20px;

    border-bottom: 1px solid #374151;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #f9fafb;
}

#logoutBtn {
    background-color: transparent;
    color: #d1d5db;
}

.create-task-section {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;

    padding: 28px;
    margin-bottom: 16px;
}

.create-task-section h2 {
    font-size: 22px;
    margin-bottom: 24px;
}

#createTaskForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#createTaskForm > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#createTaskForm label {
    font-size: 14px;
    color: #d1d5db;
}

#createTaskForm input,
#createTaskForm textarea {
    width: 100%;
    box-sizing: border-box;

    background-color: #111827;
    color: #f9fafb;

    border: 1px solid #4b5563;
    border-radius: 8px;

    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;

    outline: none;
    transition: border-color 0.2s ease;
}

#createTaskForm textarea {
    min-height: 100px;
    resize: vertical;
}

#createTaskForm input:focus,
#createTaskForm textarea:focus {
    border-color: #8b5cf6;
}

#createTaskForm button {
    align-self:  flex-end;

    background-color: #7c3aed;
    color: #ffffff;

    border: none;
    border-radius: 8px;

    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: background-color 0.2s ease;
}

#createTaskForm button:hover {
    background-color: #6d28d9;
}

.dashboard-header #logoutBtn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 100px;
    min-height: 40px;
    padding: 10px 20px;

    background-color: #293244;
    color: #e5e7eb;

    border: 1px solid #4b5563;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;
    transition: background-color 0.2 ease, border-color 0.2 ease;
}

.dashboard-header #logoutBtn:hover {
    background-color: #374151;
    border-color: #8b5cf6;
}

.tasks-section {
    margin-top: 32px;
}

.tasks-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

#taskList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;

    padding: 20px 24px;
    
    transition: border-color 0.2s ease,
                transform 0.2s ease;
}

.task-item:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.task-item h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f9fafb;
}

.task-item p {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.task-content {
    flex: 1;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: #8b6cf6;
    cursor: pointer;
}

.task-item.completed {
    opacity: 0.65;
}

.task-item.completed h3 {
    text-decoration: line-through;
    color: #9ca3af;
}

.delete-task-btn {
    background-color: transparent;
    color: #f87171;
    border: 1px solid #7f1f1f;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2 ease;
    flex-shrink: 0;
}

.delete-task-btn:hover {
    background-color: #7f1d1d;
    color: #ffffff;
    border-color: #ef4444;
}

.delete-task-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edit-task-btn {
    background-color: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2 ease;
    flex-shrink: 0;
}

.edit-task-btn:hover {
    background-color: #4b5563;
    border-color: #8b5cf6;
}

.edit-task-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.7);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    background: #1f2937;
    padding: 30px;
    border-radius: 12px;

    width: 90%;
    max-width: 450px;

    border: 1px solid #374151;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-content input,
.modal-content textarea {
    background: #111827;
    color: white;

    border: 1px solid #374151;
    border-radius: 8px;

    padding: 12px;
    font: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions button {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

#cancelEditBtn {
    background: #374151;
    color: white;
}

#saveEditBtn {
    background: #7c3aed;
    color: white;
}

.modal-content form > div:not(.model-actions) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.modal-content label {
    display: block;
    width: 100%;
}

.modal-content input,
.modal-content textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.modal-content textarea {
    min-height: 100px;
    resize: vertical;
}

@media (max-width: 600px) {
    .dashboard {
        padding:16px;
    }

    .task-item {
        flex-wrap: wrap;
        gap: 12px;
    }

    .task-content {
        flex: 1 1 calc(100% - 44px);
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .edit-task-btn,
    .delete-task-btn {
        flex: 1;
    }

    .modal-content {
        width: calc(100% - 32px);
        max-width: 450px;
        padding: 20px;
        box-sizing: border-box;
    }
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;
    border: 1px solid #8b5cf6;
    border-radius: 8px;

    color: #f9fafb;
    text-decoration: none;
    font-size: 14px;

    transition: background-color 0.2 ease;
}

.home-btn:hover {
    background-color: #374151;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}