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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2563eb;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.login-container button:hover {
    background: #1d4ed8;
}

.error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Header */
header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    color: #2563eb;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Main */
main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

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

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

.filters select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

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

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Tasks List */
.tasks-list {
    display: grid;
    gap: 15px;
}

.task-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.task-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.task-card.priority-high {
    border-left-color: #dc2626;
}

.task-card.priority-medium {
    border-left-color: #f59e0b;
}

.task-card.priority-low {
    border-left-color: #10b981;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.task-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.task-status.todo {
    background: #dbeafe;
    color: #1e40af;
}

.task-status.in_progress {
    background: #fef3c7;
    color: #92400e;
}

.task-status.done {
    background: #d1fae5;
    color: #065f46;
}

.task-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.task-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.task-progress {
    font-size: 13px;
    color: #6b7280;
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    position: relative;
}

.modal-small {
    max-width: 400px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
}

.close:hover {
    color: #374151;
}

.modal h2 {
    margin-bottom: 20px;
    color: #111827;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.tag-checkbox input {
    cursor: pointer;
}

.tag-checkbox:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
}

/* Subtasks */
.subtask-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.subtask-item input[type="text"] {
    flex: 1;
}

.subtask-item input[type="checkbox"] {
    width: auto;
    margin-top: 10px;
}

.subtask-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Tags List View */
.tags-list {
    display: grid;
    gap: 10px;
}

.tag-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tag-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tag-color-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
}

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

/* Gantt Chart */
.gantt-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#ganttChart {
    max-height: 600px;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}

/* Date Groups */
.date-group {
    margin-bottom: 30px;
}

.date-header {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    text-transform: capitalize;
}

.date-tasks {
    display: grid;
    gap: 15px;
}

/* Overdue Tasks */
.task-card.overdue {
    border-left-width: 4px;
    border-left-color: #dc2626 !important;
    background: #fef2f2;
}

.task-card.overdue .task-title {
    color: #dc2626;
}

/* Backlog Section */
.backlog-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 3px dashed #9ca3af;
}

.backlog-section .date-header {
    color: #6b7280;
}

.backlog-task {
    opacity: 0.85;
    border-left-color: #9ca3af !important;
}
