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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f8f9fa;
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 320px;
    background: #2d3748;
    color: white;
    padding: 20px;
    overflow-y: auto;
    transition: margin-left 0.3s;
    position: relative;
}

.sidebar.collapsed {
    margin-left: -320px;
}

.sidebar-toggle {
    position: fixed;
    left: 0;
    top: 20px;
    width: 30px;
    height: 40px;
    background: #2d3748;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: left 0.3s;
}

.sidebar-toggle.shifted {
    left: 320px;
}

.sidebar-toggle:hover {
    background: #4a5568;
}

.sidebar h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

.sidebar-controls {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #4a5568;
}

.toggle-done {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    background: #4a5568;
    border-radius: 3px;
    user-select: none;
    transition: background 0.2s;
}

.toggle-done:hover {
    background: #5a6779;
}

.toggle-done input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.lists-container {
    margin-bottom: 15px;
}

.list-item {
    padding: 6px 8px;
    margin-bottom: 3px;
    background: #4a5568;
    border-radius: 3px;
    cursor: move;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.list-item:hover {
    background: #5a6779;
}

.list-item.dragging-list {
    opacity: 0.5;
}

.list-item-drag-handle {
    cursor: grab;
    color: #a0aec0;
    font-size: 14px;
    user-select: none;
}

.list-item-drag-handle:active {
    cursor: grabbing;
}

.list-item-name {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 2px;
    font-family: inherit;
    min-width: 0;
}

.list-item-name:focus {
    background: #2d3748;
    outline: 1px solid #667eea;
}

.list-item-name:disabled {
    cursor: move;
}

.list-item-counts {
    color: #a0aec0;
    font-size: 11px;
    margin-left: 8px;
    flex-shrink: 0;
    font-family: monospace;
}

.column-selector {
    display: flex;
    gap: 2px;
}

.column-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #2d3748;
    color: #a0aec0;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s;
}

.column-btn:hover {
    background: #5a6779;
}

.column-btn.active {
    background: #667eea;
    color: white;
}

.column-btn.drag-over {
    background: #48bb78;
    color: white;
    transform: scale(1.1);
}

.list-item-delete {
    background: transparent;
    border: none;
    color: #fc8181;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.list-item-delete:hover {
    background: #fc8181;
    color: white;
}

.btn {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.btn:hover {
    background: #5a67d8;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

/* List columns */
.list-column {
    flex: 1;
    min-width: 0;
    max-width: 33.33%;
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.list-title {
    font-size: 16px;
    font-weight: bold;
    color: #2d3748;
}

.list-body {
    flex: 1;
    overflow-y: auto;
}

/* Task items */
.task {
    background: #f7fafc;
    border-left: 3px solid #667eea;
    padding: 6px 10px;
    margin-bottom: 3px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.task.important {
    border-left-color: #f56565 !important;
    background: #fff5f5 !important;
}

.task:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    background: #fff;
}

.task.dragging {
    opacity: 0.3;
    cursor: grabbing;
}

.task.drag-over-top {
    border-top: 3px solid #667eea;
    padding-top: 3px;
}

.task.drag-over-bottom {
    border-bottom: 3px solid #667eea;
    padding-bottom: 3px;
}

.task.in_progress {
    border-left-color: #ed8936;
    background: #fffaf0;
}

.task.in_progress.important {
    border-left-color: #f56565;
}

.task.done {
    border-left-color: #48bb78;
    background: #f0fff4;
    opacity: 0.6;
}

.task.done.important {
    border-left-color: #f56565;
}

.task.done.hidden {
    display: none;
}

.task-title {
    font-weight: bold;
    color: #2d3748;
    min-width: 50px;
    flex-shrink: 0;
}

.task.done .task-title {
    text-decoration: line-through;
}

.task-description {
    color: #4a5568;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-date {
    color: #a0aec0;
    font-size: 10px;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 6px;
    user-select: none;
}

.task-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 10;
}

.task-btn {
    padding: 2px 6px;
    border: none;
    border-radius: 2px;
    cursor: pointer !important;
    font-size: 11px;
    transition: opacity 0.2s;
    line-height: 1;
    pointer-events: auto;
}

.task-btn:hover {
    opacity: 0.8;
}

.btn-pending {
    background: #667eea;
    color: white;
}

.btn-progress {
    background: #ed8936;
    color: white;
}

.btn-done {
    background: #48bb78;
    color: white;
}

.btn-delete {
    background: #fc8181;
    color: white;
}

.btn-edit {
    background: #a0aec0;
    color: white;
}

/* Add task form */
.add-task-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 5px;
    align-items: center;
}

.add-task-form input {
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
}

.add-task-form input:focus {
    outline: none;
    border-color: #667eea;
}

.add-task-form input:first-child {
    width: 70px;
    flex-shrink: 0;
}

.add-task-form input:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.add-task-form .btn {
    width: 32px;
    padding: 6px 0;
    font-size: 16px;
    margin: 0;
    flex-shrink: 0;
    background: #667eea;
}

.add-task-form .btn:hover {
    background: #5a67d8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    min-width: 400px;
    max-width: 500px;
}

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

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    margin-bottom: 15px;
    font-family: inherit;
}

.modal-content input[type="date"] {
    font-size: 14px;
}

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

.modal-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
}

.modal-content input[type="checkbox"] {
    width: auto;
    margin: 0;
}

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

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.modal-btn-cancel {
    background: #a0aec0;
    color: white;
}

.modal-btn-save {
    background: #667eea;
    color: white;
}

.empty-state {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
}