/* ============================================================
   TaskManager — стили интерфейса
   ============================================================ */

:root {
    color-scheme: light;
    --bg:           #f4f5f7;
    --surface:      #ffffff;
    --surface-2:    #ebecf0;
    --border:       #dfe1e6;
    --text:         #172b4d;
    --text-soft:    #5e6c84;
    --text-mute:    #97a0af;
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #e8f0fe;
    --danger:       #e11d48;
    --danger-soft:  #fee2e2;
    --warning:      #d97706;
    --success:      #16a34a;
    --shadow:       0 1px 2px rgba(9,30,66,.15), 0 0 1px rgba(9,30,66,.1);
    --shadow-lg:    0 8px 28px rgba(9,30,66,.28);
    --radius:       8px;
    --sidebar-w:    270px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg:           #0f172a;
    --surface:      #1e293b;
    --surface-2:    #29374d;
    --border:       #384a63;
    --text:         #e6ebf4;
    --text-soft:    #9fb0c8;
    --text-mute:    #6b7b95;
    --primary:      #3b82f6;
    --primary-dark: #2563eb;
    --primary-soft: #1d3355;
    --danger:       #fb7185;
    --danger-soft:  #45212c;
    --warning:      #fbbf24;
    --success:      #34d399;
    --shadow:       0 1px 2px rgba(0,0,0,.5), 0 0 1px rgba(0,0,0,.4);
    --shadow-lg:    0 8px 28px rgba(0,0,0,.6);
}
:root[data-theme="dark"] .swimlane { background: rgba(255,255,255,.03); }
:root[data-theme="dark"] .badge.gray,
:root[data-theme="dark"] .role-pill { filter: brightness(.85) saturate(.9); }

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

#app { height: 100vh; }

.boot-loader {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; color: var(--text-mute); font-size: 16px;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--text); }
a { color: var(--primary); }

/* --------- Кнопки --------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text); font-weight: 500;
    transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }

/* --------- Поля ввода --------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.input, .select, .textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--surface); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* ============================================================
   ЭКРАНЫ АВТОРИЗАЦИИ
   ============================================================ */
.auth-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%); padding: 20px;
}
.auth-card {
    width: 100%; max-width: 400px; background: var(--surface);
    border-radius: 12px; padding: 32px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { color: var(--text-soft); margin: 0 0 22px; font-size: 13px; }
.auth-error { background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-soft); }

/* ============================================================
   ОСНОВНОЙ МАКЕТ
   ============================================================ */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* --------- Боковая панель --------- */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: #0f1d40; color: #c7d0e0;
    display: flex; flex-direction: column; height: 100vh;
}
.sidebar-head { padding: 16px 18px; display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: #fff; }
.sidebar-search { padding: 0 14px 12px; }
.sidebar-search input {
    width: 100%; padding: 8px 11px; border-radius: 6px; border: 1px solid #2a3a5e;
    background: #1a2949; color: #fff; outline: none;
}
.sidebar-search input::placeholder { color: #7886a3; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 14px; }
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #2a3a5e; border-radius: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
    color: #c7d0e0; cursor: pointer; font-weight: 500; margin-bottom: 1px; user-select: none;
}
.nav-item:hover { background: #1a2949; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .badge { margin-left: auto; }
.nav-icon { width: 18px; text-align: center; opacity: .9; }

.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #6b7a9c; padding: 14px 10px 5px; font-weight: 700; display: flex; align-items: center; }
.nav-section-label button { margin-left: auto; background: none; border: none; color: #6b7a9c; font-size: 16px; line-height: 1; padding: 0 4px; }
.nav-section-label button:hover { color: #fff; }

.folder-head { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: #aeb9d0; font-weight: 600; user-select: none; }
.folder-head:hover { background: #1a2949; color: #fff; }
.folder-caret { transition: transform .15s; font-size: 10px; width: 12px; }
.folder-caret.collapsed { transform: rotate(-90deg); }
.folder-count { margin-left: 6px; font-size: 11px; color: #6b7a9c; font-weight: 500; }
.folder-menu-btn { margin-left: auto; background: none; border: none; color: #6b7a9c; font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.folder-head:hover .folder-menu-btn { opacity: 1; }
.space-item:hover .folder-menu-btn, .space-item.active .folder-menu-btn { opacity: 1; }
.folder-menu-btn:hover { color: #fff; }
/* Подсветка зоны сброса при перетаскивании пространства */
.folder-head.drop-target, .folder-spaces.drop-target { outline: 2px dashed #5b7cc4; outline-offset: -2px; border-radius: 6px; background: #1a2949; }
.nofolder-zone { min-height: 6px; }
.nofolder-zone.drop-target { min-height: 26px; }
.drop-hint { color: #6b7a9c; font-size: 11px; padding: 6px 10px 6px 26px; font-style: italic; }
.space-item[draggable="true"] { cursor: grab; }
.space-item[draggable="true"]:active { cursor: grabbing; }
.space-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 26px; border-radius: 6px; cursor: pointer; color: #c7d0e0; margin-bottom: 1px; user-select: none; }
.space-item:hover { background: #1a2949; color: #fff; }
.space-item.active { background: var(--primary); color: #fff; }
.space-item .dot { width: 7px; height: 7px; border-radius: 50%; background: #5b7cc4; flex-shrink: 0; }
.space-item .sp-count { margin-left: auto; font-size: 11px; color: #6b7a9c; }

.sidebar-foot { border-top: 1px solid #2a3a5e; padding: 10px 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip .avatar { width: 30px; height: 30px; }
.user-chip .u-name { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: #7886a3; }
.user-chip .logout { margin-left: auto; background: none; border: none; color: #7886a3; font-size: 16px; padding: 4px; }
.user-chip .logout:hover { color: #fff; }

/* --------- Аватары --------- */
.avatar {
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0; text-transform: uppercase;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

/* --------- Основная область --------- */
.main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar {
    height: 56px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; padding: 0 18px;
}
.topbar h2 { margin: 0; font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .meta { color: var(--text-soft); font-size: 13px; }

.content { flex: 1; overflow: auto; }

/* ============================================================
   ДОСКА (board)
   ============================================================ */
.board-toolbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 18px; flex-wrap: wrap;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.board-toolbar .members { display: flex; align-items: center; }
.board-toolbar .members .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); font-size: 13px; }
.filter-chip select, .filter-chip input { border: none; outline: none; background: transparent; max-width: 150px; }

.board-scroll { padding: 8px 18px 60px; overflow-x: auto; cursor: grab; }
.board-scroll.panning { cursor: grabbing; user-select: none; }
.board-scroll.panning .card { pointer-events: none; }

/* колонки-заголовки */
.board-grid { min-width: max-content; }
.board-columns-head { display: flex; gap: 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.board-col-head {
    width: 290px; flex-shrink: 0; display: flex; align-items: center; gap: 7px;
    padding: 8px 12px; background: var(--surface-2); border-radius: 6px; font-weight: 700; font-size: 13px;
}
.board-col-head .col-count { color: var(--text-mute); font-weight: 600; }
.board-col-head .col-menu { margin-left: auto; }
.col-color-bar { width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
/* Колонки теперь у каждой строки свои: заголовки внутри дорожки, не липкие, выровнены с ячейками */
.swimlane .board-columns-head { position: static; padding: 8px 12px 0; background: transparent; }
.board-col-head.col-add {
    width: 40px; min-width: 40px; justify-content: center; cursor: pointer;
    color: var(--text-mute); font-size: 18px; font-weight: 400;
}
.board-col-head.col-add:hover { background: var(--primary-soft); color: var(--primary); }

.swimlane { margin-top: 10px; background: rgba(255,255,255,.5); border-radius: 8px; }
.swimlane-head {
    display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer;
    font-weight: 700; border-bottom: 1px solid var(--border); user-select: none;
}
.swimlane-head:hover { background: var(--surface-2); border-radius: 8px 8px 0 0; }
.swimlane-head .caret { font-size: 11px; transition: transform .15s; }
.swimlane-head .caret.collapsed { transform: rotate(-90deg); }
.swimlane-head .lane-count { color: var(--text-mute); font-weight: 600; font-size: 12px; }
.swimlane-head .lane-actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.swimlane-head:hover .lane-actions { opacity: 1; }

.swimlane-body { display: flex; gap: 10px; padding: 10px 12px; }
.lane-cell {
    width: 290px; flex-shrink: 0; min-height: 60px; border-radius: 6px;
    display: flex; flex-direction: column; gap: 7px; padding: 2px;
}
.lane-cell.drag-over { background: var(--primary-soft); outline: 2px dashed var(--primary); }
.cell-add { color: var(--text-mute); font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; border: 1px dashed transparent; }
.cell-add:hover { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }

/* карточка */
.card {
    background: var(--surface); border-radius: 7px; padding: 10px 11px; box-shadow: var(--shadow);
    cursor: pointer; border: 1px solid transparent; position: relative;
}
.card:hover { border-color: var(--primary); }
.card.dragging { opacity: .4; }
.card.done .card-title { text-decoration: line-through; color: var(--text-mute); }
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.card-prio { position: absolute; top: 0; left: 0; width: 4px; height: 100%; border-radius: 7px 0 0 7px; }
.card-prio.high { background: var(--danger); }
.card-prio.medium { background: var(--warning); }
.card-prio.low { background: var(--success); }
.card-check { position: absolute; top: 8px; right: 8px; }
.card-title { font-weight: 500; line-height: 1.35; margin-bottom: 8px; word-break: break-word; padding-right: 4px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); }
.card-badge { display: inline-flex; align-items: center; gap: 3px; }
.due-badge { padding: 2px 7px; border-radius: 4px; background: var(--surface-2); font-weight: 600; }
.due-badge.overdue { background: var(--danger-soft); color: var(--danger); }
.due-badge.soon { background: #fef3c7; color: var(--warning); }
.card-meta .avatar { margin-left: auto; }

/* ============================================================
   СПИСКИ ЗАДАЧ (мои задачи / архив / поиск)
   ============================================================ */
.tabs { display: flex; gap: 4px; padding: 12px 18px 0; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 6px 6px 0 0; cursor: pointer; font-weight: 600; color: var(--text-soft); border: 1px solid transparent; border-bottom: none; }
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--surface); color: var(--primary); border-color: var(--border); }
.tab .badge { margin-left: 6px; }

.list-wrap { padding: 16px 18px; }
.task-row {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 7px; margin-bottom: 7px; cursor: pointer;
}
.task-row:hover { border-color: var(--primary); }
.task-row .t-title { font-weight: 500; flex: 1; }
.task-row .t-ctx { font-size: 12px; color: var(--text-mute); }
.task-row .t-ctx b { color: var(--text-soft); font-weight: 600; }

.empty-state { text-align: center; color: var(--text-mute); padding: 60px 20px; }
.empty-state .big { font-size: 40px; margin-bottom: 10px; }

/* badge */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-2); color: var(--text-soft); font-size: 11px; font-weight: 700; }
.badge.red { background: var(--danger); color: #fff; }
.badge.blue { background: var(--primary); color: #fff; }

/* таблица пользователей */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th { text-align: left; padding: 11px 14px; font-size: 12px; text-transform: uppercase; color: var(--text-soft); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.role-pill { padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary-dark); }
.role-pill.superadmin { background: #fae8ff; color: #a21caf; }
.role-pill.admin { background: #dbeafe; color: var(--primary-dark); }
.role-pill.editor { background: #dcfce7; color: #15803d; }
.role-pill.performer { background: #fef3c7; color: #b45309; }
.role-pill.guest, .role-pill.commenter { background: var(--surface-2); color: var(--text-soft); }
.status-dot { display:inline-block; width:8px;height:8px;border-radius:50%;margin-right:6px; }
.status-dot.active { background: var(--success); }
.status-dot.blocked { background: var(--danger); }

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */
/* ============================================================
   ДОКУМЕНТЫ
   ============================================================ */
.doc-view { max-width: 820px; margin: 0 auto; padding: 24px 24px 60px; }
.doc-title { font-size: 30px; font-weight: 800; margin: 4px 0 6px; line-height: 1.2; }
.doc-title-input { font-size: 24px; font-weight: 700; padding: 9px 12px; margin-bottom: 12px; }
.doc-meta { font-size: 13px; margin-bottom: 22px; }
.doc-item .nav-icon { opacity: .85; }
.md-toolbar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; padding: 6px; background: var(--surface-2); border-radius: 8px; }
.md-toolbar button { min-width: 32px; height: 30px; border: 1px solid var(--border); background: var(--surface); border-radius: 5px; cursor: pointer; font-size: 13px; padding: 0 6px; }
.md-toolbar button:hover { background: var(--primary-soft); border-color: var(--primary); }
.md-toolbar .md-hint { margin-left: auto; font-size: 12px; }
.doc-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .doc-edit-grid { grid-template-columns: 1fr; } }
.doc-body-input { min-height: 440px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.6; resize: vertical; }
.doc-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; overflow-y: auto; max-height: 540px; background: var(--surface); }
.doc-preview-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }

/* Оформление отрендеренного markdown */
.prose { line-height: 1.65; color: var(--text); word-wrap: break-word; }
.prose h1 { font-size: 26px; font-weight: 800; margin: 22px 0 10px; }
.prose h2 { font-size: 21px; font-weight: 700; margin: 20px 0 8px; }
.prose h3 { font-size: 17px; font-weight: 700; margin: 16px 0 6px; }
.prose h4, .prose h5, .prose h6 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 26px; }
.prose li { margin: 3px 0; }
.prose li > ul, .prose li > ol { margin: 3px 0; }
.prose a { color: var(--primary); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.prose blockquote { border-left: 3px solid var(--primary); margin: 0 0 12px; padding: 6px 0 6px 14px; color: var(--text-soft); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.prose strong { font-weight: 700; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(9,30,66,.55); display: flex;
    align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal {
    background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg);
    width: 100%; max-width: 760px; animation: pop .14s ease;
}
.modal.narrow { max-width: 440px; }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; line-height: 1.35; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-mute); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-sep { border: none; border-top: 1px solid var(--border); margin: 18px 0 14px; }
.pf-row { display: flex; align-items: center; gap: 12px; }
.pf-row .pf-title { font-weight: 600; font-size: 14px; }
.pf-row > button { margin-left: auto; flex-shrink: 0; }
.verify-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.verify-badge.ok { background: var(--success); color: #fff; }
.verify-badge.no { background: var(--warning); color: #fff; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.modal-foot .spacer { flex: 1; }

/* раскладка карточки задачи */
.card-modal-grid { display: grid; grid-template-columns: 1fr 230px; gap: 22px; }
@media (max-width: 680px) { .card-modal-grid { grid-template-columns: 1fr; } }
.cm-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-soft); margin: 18px 0 8px; letter-spacing: .03em; }
.cm-desc { white-space: pre-wrap; line-height: 1.55; color: var(--text); }
.cm-desc a { word-break: break-all; }

.attach-item, .comment-item, .history-item { padding: 9px 0; border-bottom: 1px solid var(--border); }
.attach-item { display: flex; align-items: center; gap: 10px; }
.attach-item .a-name { flex: 1; word-break: break-all; }
.attach-item .a-meta { font-size: 12px; color: var(--text-mute); }
.comment-item { display: flex; gap: 10px; }
.comment-item .c-body { flex: 1; }
.comment-item .c-head { font-size: 12px; color: var(--text-soft); margin-bottom: 3px; }
.comment-item .c-head b { color: var(--text); }
.comment-item .c-text { white-space: pre-wrap; line-height: 1.5; }
.comment-item .c-actions button { background: none; border: none; color: var(--text-mute); font-size: 12px; padding: 0 4px; }
.comment-item .c-actions button:hover { color: var(--primary); }
.history-item { font-size: 13px; color: var(--text-soft); display: flex; gap: 8px; }
.history-item .h-time { color: var(--text-mute); font-size: 12px; white-space: nowrap; }

/* Поисковый селектор участника (combobox) */
.user-picker { position: relative; display: inline-block; width: 100%; }
.user-picker .up-input { width: 100%; }
.up-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 250; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; margin-top: 3px; padding: 4px; }
.user-picker.up-up .up-list { top: auto; bottom: 100%; margin: 0 0 3px; }
.up-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 5px; cursor: pointer; }
.up-opt:hover { background: var(--surface-2); }
.up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.up-none { width: 22px; text-align: center; color: var(--text-mute); flex-shrink: 0; }

.side-prop { margin-bottom: 14px; }
.side-prop label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-mute); margin-bottom: 4px; letter-spacing: .03em; }

/* меню (dropdown) */
.menu {
    position: absolute; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; z-index: 200;
}
.menu-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* панель массовых операций */
.bulk-bar {
    position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; background: #172b4d;
    color: #fff; padding: 12px 18px; display: flex; align-items: center; gap: 12px; z-index: 60;
    box-shadow: 0 -4px 16px rgba(0,0,0,.2); flex-wrap: wrap;
}
:root[data-theme="dark"] .bulk-bar { background: #29374d; }
.bulk-bar .bb-count { font-weight: 700; }
/* Поля панели — читаемые «пилюли» на тёмной панели в обеих темах */
.bulk-bar select, .bulk-bar input { padding: 6px 9px; border-radius: 6px; border: none; background: #fff; color: #172b4d; color-scheme: light; }
.bulk-bar .btn { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.22); }

/* toast */
#toast-root { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { padding: 11px 16px; border-radius: 8px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .14s ease; max-width: 340px; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* утилиты */
.row-flex { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--text-mute); }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.text-danger { color: var(--danger); }
.checkbox { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); }
.inline-add-form { display: flex; gap: 6px; margin-top: 6px; }
.inline-add-form input { flex: 1; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; }

/* Быстрые подсказки (кастомные тултипы) */
.app-tooltip {
    position: fixed; z-index: 500; display: none;
    background: #172b4d; color: #fff; font-size: 12px; line-height: 1.35;
    padding: 5px 9px; border-radius: 6px; max-width: 260px;
    box-shadow: var(--shadow-lg); pointer-events: none;
    animation: pop .1s ease;
}
:root[data-theme="dark"] .app-tooltip { background: #29374d; }

/* @-упоминания в комментариях */
.mention { color: var(--primary); font-weight: 600; background: var(--primary-soft); padding: 0 3px; border-radius: 4px; }
.mention-box {
    position: fixed; z-index: 400;
    min-width: 200px; max-height: 210px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: var(--shadow-lg); padding: 4px;
}
.mention-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.mention-opt:hover, .mention-opt.active { background: var(--primary-soft); }
.mention-opt .mo-role { color: var(--text-mute); font-size: 11px; margin-left: auto; }

/* состояние «занято» — защита от двойного клика */
.is-busy { opacity: .6; pointer-events: none; cursor: progress; }

/* тёмная тема: тост читаемым остаётся */
:root[data-theme="dark"] .toast { background: #29374d; color: #e6ebf4; }
