/* ============================================================
   HOUSE DESIGN STYLE — Vercel-light / Geist
   Готовый фундамент. Вставь целиком в <style> нового single-file
   HTML-инструмента, затем доверстай специфику поверх.
   Источник эталона: ЛЕНКОН Трекер (Lencon_Tracker).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

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

:root {
    /* greyscale - vercel light palette */
    --bg: #ffffff;
    --bg-subtle: #fafafa;
    --bg-elevated: #ffffff;
    --bg-hover: #f4f4f5;
    --bg-active: #ededee;
    --bg-inverse: #0a0a0a;

    --border: #ebebeb;
    --border-strong: #d4d4d4;
    --border-active: #0a0a0a;

    --text: #0a0a0a;
    --text-dim: #666666;
    --text-muted: #8f8f8f;
    --text-subtle: #a1a1a1;
    --text-inverse: #ffffff;

    /* signal colors - desaturated, vercel-like */
    --danger: #c53030;   --danger-bg: #fff5f5;   --danger-border: #fbb;
    --warning: #b45309;  --warning-bg: #fffaeb;  --warning-border: #f5d38c;
    --success: #166534;  --success-bg: #f0fdf4;  --success-border: #bbf7d0;
    --info: #1e40af;     --info-bg: #eff6ff;     --info-border: #bfdbfe;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 32px rgba(0,0,0,0.08);

    --radius: 6px;
    --radius-lg: 10px;

    --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html, body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}
body { min-height: 100vh; }

/* Фирменная фоновая сетка — на грани видимости */
body {
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.018) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.018) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* === HEADER === */
.header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 12px 28px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    gap: 20px;
}
.header-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; flex-shrink: 0; min-height: 32px;
}
.user-label {
    display: inline-flex; align-items: center; justify-content: center;
    height: 28px; font-size: 12px; color: var(--text-muted); font-weight: 500;
    white-space: nowrap; line-height: 1; padding: 0 10px 0 0;
    margin: 0; border-right: 1px solid var(--border); margin-right: 2px;
}
.logo { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.logo-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.logo-icon svg { width: 22px; height: 22px; display: block; }
.logo-text { display: inline-flex; align-items: center; gap: 4px; }
.logo-text span { color: var(--text-muted); font-weight: 500; }

/* === BUTTONS === */
.btn {
    padding: 7px 12px; border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--bg); color: var(--text);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; letter-spacing: -0.005em; line-height: 1;
    height: 32px; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.btn.primary:hover { background: #383838; border-color: #383838; }
.btn.danger { color: var(--danger); border-color: var(--border-strong); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.small { padding: 4px 9px; font-size: 12px; height: 28px; }
.btn.icon { padding: 6px; min-width: 28px; justify-content: center; height: 28px; width: 28px; }

/* === VIEW TABS === */
.view-tabs {
    background: var(--bg); padding: 0 28px; display: flex; gap: 0;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 64px; z-index: 90;
}
.view-tab {
    padding: 14px 4px; margin-right: 24px; font-size: 14px;
    color: var(--text-dim); cursor: pointer; border: none; background: transparent;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 0.12s, border-color 0.12s;
    font-family: inherit; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px; letter-spacing: -0.005em;
}
.view-tab svg { width: 14px; height: 14px; opacity: 0.7; }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--text); border-bottom-color: var(--text); }
.view-tab.active svg { opacity: 1; }

/* === FILTERS / SEGMENTED CONTROL === */
.filters {
    background: var(--bg-subtle); padding: 12px 28px;
    display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
    border-bottom: 1px solid var(--border);
}
.filter-groups-row {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    width: 100%; margin-top: 10px;
}
.filter-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.filter-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.filter-select {
    padding: 5px 28px 5px 11px; border: 1px solid var(--border-strong);
    border-radius: var(--radius); background: var(--bg); color: var(--text);
    font-size: 12.5px; font-family: inherit; font-weight: 500; height: 32px;
    min-width: 220px; max-width: 360px; cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { outline: none; border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.filter-group .filter-btn {
    padding: 5px 11px; border: 1px solid var(--border-strong);
    background: var(--bg); color: var(--text-dim); font-size: 12.5px;
    cursor: pointer; font-family: inherit; font-weight: 500;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.4; margin: 0; border-radius: 0; border-right-width: 0;
}
.filter-group .filter-btn:first-of-type { border-radius: var(--radius) 0 0 var(--radius); }
.filter-group .filter-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right-width: 1px; }
.filter-group .filter-btn:only-of-type { border-radius: var(--radius); border-right-width: 1px; }
.filter-btn:hover { color: var(--text); background: var(--bg-hover); }
.filter-btn.active { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.filter-btn.active + .filter-btn { border-left-color: var(--bg-inverse); }
.search-box {
    flex: 1; max-width: 320px; padding: 7px 12px 7px 32px;
    border-radius: var(--radius); border: 1px solid var(--border-strong);
    background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 11px center;
    color: var(--text); font-size: 13px; font-family: inherit; height: 32px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.search-box::placeholder { color: var(--text-muted); }
.search-box:focus { outline: none; border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

/* === CARD === */
.project-card {
    background: var(--bg); border-radius: var(--radius-lg);
    margin-bottom: 10px; border: 1px solid var(--border);
    overflow: hidden; transition: border-color 0.12s, box-shadow 0.12s;
    animation: fadeUp 0.25s ease both;
}
.project-card:hover { border-color: var(--border-strong); }
.project-card.expanded { border-color: var(--border-active); box-shadow: var(--shadow-md); }
.project-card:nth-child(2) { animation-delay: 0.03s; }
.project-card:nth-child(3) { animation-delay: 0.06s; }
.project-card:nth-child(4) { animation-delay: 0.09s; }
.project-card:nth-child(5) { animation-delay: 0.12s; }
.project-card:nth-child(n+6) { animation-delay: 0.15s; }

.project-num, .project-code { font-family: var(--mono); }
.project-code {
    font-size: 12px; color: var(--text-dim); background: var(--bg-subtle);
    padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); font-weight: 500;
}

/* === STATUS BADGE === */
.status-badge {
    font-size: 12px; padding: 2px 9px 2px 7px; border-radius: 999px;
    font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid; line-height: 1.5;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.risk    { color: var(--danger);  background: var(--danger-bg);  border-color: var(--danger-border); }
.status-badge.warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.status-badge.ok      { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.status-badge.development { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.status-badge.correction  { color: var(--text); background: var(--bg-subtle); border-color: var(--border-strong); }

/* === PROGRESS MINI === */
.progress-mini-bar { width: 70px; height: 4px; background: var(--bg-active); border-radius: 999px; overflow: hidden; }
.progress-mini-fill { height: 100%; border-radius: 999px; background: var(--text); transition: width 0.3s ease; }
.progress-mini-label, .progress-mini-value { font-family: var(--mono); font-weight: 500; }
.progress-mini-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }
.progress-mini-value { font-size: 12px; color: var(--text); }

/* === STATUS PALETTE (OKLCH) — серый→синий→янтарь→лавандовый→зелёный ===
   Единая светлота L≈0.965, низкая хрома. Применяй к фону ячеек/плиток статусов. */
[data-cell-st="not_started"] { background: oklch(0.970 0.002 270); }
[data-cell-st="in_progress"] { background: oklch(0.965 0.022 235); }
[data-cell-st="review"]      { background: oklch(0.965 0.025  85); }
[data-cell-st="client"]      { background: oklch(0.965 0.022 295); }
[data-cell-st="done"]        { background: oklch(0.965 0.030 150); }
/* Насыщенный текст того же тона — для имён/значений внутри статусной ячейки */
[data-cell-st="in_progress"] .st-text { color: oklch(0.42 0.10 240); }
[data-cell-st="review"]      .st-text { color: oklch(0.45 0.09  80); }
[data-cell-st="client"]      .st-text { color: oklch(0.42 0.12 295); }
[data-cell-st="done"]        .st-text { color: oklch(0.40 0.10 150); }
[data-cell-st="not_started"] .st-text { color: var(--text-muted); }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--text-dim); font-weight: 500; display: block; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
    font-size: 14px; font-family: inherit; transition: border-color 0.12s, box-shadow 0.12s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.form-textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg); border-radius: 12px; border: 1px solid var(--border-strong);
    max-width: 1060px; width: 100%; max-height: 90vh; overflow-y: auto;
    padding: 28px; box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

/* === AVATAR === */
.member-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-inverse); color: var(--text-inverse);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; flex-shrink: 0; font-family: var(--mono);
}
.member-avatar.light { background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* === ENTRY ANIMATION === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* === MOBILE === */
@media (max-width: 768px) {
    * { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
    button, .btn, [onclick], .filter-btn, .view-tab { touch-action: manipulation; }
    body {
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        overflow-x: hidden;
    }
    .header {
        padding: 10px 12px; gap: 10px; padding-top: calc(10px + env(safe-area-inset-top));
        grid-template-columns: 1fr auto;
    }
    .header-stats { display: none; }
    .header-actions { grid-column: 2; }
    .view-tabs { top: calc(52px + env(safe-area-inset-top)); padding: 0 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px; scrollbar-width: none; }
    .view-tabs::-webkit-scrollbar { display: none; }
    .view-tab { padding: 12px 16px; font-size: 13px; min-height: 44px; }
    .filter-btn { padding: 8px 12px; min-height: 36px; }
    .search-run-row { flex-wrap: wrap; }
    .search-run-row .search-box { max-width: 100%; }
}

/* === LENCON TENDERS PLATFORM === */
.hidden { display: none !important; }

#login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.login-card p { color: var(--text-muted); font-size: 13px; margin: 6px 0 20px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; }

.header-stats {
    display: flex; gap: 0; flex-wrap: wrap; align-items: center;
    justify-content: center; min-width: 0;
}
.stat-box { padding: 4px 16px; text-align: left; min-width: 72px; border-right: 1px solid var(--border); line-height: 1.2; }
.stat-box:last-child { border-right: none; }
.stat-value { font-size: 18px; font-weight: 600; font-family: var(--mono); letter-spacing: -0.02em; }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 1px; }

.filters { position: sticky; top: 57px; z-index: 85; background: var(--bg-subtle); }
#app .view-tabs { top: 118px; z-index: 80; background: var(--bg); }
.modal-close-btn { font-size: 22px; line-height: 1; padding: 4px 8px; }
.search-run-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.search-run-row select, .search-run-row input[type="number"] {
    padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--bg); font-size: 13px; height: 32px; font-family: inherit;
}
.search-run-row input[type="number"] { width: 56px; }

.main-content { padding: 20px 28px 40px; max-width: 1400px; margin: 0 auto; }

.dash-section { margin-bottom: 28px; }
.dash-section h3 {
    font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 12px;
    letter-spacing: -0.005em;
}
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dash-kpi {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 14px 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.dash-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dash-kpi-val { font-size: 22px; font-weight: 600; font-family: var(--mono); }
.dash-kpi-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.cards-view { max-width: 100%; }
.cards-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.cards-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cards-count { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.cards-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.cards-list { display: flex; flex-direction: column; gap: 0; }
.cards-list .tender-row { margin-bottom: 10px; }

.history-view .activity-feed { max-height: none; }

.tender-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); margin-bottom: 8px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
    animation: fadeUp .25s ease both;
}
.tender-row:hover { border-color: var(--border-active); box-shadow: var(--shadow-sm); }
.tender-row-body { flex: 1; min-width: 0; }
.tender-row-title { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.tender-row-customer { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.tender-row-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tender-row-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tender-row-right { text-align: right; flex-shrink: 0; padding-top: 2px; }
.tender-score { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.tender-deadline { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.tender-deadline.urgent { color: var(--danger); font-weight: 600; }

.sum-stages {
    display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 8px;
    overflow-x: auto; padding: 2px 2px 4px; -webkit-overflow-scrolling: touch;
}
.sum-stage {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    font-size: 10px; line-height: 1; padding: 3px 6px; border-radius: 4px;
    border: 1px solid var(--border); cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}
.sum-stage:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.sum-stage-current { border-color: var(--border-active); box-shadow: 0 0 0 1px var(--border-active); }
.sum-stage-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sum-stage-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.sum-stage[data-cell-st="not_started"] { background: oklch(0.970 0.002 270); color: var(--text-muted); }
.sum-stage[data-cell-st="in_progress"] { background: oklch(0.965 0.022 235); color: oklch(0.42 0.10 240); }
.sum-stage[data-cell-st="review"]      { background: oklch(0.965 0.025  85); color: oklch(0.45 0.09  80); }
.sum-stage[data-cell-st="client"]      { background: oklch(0.965 0.022 295); color: oklch(0.42 0.12 295); }
.sum-stage[data-cell-st="done"]        { background: oklch(0.965 0.030 150); color: oklch(0.40 0.10 150); }
.sum-stage[data-cell-st="not_started"] .sum-stage-dot { background: var(--text-subtle); }
.sum-stage[data-cell-st="in_progress"] .sum-stage-dot { background: oklch(0.55 0.12 240); }
.sum-stage[data-cell-st="review"]      .sum-stage-dot { background: oklch(0.60 0.11  80); }
.sum-stage[data-cell-st="client"]      .sum-stage-dot { background: oklch(0.55 0.14 295); }
.sum-stage[data-cell-st="done"]        .sum-stage-dot { background: oklch(0.52 0.13 150); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 11px; color: var(--text-muted); font-weight: 600; background: var(--bg-subtle); }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: var(--bg-hover); }

/* Kanban — по lencon-tasks skill */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 120px; }
.kanban-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.kanban-col-title { font-size: 13px; font-weight: 600; }
.kanban-col-count { font-family: var(--mono); font-size: 12px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.kanban-col-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-col.drag-over { background: var(--bg-hover); border-color: var(--border-active); }
.kanban-col-empty { font-size: 12px; color: var(--text-subtle); text-align: center; padding: 16px; }

.tcard {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px; cursor: grab; position: relative; transition: border-color .12s, box-shadow .12s;
    border-left: 3px solid var(--border-strong);
}
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tcard.dragging { opacity: 0.45; cursor: grabbing; }
.tcard.risk-high { border-left-color: var(--danger); }
.tcard.risk-medium { border-left-color: var(--warning); }
.tcard-customer { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.tcard-title { font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.tcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.tcard-score { font-family: var(--mono); font-weight: 600; color: var(--text); }
.tcard-progress { height: 3px; background: var(--bg-active); margin-top: 8px; border-radius: 999px; overflow: hidden; }
.tcard-progress-fill { height: 100%; background: oklch(0.55 0.12 150); border-radius: 999px; transition: width .3s; }
.tcard-drop-marker { height: 2px; background: var(--text); border-radius: 1px; margin: 2px 0; }

.modal-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.modal-tab {
    padding: 10px 14px; border: none; background: none; cursor: pointer; color: var(--text-dim);
    font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit;
}
.modal-tab.active { color: var(--text); border-bottom-color: var(--text); }
.modal-tab-panel.hidden { display: none; }
.roadmap-stage { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.roadmap-stage.done { border-color: var(--success-border); background: var(--success-bg); }
.roadmap-stage.in_progress { border-color: var(--info-border); background: var(--info-bg); }
.progress-bar { height: 4px; background: var(--bg-active); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: var(--text); transition: width .3s; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; cursor: pointer; }
.chip.selected { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.red-flags { color: var(--danger); font-size: 13px; margin-top: 8px; }
.activity-line {
    display: grid; grid-template-columns: 130px 100px 1fr; gap: 10px; align-items: baseline;
    font-size: 12px; color: var(--text-muted); padding: 8px 0; border-bottom: 1px solid var(--border);
}
.activity-time { font-family: var(--mono); font-size: 11px; color: var(--text-subtle); }
.activity-who { font-weight: 500; color: var(--text-dim); }
.activity-text { color: var(--text); }

.activity-feed { display: flex; flex-direction: column; gap: 0; max-height: 320px; overflow-y: auto; }
.activity-feed-row {
    display: grid; grid-template-columns: 108px 88px 1fr; gap: 8px; align-items: start;
    padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.activity-feed-row.clickable { cursor: pointer; border-radius: var(--radius); }
.activity-feed-row.clickable:hover { background: var(--bg-hover); }
.activity-tender {
    grid-column: 1 / -1; font-size: 11px; color: var(--text-muted);
    padding-left: 0; margin-top: -2px;
}
.search-status { font-size: 12px; color: var(--text-muted); margin-left: 8px; font-family: var(--mono); }
.kanban-hint { margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* Dashboard funnel */
.funnel { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.funnel-step { flex: 1; min-width: 100px; cursor: pointer; text-align: center; padding: 8px 4px; border-radius: var(--radius); transition: background .12s; }
.funnel-step:hover { background: var(--bg-hover); }
.funnel-bar-wrap { height: 8px; background: var(--bg-active); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.funnel-bar { height: 100%; background: oklch(0.55 0.12 240); border-radius: 999px; min-width: 4px; transition: width .3s; }
.funnel-step:nth-child(5) .funnel-bar { background: oklch(0.52 0.13 150); }
.funnel-val { font-family: var(--mono); font-size: 20px; font-weight: 600; line-height: 1; }
.funnel-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.funnel-arrow { color: var(--text-subtle); font-size: 18px; padding-bottom: 28px; flex-shrink: 0; }

.stage-bars { display: flex; flex-direction: column; gap: 6px; }
.stage-bar-row { display: grid; grid-template-columns: 160px 1fr 36px; gap: 10px; align-items: center; cursor: pointer; padding: 4px 6px; border-radius: var(--radius); transition: background .12s; }
.stage-bar-row:hover { background: var(--bg-hover); }
.stage-bar-lbl { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-bar-track { height: 6px; background: var(--bg-active); border-radius: 999px; overflow: hidden; }
.stage-bar-fill { height: 100%; background: var(--text); border-radius: 999px; transition: width .3s; }
.stage-bar-cnt { font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: right; }

.region-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.region-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; background: var(--bg); }
.region-cnt { font-family: var(--mono); font-weight: 600; color: var(--text-dim); }

.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Kanban stages — горизонтальный скролл */
.kanban-stages-wrap { overflow-x: auto; padding-bottom: 8px; margin: 0 -4px; }
.kanban-stages-board { display: flex; gap: 10px; min-width: max-content; padding: 4px; }
.kanban-stage-col { min-width: 200px; max-width: 220px; flex-shrink: 0; }

/* Stage track — как в трекере */
.stages-container { overflow-x: auto; padding-bottom: 8px; margin: 0 -2px 12px; }
.stages-pipeline { display: flex; gap: 6px; min-width: max-content; padding: 2px; }
.stage {
    min-width: 118px; max-width: 140px; flex: 1;
    border-radius: var(--radius); padding: 10px 10px 8px;
    border: 1px solid var(--border); cursor: pointer;
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color .12s, box-shadow .12s;
}
.stage:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stage.stage-current { border-color: var(--border-active); box-shadow: 0 0 0 1px var(--border-active); }
.stage.stage-selected { outline: 2px solid var(--text); outline-offset: 1px; }
.stage.stage-skipped { opacity: .55; border-style: dashed; }
.stage-head { display: flex; align-items: center; gap: 6px; min-height: 14px; }
.stage-name { font-size: 11px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.stage-checks { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }

.stage[data-cell-st="not_started"] { background: oklch(0.970 0.002 270); }
.stage[data-cell-st="in_progress"] { background: oklch(0.965 0.022 235); }
.stage[data-cell-st="review"]      { background: oklch(0.965 0.025  85); }
.stage[data-cell-st="client"]      { background: oklch(0.965 0.022 295); }
.stage[data-cell-st="done"]        { background: oklch(0.965 0.030 150); }
.stage[data-cell-st="in_progress"] .stage-name { color: oklch(0.42 0.10 240); }
.stage[data-cell-st="review"]      .stage-name { color: oklch(0.45 0.09  80); }
.stage[data-cell-st="done"]        .stage-name { color: oklch(0.40 0.10 150); }
.stage[data-cell-st="not_started"] .stage-name { color: var(--text-muted); }

.mc-status-toggle {
    width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; border-radius: 50%;
    background: rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.12); position: relative;
    transition: background .15s, border-color .15s, transform .1s;
}
.mc-status-toggle::after {
    content: '↻'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: rgba(0,0,0,0.45); line-height: 1;
}
.stage:hover .mc-status-toggle { background: rgba(0,0,0,0.14); border-color: rgba(0,0,0,0.22); }
.mc-status-toggle:hover { background: rgba(0,0,0,0.22) !important; border-color: rgba(0,0,0,0.35) !important; transform: rotate(60deg); }

.stage-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.mc-status-swatch {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    vertical-align: middle; margin-right: 4px; border: 1px solid var(--border);
}
.mc-status-swatch[data-st="not_started"] { background: oklch(0.970 0.002 270); }
.mc-status-swatch[data-st="in_progress"] { background: oklch(0.965 0.022 235); }
.mc-status-swatch[data-st="review"]      { background: oklch(0.965 0.025  85); }
.mc-status-swatch[data-st="done"]        { background: oklch(0.965 0.030 150); }

.track-stats { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.track-stats strong { color: var(--text); font-weight: 600; font-family: var(--mono); }
.tender-modal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.stage-detail { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px; background: var(--bg-subtle); }
.stage-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.stage-check-item { display: flex; gap: 8px; font-size: 12px; margin-top: 6px; cursor: pointer; align-items: flex-start; }
.stage-check-item input { margin-top: 2px; }
.stage-notes { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.stage:not(:last-child) { margin-right: 12px; position: relative; }
.stage:not(:last-child)::after {
    content: '›'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
    color: var(--text-subtle); font-size: 15px; font-weight: 600; pointer-events: none;
}

.tcard-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.tcard-tag {
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-dim); font-weight: 500;
}
.tcard-tag.stage { background: oklch(0.965 0.022 235); border-color: oklch(0.88 0.04 235); color: oklch(0.42 0.10 240); }
.tcard-tag.progress { font-family: var(--mono); background: var(--bg-subtle); }

.row-stage-badge {
    font-size: 11px; padding: 2px 7px; border-radius: 4px;
    background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-dim);
}

.kanban-col-highlight {
    border-color: var(--border-active) !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
    animation: colPulse 1.2s ease;
}
@keyframes colPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 0 0 4px rgba(0,0,0,0.12); }
}

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-panel {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px 22px;
}
.settings-heading { font-size: 14px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }
.stage-settings-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.stage-settings-row {
    display: grid; grid-template-columns: 28px 1fr auto auto auto; gap: 8px; align-items: center;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.stage-settings-num { font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-align: center; }
.stage-settings-name { font-weight: 500; }
.stage-settings-slug { font-family: var(--mono); font-size: 10px; color: var(--text-subtle); }
.stage-add-row { display: flex; gap: 8px; margin-top: 12px; }
.stage-add-row .form-input { flex: 1; }
