/* ===== CSS Variables ===== */
:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-column: #141620;
    --bg-hover: #242736;
    --border: #2a2d3a;
    --text: #e4e6f0;
    --text-secondary: #8b8fa3;
    --accent: #6c5ce7;
    --accent-hover: #7e70f0;
    --new: #00b894;
    --working: #fdcb6e;
    --completed: #00cec9;
    --recheck: #e17055;
    --priority-low: #00b894;
    --priority-medium: #fdcb6e;
    --priority-high: #d63031;
    --kate: #e84393;
    --mira: #0984e3;
    --kaka: #6c5ce7;
    --personal: #636e72;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: auto;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 1.4rem; font-weight: 700; }
.subtitle { color: var(--text-secondary); font-size: 0.85rem; margin-left: 8px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===== Refresh Button ===== */
.refresh-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-left: 12px;
}
.refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    transform: rotate(180deg);
    border-color: var(--accent);
}
.refresh-btn:active {
    transform: scale(0.95);
}

/* ===== Filter Buttons ===== */
.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== Add Button ===== */
.btn-add {
    padding: 8px 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-add:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 14px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-number { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.stat-new { color: var(--new); }
.stat-working { color: var(--working); }
.stat-completed { color: var(--completed); }
.stat-recheck { color: var(--recheck); }

/* ===== Board ===== */
.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

/* ===== Columns ===== */
.column {
    background: var(--bg-column);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}
.column-header {
    padding: 16px;
    border-bottom: 2px solid var(--new);
    border-radius: var(--radius) var(--radius) 0 0;
}
.column-header.working { border-bottom-color: var(--working); }
.column-header.completed { border-bottom-color: var(--completed); }
.column-header.recheck { border-bottom-color: var(--recheck); }
.column-title { display: flex; align-items: center; gap: 8px; }
.column-icon { font-size: 1.2rem; }
.column-title h2 { font-size: 0.95rem; font-weight: 600; }
.task-count {
    background: var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* ===== Task List ===== */
.task-list {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    transition: background 0.2s;
}
.task-list.drag-over {
    background: rgba(108, 92, 231, 0.1);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ===== Task Card ===== */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
}
.task-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}
.task-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    line-height: 1.3;
}
.task-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.task-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== Labels/Tags ===== */
.label {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.label-kate { background: rgba(232, 67, 147, 0.2); color: var(--kate); }
.label-mira { background: rgba(9, 132, 227, 0.2); color: var(--mira); }
.label-kaka { background: rgba(108, 92, 231, 0.2); color: var(--kaka); }
.label-personal { background: rgba(99, 110, 114, 0.2); color: #b2bec3; }

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.priority-low { background: var(--priority-low); }
.priority-medium { background: var(--priority-medium); }
.priority-high { background: var(--priority-high); animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.task-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ===== Form ===== */
form { padding: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}
.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}
.btn-cancel:hover { border-color: var(--text-secondary); }
.btn-save {
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
}
.btn-save:hover { background: var(--accent-hover); }

/* ===== Detail Modal ===== */
.detail-modal { max-width: 550px; }
.detail-body { padding: 20px; }
.detail-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.detail-desc {
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 60px;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.detail-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;\n    gap: 20px;
}
.detail-actions { display: flex; gap: 8px; }
.btn-edit {
    padding: 8px 16px;\n    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
}
.btn-delete {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--recheck);
    color: var(--recheck);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
}
.btn-delete:hover { background: rgba(225, 112, 85, 0.1); }

.detail-status {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {\n    .board {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {\n    .board {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .header {
        padding: 12px 16px;
    }
    .header h1 { font-size: 1.1rem; }
    .stats-bar {
        gap: 16px;
        padding: 10px 16px;
    }
    .stat-number { font-size: 1.2rem; }
    .filter-group { gap: 3px; }
    .filter-btn { padding: 5px 10px; font-size: 0.7rem; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.empty-state .empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
