﻿/* ============================================
   KANBAN BOARD - COMPLETE STYLES
   Версия: 3.0 (чистая сборка)
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #0079bf;
    --primary-dark: #026aa7;
    --accent: #667eea;
    --accent-dark: #764ba2;
    --card-bg: #ffffff;
    --column-bg: #ebecf0;
    --text: #172b4d;
    --text-secondary: #718096;
    --border: #dfe1e6;
    --hover: rgba(9, 30, 66, 0.08);
    --shadow: rgba(9, 30, 66, 0.13);
    --green: #48bb78;
    --red: #f56565;
    --orange: #ed8936;
    --blue: #4299e1;
    --purple: #9f7aea;
    --yellow: #ecc94b;
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

/* ===== BOARDS SCREEN ===== */
.boards-screen {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.boards-screen.hidden { display: none !important; }

.boards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.boards-header h1 {
    font-size: 28px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}
.boards-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.boards-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}
.boards-menu-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.board-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 24px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}
.board-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}
.board-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.board-card:active { cursor: grabbing; }
.board-card h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.board-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.board-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.board-stats span { display: flex; align-items: center; gap: 4px; }

.board-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}
.board-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.4;
    transition: all 0.2s;
    color: var(--text-secondary);
    flex-shrink: 0;
    line-height: 1;
}
.board-action-btn:hover {
    opacity: 1;
    background: var(--hover);
    color: var(--text);
}
.board-card:hover .board-action-btn { opacity: 0.7; }

/* ===== BOARD SCREEN ===== */
.board-screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}
.board-screen.active { display: flex; }

.board-topbar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-wrap: wrap;
    gap: 12px;
}
.board-topbar-left { display: flex; align-items: center; gap: 16px; }
.board-topbar h2 { font-size: 20px; font-weight: 700; }
.board-topbar-right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.board-content {
    flex: 1;
    overflow: visible;
    padding: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

/* ===== CONTROLS ===== */
.controls-wrap {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.controls-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.controls-row:last-child { margin-bottom: 0; }

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.control-group select,
.control-group input[type="date"] {
    padding: 10px 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.control-group select:hover,
.control-group input:hover { border-color: var(--primary); }
.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.1);
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
}
.checkbox-wrap:hover { background: rgba(102, 126, 234, 0.05); }
.checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== ПОИСК ===== */
#kanbanSearch {
    padding: 10px 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s;
    min-width: 220px;
}
#kanbanSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
    background: #fff;
}
#kanbanSearch::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.card.search-match {
    box-shadow: 0 0 0 2px var(--accent), 0 4px 12px var(--shadow);
}

/* ===== COLUMNS ===== */
.columns-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 20px;
    overflow-x: auto;
    overflow-y: visible;
    width: max-content;
    min-width: 100%;
}
.column {
    background: var(--column-bg);
    border-radius: 14px;
    width: 300px;
    min-width: 260px;
    max-width: 640px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-top: 3px solid var(--primary);
    flex-shrink: 0;
    overflow: hidden;
}
.column-header {
    padding: 12px 14px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
    cursor: grab;
}
.column-header:active { cursor: grabbing; }
.column-header-left { display: flex; align-items: center; gap: 8px; flex: 1; }

.column-name-editable {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
}
.column-name-editable:hover { background: rgba(9, 30, 66, 0.06); }
.column-name-editable:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.column-count {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.column-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.column-menu-btn:hover {
    opacity: 1;
    background: var(--hover);
}

.column-cards {
    padding: 8px;
    flex: 1;
    min-height: 50px;
    overflow-y: visible;
}
.column-cards.drag-over {
    background: rgba(0, 121, 191, 0.1);
    border-radius: 8px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    cursor: grab;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}
.card:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 16px rgba(9, 30, 66, 0.18);
    transform: translateY(-2px);
}
.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg);
}
.card.priority-low { border-left-color: #48dbfb; }
.card.priority-medium { border-left-color: #feca57; }
.card.priority-high { border-left-color: #ff6b6b; }
.card.today { border-left-color: var(--orange) !important; }
.card.overdue { border-left-color: var(--red) !important; }
.card.mine { background: rgba(102, 126, 234, 0.05); }

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.card-header-row .card-title {
    flex: 1;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    transition: color 0.2s;
    color: var(--text);
}
.card-header-row .card-title:hover { color: var(--accent); }

.card-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.4;
    transition: all 0.2s;
    color: var(--text-secondary);
    flex-shrink: 0;
    line-height: 1;
}
.card-menu-btn:hover {
    opacity: 1;
    background: var(--hover);
    color: var(--text);
}
.card:hover .card-menu-btn { opacity: 0.7; }

.card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    cursor: pointer;
    word-break: break-word;      /* длинные слова переносятся */
    overflow-wrap: anywhere;     /* подстраховка для Safari/Firefox */
    display: -webkit-box;
    -webkit-line-clamp: 3;       /* максимум 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;            /* остальное обрезается */
    text-overflow: ellipsis;     /* троеточие в конце */
}

.card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}
.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.card-date { display: flex; align-items: center; gap: 4px; }

.card-labels-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.card-label {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== BADGES ===== */
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-priority-low { background: #e3fcef; color: #006644; }
.badge-priority-medium { background: #fffae6; color: #ff8b00; }
.badge-priority-high { background: #ffebe6; color: #de350b; }
.badge-crm { background: #eae6ff; color: #403294; }
.badge-owner { background: rgba(66, 153, 225, 0.15); color: var(--blue); }
.badge-attempts { background: rgba(236, 201, 75, 0.2); color: #b7791f; }
.badge-kp { background: rgba(237, 137, 54, 0.18); color: var(--orange); }
.badge-money { background: rgba(72, 187, 120, 0.15); color: var(--green); }
.badge-wait { background: rgba(127, 140, 141, 0.15); color: var(--text-secondary); }
.badge-overdue { background: rgba(245, 101, 101, 0.15); color: var(--red); }
.badge-rot {
    background: rgba(128, 0, 128, 0.15);
    color: #6a0dad;
    border: 1px solid rgba(106, 13, 173, 0.3);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Цветные точки вместо эмодзи приоритета */
.badge-priority-low::before,
.badge-priority-medium::before,
.badge-priority-high::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
    flex-shrink: 0;
}
.badge-priority-low::before { background: #48dbfb; }
.badge-priority-medium::before { background: #feca57; }
.badge-priority-high::before { background: #ff6b6b; }

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.55);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.3); }

.btn-danger {
    background: #eb5a46;
    color: white;
}
.btn-danger:hover { background: #cf513d; }

.btn-small { padding: 6px 12px; font-size: 13px; }

.add-card-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
    font-family: inherit;
}
.add-card-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}

.add-column-btn {
    min-width: 300px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
}
.add-column-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.show-more-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: #edf2f7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
}
.show-more-btn:hover { background: #e2e8f0; color: var(--text); }

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlide 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -30px -30px 24px;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}
.modal-header h2 { color: #ffffff; font-size: 18px; margin: 0; }
.modal-header .close-btn {
    color: rgba(255, 255, 255, 0.85);
}
.modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.close-btn:hover {
    background: var(--hover);
    color: var(--text);
}


.view-card-content { max-height: 70vh; overflow-y: auto; }
.view-card-content h3 { color: var(--text); margin: 0; }
.view-card-content h4 { color: var(--text-secondary); margin: 0; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
    color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== CONTEXT MENUS ===== */
.column-context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    min-width: 200px;
    display: none;
}
.column-context-menu.active { display: block; }
.column-context-menu button {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s;
    font-family: inherit;
}
.column-context-menu button:hover { background: var(--hover); }
.column-context-menu button:first-child { border-radius: 8px 8px 0 0; }
.column-context-menu button:last-child { border-radius: 0 0 8px 8px; }

.card-context-menu {
    position: fixed;
    z-index: 3000;
    min-width: 220px;
}
.card-context-menu-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid var(--border);
}
.card-context-menu-content button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}
.card-context-menu-content button:hover { background: var(--hover); }
.card-context-menu-content button:first-child { border-radius: 8px 8px 0 0; }
.card-context-menu-content button:last-child { border-radius: 0 0 8px 8px; }
.card-context-menu-content button.danger {
    color: var(--red);
    border-top: 1px solid var(--border);
}
.card-context-menu-content button.danger:hover { background: rgba(245, 101, 101, 0.1); }

.board-context-menu {
    position: fixed;
    z-index: 3000;
    min-width: 220px;
}
.board-context-menu-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid var(--border);
}
.board-context-menu-content button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}
.board-context-menu-content button:hover { background: var(--hover); }
.board-context-menu-content button:first-child { border-radius: 8px 8px 0 0; }
.board-context-menu-content button:last-child { border-radius: 0 0 8px 8px; }
.board-context-menu-content button.danger {
    color: var(--red);
    border-top: 1px solid var(--border);
}
.board-context-menu-content button.danger:hover { background: rgba(245, 101, 101, 0.1); }

.boards-context-menu {
    position: fixed;
    z-index: 3000;
    min-width: 220px;
}
.boards-context-menu-content {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid var(--border);
}
.boards-context-menu-content button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}
.boards-context-menu-content button:hover { background: var(--hover); }
.boards-context-menu-content button:first-child { border-radius: 10px 10px 0 0; }
.boards-context-menu-content button:last-child { border-radius: 0 0 10px 10px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
    grid-column: 1 / -1;
}
.empty-state h2 { font-size: 32px; margin-bottom: 16px; }
.empty-state p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }

/* ===== MOBILE MENU ===== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.mobile-menu.active { display: flex; }
.mobile-menu-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 300px;
}
.mobile-menu-content button {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 8px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
}
.mobile-menu-content button:hover { background: var(--accent-dark); }
.mobile-menu-btn { display: none; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.6); }

.column-cards::-webkit-scrollbar { width: 6px; }
.column-cards::-webkit-scrollbar-track { background: transparent; }
.column-cards::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }

/* ===== DRAG AND DROP ===== */
[draggable="true"] { user-select: none; }
.drag-over {
    background: rgba(0, 121, 191, 0.1) !important;
    border-radius: 8px;
}
.column.dragging { opacity: 0.5; transform: rotate(2deg); }
.column.drag-over {
    background: rgba(102, 126, 234, 0.15) !important;
    border: 2px dashed var(--accent) !important;
}
.column-header.drag-over { background: rgba(102, 126, 234, 0.1); }

.board-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    cursor: grabbing;
}
.board-card.drag-over {
    border: 2px dashed var(--accent) !important;
    background: rgba(102, 126, 234, 0.1) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.3s ease; }

/* ===== CHECKLISTS ===== */
/* ===== ЧЕК-ЛИСТЫ: ВЕРТИКАЛЬНЫЙ СКРОЛЛ КАК У ДРУГИХ ОКОН ===== */
#checklistModal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;
    overflow-x: hidden;
}
#checklistModal .modal-content {
    width: 650px;
    max-width: 95vw;
    min-width: min(560px, 95vw);
    max-height: none !important;
    overflow: visible !important;
}
.checklist {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}
.checklist-header { margin-bottom: 12px; }
.checklist-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.checklist-title-input {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
}
.checklist-title-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px var(--primary);
}
.checklist-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), #38a169);
    transition: width 0.3s ease;
    border-radius: 4px;
}
.progress-text { font-size: 13px; font-weight: 700; color: var(--green); min-width: 40px; text-align: right; }
.checklist-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.overdue-badge {
    background: rgba(245, 101, 101, 0.15);
    color: var(--red);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.checklist-items { margin: 8px 0; }
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.checklist-item:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.checklist-item.dragging { opacity: 0.5; background: #e2e8f0; }
.checklist-item.drag-over { border-top: 2px solid var(--primary); }
.checklist-item.done { opacity: 0.6; }
.checklist-item.done .item-text { text-decoration: line-through; color: var(--text-secondary); }
.checklist-item.overdue {
    border-left: 3px solid var(--red);
    background: rgba(245, 101, 101, 0.05);
}
.drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 14px;
    user-select: none;
    padding: 0 4px;
}
.drag-handle:active { cursor: grabbing; }
.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}
.item-text {
    flex: 1;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.item-text:hover { background: #f0f0f0; }
.item-deadline {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
.item-deadline:focus { outline: none; border-color: var(--primary); }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}
.btn-icon:hover { opacity: 1; background: var(--hover); }
.btn-delete:hover { background: rgba(245, 101, 101, 0.1); }

.add-item-form { display: flex; gap: 8px; margin-top: 10px; }
.new-item-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: white;
}
.new-item-input:focus {
    outline: none;
    border-color: var(--primary);
    border-style: solid;
}
.new-item-deadline {
    padding: 8px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.card-checklist-summary {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-checklist-summary:hover { background: rgba(102, 126, 234, 0.15); }
.card-checklist-summary.overdue { background: rgba(245, 101, 101, 0.1); }
.checklist-mini-bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.checklist-mini-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s;
}
.card-checklist-summary.overdue .checklist-mini-fill { background: var(--red); }
.checklist-mini-text { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }

.card-checklist-add {
    margin-top: 10px;
    padding: 8px 10px;
    background: transparent;
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    transition: all 0.2s;
}
.card-checklist-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.add-checklist-form input {
    flex: 1;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.add-checklist-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.1);
}

/* ===== LABELS ===== */
.labels-manager-modal .modal-content { max-width: 600px; }
.label-manager-item:hover { background: #edf2f7 !important; }
.label-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 121, 191, 0.1);
}
.color-option:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-labels-modal .modal-content { max-width: 450px; }
.label-checkbox-item:hover { background: rgba(102, 126, 234, 0.05) !important; }
.label-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

#activeLabelsFilter { min-height: 32px; }
.filter-label { transition: all 0.2s; }
.filter-label:hover { opacity: 0.85; transform: scale(1.05); }
.filter-label button { font-size: 16px; line-height: 1; }
.filter-label button:hover { transform: scale(1.3); }

.card-labels-btn {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px dashed var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    transition: all 0.2s;
}
.card-labels-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.modal-label-item { user-select: none; }
.modal-label-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.modal-label-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.modal-label-item span { font-weight: 500; }

/* ===== SETTINGS MENU ===== */
.settings-menu {
    position: fixed;
    z-index: 2000;
    min-width: 280px;
    max-width: 320px;
}
.settings-menu-content {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid var(--border);
}
.settings-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
}
.settings-menu-header h3 { margin: 0; font-size: 18px; }
.settings-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }
.settings-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.settings-item:hover { color: var(--accent); }
.settings-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ===== DARK THEME ===== */
body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
body.dark-theme .boards-header,
body.dark-theme .controls-wrap,
body.dark-theme .board-topbar {
    background: rgba(26, 26, 46, 0.72);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
body.dark-theme .controls-wrap { border-radius: 16px; }

body.dark-theme .board-card,
body.dark-theme .column,
body.dark-theme .card,
body.dark-theme .modal-content {
    background: var(--card-bg);
    color: var(--text);
}
body.dark-theme .column {
    background: rgba(37, 37, 80, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
body.dark-theme .card {
    background: rgba(30, 30, 63, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
body.dark-theme .card:hover {
    background: rgba(42, 42, 74, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background: #2a2a4a;
    color: var(--text);
    border-color: var(--border);
}
body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    color: white;
}
body.dark-theme .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }
body.dark-theme .board-topbar .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }

/* Темная тема для кнопок топбара */
body.dark-theme .board-topbar .btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: white;
}

body.dark-theme .board-topbar .btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

body.dark-theme .board-topbar .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: white;
}

body.dark-theme .board-topbar .btn-danger {
    background: #eb5a46;
    border-color: transparent;
    color: white;
}

body.dark-theme .board-topbar .btn-danger:hover {
    background: #cf513d;
}

body.dark-theme .column-context-menu {
    background: #232345;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
body.dark-theme .column-context-menu button { background: #232345; color: var(--text); }
body.dark-theme .column-context-menu button:hover { background: rgba(255, 255, 255, 0.08); }

body.dark-theme .board-content { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
body.dark-theme .card:hover { background: #26264d; }
body.dark-theme .column-name-editable { background: transparent; color: var(--text); }
body.dark-theme .column-name-editable:hover { background: rgba(255, 255, 255, 0.07); }
body.dark-theme .column-name-editable:focus { background: #2a2a4a; }
body.dark-theme .add-card-btn { border-color: #3a3a6a; color: var(--text-secondary); }
body.dark-theme .add-card-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

body.dark-theme .badge-priority-low { background: rgba(72, 219, 251, 0.16); color: #48dbfb; }
body.dark-theme .badge-priority-medium { background: rgba(255, 159, 26, 0.18); color: #ffb84d; }
body.dark-theme .badge-priority-high { background: rgba(255, 107, 107, 0.18); color: #ff6b6b; }
body.dark-theme .badge-crm { background: rgba(159, 122, 234, 0.20); color: #c4b5fd; }
body.dark-theme .badge-rot {
    background: rgba(159, 122, 234, 0.25);
    color: #c4b5fd;
    border-color: rgba(159, 122, 234, 0.4);
}

body.dark-theme .checklist-mini-bar,
body.dark-theme .progress-bar { background: #3a3a6a !important; }
body.dark-theme .checklist-mini-fill,
body.dark-theme .progress-fill { background: #61bd4f !important; }

body.dark-theme ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); }
body.dark-theme .column-cards::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

body.dark-theme .modal-label-item { background: #2a2a4a !important; border-color: #3a3a6a !important; }
body.dark-theme .modal-label-item:hover { background: #353555 !important; }
body.dark-theme #modalLabelsContainer { background: rgba(255, 255, 255, 0.05) !important; }
body.dark-theme .view-card-content [style*="background:#f8f9fa"] { background: #2a2a4a !important; }
body.dark-theme .label-name-input { background: #1e1e3f !important; border-color: #3a3a6a !important; color: var(--text) !important; }
body.dark-theme .label-manager-item { background: #2a2a4a !important; border: 1px solid #3a3a6a; }
body.dark-theme .label-manager-item:hover { background: #353555 !important; }

body.dark-theme .add-card-btn,
body.dark-theme .add-column-btn { background: rgba(255, 255, 255, 0.05); }
body.dark-theme .add-card-btn:hover,
body.dark-theme .add-column-btn:hover { background: rgba(255, 255, 255, 0.1); }
body.dark-theme .show-more-btn { background: #2a2a4a; }
body.dark-theme .show-more-btn:hover { background: #353555; }

body.dark-theme .kcard,
body.dark-theme .card-checklist-summary,
body.dark-theme .card-checklist-add { background: var(--card-bg); }
body.dark-theme .checklist,
body.dark-theme .checklist-item { background: #2a2a4a; }
body.dark-theme .checklist-item { border-color: #3a3a6a; }
body.dark-theme .progress-bar { background: #3a3a6a; }

body.dark-theme .kcard-move-btn { border-color: #3a3a6a; }
body.dark-theme .kcard-move-btn:hover { background: rgba(255, 255, 255, 0.08); }

body.dark-theme .archive-item { background: rgba(42, 42, 74, 0.6); border-left-color: #3a3a6a; }
body.dark-theme .archive-item:hover { background: rgba(53, 53, 85, 0.8); }

body.dark-theme .history-icon { background: rgba(255, 255, 255, 0.08); }
body.dark-theme .history-event:not(:last-child)::before { background: #3a3a6a; }

body.dark-theme .boards-context-menu-content { background: #232345; border-color: rgba(255, 255, 255, 0.1); }
body.dark-theme .boards-context-menu-content button { color: var(--text); }
body.dark-theme .boards-context-menu-content button:hover { background: rgba(255, 255, 255, 0.08); }

body.dark-theme .boards-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: white;
}
body.dark-theme .boards-menu-btn:hover { background: rgba(255, 255, 255, 0.16); }

body.dark-theme #kanbanSearch {
    background: #2a2a4a;
    border-color: #3a3a6a;
    color: var(--text);
}
body.dark-theme #kanbanSearch:focus { background: #1e1e3f; border-color: var(--accent); }
body.dark-theme #kanbanSearch::placeholder { color: #a0a0b0; }

/* ===== LIGHT THEME ===== */
body.light-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== COMPACT CARDS ===== */
body.compact-cards .card { padding: 8px; margin-bottom: 6px; }
body.compact-cards .card-title { font-size: 13px; margin-bottom: 4px; }
body.compact-cards .card-description { font-size: 11px; margin-bottom: 6px; }
body.compact-cards .badge { padding: 2px 6px; font-size: 10px; }
body.compact-cards .card-footer { font-size: 10px; }
body.compact-cards .kcard-move { margin-top: 6px; gap: 2px; }
body.compact-cards .kcard-move-btn { padding: 2px 6px; font-size: 11px; min-width: 22px; }

/* ===== KARD MOVE (← →) ===== */
.kcard-move {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}
.kcard-move-spacer { flex: 1; }
.kcard-move-btn {
    padding: 3px 10px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: all 0.2s;
    font-family: inherit;
    min-width: 28px;
}
.kcard-move-btn:hover {
    opacity: 1;
    color: var(--text);
    border-color: var(--primary);
    background: var(--hover);
}
.card:hover .kcard-move-btn { opacity: 0.85; }

/* ===== ARCHIVE ===== */
.archive-modal .modal-content { max-width: 600px; }
.archive-list { max-height: 60vh; overflow-y: auto; padding: 4px; }
.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--column-bg);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--border);
    transition: all 0.2s;
}
.archive-item:hover { background: var(--hover); border-left-color: var(--accent); }
.archive-item-main { flex: 1; min-width: 0; }
.archive-item-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.archive-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.archive-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

#boardsArchiveModal .archive-item { cursor: default; }
#archiveBoardsCount { cursor: pointer; }
#archiveBoardsCount:hover { opacity: 1; color: var(--accent); }

/* ===== HISTORY ===== */
.card-history-timeline {
    max-height: 300px;
    overflow-y: auto;
    padding-left: 4px;
}
.history-event {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    position: relative;
}
.history-event:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 28px;
    bottom: -8px;
    width: 2px;
    background: var(--border);
}
.history-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    z-index: 1;
}
.history-body { flex: 1; min-width: 0; }
.history-details { font-size: 13px; color: var(--text); line-height: 1.4; }
.history-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ===== COLOR PICKER ===== */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 0 30px;
}
.color-swatch {
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    position: relative;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.color-swatch.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body { padding: 10px; }
    .boards-header {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        text-align: center;
    }
    .boards-grid { grid-template-columns: 1fr; }
    .board-topbar {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    .board-topbar-left,
    .board-topbar-right {
        width: 100%;
        justify-content: center;
    }
    .board-topbar h2 { font-size: 16px; }
    .btn { padding: 8px 12px; font-size: 13px; }
    .controls-wrap { padding: 12px; }
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    .control-group select,
    .control-group input[type="date"] { flex: 1; }
    .columns-container {
        flex-direction: column;
        align-items: stretch;
    }
    .column {
        min-width: 100%;
        max-width: 100%;
        max-height: none;
    }
    .add-column-btn { min-width: 100%; }
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
    .form-row { grid-template-columns: 1fr; }
    .mobile-menu-btn { display: inline-flex; }
    .card, .kcard { touch-action: pan-y; }
    .column-menu-btn { padding: 8px 12px; font-size: 24px; }
    .board-content { padding: 10px; }
}
@media (max-width: 360px) {
    .board-topbar-right .btn { padding: 6px 10px; font-size: 12px; }
    .column-header { font-size: 14px; padding: 10px 12px; }
    .card-title { font-size: 14px; }
}

/* ===== PRINT ===== */
@media print {
    body { background: white; padding: 0; }
    .board-topbar,
    .controls-wrap,
    .add-card-btn,
    .add-column-btn,
    .btn { display: none !important; }
    .columns-container { flex-direction: column; }
    .column {
        min-width: 100%;
        max-width: 100%;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* ===== КНОПКА-ЗАМОК ФИКСАЦИИ КОЛОНОК ===== */
#lockColumnsBtn {
    min-width: 42px;
    justify-content: center;
    font-size: 16px;
}
#lockColumnsBtn.locked {
    background: rgba(245, 101, 101, 0.25);
    border-color: rgba(245, 101, 101, 0.6);
    color: #ff8b8b;
}
body.dark-theme #lockColumnsBtn.locked {
    background: rgba(245, 101, 101, 0.2);
    border-color: rgba(245, 101, 101, 0.5);
}

/* ===== ДОСКА НАСТРОЕК ===== */
#settingsScreen { display: none; }
#settingsScreen.active { display: flex; }
#settingsScreen .controls-wrap {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
body.dark-theme #settingsScreen .controls-wrap {
    background: rgba(26, 26, 46, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== ИСПОЛНИТЕЛЬ ===== */
.badge-assignee {
    border-radius: 999px;
    min-width: 28px;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid currentColor;
}
.card.mine {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.45), 0 1px 3px var(--shadow);
}
body.dark-theme .card.mine {
    box-shadow: 0 0 0 2px rgba(159, 122, 234, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ===== ОДИН ВЕРТИКАЛЬНЫЙ СКРОЛЛ + ВИДИМЫЕ ПОЛОСЫ ===== */
.board-screen {
    height: calc(100vh - 40px); /* 100vh минус отступы body 20px сверху и снизу */
    min-height: 0;
}
.board-content {
    flex: 1;
    min-height: 0;
	overflow: visible;
    padding: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}
.columns-container { padding-bottom: 28px; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); border-radius: 8px; }
::-webkit-scrollbar-thumb {
    background: #9aa3b5;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb:hover { background: #b8c0d0; }
body.dark-theme ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.45); }
body.dark-theme ::-webkit-scrollbar-thumb {
    background: #6a6f9a;
    border-color: rgba(0, 0, 0, 0.45);
}
body.dark-theme ::-webkit-scrollbar-thumb:hover { background: #8a8fc0; }

}
@media (max-width: 768px) {
    .board-screen { height: calc(100vh - 20px); }
}
/* ===== ПЕРЕКЛЮЧАТЕЛЬ ВИДОВ ===== */
.view-switch {
    gap: 4px;
    background: rgba(9, 30, 66, 0.06);
    padding: 4px;
    border-radius: 10px;
}
body.dark-theme .view-switch { background: rgba(255, 255, 255, 0.06); }
.view-btn {
    opacity: 0.6;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    background: transparent;
    color: var(--text);
    border: none;
}
.view-btn:hover { opacity: 1; }
.view-btn.active {
    opacity: 1;
    background: var(--card-bg);
    color: var(--text);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
/* ===== ВИД «ТАБЛИЦА» ===== */
.table-wrap {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.kanban-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 860px;
}
.kanban-table th,
.kanban-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.kanban-table thead th {
    background: rgba(9, 30, 66, 0.04);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
}
body.dark-theme .kanban-table thead th { background: #252550; }
.kanban-table th.sortable { cursor: pointer; user-select: none; }
.kanban-table th.sortable:hover { color: var(--accent); }
.kanban-table th.sorted { color: var(--accent); }
.kanban-table tbody tr:hover { background: rgba(102, 126, 234, 0.06); }
.kanban-table tbody tr.row-mine {
    background: rgba(102, 126, 234, 0.08);
    box-shadow: inset 3px 0 0 var(--accent);
}
.kanban-table td.col-num, .kanban-table th.col-num { width: 40px; color: var(--text-secondary); }
.kanban-table td.col-act, .kanban-table th.col-act { width: 44px; }
.tbl-title { cursor: pointer; font-weight: 600; color: var(--text); }
.tbl-title:hover { color: var(--accent); }
.tbl-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tbl-col { display: inline-flex; align-items: center; gap: 6px; }
.tbl-col i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tbl-empty { color: var(--text-secondary); opacity: 0.6; }
td.dl-overdue { color: var(--red); font-weight: 700; }
td.dl-today { color: var(--orange); font-weight: 700; }
.tbl-empty-row { text-align: center; padding: 32px; color: var(--text-secondary); }

/* ===== КРУГЛАЯ КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ ===== */
#themeToggleBtn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
}
#themeToggleBtn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(15deg) scale(1.08);
}
body.dark-theme #themeToggleBtn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}
body.dark-theme #themeToggleBtn:hover {
    background: rgba(255, 255, 255, 0.16);
}
/* Кнопки ⚙️ и темы в шапке "Мои доски" */
.boards-header-actions .btn {
    padding: 8px 12px;
    background: var(--column-bg);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.boards-header-actions .btn:hover {
    background: var(--hover);
    transform: none;
}
/* ===== ВИД «КАЛЕНДАРЬ» ===== */
.cal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    min-width: 170px;
    text-align: center;
}
.cal-overdue {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    background: rgba(245, 101, 101, 0.12);
    padding: 4px 10px;
    border-radius: 8px;
}
.cal-nodate {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--hover);
    padding: 4px 10px;
    border-radius: 8px;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 6px 0;
}
.cal-cell {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 96px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}
.cal-cell.other { opacity: 0.45; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-cell.weekend { border-color: rgba(245, 101, 101, 0.35); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.cal-cell.today .cal-day { color: var(--accent); }
.cal-chip {
    font-size: 11px;
    line-height: 1.3;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--column-bg);
    border-left: 3px solid var(--accent);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.cal-chip:hover { background: var(--hover); }
.cal-more { font-size: 10px; color: var(--text-secondary); }
body.dark-theme .cal-cell { background: rgba(30, 30, 63, 0.9); border-color: #3a3a6a; }
body.dark-theme .cal-chip { background: #2a2a4a; }
@media (max-width: 768px) {
    .cal-cell { min-height: 64px; }
    .cal-grid { overflow-x: auto; }
}
/* ===== ТЁМНАЯ ТЕМА: нативные кнопки и чекбоксы ===== */
body.dark-theme {
    color-scheme: dark; /* чекбоксы, селекты, даты рисуются тёмными */
}
body.dark-theme .controls-wrap button:not(.view-btn),
body.dark-theme .cal-header button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(6px);
}
body.dark-theme .controls-wrap button:not(.view-btn):hover,
body.dark-theme .cal-header button:hover {
    background: rgba(255, 255, 255, 0.16);
}
/* Круглые кнопки листания календаря ‹ › */
body.dark-theme .cal-header button.cal-nav {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 16px;
}
/* ===== НЕДЕЛЯ: сетка 3 колонки (Пн Вт Ср / Чт Пт Сб / Вс) ===== */
.cal-week {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.cal-week-day {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    overflow: hidden;
}
.cal-week-day.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-week-day.weekend { border-color: rgba(245, 101, 101, 0.35); }
/* Воскресенье занимает всю третью строку */
.cal-week-sunday { grid-column: auto; }
.cal-week-head {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.cal-week-head b { font-size: 15px; color: var(--text); }
.cal-week-day.today .cal-week-head b { color: var(--accent); }
.cal-week-count {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
}
.cal-week-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 260px;
}
.cal-week-empty {
    color: var(--text-secondary);
    opacity: 0.5;
    text-align: center;
    font-size: 12px;
    padding: 12px 0;
}
.cal-wchip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--column-bg);
    border-left: 3px solid var(--accent);
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
    transition: background 0.2s;
}
.cal-wchip:hover { background: var(--hover); }
.cal-wchip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-wchip-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-wchip-ini { font-size: 10px; font-weight: 700; }
body.dark-theme .cal-week-day { background: rgba(30, 30, 63, 0.9); border-color: #3a3a6a; }
body.dark-theme .cal-week-head { border-color: #3a3a6a; }
body.dark-theme .cal-wchip { background: #2a2a4a; }
body.dark-theme .cal-wchip:hover { background: #353555; }
@media (max-width: 768px) {
    .cal-week { grid-template-columns: 1fr; }
    .cal-week-sunday { grid-column: auto; }
    .cal-week-day { min-height: 120px; }
}
/* Календарь: переключатель Месяц/Неделя в стиле соседних кнопок */
.cal-header .view-switch {
    background: transparent;
    padding: 0;
    gap: 8px;
}
body.dark-theme .cal-header .view-switch { background: transparent; }
body.dark-theme .cal-header button.view-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
}
body.dark-theme .cal-header button.view-btn:hover { background: rgba(255, 255, 255, 0.16); }
body.dark-theme .cal-header button.view-btn.active {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
}
/* ===== НАСТРОЙКА СОСТАВА КАРТОЧКИ ===== */
.card-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 16px;
    max-width: 720px;
}
/* ===== ВКЛАДКИ ПРОСМОТРА КАРТОЧКИ ===== */
.view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.view-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
}
.view-tab:hover { color: var(--text); }
.view-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
/* Компактная история */
.history-compact {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.history-compact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.history-compact-row:last-child { border-bottom: none; }
.history-compact-row:nth-child(even) { background: var(--hover); }
.hc-icon { flex-shrink: 0; font-size: 13px; }
.hc-details {
    flex: 1;
    min-width: 0;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hc-time { flex-shrink: 0; color: var(--text-secondary); font-size: 11px; }
body.dark-theme .view-tabs,
body.dark-theme .history-compact,
body.dark-theme .history-compact-row { border-color: #3a3a6a; }

/* ===== МОДАЛКА КАРТОЧКИ: СТАБИЛЬНАЯ ШИРИНА ===== */
.card-modal .modal-content {
    width: 640px;          /* или любое другое значение: 640px, 720px... */
    max-width: 95vw;
    max-height: none;
    overflow: visible;
}
.card-modal textarea {
    resize: vertical;      /* тянем только вниз, вправо не уезжает */
    width: 100%;
    max-width: 100%;
}
.modal.card-modal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;      /* выше экрана — крутится окно, не модалка */
}

/* ===== МОДАЛКА КАРТОЧКИ: БЕЗ УЕЗЖАНИЯ ВПРАВО И БЕЗ СКРОЛЛА ===== */
.card-modal textarea {
    resize: vertical;   /* уголок тянет только вниз, вправо — нельзя */
    width: 100%;
    max-width: 100%;    /* поле никогда не шире формы */
}
.card-modal .modal-content {
    max-height: none;   /* модалка растёт вниз без внутреннего скролла */
    overflow: visible;
}
.modal.card-modal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;   /* если модалка выше экрана — крутится ОКНО, не карточка */
}
/* ===== МОДАЛКА КАРТОЧКИ: ЗАПРЕТ СУЖЕНИЯ ===== */
.card-modal textarea {
    resize: vertical;      /* тянем только по высоте */
    min-height: 96px;      /* минимум ~4 строки: ниже не ужмётся */
    max-width: 100%;       /* не вылезает вправо за форму */
}
.card-modal .modal-content {
    min-width: min(560px, 95vw);   /* модалка не уже базовой ширины */
}

/* Поле названия карточки: как input, но растёт */
#cardTitle {
    min-height: 40px;
    font-weight: 600;
}

/* ===== ПРОСМОТР КАРТОЧКИ: КАК РЕДАКТИРОВАНИЕ, БЕЗ ВНУТРЕННЕГО СКРОЛЛА ===== */
.card-modal .view-card-content {
    max-height: none;
    overflow: visible;
}

/* ===== ПРОСМОТР КАРТОЧКИ: ПЕРЕНОС ДЛИННЫХ СЛОВ ===== */
.view-card-content {
    overflow-wrap: anywhere;   /* рвать слова, если не влезают */
    word-break: break-word;    /* страховка для старых браузеров */
}
.view-card-content h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-bottom: 12px;
}

/* ===== МОДАЛКА КАРТОЧКИ: СКРОЛЛ ТОЛЬКО У ОКНА ===== */
.card-modal .modal-content {
    width: 640px;
    max-width: 95vw;
    max-height: none;      /* модалка не режется по высоте экрана */
    overflow: visible;     /* никакого внутреннего скролла */
}
.modal.card-modal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;      /* крутится окно браузера, не модалка */
}
.card-modal textarea {
    resize: none;          /* высота управляется автоматически */
    overflow: hidden;      /* свой скролл у поля не появляется */
}
#cardTitle { min-height: 40px; font-weight: 600; }
#cardDesc { min-height: 96px; }

/* ===== ФОН НЕ КРУТИТСЯ, ПОКА ОТКРЫТА МОДАЛКА ===== */
body.modal-open {
    overflow: hidden;
}

/* ===== КОМПАКТНАЯ КАРТОЧКА: СХЕМА ===== */
.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* название: максимум 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 6px;
}
.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 4;          /* ОПИСАНИЕ: 4 строки, как вы просили */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.card-labels-row {
    flex-wrap: nowrap;
    overflow: hidden;
    margin-bottom: 6px;
}
.card-labels-more {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    align-self: center;
}
.card-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
    overflow: hidden;               /* чипы в одну строку, без переносов */
    white-space: nowrap;
}
.card-chips .badge { flex-shrink: 0; }
.card-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kcard-move { opacity: 0.5; transition: opacity 0.2s; }
.card:hover .kcard-move { opacity: 1; }
body.compact-cards .card-desc { -webkit-line-clamp: 2; }

/* ===== ДАТА СОЗДАНИЯ В ФУТЕРЕ КАРТОЧКИ ===== */
.card-created {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-right: 6px;
}

/* ===== МЕНЕДЖЕР МЕТОК: КАК ОКНО КАРТОЧКИ, БЕЗ ВНУТРЕННЕГО СКРОЛЛА ===== */
.modal.labels-manager-modal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.labels-manager-modal .modal-content {
    width: 720px;
    max-width: 95vw;
    min-width: min(560px, 95vw);
    max-height: none !important;
    overflow: visible !important;
}
.labels-manager-modal .modal-content > div {
    max-height: none !important;
    overflow: visible !important;
}
/* ===== СТРОКИ НЕ РАЗДУВАЮТСЯ ОТ ДЛИННЫХ НАЗВАНИЙ ===== */
.label-manager-item { min-width: 0; }
.label-manager-item > div { min-width: 0; }
.label-name-input { min-width: 0; text-overflow: ellipsis; }
.label-checkbox-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filter-label { max-width: 220px; overflow: hidden; }
/* ===== КНОПКА ПАЛИТРЫ: РАДУЖНЫЙ КРУЖОК ВМЕСТО ЭМОДЗИ ===== */
.labels-manager-modal button[title="Изменить цвет"] {
    font-size: 0 !important;
    line-height: 0 !important;
    width: 26px;
    height: 26px;
    padding: 0 !important;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    background: conic-gradient(#ff6b6b, #feca57, #48bb78, #48dbfb, #667eea, #c377e0, #ff6b6b);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.labels-manager-modal button[title="Изменить цвет"]:hover {
    transform: scale(1.15);
}

/* ===== ВИД «АРХИВ» ===== */
.archive-view-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}
.archive-view-list {
    max-height: none !important;
    overflow: visible !important;
    padding: 0;
}
.archive-view-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 20px;
    font-size: 15px;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ===== АРХИВ: ДЕЙСТВИЯ В ТАБЛИЦЕ ===== */
.archive-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}
#archiveView .kanban-table th.col-act,
#archiveView .kanban-table td.col-act {
    width: auto;
    min-width: 170px;
}
#archiveView .kanban-table td.col-act .btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ===== БЕЗ СЧЁТЧИКА В ШАПКЕ «МОИ ДОСКИ» ===== */
.boards-header h1 span {
    display: none !important;
}

/* ===== ТУЛБАР: ДВЕ СТРОКИ ===== */
.controls-row { align-items: center; }
.controls-row .search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    min-width: 200px;
}
.controls-row .search-group label {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}
.controls-row .search-group input {
    flex: 1;
    width: 100%;
    min-width: 0;
}
#kanbanSearch {
    width: 100%;
    min-width: 0;
    flex: 1;
}
.controls-row.filters-row { justify-content: flex-start; }
.controls-row.filters-row #activeLabelsFilter {
    flex: 1 1 auto;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.kb-range-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== ЭКРАН ВХОДА / РЕГИСТРАЦИИ ===== */
#authScreen {
    position: fixed; inset: 0; z-index: 5000;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}
.auth-card {
    width: 400px; max-width: 92vw;
    background: var(--card-bg); border-radius: 16px; padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.auth-card h2 { margin-bottom: 6px; color: var(--text); }
.auth-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 18px; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.auth-switch { margin-top: 14px; font-size: 13px; color: var(--text-secondary); text-align: center; }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: underline; }
body.dark-theme .auth-card { background: #232345; }
body.dark-theme .auth-card input { background: #2a2a4a; color: var(--text); border-color: #3a3a6a; }

/* ===== ФАЗА 3: КАРТОЧКА ПОЛЬЗОВАТЕЛЯ ===== */
.user-chip-wrap { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff; transition: background 0.2s;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.22); }
.boards-header-actions .user-chip {
    background: var(--hover); border-color: var(--border); color: var(--text);
}
.boards-header-actions .user-chip:hover { background: rgba(102, 126, 234, 0.15); }
.user-chip-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-chip-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-role { font-size: 11px; opacity: 0.75; }

/* ===== МОДАЛКА ПОЛЬЗОВАТЕЛЕЙ: КОМФОРТНАЯ ВЫСОТА СТРОК ===== */
#usersModal input,
#usersModal select {
    padding: 10px 12px !important;
    min-height: 42px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text);
}
#usersModal input:focus,
#usersModal select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15) !important;
}
body.dark-theme #usersModal input,
body.dark-theme #usersModal select {
    background: #2a2a4a !important;
    color: var(--text) !important;
    border-color: #3a3a6a !important;
}
/* строки списка пользователей чуть выше */
#usersModal div[style*="padding:10px"] { padding: 14px !important; }
/* расстояние между полями формы создания */
#usersModal div[style*="display:grid"] { gap: 12px !important; }

/* ===== МОДАЛКА ДОСКИ: ТЕ ЖЕ ОГРАНИЧЕНИЯ, ЧТО У КАРТОЧКИ ===== */
.modal.board-modal {
    align-items: flex-start;      /* модалка растёт вниз от верха */
    padding: 24px 0;
    overflow-y: auto;             /* вертикальный скролл — только у окна */
    overflow-x: hidden;           /* горизонтального скролла нет вообще */
}
.board-modal .modal-content {
    width: 640px;                 /* стабильная ширина, как у карточки */
    max-width: 95vw;
    min-width: min(560px, 95vw);  /* не сужается */
    max-height: none;             /* не режется по высоте экрана */
    overflow: visible;            /* никакого внутреннего скролла */
}
.board-modal textarea {
    resize: none;                 /* высота управляется автоматически */
    overflow: hidden;             /* свой скролл у поля не появляется */
    width: 100%;
    max-width: 100%;              /* не вылезает вправо за форму */
}
#boardName { min-height: 40px; font-weight: 600; }
#boardDesc { min-height: 96px; }

/* ===== ФАЗА 4.1: ЧИТАТЕЛЬ НА ДОСКЕ ===== */
body.role-viewer-board .add-card-btn,
body.role-viewer-board .add-column-btn,
body.role-viewer-board .card-menu-btn,
body.role-viewer-board .column-menu-btn,
body.role-viewer-board .kcard-move { display: none !important; }
body.role-viewer-board .column-name-editable { pointer-events: none; }
body.role-viewer-board .card,
body.role-viewer-board .column { cursor: default; }

/* ===== МОДАЛКА УЧАСТНИКОВ: КОМФОРТНЫЕ РАЗМЕРЫ ПОЛЕЙ ===== */
#membersModal input,
#membersModal select,
#userAdminModal input,
#userAdminModal select {
    padding: 10px 12px !important;
    min-height: 42px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text);
}
#membersModal input:focus,
#membersModal select:focus,
#userAdminModal input:focus,
#userAdminModal select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15) !important;
}
body.dark-theme #membersModal input,
body.dark-theme #membersModal select,
body.dark-theme #userAdminModal input,
body.dark-theme #userAdminModal select {
    background: #2a2a4a !important;
    color: var(--text) !important;
    border-color: #3a3a6a !important;
}
/* расстояние между полями формы приглашения */
#membersModal div[style*="display:grid"] { gap: 12px !important; }
/* строки списка участников чуть просторнее */
#membersModal div[style*="padding:10px"] { padding: 12px !important; }

/* ===== КРУГЛАЯ КНОПКА «ПОЛЬЗОВАТЕЛИ И РОЛИ» ===== */
#usersTableBtn,
#usersTableBtnBoards,
#usersTableBtnInner {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
}
#usersTableBtn:hover,
#usersTableBtnBoards:hover,
#usersTableBtnInner:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.08);
}
body.dark-theme #usersTableBtn,
body.dark-theme #usersTableBtnBoards,
body.dark-theme #usersTableBtnInner {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}
.boards-header-actions #usersTableBtnBoards {
    background: var(--column-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
body.dark-theme .boards-header-actions #usersTableBtnBoards {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
}

/* ===== УЧАСТНИКИ: ПОЛЕ ПОИСКА ===== */
#membersSearchInput {
    padding: 10px 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s;
}
#membersSearchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}
body.dark-theme #membersSearchInput {
    background: #2a2a4a;
    border-color: #3a3a6a;
    color: var(--text);
}

/* ===== КОНТЕКСТНЫЕ МЕНЮ ВСЕГДА В ПРЕДЕЛАХ ЭКРАНА ===== */
.board-context-menu,
.boards-context-menu,
.card-context-menu {
    max-height: calc(100vh - 16px);
    overflow-y: auto;
}

/* ===== ЭКРАН ПОЛЬЗОВАТЕЛЕЙ: ПОЛЕ ПОИСКА ===== */
#usersSearchInput {
    padding: 10px 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s;
}
#usersSearchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}
body.dark-theme #usersSearchInput {
    background: #2a2a4a;
    border-color: #3a3a6a;
    color: var(--text);
}

/* ===== ЛИЧНЫЙ КАБИНЕТ: ПОЛЯ КАК В ФОРМЕ ПРИГЛАШЕНИЯ ===== */
#profileModal input {
    padding: 10px 12px;
    min-height: 42px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    box-sizing: border-box;
    transition: all 0.2s;
}
#profileModal input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}
#profileModal input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
body.dark-theme #profileModal input {
    background: #2a2a4a;
    border-color: #3a3a6a;
    color: var(--text);
}

/* ===== ФАЗА 4.2: БЛОКИРОВКА РЕДАКТИРОВАНИЯ ===== */
.card-lock-badge {
    margin: 6px 10px 0 10px;
    padding: 4px 8px;
    font-size: 11px;
    color: #b7791f;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 6px;
    display: inline-block;
}
/* ===== ФАЗА 4.3: КТО СЕЙЧАС В СЕТИ ===== */
.online-slot { display: flex; align-items: center; margin-right: 10px; }
.online-stack { display: flex; align-items: center; }
.online-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700;
    border: 2px solid #22c55e; margin-right: -6px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.online-avatar.me { border-color: #3b82f6; }
.online-more { font-size: 11px; color: var(--text-secondary); margin-left: 10px; }


/* ===== КРУГЛЫЙ NATIVE COLOR PICKER (как в управлении метками) ===== */
.color-wheel-input {
    -webkit-appearance: none;
    appearance: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
}
.color-wheel-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-wheel-input::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}
.color-wheel-input::-moz-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}

/* ===== ДОСТУП К ДОСКЕ: СКРОЛЛ КАК У ДРУГИХ ОКОН (крутится окно, не внутренний блок) ===== */
.modal.access-modal {
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.access-modal .modal-content {
    width: 640px;
    max-width: 95vw;
    min-width: min(560px, 95vw);
    max-height: none !important;
    overflow: visible !important;
}
.access-modal .access-list {
    max-height: none !important;
    overflow: visible !important;
    padding: 0;
}

/* ===== РАДУЖНЫЙ КРУГЛЫЙ КНОПОК «СВОЙ ЦВЕТ» (как в управлении метками) ===== */
.color-wheel-rainbow {
    font-size: 0;
    line-height: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    background: conic-gradient(#ff6b6b, #feca57, #48bb78, #48dbfb, #667eea, #c377e0, #ff6b6b);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.color-wheel-rainbow:hover { transform: scale(1.15); }

/* ===== ОНЛАЙН-ТОЧКА НА АВАТАРЕ В ТАБЛИЦАХ ===== */
.online-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.online-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
body.dark-theme .online-dot {
    border-color: #1e1e3f;
}

/* ===== ONLINE РЯДОМ С ИМЕНЕМ ===== */
.online-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #22c55e;
    white-space: nowrap;
    vertical-align: middle;
}
.online-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    display: inline-block;
}
body.dark-theme .online-flag { color: #4ade80; }
body.dark-theme .online-dot-inline { background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25); }

/* ===== ТОЛБАР «МОИ ДОСКИ»: ПОИСК/СОРТИРОВКА/ПЕРИОД КАК В ДОСКЕ ===== */
.boards-toolbar-row { margin-top: 12px; margin-bottom: 0; align-items: center; }
.boards-toolbar-row .search-group { flex: 1 1 260px; display: flex; min-width: 200px; }
#boardsSearch {
    width: 100%;
    min-width: 0;
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s;
}
#boardsSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}
#boardsSearch::placeholder { color: var(--text-secondary); opacity: 0.7; }
body.dark-theme #boardsSearch { background: #2a2a4a; border-color: #3a3a6a; color: var(--text); }
body.dark-theme #boardsSearch:focus { background: #1e1e3f; border-color: var(--accent); }
body.dark-theme #boardsSearch::placeholder { color: #a0a0b0; }
.boards-found { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ===== ИЗМЕНЕНИЕ ШИРИНЫ КОЛОНКИ ===== */
.column-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 6;
    background: transparent;
    transition: background 0.15s;
}
.column-resize-handle:hover,
body.resizing-column .column-resize-handle {
    background: rgba(102, 126, 234, 0.35);
}
body.resizing-column { user-select: none; }
body.resizing-column * { cursor: col-resize !important; }

/* ===== ВКЛАДКА «ЧЕК-ЛИСТЫ»: ПОЛОСА ПРОГРЕССА В ЯЧЕЙКЕ ===== */
.cl-table-bar {
    flex: none !important;
    width: 90px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* ===== ИКОНКИ В КНОПКАХ ЧЕК-ЛИСТА ===== */
.btn-icon svg { display: block; }
.checklist-title-row .btn-icon { flex-shrink: 0; }

/* ===== ПЕРЕТАСКИВАНИЕ БЛОКОВ ЧЕК-ЛИСТОВ ===== */
.checklist {
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.checklist.dragging {
    opacity: 0.45;
    transform: scale(0.98);
}
.checklist.drag-over {
    box-shadow: 0 0 0 2px var(--primary);
}
.checklist-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: -2px;
    user-select: none;
    padding: 2px 6px;
    margin-right: 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.checklist-drag-handle:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.checklist-drag-handle:active { cursor: grabbing; }
body.dark-theme .checklist-drag-handle:hover { background: rgba(255, 255, 255, 0.08); }

/* ===== БЕЙДЖ ЧЕК-ЛИСТА: ЖЁЛТЫЙ В РАБОТЕ, ЗЕЛЁНЫЙ ПРИ 100% ===== */
.card-checklist-summary .checklist-mini-fill { background: #f2c400; }
.card-checklist-summary.done100 .checklist-mini-fill { background: var(--green); }
.card-checklist-summary.done100 .checklist-mini-text { color: var(--green); font-weight: 700; }
.card-checklist-summary.overdue .checklist-mini-fill { background: var(--red); }

/* ===== ЧЕК-ЛИСТЫ: READ-ONLY ДЛЯ ЧИТАТЕЛЯ ДОСКИ ===== */
body.role-viewer-board .checklist .btn-icon.btn-delete { display: none !important; }
body.role-viewer-board .checklist .add-item-form { display: none !important; }
body.role-viewer-board .checklist .checklist-drag-handle,
body.role-viewer-board .checklist .drag-handle { display: none !important; }
body.role-viewer-board .checklist input[type="checkbox"],
body.role-viewer-board .checklist .item-deadline,
body.role-viewer-board .checklist .checklist-title-input,
body.role-viewer-board .checklist .item-text { pointer-events: none; opacity: .8; }


/* ===== ЧЕК-ЛИСТЫ: ЛИМИТЫ ДЛИНЫ И ПЕРЕНОС СТРОК ===== */
.checklist .item-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    cursor: text;
}
.checklist-item.done .item-text {
    text-decoration: line-through;
    opacity: .6;
}
/* ===== INLINE-РЕДАКТОР ПУНКТА: КАК НАЗВАНИЕ ЧЕК-ЛИСТА ===== */
.checklist .item-text-input {
    display: block;
    flex: 1 1 0%;
    width: 100%;
    min-width: 0;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 6px;
    color: var(--text) !important;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    padding: 4px 6px;
    box-shadow: none !important;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.checklist .item-text-input:focus {
    outline: none;
    background: rgba(102, 126, 234, 0.12) !important;
    border-color: var(--primary) !important;
}
body.dark-theme .checklist .item-text-input {
    background: transparent !important;
    color: var(--text) !important;
}
body.dark-theme .checklist .item-text-input:focus {
    background: rgba(102, 126, 234, 0.15) !important;
}
/* ===== ЗАГОЛОВОК ЧЕК-ЛИСТА: ПЕРЕНОС СТРОК И БЕЗ БЕЛОГО ПОЛЯ ===== */
.checklist-title-input {
    display: block;
    width: 100%;
    min-height: 24px;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 6px;
    color: var(--text) !important;
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.35;
    padding: 4px 6px;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-shadow: none !important;
}
.checklist-title-input:focus {
    outline: none;
    background: rgba(102, 126, 234, 0.12) !important;
    border-color: var(--primary) !important;
}
body.dark-theme .checklist-title-input {
    background: transparent !important;
    color: var(--text) !important;
}
body.dark-theme .checklist-title-input:focus {
    background: rgba(102, 126, 234, 0.15) !important;
}
/* ===== ЧЕК-ЛИСТ: РУЧКА И НАЗВАНИЕ НА ОДНОЙ ЛИНИИ ===== */
.checklist-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    padding-right: 156px;
}
.checklist-header .checklist-drag-handle {
    margin-top: 8px;
    flex-shrink: 0;
}
.checklist-header .checklist-title-row {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}
.checklist-header .checklist-stats {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.checklist-stats .checklist-progress { flex: 0 0 auto; }
.checklist-stats .progress-bar { width: 120px; }
/* ===== ЧЕК-ЛИСТ: КНОПКИ В УГЛУ И ВОЗДУХ МЕЖДУ БЛОКАМИ ===== */
.checklist {
    position: relative;
    margin-bottom: 20px;
}
.checklist-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

/* ===== ТОЧЕЧНЫЕ ПРАВКИ ЧЕК-ЛИСТОВ ===== */
/* 1. Ручка ⋮ и название чек-листа — на одной строке */
.checklist-header {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    padding-right: 118px;
}
.checklist-header .checklist-drag-handle {
    margin-top: 6px;
    flex-shrink: 0;
}
.checklist-header .checklist-title-row {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    display: flex;
    align-items: flex-start;
    margin-right: 6px;
}
.checklist-title-input {
    flex: 1 1 0% !important;
    width: 100% !important;
    min-width: 0 !important;
}
/* 2. Inline-редактор пункта: прозрачный, как название чек-листа */
.checklist .item-text-input,
.checklist-item .item-text-input {
    -webkit-appearance: none;
    appearance: none;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 6px;
    color: var(--text) !important;
    box-shadow: none !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    min-width: 0 !important;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    padding: 4px 6px;
}
.checklist .item-text-input:focus,
.checklist-item .item-text-input:focus {
    outline: none !important;
    background: rgba(102, 126, 234, 0.12) !important;
    border-color: var(--primary) !important;
}
body.dark-theme .checklist .item-text-input,
body.dark-theme .checklist-item .item-text-input {
    background: transparent !important;
    color: var(--text) !important;
}
body.dark-theme .checklist .item-text-input:focus,
body.dark-theme .checklist-item .item-text-input:focus {
    background: rgba(102, 126, 234, 0.15) !important;
}
/* 3. Наведение на текст пункта: без светлого пятна в тёмной теме */
.item-text:hover { background: rgba(9, 30, 66, 0.06); }
body.dark-theme .item-text:hover { background: rgba(255, 255, 255, 0.08); }

/* ===== РАСТЯГИВАНИЕ КОЛОНОК ВО ВСЕХ ТАБЛИЦАХ ===== */
.kanban-table thead th { user-select: none; }
.th-resize {
    position: absolute;
    top: 0;
    right: -3px;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 3;
    background: transparent;
    transition: background 0.15s;
}
.th-resize:hover,
body.resizing-column .th-resize {
    background: rgba(102, 126, 234, 0.45);
}
body.resizing-column { user-select: none; }
body.resizing-column * { cursor: col-resize !important; }

/* ===== КОЛОКОЛЬЧИК НАПОМИНАНИЙ ===== */
.rem-bell-wrap { position: relative; display: inline-flex; }
.rem-bell {
    position: relative;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.rem-bell:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.06); }
.rem-bell.hot { border-color: rgba(245, 101, 101, 0.65); box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.25); }
.rem-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px;
    background: var(--red); color: #fff;
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.boards-header-actions .rem-bell { background: var(--column-bg); color: var(--text); border: 1px solid var(--border); }
body.dark-theme .boards-header-actions .rem-bell { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.14); }
.rem-dropdown {
    position: fixed;
    z-index: 4700;
    width: 430px; max-width: 92vw;
    max-height: 60vh; overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.rem-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; font-weight: 700;
    border-radius: 12px 12px 0 0;
}
.rem-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.rem-sec { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.rem-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.rem-sec.overdue .rem-sec-title { color: var(--red); }
.rem-sec.today .rem-sec-title { color: var(--orange); }
.rem-sec.tomorrow .rem-sec-title { color: var(--text-secondary); }
.rem-row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 6px 8px; border-radius: 8px; cursor: pointer;
    font-size: 13px; color: var(--text);
}
.rem-row:hover { background: var(--hover); }
.rem-row-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-row-date { flex-shrink: 0; font-weight: 700; }
.rem-sec.overdue .rem-row-date { color: var(--red); }
.rem-sec.today .rem-row-date { color: var(--orange); }
.rem-empty { padding: 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.rem-foot { padding: 10px 16px; }
.rem-scope { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
body.dark-theme .rem-dropdown { background: #232345; border-color: rgba(255, 255, 255, 0.12); }

/* ===== ОКНО НАПОМИНАНИЙ: ШИРЕ И СКРОЛЛ КАК У ДРУГИХ ОКОН ===== */
.modal.rem-modal {
    z-index: 4700;
    align-items: flex-start;
    padding: 24px 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.rem-modal .modal-content,
.rem-modal .rem-content {
    width: 760px;
    max-width: 95vw;
    min-width: min(560px, 95vw);
    max-height: none !important;
    overflow: visible !important;
    padding: 0;
}
.rem-head { border-radius: 16px 16px 0 0; }
.rem-foot { border-radius: 0 0 16px 16px; }

/* ===== ПОИСК НА СТРАНИЦЕ НАСТРОЕК: ВЫСОКАЯ СТРОКА ===== */
#settingsSearch {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid rgba(127, 140, 141, 0.35);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
}
#settingsSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}
body.dark-theme #settingsSearch { background: #2a2a4a; border-color: #3a3a6a; color: var(--text); }

/* ===== КРУГЛЫЕ КНОПКИ ШАПОК: ЕДИНЫЙ РАЗМЕР 42px ===== */
.round-42 {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
    line-height: 1 !important;
    flex-shrink: 0;
}

/* ===== ПИПЕТКА ЦВЕТА: КОМПАКТНЫЙ КРУЖОК ВНЕ ЗАВИСИМОСТИ ОТ ОБЩИХ ПРАВИЛ ===== */
.form-group input[type="color"],
input[type="color"].color-wheel-input {
    -webkit-appearance: none;
    appearance: none;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: none !important;
    cursor: pointer;
    flex: 0 0 auto;
}
.form-group input[type="color"]::-webkit-color-swatch-wrapper,
input[type="color"].color-wheel-input::-webkit-color-swatch-wrapper { padding: 0; }
.form-group input[type="color"]::-webkit-color-swatch,
input[type="color"].color-wheel-input::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}
.form-group input[type="color"]::-moz-color-swatch,
input[type="color"].color-wheel-input::-moz-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}

/* ===== НАЗВАНИЕ КОЛОНКИ: 2 СТРОКИ, ТРОЕТОЧИЕ, ПОДСВЕТКА КАК У КАРТОЧКИ ===== */
.column-name-editable {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* максимум 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;               /* остальное обрезается */
    word-break: break-word;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;        /* троеточие в конце */
    cursor: grab;
    transition: color 0.2s, background 0.2s;
}
.column-name-editable:hover {
    color: var(--accent);           /* та же подсветка, что у названия карточки */
    background: rgba(9, 30, 66, 0.06);
}
body.dark-theme .column-name-editable:hover { background: rgba(255, 255, 255, 0.07); }
/* поле редактирования после двойного клика */
.column-name-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: white;
    font-weight: 700;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}
body.dark-theme .column-name-input { background: #2a2a4a; color: var(--text); }

/* ===== ПОЛЕ НАЗВАНИЯ КОЛОНКИ: БЕЗ БРАУЗЕРНЫХ ЗНАЧКОВ ===== */
.column-name-input::-webkit-contacts-auto-fill-button,
.column-name-input::-webkit-credentials-auto-fill-button,
.column-name-input::-webkit-clear-button,
.column-name-input::-webkit-list-button,
.column-name-editable::-webkit-contacts-auto-fill-button,
.column-name-editable::-webkit-credentials-auto-fill-button,
.column-name-editable::-webkit-clear-button,
.column-name-editable::-webkit-list-button {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
}