/* ═══════════════════════════════════════════════════════════════════
   Task Tracker — Styles
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg:        #f1f5f9;
    --surface:   #ffffff;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --text-muted:#64748b;
    --accent:    #6366f1;
    --radius:    12px;
    --shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);

    --prio-high: #ef4444;
    --prio-med:  #f59e0b;
    --prio-low:  #94a3b8;

    --col-todo:  #6366f1;
    --col-prog:  #f59e0b;
    --col-done:  #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────── */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.header h1 { font-size: 1.25rem; font-weight: 700; }
.header-sub { color: var(--text-muted); font-size: 0.875rem; }

/* ── Board ──────────────────────────────────────────────────────── */

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    max-width: 1280px;
    margin: 0 auto;
    align-items: start;
}

.column {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.col-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--col-color, var(--accent));
    flex-shrink: 0;
}

.column-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.col-count {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
}

/* ── Task List ──────────────────────────────────────────────────── */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
    flex: 1;
}

.task-list:empty::after {
    content: 'Нет задач';
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 20px 0;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

/* ── Task Card ──────────────────────────────────────────────────── */

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: box-shadow 0.15s, transform 0.15s;
    user-select: none;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.sortable-drag {
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    transform: rotate(2deg);
    opacity: 0.9;
}

.task-card.sortable-ghost {
    opacity: 0.35;
    background: var(--bg);
    border: 2px dashed var(--accent);
}

.task-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.priority-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.priority-high { background: #fef2f2; color: var(--prio-high); }
.priority-medium { background: #fffbeb; color: var(--prio-med); }
.priority-low { background: #f8fafc; color: var(--prio-low); }

.task-card-due {
    display: flex;
    align-items: center;
    gap: 3px;
}

.task-card-due.overdue { color: var(--prio-high); font-weight: 600; }

/* ── Add Button ─────────────────────────────────────────────────── */

.btn-add {
    margin-top: 12px;
    padding: 8px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.btn-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f8f9ff;
}

/* ── Modal ──────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--surface);
    color: var(--text);
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-danger {
    background: #fef2f2;
    color: var(--prio-high);
}
.btn-danger:hover { background: #fee2e2; }

/* ── Toast ──────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 2000;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error { background: var(--prio-high); }

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .board {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .modal {
        max-width: 100%;
        margin: 0 8px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .board { grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
}
