/* ===== Сброс и базовые стили ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 240px;

    --status-new: #94a3b8;
    --status-in_progress: #3b82f6;
    --status-waiting_client: #f59e0b;
    --status-done: #22c55e;
    --status-overdue: #ef4444;

    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    padding: 24px;
    flex: 1;
    padding-bottom: 80px;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s;
}

.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.sidebar-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 8px 8px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .95rem;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-item.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.nav-logout { color: #ef4444; }
.nav-logout:hover { color: #dc2626; background: #fef2f2; }
.nav-badge {
    margin-left: auto;
    background: var(--status-overdue);
    color: #fff;
    font-size: .7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* ===== Top bar ===== */
.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title { font-size: 1.25rem; font-weight: 600; flex: 1; }

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-link { font-size: 1.3rem; position: relative; text-decoration: none; }
.badge {
    position: absolute;
    top: -6px; right: -8px;
    background: var(--status-overdue);
    color: #fff;
    font-size: .65rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

.user-name { font-size: .9rem; color: var(--text-muted); }

.burger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.burger-btn span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ===== Bottom nav (mobile) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    padding: 6px 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .75rem;
    padding: 4px 8px;
}
.bottom-nav-item span { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-logout { color: #ef4444; }
.bottom-nav-logout.active { color: #ef4444; }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title { font-size: 1rem; font-weight: 600; }

/* ===== Stats grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label { font-size: .85rem; color: var(--text-muted); }
.stat-card.overdue .stat-value { color: var(--status-overdue); }
.stat-card.done .stat-value { color: var(--status-done); }
.stat-card.active .stat-value { color: var(--status-in_progress); }

/* ===== Task cards ===== */
.task-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--border);
    transition: box-shadow .15s;
}

.task-card:hover { box-shadow: var(--shadow-md); }
.task-card.status-new { border-left-color: var(--status-new); }
.task-card.status-in_progress { border-left-color: var(--status-in_progress); }
.task-card.status-waiting_client { border-left-color: var(--status-waiting_client); }
.task-card.status-done { border-left-color: var(--status-done); }
.task-card.status-overdue { border-left-color: var(--status-overdue); background: #fff5f5; }

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.task-card-title { font-weight: 600; font-size: .95rem; }
.task-card-title a { color: var(--text); text-decoration: none; }
.task-card-title a:hover { color: var(--primary); }

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== Badges ===== */
.badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.badge-status.status-new { background: var(--status-new); }
.badge-status.status-in_progress { background: var(--status-in_progress); }
.badge-status.status-waiting_client { background: var(--status-waiting_client); }
.badge-status.status-done { background: var(--status-done); }
.badge-status.status-overdue { background: var(--status-overdue); }

.badge-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-priority.priority-high { background: #fee2e2; color: #dc2626; }
.badge-priority.priority-medium { background: #fef3c7; color: #d97706; }
.badge-priority.priority-low { background: #f0fdf4; color: #16a34a; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
}

.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: var(--bg); }

/* ===== Login page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-logo { text-align: center; font-size: 2.5rem; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }

/* Поле пароля с кнопкой «глазик» */
.password-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-field-wrap .password-input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 4px 6px;
    opacity: .65;
}
.password-toggle:hover { opacity: 1; }

/* Honeypot для ботов (скрытое поле на входе) */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ===== Subtasks ===== */
.subtask-list { list-style: none; }
.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.subtask-item:last-child { border-bottom: none; }
.subtask-item.done .subtask-title { text-decoration: line-through; color: var(--text-muted); }

.subtask-checkbox {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.progress-bar-wrap {
    background: var(--border);
    border-radius: 20px;
    height: 8px;
    margin: 8px 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--status-done);
    border-radius: 20px;
    transition: width .3s;
}

/* ===== Comments ===== */
.comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: .85rem;
}
.comment-author { font-weight: 600; }
.comment-date { color: var(--text-muted); }
.comment-text { font-size: .9rem; line-height: 1.5; }

/* ===== Calendar ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 24px;
}

.cal-header {
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px;
}

.cal-day {
    min-height: 80px;
    background: var(--surface);
    border-radius: 8px;
    padding: 6px;
    border: 1px solid var(--border);
    font-size: .8rem;
}

.cal-day.other-month { opacity: .4; }
.cal-day.today { border-color: var(--primary); background: #eef2ff; }
.cal-day-num { font-weight: 600; margin-bottom: 4px; font-size: .85rem; }

.cal-task {
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: .65rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
}
.cal-task.overdue { background: var(--status-overdue); }

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cal-nav h2 { font-size: 1.1rem; font-weight: 600; }

/* Upcoming list */
.upcoming-list { list-style: none; }
.upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.upcoming-date {
    min-width: 50px;
    text-align: center;
    background: var(--bg);
    border-radius: 8px;
    padding: 6px;
    font-size: .8rem;
    font-weight: 600;
}
.upcoming-date.overdue { background: #fee2e2; color: var(--status-overdue); }

/* ===== Notifications ===== */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.notif-item.unread { background: #f0f9ff; margin: 0 -20px; padding: 14px 20px; }
.notif-icon { font-size: 1.4rem; }
.notif-body { flex: 1; }
.notif-title { font-weight: 600; font-size: .9rem; }
.notif-message { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.notif-date { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Files ===== */
.file-list { list-style: none; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.file-item a { font-weight: 500; }

/* ===== Activity log ===== */
.activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.activity-date { color: var(--text-muted); white-space: nowrap; min-width: 120px; }

/* ===== Grid 2 col ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== Modal overlay ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-content { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .burger-btn { display: flex; }
    .bottom-nav { display: flex; padding: 6px 4px; }
    .bottom-nav-item { flex: 1; min-width: 0; font-size: .65rem; padding: 4px 2px; }
    .bottom-nav-item small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .page-content { padding: 16px; padding-bottom: 80px; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .calendar-grid { display: none; }
    .user-name { display: none; }
    .login-card { padding: 28px 20px; }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
}

/* ===== Utilities ===== */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--status-overdue); }
.text-success { color: var(--status-done); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }

/* ===== Канбан ===== */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}

.kanban-column {
    flex: 0 0 260px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-weight: 600;
    font-size: .9rem;
    border-bottom: 2px solid var(--border);
}

.kanban-col-new .kanban-column-header { border-bottom-color: var(--status-new); }
.kanban-col-in_progress .kanban-column-header { border-bottom-color: var(--status-in_progress); }
.kanban-col-waiting_client .kanban-column-header { border-bottom-color: var(--status-waiting_client); }
.kanban-col-done .kanban-column-header { border-bottom-color: var(--status-done); }

.kanban-count {
    background: var(--border);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 700;
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 80px;
    transition: background .15s;
}

.kanban-cards.drag-over {
    background: #eef2ff;
    border-radius: 0 0 var(--radius) var(--radius);
}

.kanban-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    cursor: grab;
    border-left: 3px solid var(--border);
    transition: box-shadow .15s, transform .1s;
}

.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: .5; cursor: grabbing; }
.kanban-card.is-overdue { border-left-color: var(--status-overdue); background: #fff5f5; }

.kanban-card-title {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 6px;
}
.kanban-card-title:hover { color: var(--primary); }

.kanban-card-deadline {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.kanban-card-deadline.overdue { color: var(--status-overdue); font-weight: 600; }

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* ===== Таймлайн ===== */
.collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapse-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.collapse-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.collapsible-body.is-collapsed {
    display: none;
}

.collapsible-body:not(.is-collapsed) {
    padding-top: 4px;
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-date {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.timeline-text {
    font-size: .9rem;
    line-height: 1.4;
}

/* ===== Чек-лист (Notion-style) ===== */
.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-item {
    padding: 4px 0;
    border-radius: 6px;
    transition: background .1s;
}

.checklist-item:hover { background: var(--bg); }

.checklist-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 6px 4px;
    user-select: none;
}

.checklist-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checklist-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    background: var(--surface);
}

.checklist-checkbox:checked + .checklist-check {
    background: var(--status-done);
    border-color: var(--status-done);
}

.checklist-checkbox:checked + .checklist-check::after {
    content: '✓';
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

.checklist-text {
    font-size: .95rem;
    line-height: 1.4;
    flex: 1;
}

.checklist-item.done .checklist-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-add-form { margin-top: 8px; }

.checklist-add-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: .9rem;
    color: var(--text-muted);
    outline: none;
}

.checklist-add-input:focus {
    color: var(--text);
    background: var(--bg);
    border-radius: 6px;
    padding-left: 8px;
}

/* ===== Переключатель вида ===== */
.view-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 8px;
}

.view-tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .15s;
}

.view-tab:hover { color: var(--text); text-decoration: none; }
.view-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ===== Прогресс проекта ===== */
.project-progress-block {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}

.progress-bar-lg { height: 12px; }

@media (max-width: 768px) {
    .kanban-column { flex: 0 0 220px; }
    .kanban-board { min-height: 300px; }
    .kanban-card[draggable] { cursor: default; }
    .kanban-mobile-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== v3: Финансы ===== */
.finance-block {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
}
.finance-row {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    padding: 3px 0;
}
.finance-bar { background: #22c55e; }

/* ===== v3: Этапы ===== */
.stages-list { list-style: none; }
.stage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.stage-item:last-child { border-bottom: none; }
.stage-item.paid { opacity: .85; }
.stage-num {
    width: 28px; height: 28px;
    background: var(--bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.stage-body { flex: 1; }
.stage-title { font-weight: 600; font-size: .95rem; }
.stage-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 10px; margin-top: 2px; }

/* ===== v3: Фильтры ===== */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: center;
}
.filter-check {
    display: flex; align-items: center; gap: 6px;
    font-size: .85rem; cursor: pointer;
}

/* ===== v3: Поиск ===== */
.header-search { max-width: 220px; }
.header-search .form-control { padding: 6px 10px; font-size: .85rem; }
.search-result-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-form .form-control { flex: 1; }

/* ===== v3: Статус на проверке ===== */
.badge-status.status-ready_for_review { background: #8b5cf6; }
.badge-status.status-revision { background: #e11d48; }
.task-card.status-ready_for_review { border-left-color: #8b5cf6; }
.task-card.status-revision { border-left-color: #e11d48; background: #fff1f2; }
.task-detail-card.status-ready_for_review { border-left: 4px solid #8b5cf6; }
.task-detail-card.status-revision { border-left: 4px solid #e11d48; }
.kanban-card.is-review { border-left-color: #8b5cf6; }

.client-status-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.edit-task-form {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

/* ===== v3: Приёмка задачи ===== */
.accept-task-block {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}

/* ===== v3: Мобильный канбан ===== */
.kanban-mobile-actions { display: none; }

/* ===== Архив проектов ===== */
.card-archived {
    opacity: .92;
    background: #f8fafc;
}

.project-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.inline-form button {
    vertical-align: middle;
}

/* ===== Платежи ===== */
.finance-row-total {
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px dashed var(--border);
}

.payments-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.payment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
}

.payment-date {
    color: var(--text-muted);
    font-size: .85rem;
    min-width: 72px;
}

.payment-amount {
    color: var(--primary);
}

.extra-tasks-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.extra-tasks-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
}

.extra-tasks-list li:last-child {
    border-bottom: none;
}

.task-finance-block {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.task-finance-form {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
