/* ============================================================
   TalkLog UI — KodLog Visual DNA
   Premium B2B SaaS 2026 · Enterprise · Indigo/Violet Brand
   ============================================================ */

/* === CSS Variables === */
:root {
    /* Brand — deep indigo/violet, close to KodLog */
    --brand-900: #0f1225;
    --brand-800: #151829;
    --brand-700: #1a1f36;
    --brand-600: #232844;
    --brand-500: #2d3561;
    --brand-400: #3d4a80;
    --brand-300: #4f5fa3;
    --brand-200: #6b7fd4;
    --brand-100: #a3b0e8;
    --brand-50:  #eef0fc;

    /* Accent violet */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    --accent-bg: rgba(99,102,241,.08);
    --accent-subtle: rgba(99,102,241,.12);

    /* Legacy compat */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;
    --primary-dark: #4338ca;
    --primary-bg: rgba(99,102,241,.08);
    --primary-subtle: rgba(99,102,241,.12);
    --secondary: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Semantic */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8f9fc;
    --gray-100: #f1f3f9;
    --gray-200: #e4e7f0;
    --gray-300: #c8cfe0;
    --gray-400: #9aa3c2;
    --gray-500: #6b7599;
    --gray-600: #4a5270;
    --gray-700: #2f3553;
    --gray-800: #1e2240;
    --gray-900: #12162e;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f4f6fb;
    --border-color: #e5e7f0;
    --border: #e5e7f0;

    /* Layout */
    --sidebar-width: 264px;
    --header-height: 64px;

    /* Radii */
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-pill: 50px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow: 0 4px 8px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
    --shadow-md: 0 6px 16px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.10), 0 4px 12px rgba(16,24,40,.06);
    --shadow-xl: 0 24px 48px rgba(16,24,40,.14), 0 8px 20px rgba(16,24,40,.08);
    --shadow-accent: 0 4px 16px rgba(99,102,241,.3);
    --shadow-accent-lg: 0 8px 28px rgba(99,102,241,.4);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --transition: all .22s cubic-bezier(.4,0,.2,1);
    --transition-fast: all .14s ease;

    /* Charts */
    --chart-1: #6366f1;
    --chart-2: #059669;
    --chart-3: #f59e0b;
    --chart-4: #ef4444;
    --chart-5: #8b5cf6;
    --chart-6: #0ea5e9;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text-primary); background: var(--bg-secondary); line-height: 1.6; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
::selection { background: var(--accent); color: #fff; }

/* === App Layout === */
.app-layout { display: flex; min-height: 100vh; }
/* main-content — флекс-колонка: хедер сверху, контент растёт, футер всегда внизу
   во всю ширину. min-width:0 защищает от «распирания» широким контентом
   (длинные коды ЧЗ и пр.), из-за которого футер мог уезжать вбок. */
.main-content { flex: 1; min-width: 0; margin-left: var(--sidebar-width); min-height: 100vh;
    background: var(--bg-secondary); display: flex; flex-direction: column; }
.content-area { flex: 1 0 auto; min-width: 0; padding: 28px 32px; padding-bottom: var(--content-bottom-pad, 28px); }
/* Футер: всегда отдельной строкой во всю ширину снизу. width:100% + clear
   страхуют от «уезда вбок», если внутри контента есть float/широкий блок. */
.app-footer { flex: 0 0 auto; flex-shrink: 0; width: 100%; clear: both; box-sizing: border-box; }
/* Страховка вёрстки: если из-за лишнего </div> в контенте <footer> вылетает из
   .main-content и становится прямым flex-соседом в .app-layout, он раньше воровал
   всю ширину строки → .main-content схлопывался в 0 (имя вертикально, пусто справа).
   Прямой footer-ребёнок app-layout переносим на свою строку и не даём отнимать
   ширину у main-content. */
.app-layout { flex-wrap: wrap; }
.app-layout > .app-footer { flex: 1 0 100%; order: 100; margin-left: var(--sidebar-width); }
.app-layout > .main-content { flex: 1 1 auto; }
/* Когда софтфон-виджет открыт, добавляем нижний отступ чтобы он не перекрывал кнопки */
body.has-softphone { --content-bottom-pad: 220px; }
body.has-softphone-iframe { --content-bottom-pad: 600px; }

/* ============================================================
   SIDEBAR — Dark brand, KodLog style
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%);
    color: #fff;
    z-index: 100;
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    transition: var(--transition);
    box-shadow: 2px 0 24px rgba(0,0,0,.18);
}

/* Scrollbar in sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.sidebar-logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,.4);
    flex-shrink: 0;
}
.sidebar-logo-text {
    font-size: 19px; font-weight: 800; color: #fff; line-height: 1;
}
.sidebar-logo-text span {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav { flex: 1; padding: 12px 0 8px; }
.nav-section { padding: 0 12px; margin-bottom: 2px; }
.nav-section-title {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: rgba(255,255,255,.28);
    padding: 18px 12px 6px;
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    color: rgba(255,255,255,.58);
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-weight: 500; font-size: 13.5px;
    text-decoration: none;
    margin-bottom: 1px;
    position: relative;
}
.nav-link:hover {
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.07);
}
.nav-link.active {
    color: #fff;
    background: rgba(99,102,241,.22);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,.3);
}
.nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, #818cf8, #a78bfa);
    left: -12px;
}
.nav-icon {
    width: 20px; height: 20px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: .7;
}
.nav-link.active .nav-icon, .nav-link:hover .nav-icon { opacity: 1; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 9px;
}

.nav-divider {
    height: 1px; background: rgba(255,255,255,.06);
    margin: 10px 12px;
}

.sidebar-footer {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    background: rgba(255,255,255,.05);
    transition: var(--transition); cursor: pointer;
    margin-bottom: 8px;
}
.sidebar-user:hover { background: rgba(255,255,255,.09); }
.sidebar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.38); }
.sidebar-user-arrow { color: rgba(255,255,255,.3); font-size: 10px; }

.sidebar-footer-actions { display: flex; gap: 6px; }
.sidebar-footer-actions a,
.sidebar-footer-actions button {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 10px; border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 500; color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
    cursor: pointer; transition: var(--transition); text-decoration: none;
}
.sidebar-footer-actions a:hover,
.sidebar-footer-actions button:hover {
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.12);
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }

/* ============================================================
   TOPBAR
   ============================================================ */
.top-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 28px 0 32px; height: var(--header-height);
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}
.top-header-left { display: flex; align-items: center; gap: 14px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.page-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.top-header-right { display: flex; align-items: center; gap: 8px; }
.menu-toggle {
    display: none; background: none; border: none;
    padding: 8px; border-radius: var(--radius-xs);
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition);
}
.menu-toggle:hover { background: var(--gray-100); color: var(--text-primary); }
.menu-toggle svg { display: block; }

/* Topbar search */
.topbar-search {
    position: relative;
}
.topbar-search input {
    width: 240px; padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border-color); border-radius: var(--radius-pill);
    font-size: 13px; background: var(--gray-50); color: var(--text-primary);
    outline: none; transition: var(--transition);
}
.topbar-search input:focus {
    border-color: var(--accent); width: 280px;
    background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* Выпадающие результаты быстрого поиска */
.quick-search-results {
    position: absolute; top: calc(100% + 6px); left: 0;
    min-width: 320px; max-width: 420px; max-height: 60vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    z-index: 200; padding: 4px;
}
.quick-search-group {
    padding: 8px 10px 4px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.quick-search-item {
    display: block; padding: 8px 10px; border-radius: 8px;
    text-decoration: none; color: var(--text-primary);
}
.quick-search-item:hover,
.quick-search-item.active { background: var(--gray-50); }
.quick-search-title { display: block; font-size: 13px; font-weight: 600; }
.quick-search-meta {
    display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.quick-search-empty {
    padding: 14px 12px; font-size: 13px; color: var(--text-muted); text-align: center;
}

/* Icon button */
.icon-btn {
    width: 38px; height: 38px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1.5px solid var(--border-color);
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--gray-100); border-color: var(--gray-300); color: var(--text-primary); }
.icon-btn .notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444; border: 2px solid #fff;
}

/* Topbar user */
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px 5px 5px; border-radius: var(--radius-pill);
    cursor: pointer; transition: var(--transition); border: 1.5px solid transparent;
}
.topbar-user:hover { background: var(--gray-100); border-color: var(--border-color); }
.topbar-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff;
}
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user-chevron { color: var(--text-muted); font-size: 10px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 20px; border: none; border-radius: var(--radius-pill);
    font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
    position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: var(--shadow-accent-lg); color: #fff; }

.btn-secondary {
    background: #fff; color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,.3);
}
.btn-accent:hover { box-shadow: 0 6px 20px rgba(139,92,246,.45); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(220,38,38,.25); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 6px 20px rgba(220,38,38,.35); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1.5px solid transparent; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-bg); border-color: transparent; }

.btn-success { background: linear-gradient(135deg, #059669, #047857); color: #fff; box-shadow: 0 4px 14px rgba(5,150,105,.25); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(5,150,105,.35); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-xl { padding: 15px 36px; font-size: 16px; font-weight: 700; }
.btn-block { width: 100%; }

.btn-icon { padding: 9px; border-radius: var(--radius-xs); }
.btn-icon.btn-sm { padding: 6px; }
.btn-icon.btn-xs { padding: 5px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

/* KPI / Stat card */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative; overflow: hidden;
    cursor: default;
}
.stat-card::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, transparent);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { background: linear-gradient(90deg, var(--accent), var(--secondary)); }

.stat-card--accent:hover::after { background: linear-gradient(90deg, #6366f1, #7c3aed); }
.stat-card--green:hover::after { background: linear-gradient(90deg, #059669, #047857); }
.stat-card--amber:hover::after { background: linear-gradient(90deg, #d97706, #b45309); }
.stat-card--red:hover::after { background: linear-gradient(90deg, #dc2626, #b91c1c); }
.stat-card--blue:hover::after { background: linear-gradient(90deg, #2563eb, #1d4ed8); }

.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon-accent { background: rgba(99,102,241,.1); color: var(--accent); }
.stat-icon-green { background: rgba(5,150,105,.1); color: var(--success); }
.stat-icon-amber { background: rgba(217,119,6,.1); color: var(--warning); }
.stat-icon-red { background: rgba(220,38,38,.1); color: var(--danger); }
.stat-icon-blue { background: rgba(37,99,235,.1); color: var(--info); }
.stat-icon-violet { background: rgba(124,58,237,.1); color: #7c3aed; }

.stat-value {
    font-size: 30px; font-weight: 800; color: var(--text-primary); line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-value-sm { font-size: 22px; font-weight: 800; }
.stat-change { font-size: 11.5px; font-weight: 600; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.stat-change-up { color: var(--success); }
.stat-change-down { color: var(--danger); }
.stat-change-neutral { color: var(--text-muted); }

/* Mini sparkline bar */
.stat-sparkline { display: flex; align-items: flex-end; gap: 3px; height: 32px; margin-top: 12px; }
.stat-sparkline-bar {
    flex: 1; border-radius: 3px 3px 0 0;
    background: rgba(99,102,241,.2);
    transition: background .2s;
    min-width: 4px;
}
.stat-sparkline-bar:hover { background: rgba(99,102,241,.5); }
.stat-sparkline-bar.active { background: rgba(99,102,241,.7); }

/* Legacy compat */
.metric-card { background: #fff; border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.metric-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.metric-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.metric-icon.purple { background: rgba(99,102,241,.1); color: var(--accent); }
.metric-icon.green { background: rgba(5,150,105,.1); color: var(--success); }
.metric-icon.blue { background: rgba(37,99,235,.1); color: var(--info); }
.metric-icon.orange { background: rgba(217,119,6,.1); color: var(--warning); }
.metric-icon.red { background: rgba(220,38,38,.1); color: var(--danger); }
.metric-icon.violet { background: rgba(124,58,237,.1); color: #7c3aed; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.metric-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.2; letter-spacing: -.5px; }
.metric-change { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }
.metric-change.neutral { color: var(--text-muted); }

/* ============================================================
   HERO BLOCK
   ============================================================ */
.page-hero {
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 50%, var(--brand-500) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative; overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 280px; height: 280px; border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.page-hero::after {
    content: '';
    position: absolute; bottom: -80px; right: 15%;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(99,102,241,.15);
}
.page-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-hero-title { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.page-hero-sub { font-size: 13.5px; color: rgba(255,255,255,.6); }
.page-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: var(--radius-pill);
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85);
    margin-bottom: 10px;
}
.page-hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; }

.page-hero-stats { display: flex; gap: 28px; }
.page-hero-stat { text-align: center; }
.page-hero-stat-val { font-size: 22px; font-weight: 800; line-height: 1; }
.page-hero-stat-label { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 3px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

.form-input, .form-select, .form-control {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text-primary);
    background: #fff;
    transition: var(--transition);
    outline: none;
    line-height: 1.5;
}
.form-input:focus, .form-select:focus, .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-input::placeholder, .form-control::placeholder { color: var(--gray-400); }
.form-input.error, .form-control.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-textarea {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text-primary);
    background: #fff; resize: vertical;
    transition: var(--transition); outline: none; line-height: 1.6;
    min-height: 90px;
}
.form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* Toggle */
.form-toggle {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 13.5px; font-weight: 500; color: var(--text-primary);
    user-select: none;
}
.toggle-track {
    width: 40px; height: 22px; border-radius: 11px;
    background: var(--gray-300); transition: background .2s; flex-shrink: 0;
    position: relative;
}
.toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.form-toggle input { display: none; }
.form-toggle input:checked + .toggle-track { background: var(--accent); }
.form-toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* Checkbox */
.form-checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.form-checkbox input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); border-radius: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.checkbox-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); border-radius: 4px; }

.form-range { width: 100%; accent-color: var(--accent); height: 4px; cursor: pointer; }

/* Search input */
.search-input-wrap { position: relative; }
.search-input-wrap input {
    padding-left: 36px;
}
.search-input-wrap .search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--radius-pill);
    font-size: 11.5px; font-weight: 600; line-height: 1.4;
    white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge-primary { background: rgba(99,102,241,.1); color: var(--accent); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }
.badge-success { background: rgba(5,150,105,.1); color: var(--success); }
.badge-warning { background: rgba(217,119,6,.1); color: var(--warning); }
.badge-danger { background: rgba(220,38,38,.1); color: var(--danger); }
.badge-info { background: rgba(37,99,235,.1); color: var(--info); }
.badge-violet { background: rgba(124,58,237,.1); color: #7c3aed; }
.badge-dark { background: var(--brand-600); color: rgba(255,255,255,.75); }

/* Status chip with dot */
.status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-chip .chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-chip-active, .status-chip-completed, .status-chip-success {
    background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border);
}
.status-chip-active .chip-dot, .status-chip-completed .chip-dot { background: var(--success); }
.status-chip-pending, .status-chip-queued, .status-chip-paused {
    background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border);
}
.status-chip-pending .chip-dot { background: var(--warning); }
.status-chip-error, .status-chip-failed, .status-chip-danger {
    background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border);
}
.status-chip-error .chip-dot { background: var(--danger); }
.status-chip-draft, .status-chip-inactive {
    background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200);
}
.status-chip-draft .chip-dot, .status-chip-inactive .chip-dot { background: var(--gray-400); }
.status-chip-scheduled {
    background: rgba(37,99,235,.1); color: #2563eb; border: 1px solid rgba(37,99,235,.2);
}
.status-chip-scheduled .chip-dot { background: #2563eb; }
.status-chip-info, .status-chip-running {
    background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border);
}
.status-chip-info .chip-dot { background: var(--info); }

/* ============================================================
   TABLES
   ============================================================ */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--gray-50); }
.data-table th {
    padding: 11px 16px; text-align: left;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-primary);
    vertical-align: middle; font-size: 13.5px;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(99,102,241,.03); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .row-actions { opacity: 0; transition: opacity .15s; }
.data-table tbody tr:hover .row-actions { opacity: 1; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    padding: 14px 18px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.filter-input {
    padding: 7px 11px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff; color: var(--text-primary);
    min-width: 130px;
    transition: var(--transition); outline: none;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* Status filter tabs (pill group) */
.filter-tabs {
    display: flex; gap: 4px; align-items: center;
    padding: 4px; background: var(--gray-100);
    border-radius: var(--radius-sm);
}
.filter-tab {
    padding: 6px 14px; border-radius: var(--radius-xs);
    font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition); border: none; background: none;
    white-space: nowrap;
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
    background: #fff; color: var(--accent); font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex; gap: 0;
    border-bottom: 1.5px solid var(--border-color);
    margin-bottom: 20px; overflow-x: auto;
}
.tab {
    padding: 11px 18px; font-size: 13.5px; font-weight: 600;
    color: var(--text-muted); border: none; background: none;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1.5px; transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,18,37,.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .2s ease; }
.modal {
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 560px; max-height: 92vh;
    overflow-y: auto; display: flex; flex-direction: column;
    animation: modalSlide .22s ease;
}
@keyframes modalSlide { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition); font-size: 13px;
}
.modal-close:hover { background: var(--gray-200); color: var(--text-primary); }
.modal-body { padding: 22px; flex: 1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    flex-shrink: 0;
}

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.3);
    backdrop-filter: blur(4px); z-index: 999;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; right: -440px; top: 0; bottom: 0;
    width: 420px; background: #fff; z-index: 1000;
    box-shadow: -4px 0 32px rgba(0,0,0,.1);
    display: flex; flex-direction: column;
    transition: right .25s ease;
}
.drawer.active { right: 0; }
.drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid var(--border-color); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500;
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-success { background: var(--success-bg); color: #065f46; border-color: var(--success-border); }
.alert-error { background: var(--danger-bg); color: #991b1b; border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning-border); }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: var(--info-border); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    padding: 12px 18px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; color: #fff;
    box-shadow: var(--shadow-lg); animation: toastIn .28s ease;
    max-width: 360px; pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #059669, #047857); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.toast-info { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
@keyframes toastIn { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 8px;
    border-radius: var(--radius-pill);
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    background: #fff; transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.pagination .active { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; border-color: transparent; box-shadow: var(--shadow-accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }
.pagination-info { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon {
    width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100); color: var(--gray-400);
    font-size: 28px;
}
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { color: var(--text-muted); margin-bottom: 22px; font-size: 13.5px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ============================================================
   SKELETONS
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%; animation: skeleton 1.5s infinite;
    border-radius: var(--radius-xs);
}
.skeleton-text { height: 14px; border-radius: 7px; }
.skeleton-card { height: 80px; border-radius: var(--radius); }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    min-width: 180px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 14px;
    font-size: 13.5px; color: var(--text-primary);
    transition: background .12s; cursor: pointer; width: 100%;
    border: none; background: none; text-align: left;
    text-decoration: none;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--accent); }
.dropdown-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.dropdown-item:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-menu-left { right: auto; left: 0; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
    position: fixed; inset: 0; background: rgba(15,18,37,.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.confirm-box {
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); padding: 28px;
    max-width: 380px; width: 90%; text-align: center;
    animation: modalSlide .2s ease;
}
.confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-box h3 { margin-bottom: 8px; font-size: 17px; font-weight: 700; }
.confirm-box p { color: var(--text-secondary); margin-bottom: 22px; font-size: 13.5px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   WIZARD STEPS
   ============================================================ */
.wizard-steps {
    display: flex; gap: 0; align-items: center;
    padding: 24px 32px; border-bottom: 1px solid var(--border-color);
    background: var(--gray-50); overflow-x: auto;
}
.wizard-step {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; position: relative;
}
.wizard-step + .wizard-step::before {
    content: '';
    display: block; width: 36px; height: 2px;
    background: var(--gray-200); flex-shrink: 0;
    margin: 0 8px;
}
.wizard-step.completed + .wizard-step::before { background: var(--success); }
.wizard-step .step-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gray-200); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
    transition: var(--transition);
}
.wizard-step .step-info {}
.wizard-step .step-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.wizard-step .step-sub { font-size: 11px; color: var(--text-muted); }
.wizard-step.active .step-num { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; box-shadow: var(--shadow-accent); }
.wizard-step.active .step-label { color: var(--accent); }
.wizard-step.completed .step-num { background: var(--success-gradient); color: #fff; }
.wizard-step.completed .step-label { color: var(--success); }

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-player {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--gray-50);
    border-radius: var(--radius-sm); border: 1px solid var(--border-color);
}
.audio-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff;
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; transition: var(--transition);
    box-shadow: var(--shadow-accent);
}
.audio-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-accent-lg); }
.audio-progress {
    flex: 1; height: 4px; background: var(--gray-200);
    border-radius: 2px; overflow: hidden; cursor: pointer; position: relative;
}
.audio-progress-bar { height: 100%; background: linear-gradient(90deg, #6366f1, #7c3aed); border-radius: 2px; transition: width .1s; }
.audio-time { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); min-width: 40px; }
.audio-waveform {
    display: flex; align-items: center; gap: 2px; height: 28px; flex: 1;
}
.audio-waveform-bar {
    flex: 1; min-width: 3px; background: rgba(99,102,241,.25); border-radius: 2px;
    transition: background .2s;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 1.5px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: -20px; top: 3px;
    width: 11px; height: 11px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.timeline-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 3px; }
.timeline-content { font-size: 13px; line-height: 1.5; }

/* ============================================================
   TRANSCRIPT
   ============================================================ */
.transcript { max-height: 480px; overflow-y: auto; }
.transcript-line {
    display: flex; gap: 10px; padding: 8px 10px;
    border-radius: var(--radius-xs); margin-bottom: 2px;
    transition: background .12s;
}
.transcript-line:hover { background: var(--gray-50); }
.transcript-timestamp { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; min-width: 44px; padding-top: 2px; }
.transcript-role { font-size: 10px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; min-width: 52px; padding: 3px 7px; border-radius: var(--radius-pill); text-align: center; height: fit-content; }
.transcript-role.ai, .transcript-role.agent { background: rgba(99,102,241,.1); color: var(--accent); }
.transcript-role.client { background: rgba(5,150,105,.1); color: var(--success); }
.transcript-role.operator { background: rgba(37,99,235,.1); color: var(--info); }
.transcript-role.unknown { background: var(--gray-100); color: var(--text-muted); }
.transcript-text { font-size: 13.5px; line-height: 1.6; flex: 1; }

/* ============================================================
   IVR CANVAS
   ============================================================ */
.ivr-canvas {
    position: relative; min-height: 520px;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
    background-image: radial-gradient(circle, var(--gray-200) 1px, transparent 1px);
    background-size: 22px 22px;
}
.ivr-node {
    position: absolute; padding: 12px 16px;
    background: #fff; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    cursor: grab; user-select: none;
    transition: box-shadow .2s, border-color .2s; min-width: 150px;
}
.ivr-node:hover, .ivr-node.selected { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.ivr-node-type { font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; color: var(--accent); margin-bottom: 4px; }
.ivr-node-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }
.progress-bar-accent { background: linear-gradient(90deg, #6366f1, #7c3aed); }
.progress-bar-success { background: linear-gradient(90deg, #059669, #047857); }
.progress-bar-warning { background: linear-gradient(90deg, #d97706, #b45309); }
.progress-bar-danger { background: linear-gradient(90deg, #dc2626, #b91c1c); }

/* ============================================================
   STATUS DOT
   ============================================================ */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.2); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,.2); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.2); }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.avatar-square { border-radius: var(--radius-sm); }
.avatar-sm.avatar-square { border-radius: var(--radius-xs); }

/* ============================================================
   VOICE CARD
   ============================================================ */
.voice-card { transition: var(--transition); }
.voice-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.voice-card--inactive { opacity: .65; }
.voice-card--selected { border: 2px solid var(--accent) !important; box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important; }
.voice-waveform {
    display: flex; align-items: center; gap: 2px; height: 32px;
    padding: 4px 0; margin: 8px 0;
}
.voice-waveform-bar {
    width: 3px; border-radius: 2px;
    background: rgba(99,102,241,.25); flex-shrink: 0;
    transition: background .2s;
}
.voice-waveform-bar.tall { height: 100%; }
.voice-waveform-bar.mid { height: 70%; }
.voice-waveform-bar.short { height: 40%; }
.voice-waveform-bar.xs { height: 20%; }

/* ============================================================
   CHART
   ============================================================ */
.chart-container { position: relative; height: 260px; }
.chart-container-sm { height: 180px; }
.chart-container-xs { height: 120px; }

/* ============================================================
   ACTIONS
   ============================================================ */
.actions { display: flex; gap: 3px; align-items: center; }
.row-actions { display: flex; gap: 3px; }

/* ============================================================
   GRID / FLEX UTILITIES
   ============================================================ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ============================================================
   SPACING
   ============================================================ */
.mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; } .px-0 { padding-left: 0; padding-right: 0; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; } .font-mono { font-family: var(--font-mono); }
.cursor-pointer { cursor: pointer; }
.text-lg { font-size: 16px; } .text-sm { font-size: 12.5px; } .text-xs { font-size: 11px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--text-primary); } .text-accent { color: var(--accent); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 50%, var(--accent-hover) 100%);
    position: relative; overflow: hidden; padding: 20px;
}
.auth-page::before {
    content: ''; position: absolute;
    width: 560px; height: 560px; background: rgba(255,255,255,.05);
    border-radius: 50%; top: -200px; right: -100px;
    animation: authOrb 22s infinite ease-in-out;
}
.auth-page::after {
    content: ''; position: absolute;
    width: 380px; height: 380px; background: rgba(99,102,241,.15);
    border-radius: 50%; bottom: -140px; left: -80px;
    animation: authOrb 22s infinite ease-in-out reverse;
}
@keyframes authOrb {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(28px,-28px) scale(1.08); }
    66% { transform: translate(-18px,18px) scale(.93); }
}
.auth-card {
    background: #fff; border-radius: var(--radius-xl);
    box-shadow: 0 32px 64px rgba(0,0,0,.22);
    padding: 44px 40px; width: 100%; max-width: 440px;
    position: relative; z-index: 1; animation: modalSlide .35s ease;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; }
.logo-icon { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.logo-text { font-size: 26px; font-weight: 800; color: var(--text-primary); }
.logo-text span { background: linear-gradient(135deg, #6366f1, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-title { font-size: 21px; font-weight: 800; text-align: center; color: var(--text-primary); margin-bottom: 6px; }
.auth-subtitle { font-size: 13.5px; color: var(--text-muted); text-align: center; margin-bottom: 26px; }
.auth-links { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-secondary); }
.auth-links a { color: var(--accent); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ============================================================
   MISC
   ============================================================ */
.btn-block { width: 100%; }
.divider { height: 1px; background: var(--border-color); margin: 16px 0; }
.rounded-full { border-radius: 50%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

/* KodLog-style section title */
.section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 14px;
}

/* Info rows (key-value) */
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; border-bottom: 1px solid var(--gray-100);
    font-size: 13px; gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row-label, .info-label { color: var(--text-muted); flex-shrink: 0; }
.info-row-value, .info-value { font-weight: 600; color: var(--text-primary); text-align: right; }

/* Feature list */
.feature-list { list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.feature-list-icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 1px; }
.feature-list-icon-success { background: rgba(5,150,105,.1); color: var(--success); }
.feature-list-icon-danger { background: rgba(220,38,38,.1); color: var(--danger); }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .sidebar-overlay, .top-header, .filters-bar, .btn, .pagination, .toast-container { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
    .content-area { padding: 24px; }
}
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 20px; }
    .topbar-search input { width: 180px; }
}
@media (max-width: 768px) {
    .sidebar { left: -280px; width: 280px; }
    .sidebar.open { left: 0; }
    .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sidebar.open ~ .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; }
    .top-header { padding: 0 16px; }
    .menu-toggle { display: flex; }
    .content-area { padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; }
    .wizard-steps { flex-wrap: wrap; padding: 16px; gap: 8px; }
    .wizard-step + .wizard-step::before { display: none; }
    .drawer { width: 100%; right: -100%; }
    .modal-xl, .modal-lg { max-width: 100%; margin: 8px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .page-hero-stats { display: none; }
    .topbar-search { display: none; }
    /* Длинное ФИО в topbar не должно распирать .top-header */
    .top-header-left, .top-header-right { min-width: 0; }
    .topbar-user-menu, .topbar-user { min-width: 0; }
    .topbar-user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    html { font-size: 13px; }
    .auth-card { padding: 28px 20px; }
    .page-hero { padding: 20px; }
    .page-hero-title { font-size: 18px; }
}

/* ============================================================
   RECIPIENT CARD — KodLog v2 (AIDesigner port: run d838b79a)
   Рабочий центр получателя: hero / KPI / 6 вкладок / коды / timeline
   Все цвета через --accent / --success / --warning / --danger / --gray-*
   ============================================================ */

.rc { display: flex; flex-direction: column; gap: 0; }

/* === HERO COMMAND CENTER ============================= */
.rc-hero {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.rc-hero__top {
    padding: 20px 24px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.rc-crumbs {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 500; color: var(--text-muted);
}
.rc-crumbs a { color: var(--text-muted); text-decoration: none; }
.rc-crumbs a:hover { color: var(--text-primary); }
.rc-crumbs__sep { opacity: .4; }
.rc-crumbs__id {
    background: var(--gray-100); color: var(--text-primary);
    padding: 2px 8px; border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono); font-size: 11px;
}
.rc-hero__status {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--warning-bg); border: 1px solid var(--warning-border);
    color: #92400e; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
    box-shadow: var(--shadow-xs);
}
.rc-hero__status--success { background: var(--success-bg); border-color: var(--success-border); color: #065f46; }
.rc-hero__status--danger  { background: var(--danger-bg); border-color: var(--danger-border); color: #991b1b; }
.rc-hero__status--info    { background: var(--info-bg); border-color: var(--info-border); color: #1e40af; }
.rc-hero__status--neutral { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-700); }
.rc-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor; position: relative;
}
.rc-pulse::before {
    content:''; position: absolute; inset: 0; border-radius: 50%;
    background: currentColor; opacity: .55;
    animation: rcPulse 1.6s ease-out infinite;
}
@keyframes rcPulse {
    0% { transform: scale(1); opacity: .55; }
    80%, 100% { transform: scale(2.4); opacity: 0; }
}

.rc-hero__identity {
    padding: 0 24px 18px;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.rc-name {
    font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
    color: var(--text-primary); line-height: 1.2;
    margin: 0 0 8px;
}
.rc-meta {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 6px 14px; color: var(--text-secondary); font-size: 13px;
}
.rc-meta__item { display: inline-flex; align-items: center; gap: 6px; }
.rc-meta__item i, .rc-meta__icon { color: var(--text-muted); font-style: normal; }
.rc-meta__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--gray-300); }
.rc-meta__region {
    background: var(--gray-100);
    padding: 2px 8px; border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-primary); font-weight: 500;
}
.rc-meta__region .rc-meta__icon { color: var(--accent); }
.rc-meta__snils, .rc-meta__phone { font-family: var(--font-mono); }

/* Warning callout block */
.rc-alert {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--danger-bg); border: 1px solid var(--danger-border);
    color: #991b1b; padding: 10px 14px; border-radius: var(--radius-sm);
    max-width: 380px; font-size: 12px;
}
.rc-alert__icon { font-size: 18px; line-height: 1; color: #dc2626; flex-shrink: 0; }
.rc-alert__title { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.rc-alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.rc-alert--warning .rc-alert__icon { color: #d97706; }
.rc-alert--info { background: var(--info-bg); border-color: var(--info-border); color: #1e40af; }
.rc-alert--info .rc-alert__icon { color: #2563eb; }

/* KPI strip in hero */
.rc-kpi-row {
    padding: 18px 24px;
    border-top: 1px solid var(--gray-100);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.rc-kpi {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0;
}
.rc-kpi__label {
    font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .8px;
    color: var(--text-muted);
}
.rc-kpi__body { display: flex; align-items: center; gap: 10px; }
.rc-kpi__avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gray-100); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
    border: 1px solid var(--border-color);
}
.rc-kpi__avatar--accent { background: var(--accent-bg); color: var(--accent); }
.rc-kpi__avatar--success { background: var(--success-bg); color: var(--success); }
.rc-kpi__avatar--warning { background: var(--warning-bg); color: var(--warning); }
.rc-kpi__main { font-weight: 600; color: var(--text-primary); font-size: 14px; line-height: 1.2; min-width: 0; }
.rc-kpi__main .rc-mono { font-family: var(--font-mono); }
.rc-kpi__sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* Progress ring (donut) */
.rc-ring {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gray-200); position: relative; flex-shrink: 0;
}
.rc-ring::after {
    content: ''; position: absolute; inset: 3px;
    background: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.rc-ring__icon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--text-secondary); z-index: 1;
}
.rc-ring--p25 { background: conic-gradient(var(--accent) 25%, var(--gray-200) 0); }
.rc-ring--p50 { background: conic-gradient(var(--accent) 50%, var(--gray-200) 0); }
.rc-ring--p75 { background: conic-gradient(var(--success) 75%, var(--gray-200) 0); }
.rc-ring--p90 { background: conic-gradient(var(--success) 90%, var(--gray-200) 0); }
.rc-ring--p100 { background: conic-gradient(var(--success) 100%, var(--gray-200) 0); }
.rc-ring--warning { background: conic-gradient(var(--warning) var(--rc-pct,0%), var(--gray-200) 0); }

.rc-kpi__pct { font-weight: 600; font-size: 11.5px; }
.rc-kpi__pct--success { color: var(--success); }
.rc-kpi__pct--warning { color: var(--warning); }
.rc-kpi__pct--danger  { color: var(--danger); }

/* Pill metrics inside KPI col 4 */
.rc-pillmetrics { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-pillmetric {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--gray-100); border: 1px solid var(--border-color);
    padding: 4px 10px; border-radius: var(--radius-xs);
    font-size: 12px; color: var(--text-primary);
}
.rc-pillmetric strong { font-weight: 700; }
.rc-pillmetric .rc-meta__icon { color: var(--text-secondary); }

/* === HERO 2026 — bento, hairline, mono-tabular ============== */
.rc-hero2 {
    --hairline: rgba(15,18,37,.06);
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 1px 0 0 rgba(15,18,37,.02), 0 8px 24px -16px rgba(15,18,37,.12);
}

.rc-hero2__bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--hairline);
    background: linear-gradient(180deg, #fafbff, #ffffff);
}

/* Status pill: tonal, hairline border, no fill noise */
.rc-status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    letter-spacing: .3px;
    border: 1px solid;
    font-variant: all-small-caps;
    line-height: 1;
}
.rc-status-pill .rc-pulse { width: 7px; height: 7px; }
.rc-status-pill--ok      { background: #f0fdf6; border-color: #c0eed5; color: #047857; }
.rc-status-pill--ok .rc-pulse { color: #10b981; }
.rc-status-pill--warn    { background: #fffaf0; border-color: #fde6b3; color: #b45309; }
.rc-status-pill--warn .rc-pulse { color: #f59e0b; }
.rc-status-pill--err     { background: #fff5f5; border-color: #fbd0d0; color: #b91c1c; }
.rc-status-pill--err .rc-pulse { color: #ef4444; }
.rc-status-pill--info    { background: #f3f7ff; border-color: #c9d8fc; color: #1e40af; }
.rc-status-pill--info .rc-pulse { color: #3b82f6; }
.rc-status-pill--neutral { background: var(--gray-50); border-color: var(--border-color); color: var(--gray-700); }
.rc-status-pill--neutral .rc-pulse { color: var(--gray-400); }

/* Bento: 12-col grid that collapses gracefully */
.rc-bento2 {
    display: grid;
    grid-template-columns: 2.2fr 1.1fr 1.1fr 1.3fr 1.1fr;
    align-items: stretch;
}
.rc-bento2__cell {
    padding: 18px 22px;
    border-right: 1px solid var(--hairline);
    display: flex; flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.rc-bento2__cell:last-child { border-right: 0; }

.rc-bento2__label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-muted);
}
.rc-bento2__main {
    font-size: 13.5px; font-weight: 600; color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-bento2__hint {
    font-size: 11.5px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-bento2__empty {
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    font-style: italic;
}
.rc-bento2__link {
    background: none; border: 0; padding: 0; margin: 0;
    color: var(--accent); font-size: 12px; font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}
.rc-bento2__link:hover { color: var(--accent-hover); text-decoration: underline; }
.rc-bento2__col { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }

/* Identity cell */
.rc-bento2__cell--identity { gap: 14px; }
.rc-bento2__name {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em; line-height: 1.15;
    margin: 0;
}
.rc-datalist {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0;
    font-size: 13px;
}
.rc-datalist__row { display: contents; }
.rc-datalist dt {
    font-size: 11px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .6px;
    padding-top: 1px;
}
.rc-datalist dd {
    margin: 0; color: var(--text-primary); font-weight: 500;
    font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-datalist__hint { color: var(--text-muted); font-weight: 400; margin-left: 4px; font-size: 11.5px; }

/* Contact cell */
.rc-bento2__phone {
    display: block;
    font-family: var(--font-mono);
    font-size: 17px; font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -.01em;
    text-decoration: none;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.rc-bento2__phone:hover { color: var(--accent); }

/* Courier cell */
.rc-bento2__courier { display: flex; align-items: center; gap: 12px; }
.rc-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
    background: var(--gray-100); color: var(--text-secondary);
    border: 1px solid var(--hairline);
}
.rc-avatar--accent {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #fff; border: 0;
    box-shadow: 0 2px 8px -2px rgba(99,102,241,.5);
}
.rc-avatar--ghost {
    background: var(--gray-50);
    color: var(--text-muted);
    border: 1px dashed var(--gray-300);
}

/* Codes cell — donut */
.rc-bento2__cell--codes {
    align-items: flex-start;
}
.rc-donut {
    --rc-size: 84px;
    width: var(--rc-size); height: var(--rc-size);
    border-radius: 50%;
    background: conic-gradient(var(--rc-color, var(--gray-300)) var(--rc-pct, 0%), var(--gray-100) 0);
    display: flex; align-items: center; justify-content: center;
    margin-top: -2px;
}
.rc-donut__inner {
    width: calc(var(--rc-size) - 14px); height: calc(var(--rc-size) - 14px);
    background: #fff; border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 1px var(--hairline);
}
.rc-donut__num {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em; line-height: 1;
}
.rc-donut__total { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.rc-donut__pct {
    font-size: 10px; color: var(--text-muted); margin-top: 1px;
    font-weight: 600;
}
.rc-bento2__statusline {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-secondary);
    margin-top: 4px;
}
.rc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); display: inline-block; }
.rc-dot--ok { background: var(--success); }
.rc-dot--warn { background: var(--warning); }
.rc-dot--err { background: var(--danger); }

/* Docs cell — clickable number chips */
.rc-bento2__numpair {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 2px;
}
.rc-numchip {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition-fast);
    min-width: 0;
}
.rc-numchip:hover {
    background: var(--accent-bg); border-color: rgba(99,102,241,.18);
    transform: translateY(-1px);
}
.rc-numchip__n {
    font-size: 20px; font-weight: 700; color: var(--text-primary);
    letter-spacing: -.02em; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rc-numchip__l { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }

/* Alert lines under bento */
.rc-hero2__alerts {
    border-top: 1px solid var(--hairline);
    background: var(--gray-50);
    display: flex; flex-direction: column;
}
.rc-alertline {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px;
    font-size: 12.5px;
    border-left: 3px solid;
    border-bottom: 1px solid var(--hairline);
}
.rc-alertline:last-child { border-bottom: 0; }
.rc-alertline strong { font-weight: 600; }
.rc-alertline__icon { font-size: 14px; opacity: .85; flex-shrink: 0; }
.rc-alertline--warning { border-left-color: var(--warning); color: #92400e; background: linear-gradient(90deg, #fff7e6 0%, #fafbff 80%); }
.rc-alertline--danger  { border-left-color: var(--danger);  color: #991b1b; background: linear-gradient(90deg, #fee7e7 0%, #fafbff 80%); }

@media (max-width: 1280px) {
    .rc-bento2 { grid-template-columns: 2fr 1fr 1fr; }
    .rc-bento2__cell--docs { grid-column: 2 / 4; border-right: 0; border-top: 1px solid var(--hairline); }
    .rc-bento2__cell--codes { border-top: 1px solid var(--hairline); }
    .rc-bento2__cell--contact { border-top: 1px solid var(--hairline); }
    .rc-bento2__cell--identity { grid-row: span 2; }
}
@media (max-width: 900px) {
    .rc-bento2 { grid-template-columns: 1fr 1fr; }
    .rc-bento2__cell { border-right: 1px solid var(--hairline); }
    .rc-bento2__cell--identity { grid-column: 1 / -1; border-right: 0; }
    .rc-bento2__cell--contact, .rc-bento2__cell--courier { border-top: 1px solid var(--hairline); }
    .rc-bento2__cell--codes, .rc-bento2__cell--docs { border-top: 1px solid var(--hairline); }
}
@media (max-width: 560px) {
    .rc-bento2 { grid-template-columns: 1fr; }
    .rc-bento2__cell { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 14px 16px; }
    .rc-bento2__cell:last-child { border-bottom: 0; }
    .rc-hero2__bar { padding: 12px 16px; }
    .rc-bento2__name { font-size: 20px; }
}

/* === STICKY TAB+ACTION STRIP =============================== */
.rc-strip {
    position: sticky; top: 0;
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    margin-bottom: 20px;
    z-index: 25;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.rc-tabs {
    display: flex; gap: 22px; overflow-x: auto;
    scrollbar-width: none;
    margin: 0; padding: 0; list-style: none;
}
.rc-tabs::-webkit-scrollbar { display: none; }
.rc-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 2px;
    background: none; border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13.5px; font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
}
.rc-tab:hover { color: var(--text-primary); }
.rc-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.rc-tab__count {
    background: var(--gray-200); color: var(--gray-700);
    padding: 1px 7px; border-radius: var(--radius-pill);
    font-size: 10.5px; font-weight: 700;
    line-height: 1.4;
}
.rc-tab.is-active .rc-tab__count { background: var(--accent-bg); color: var(--accent); }

.rc-actions {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 10px; flex-wrap: wrap;
}
.rc-act {
    height: 36px; padding: 0 14px;
    border-radius: var(--radius-pill);
    background: #fff; border: 1px solid var(--border-color);
    color: var(--text-primary); font-weight: 500; font-size: 13px;
    display: inline-flex; align-items: center; gap: 7px;
    cursor: pointer; transition: var(--transition-fast);
    box-shadow: var(--shadow-xs);
    white-space: nowrap; text-decoration: none;
}
.rc-act:hover { background: var(--gray-50); color: var(--text-primary); }
.rc-act:active { transform: scale(.97); }
.rc-act--primary {
    background: var(--brand-900); color: #fff; border-color: transparent;
}
.rc-act--primary:hover { background: var(--brand-800); color: #fff; }
.rc-act--icon { padding: 0; width: 36px; justify-content: center; }
/* Действие, требующее внимания: есть новые точки, ещё не в обзвоне */
.rc-act--accent { color: var(--warning, #b45309); border-color: currentColor }
.rc-act--accent:hover { background: var(--warning, #d97706); color: #fff }

/* «План устарел» — состав рейса менялся после расчёта, цифрам верить нельзя */
.tr-dist__stale {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 10px; padding: 8px 10px;
    border: 1px solid var(--warning, #d97706); border-radius: var(--radius-sm, 6px);
    background: var(--warning-bg, #fffbeb);
    color: var(--warning, #b45309); font-size: 12.5px; line-height: 1.4;
}
.tr-dist__stale svg { flex: 0 0 auto }
.tr-dist__stale span { flex: 1 1 200px }
.tr-dist__stale-btn {
    flex: 0 0 auto; padding: 4px 10px; cursor: pointer;
    border: 1px solid currentColor; border-radius: var(--radius-pill, 999px);
    background: transparent; color: inherit; font-size: 12px;
}
.tr-dist__stale-btn:hover { background: var(--warning, #d97706); color: #fff }

/* «Доставить дополнительно» — получатели без подтверждённых координат.
   Тот же янтарный, что у «план устарел»: оба про «посмотри сюда», а не
   про ошибку. Красным было бы неверно — доставка состоится. */
.tr-dist__extra {
    display: flex; align-items: flex-start; gap: 8px;
    margin-top: 10px; padding: 8px 10px;
    border: 1px solid var(--warning, #d97706); border-radius: var(--radius-sm, 6px);
    background: var(--warning-bg, #fffbeb);
    color: var(--warning, #b45309); font-size: 12.5px; line-height: 1.4;
}
.tr-dist__extra svg { flex: 0 0 auto; margin-top: 2px }
.tr-dist__extra-hint { margin-top: 2px; opacity: .85 }
.tr-dist__extra-list { margin: 6px 0 0; padding-left: 16px }
.tr-dist__extra-list li { margin-bottom: 3px }
.tr-dist__extra-list a { color: inherit; font-weight: 600; text-decoration: underline }
.tr-dist__extra-list span { display: block; opacity: .8; font-size: 12px }

/* Уже отправлен в ТокЛог — кнопка остаётся рабочей (повтор обновит
   кампанию), но видом показывает, что действие уже выполнялось */
.rc-act.is-done { color: var(--success, #16794a); border-color: currentColor; }
.rc-act--danger { color: var(--text-muted); border-color: transparent; box-shadow: none; background: transparent; }
.rc-act--danger:hover { color: var(--danger); background: var(--danger-bg); }
.rc-act__sep { width: 1px; height: 20px; background: var(--border-color); margin: 0 4px; }

/* === TAB PANEL CONTAINER ============================== */
.rc-panels { padding: 0 4px; }
.rc-panel { display: none; animation: rcFade .25s ease forwards; }
.rc-panel.is-active { display: block; }
@keyframes rcFade {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* === KPI STRIP for Codes tab ========================== */
.rc-stat-strip {
    display: inline-flex; align-items: stretch;
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 4px;
    box-shadow: var(--shadow-xs);
    font-family: var(--font-mono);
}
.rc-stat-strip__cell {
    padding: 4px 16px 6px; display: flex; flex-direction: column;
    border-right: 1px solid var(--gray-100);
}
.rc-stat-strip__cell:last-child { border-right: 0; }
.rc-stat-strip__label {
    font-family: var(--font); font-size: 10px;
    text-transform: uppercase; letter-spacing: .8px;
    font-weight: 600; color: var(--text-muted);
    margin-bottom: 2px;
}
.rc-stat-strip__cell--ok    .rc-stat-strip__label { color: var(--success); }
.rc-stat-strip__cell--warn  .rc-stat-strip__label { color: var(--warning); }
.rc-stat-strip__cell--err   .rc-stat-strip__label { color: var(--danger); }
.rc-stat-strip__value {
    font-weight: 700; font-size: 16px; color: var(--text-primary);
}
.rc-stat-strip__cell--ok   .rc-stat-strip__value { color: #047857; }
.rc-stat-strip__cell--warn .rc-stat-strip__value { color: #b45309; }
.rc-stat-strip__cell--err  .rc-stat-strip__value { color: #b91c1c; }

/* Filter row */
.rc-filterbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.rc-search {
    position: relative; min-width: 240px; flex: 1; max-width: 320px;
}
.rc-search input {
    width: 100%; height: 38px; padding: 0 12px 0 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #fff; color: var(--text-primary);
    font-size: 13px; font-family: var(--font-mono);
    box-shadow: var(--shadow-xs);
}
.rc-search input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.rc-search__icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}
.rc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-chip {
    height: 30px; padding: 0 12px;
    border-radius: var(--radius-pill);
    background: var(--gray-100); color: var(--text-secondary);
    font-size: 12px; font-weight: 500;
    border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; transition: var(--transition-fast);
}
.rc-chip:hover { background: var(--gray-200); color: var(--text-primary); }
.rc-chip.is-active {
    background: #fff; border-color: var(--border-color);
    color: var(--text-primary); font-weight: 600;
    box-shadow: var(--shadow-xs);
}
.rc-chip__count {
    padding: 0 6px; border-radius: var(--radius-pill);
    background: var(--gray-200); font-size: 10.5px; font-weight: 700;
    color: var(--text-muted);
}
.rc-chip.is-active .rc-chip__count {
    background: var(--accent-bg); color: var(--accent);
}

/* === CODE GROUP CARDS ================================ */
.rc-groups { display: flex; flex-direction: column; gap: 16px; }
.rc-group {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.rc-group__head {
    padding: 12px 18px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.rc-group__title {
    display: flex; align-items: center; gap: 12px; min-width: 0;
}
.rc-group__icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: #fff; border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 16px;
    box-shadow: var(--shadow-xs); flex-shrink: 0;
}
.rc-group__name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.rc-group__meta {
    font-size: 11.5px; color: var(--text-muted);
    margin-top: 2px;
}
.rc-group__status {
    padding: 4px 10px; border-radius: var(--radius-xs);
    font-size: 11.5px; font-weight: 500;
    border: 1px solid;
    display: inline-flex; align-items: center; gap: 6px;
    flex-shrink: 0;
}
.rc-group__status--ok { background: var(--success-bg); color: #047857; border-color: var(--success-border); }
.rc-group__status--pending { background: var(--warning-bg); color: #b45309; border-color: var(--warning-border); }
.rc-group__status--err { background: var(--danger-bg); color: #b91c1c; border-color: var(--danger-border); }

.rc-group__rows > * + * { border-top: 1px solid var(--gray-100); }

.rc-code-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; gap: 12px;
    transition: background var(--transition-fast);
    cursor: default;
}
.rc-code-row:hover { background: var(--gray-50); }
.rc-code-row__left {
    display: flex; align-items: center; gap: 12px;
    min-width: 0; flex: 1;
}
.rc-code-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gray-300); flex-shrink: 0;
}
.rc-code-dot--ok { background: var(--success); }
.rc-code-dot--pending {
    background: var(--warning); position: relative;
}
.rc-code-dot--pending::before {
    content:''; position: absolute; inset: 0; border-radius: 50%;
    background: var(--warning); opacity: .5;
    animation: rcPulse 1.6s ease-out infinite;
}
.rc-code-dot--err { background: var(--danger); }
.rc-code {
    font-family: var(--font-mono); font-size: 12.5px;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
    min-width: 0; letter-spacing: .03em;
}
.rc-code__head, .rc-code__tail { color: var(--text-primary); }
.rc-code__ellipsis { color: var(--gray-300); font-weight: 700; }
.rc-code-copy {
    background: none; border: 0;
    color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: 4px;
    opacity: 0; transition: opacity var(--transition-fast);
    font-size: 14px; line-height: 1;
}
.rc-code-row:hover .rc-code-copy { opacity: 1; }
.rc-code-copy:hover { color: var(--accent); background: var(--accent-bg); }
.rc-code-copy.is-copied { opacity: 1; color: var(--success); }

.rc-code-row__right {
    display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.rc-code__ts { font-size: 11.5px; color: var(--text-muted); }
.rc-code-details {
    font-size: 12px; font-weight: 500;
    color: var(--accent); background: var(--accent-bg);
    padding: 4px 10px; border-radius: var(--radius-xs);
    border: 0; cursor: pointer;
    transition: var(--transition-fast);
}
.rc-code-details:hover { background: var(--accent-subtle); }
.rc-code-details:active { transform: scale(.97); }

.rc-code-delete {
    font-size: 13px; line-height: 1;
    color: var(--muted); background: transparent;
    padding: 4px 6px; border-radius: var(--radius-xs);
    border: 0; cursor: pointer; opacity: 0;
    transition: var(--transition-fast);
}
.rc-code-row:hover .rc-code-delete { opacity: .6; }
.rc-code-delete:hover { opacity: 1; color: var(--danger, #dc2626); background: rgba(220,38,38,.08); }
.rc-code-delete:active { transform: scale(.92); }
.rc-code-delete:disabled { opacity: .3; cursor: default; }

/* ── Массовое удаление кодов ── */
.rc-bulk-bar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 16px;
    padding: 10px 16px; margin-bottom: 4px;
    background: var(--gray-50);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.rc-bulk-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.rc-bulk-info { font-size: 13px; color: var(--gray-500, #6b7280); }
.rc-bulk-info b { color: var(--text-color, #111); }
.rc-bulk-del {
    margin-left: auto;
    padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: #fff;
    background: var(--danger, #dc2626);
}
.rc-bulk-del:hover { filter: brightness(.94); }
.rc-bulk-del:active { transform: scale(.97); }
.rc-bulk-del:disabled { opacity: .5; cursor: default; }
.rc-code-check, .rc-group-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--danger, #dc2626); flex: none; }
.rc-group-check-wrap { display: inline-flex; align-items: center; }
.rc-group__actions { display: flex; align-items: center; gap: 12px; }

.rc-code-row--pending {
    background: rgba(217,119,6,0.04);
}
.rc-code-row--pending .rc-code { color: #92400e; font-family: var(--font); font-weight: 500; }
.rc-code-row--scan-now {
    height: 34px; padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--brand-900); color: #fff;
    font-size: 12.5px; font-weight: 600; border: 0;
    cursor: pointer;
}
.rc-code-row--scan-now:hover { background: var(--brand-800); }

.rc-collapsed-row {
    padding: 10px 18px; background: var(--gray-50);
    font-size: 11.5px; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.rc-collapsed-row__expand {
    color: var(--text-secondary); text-decoration: underline;
    cursor: pointer; background: none; border: 0; font-size: 11.5px;
}
.rc-collapsed-row__check { color: var(--success); }

.rc-empty {
    padding: 60px 20px; text-align: center; color: var(--text-muted);
}
.rc-empty__icon { font-size: 32px; opacity: .5; margin-bottom: 8px; }
.rc-empty__title { font-size: 15px; color: var(--text-primary); font-weight: 600; margin-bottom: 4px; }
.rc-codes-loading { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.rc-codes-loading .rc-empty__icon { font-size: 28px; opacity: .6; margin-bottom: 8px; }

/* === PRODUCT CARDS ==================================== */
.rc-products {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.rc-product {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow-xs);
    display: flex; flex-direction: column; gap: 14px;
    transition: var(--transition-fast);
}
.rc-product:hover { box-shadow: var(--shadow-sm); }
.rc-product__head { display: flex; gap: 12px; align-items: flex-start; }
.rc-product__icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent-bg); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.rc-product__name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.rc-product__meta-line {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    font-size: 11.5px; color: var(--text-muted); margin-top: 4px;
}
.rc-product__meta-line strong { color: var(--text-secondary); font-weight: 500; }

.rc-product__progress {
    background: var(--gray-100); border-radius: var(--radius-xs);
    padding: 10px 12px;
}
.rc-product__progress-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.rc-product__progress-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    font-weight: 600; color: var(--text-muted);
}
.rc-product__progress-val {
    font-family: var(--font-mono); font-size: 13px; font-weight: 700;
    color: var(--text-primary);
}
.rc-bar { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.rc-bar > div {
    height: 100%; background: var(--accent);
    border-radius: 3px; transition: width .4s ease;
}
.rc-bar--ok > div { background: var(--success); }
.rc-bar--warn > div { background: var(--warning); }
.rc-bar--err > div { background: var(--danger); }

.rc-product__actions {
    display: flex; gap: 8px; margin-top: auto;
}
.rc-btn-soft {
    flex: 1; height: 34px;
    background: var(--gray-100); border: 0;
    border-radius: var(--radius-xs);
    color: var(--text-primary); font-weight: 500; font-size: 12.5px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: var(--transition-fast);
}
.rc-btn-soft:hover { background: var(--gray-200); }
.rc-btn-soft--accent {
    background: var(--accent-bg); color: var(--accent);
}
.rc-btn-soft--accent:hover { background: var(--accent-subtle); }

/* === OVERVIEW LAYOUT ================================== */
.rc-overview {
    display: grid; gap: 18px;
    grid-template-columns: 2fr 1fr; align-items: flex-start;
}
.rc-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    margin: 0 0 12px;
}
.rc-section-title__icon { color: var(--text-muted); font-size: 16px; }
/* Шапка вкладки: заголовок слева, действие справа. Кнопка загрузки фото
   переехала сюда из шапки карточки, чтобы жить рядом с самой галереей. */
.rc-panel-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.rc-bento {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow-xs);
}
.rc-note {
    padding: 12px 14px; background: var(--accent-bg);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: var(--radius-xs); color: var(--brand-900);
    font-size: 13px; line-height: 1.5;
}
.rc-note__meta {
    font-size: 11px; color: var(--accent); margin-top: 8px; opacity: .85;
}

.rc-quicklist > * + * { border-top: 1px solid var(--gray-100); margin-top: 10px; padding-top: 10px; }
.rc-quicklist__row {
    display: flex; align-items: center; gap: 10px; padding: 4px 0;
}
.rc-quicklist__icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--gray-100); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rc-quicklist__main { flex: 1; min-width: 0; }
.rc-quicklist__title {
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-quicklist__sub {
    font-size: 11.5px; color: var(--text-muted);
    font-family: var(--font-mono);
}
.rc-quicklist__bar { width: 100px; height: 4px; flex-shrink: 0; }

/* Dark stat card for delivery route */
.rc-routepane {
    background: linear-gradient(160deg, var(--brand-800), var(--brand-900));
    color: #fff; border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow-md);
    position: relative; overflow: hidden;
}
.rc-routepane::after {
    content:''; position: absolute; top: -40px; right: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(99,102,241,.22); filter: blur(40px);
}
.rc-routepane__label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .8px; color: rgba(255,255,255,.65);
}
.rc-routepane__big {
    font-size: 26px; font-weight: 800; letter-spacing: -.02em;
    margin: 10px 0 4px;
}
.rc-routepane__big small {
    font-size: 14px; color: rgba(255,255,255,.5); font-weight: 400;
}
.rc-routepane__eta {
    font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 16px;
}
.rc-routepane__btn {
    width: 100%; height: 38px;
    background: rgba(255,255,255,.12); color: #fff;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-xs);
    font-weight: 500; font-size: 13px; cursor: pointer;
    transition: var(--transition-fast);
}
.rc-routepane__btn:hover { background: rgba(255,255,255,.2); }

/* === TIMELINE (History tab) =========================== */
.rc-timeline { position: relative; padding-left: 28px; }
.rc-timeline::before {
    content:''; position: absolute; left: 11px; top: 8px; bottom: 8px;
    width: 2px; background: var(--gray-200);
}
.rc-tl-item {
    position: relative; padding-bottom: 18px;
}
.rc-tl-item__dot {
    position: absolute; left: -22px; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    border: 3px solid #fff;
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.rc-tl-item--ok      .rc-tl-item__dot { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.rc-tl-item--warning .rc-tl-item__dot { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.rc-tl-item--danger  .rc-tl-item__dot { background: var(--danger);  box-shadow: 0 0 0 1px var(--danger); }
.rc-tl-item--neutral .rc-tl-item__dot { background: var(--gray-300); box-shadow: 0 0 0 1px var(--gray-300); }
.rc-tl-card {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); padding: 12px 14px;
    box-shadow: var(--shadow-xs);
}
.rc-tl-card__head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.rc-tl-card__type { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.rc-tl-card__time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.rc-tl-card__by { font-size: 12px; color: var(--text-secondary); }
.rc-tl-card__by strong { color: var(--text-primary); font-weight: 500; }
.rc-tl-card__fields {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.rc-tl-card__field {
    background: var(--gray-100); color: var(--text-secondary);
    padding: 1px 8px; border-radius: 4px;
    font-size: 10.5px; font-family: var(--font-mono);
}

/* === PHOTOS ============================================ */
.rc-gallery {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.rc-photo {
    background: var(--gray-100); border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); overflow: hidden;
    aspect-ratio: 1/1; position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}
.rc-photo:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rc-photo img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
/* Битая картинка: onerror прячет img и вешает класс на .rc-photo (<a>).
   Значок рисуем псевдоэлементом родителя — на самом img ::after не работает
   (replaced element). Ячейка держит aspect-ratio 1:1, грид не ломается. */
.rc-photo--broken::after {
    content: "🖼"; font-size: 28px;
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100); color: var(--text-muted);
}
.rc-photo__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 32px;
}
.rc-photo__caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 18px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
    color: #fff; font-size: 11px;
    display: flex; justify-content: space-between; align-items: center;
}

/* === MODALS ========================================== */
.rc-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.rc-modal.is-open { display: flex; }
.rc-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(15,18,37,.5);
    backdrop-filter: blur(4px);
    animation: rcFade .2s ease forwards;
}
.rc-modal__panel {
    position: relative; z-index: 1;
    background: #fff; border-radius: var(--radius);
    width: 100%; max-width: 520px;
    box-shadow: var(--shadow-xl);
    animation: rcFade .25s ease forwards;
    overflow: hidden;
    max-height: 90vh; display: flex; flex-direction: column;
}
.rc-modal__head {
    padding: 16px 22px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--gray-50);
}
.rc-modal__title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0; }
.rc-modal__close {
    background: none; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 22px; line-height: 1;
    padding: 4px;
}
.rc-modal__close:hover { color: var(--text-primary); }
.rc-modal__body { padding: 20px 22px; overflow-y: auto; }
.rc-modal__foot {
    padding: 12px 22px; border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    display: flex; justify-content: flex-end; gap: 10px;
}
.rc-modal--wide .rc-modal__panel { max-width: 680px; }

.rc-codebox {
    background: var(--gray-900); color: #fff;
    padding: 14px 16px; border-radius: var(--radius-xs);
    font-family: var(--font-mono); font-size: 13px;
    word-break: break-all; line-height: 1.5;
    margin-bottom: 16px;
    position: relative;
}
.rc-codebox__copy {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,.1); color: #fff;
    border: 0; padding: 5px 10px; border-radius: 4px;
    font-size: 11px; cursor: pointer; font-family: var(--font);
}
.rc-codebox__copy:hover { background: rgba(255,255,255,.18); }
.rc-codebox__copy.is-copied { background: var(--success); }

.rc-decoded {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px;
}
.rc-decoded__label {
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .6px;
    font-weight: 600; margin-bottom: 3px;
}
.rc-decoded__val { font-size: 13px; color: var(--text-primary); word-break: break-all; }
.rc-decoded__val--mono { font-family: var(--font-mono); }
.rc-decoded__val--ok {
    color: var(--success); display: inline-flex; align-items: center; gap: 5px;
}

/* === TOASTS =========================================== */
.rc-toasts {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 1100; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.rc-toast {
    background: var(--brand-900); color: #fff;
    padding: 10px 16px; border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 8px;
    animation: rcToast .3s ease forwards;
    pointer-events: auto;
}
.rc-toast--success { background: var(--success); }
.rc-toast--error   { background: var(--danger); }
/* Отказ по существу (1С ответила «нельзя»), а не поломка —
   красный тут отправлял чинить исправную интеграцию */
.rc-toast--warning { background: var(--warning); }
@keyframes rcToast {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
/* Уход. Класс ставили и раньше (trip-page.js, trips-list.js), но правила под
   него не было — тост просто пропадал рывком */
.rc-toast--out {
    opacity: 0; transform: translateY(10px);
    transition: opacity .28s ease, transform .28s ease;
}

/* Пояснения к расчёту — это несколько строк, а не «Сохранено».
   Даём ширину и нормальный межстрочный, иначе текст идёт одной лентой */
/* Ширина фиксированная, а не по содержимому: три-четыре пояснения висят
   в столбик одновременно, и разнокалиберные плашки читались как обрывки */
.pl-toast {
    position: relative;
    width: 400px; max-width: calc(100vw - 48px);
    align-items: flex-start;
    font-weight: 400; line-height: 1.45;
    padding: 12px 34px 12px 15px;
    cursor: pointer;
    /* Полупрозрачно с размытием: плашки висят над картой, и сплошная
       заливка закрывала как раз тот кусок, ради которого туда смотрят.
       Фон запасной — там, где backdrop-filter не поддержан, читаемость
       важнее прозрачности */
    background: rgba(30, 27, 56, .82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .1);
}

/* Крестик у каждого тоста: кликом по плашке закрывалось и раньше, но
   догадаться об этом было неоткуда */
.pl-toast__close {
    position: absolute; top: 7px; right: 8px;
    width: 20px; height: 20px; padding: 0;
    border: 0; border-radius: 6px; background: none; cursor: pointer;
    font-size: 16px; line-height: 1; color: rgba(255, 255, 255, .55);
}
.pl-toast__close:hover { background: rgba(255, 255, 255, .14); color: #fff }

/* === RESPONSIVE ======================================= */
@media (max-width: 1100px) {
    .rc-overview { grid-template-columns: 1fr; }
    .rc-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .rc-code-row__right .rc-code__ts { display: none; }
}
@media (max-width: 768px) {
    .rc-hero__top, .rc-hero__identity, .rc-kpi-row { padding-left: 16px; padding-right: 16px; }
    .rc-strip { padding: 0 16px; }
    .rc-name { font-size: 22px; }
    .rc-meta { gap: 4px 10px; font-size: 12px; }
    .rc-meta__sep { display: none; }
    .rc-kpi-row { grid-template-columns: 1fr; gap: 14px; }
    .rc-alert { max-width: 100%; }
    .rc-decoded { grid-template-columns: 1fr; }
    .rc-actions { width: 100%; justify-content: stretch; }
    .rc-actions .rc-act { flex: 1; }
    .rc-actions .rc-act--icon { flex: 0; }
}
@media (max-width: 480px) {
    .rc-tabs { gap: 14px; }
    .rc-tab { padding: 12px 0; font-size: 13px; }
    .rc-products { grid-template-columns: 1fr; }
}

/* ============================================================
   RECIPIENT CARD — v3 additions: icons, inline edit, CRUD
   ============================================================ */

/* Inline SVG icon wrapper — aligns with text */
.rc-ic {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    vertical-align: -2px;
}
.rc-ic svg { display: block; }

/* Hero label gets a small icon on left */
.rc-bento2__label {
    display: inline-flex; align-items: center; gap: 6px;
}
.rc-bento2__label .rc-ic { color: currentColor; opacity: .55; }

/* Hero datalist — restyle dt to include icon */
.rc-datalist dt {
    display: inline-flex; align-items: center; gap: 6px;
    text-transform: none; letter-spacing: 0;
    font-size: 11.5px; font-weight: 500;
    color: var(--text-muted);
}
.rc-datalist dt .rc-ic { color: var(--accent); opacity: .8; }

/* Codes cell layout with mini-stats */
.rc-bento2__cell--codes .rc-codes-row {
    display: flex; align-items: center; gap: 14px;
}
.rc-codes-mini { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rc-codes-mini__row {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.rc-codes-mini__sw {
    width: 8px; height: 8px; border-radius: 2px;
    flex-shrink: 0; background: var(--gray-300);
}
.rc-codes-mini__sw--ok   { background: var(--success); }
.rc-codes-mini__sw--warn { background: var(--warning); }
.rc-codes-mini__sw--err  { background: var(--danger); }
.rc-codes-mini__lbl { color: var(--text-muted); flex: 1; }
.rc-codes-mini__val { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 18px; text-align: right; }

/* Numchip with icon */
.rc-numchip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.rc-numchip__ic {
    width: 32px; height: 32px; border-radius: 8px;
    background: #fff; border: 1px solid var(--hairline);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rc-numchip:hover .rc-numchip__ic { background: var(--accent); color: #fff; border-color: var(--accent); }
.rc-numchip__body { display: flex; flex-direction: column; min-width: 0; }

/* Alertline with icon */
.rc-alertline__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
}
.rc-alertline__icon svg { width: 14px; height: 14px; }

/* Action buttons — flex icons */
.rc-act { line-height: 1; }
.rc-act svg { display: block; }
.rc-act--icon svg { color: currentColor; }

/* Status pill icon */
.rc-status-pill .rc-pulse { color: currentColor; }

/* === Personal tab — inline edit fields === */
.rc-grid2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: flex-start;
}
@media (max-width: 1100px) { .rc-grid2 { grid-template-columns: 1fr; } }

.rc-section-title { font-size: 13.5px; }
.rc-section-title__icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.rc-section-title__hint {
    margin-left: auto; font-size: 11px;
    color: var(--text-muted); font-weight: 400;
}
.rc-section-title { display: flex; align-items: center; gap: 8px; }

/* Fields grid */
.rc-fields {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border-top: 1px solid var(--gray-100);
}
.rc-fields--cols2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .rc-fields { grid-template-columns: 1fr; } }

.rc-field {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
    min-width: 0;
    transition: background var(--transition-fast);
}
.rc-fields > .rc-field:nth-child(2n) { border-right: 0; }
@media (max-width: 700px) {
    .rc-fields > .rc-field { border-right: 0; }
}
.rc-field:not(.rc-field--readonly):not(.rc-field--editing) { cursor: pointer; }
.rc-field:not(.rc-field--readonly):not(.rc-field--editing):hover { background: var(--gray-50); }
.rc-field__label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 4px;
}
.rc-field__label .rc-ic { color: var(--accent); opacity: .7; }
.rc-field__value {
    font-size: 14px; color: var(--text-primary);
    font-weight: 500;
    min-height: 22px;
    word-break: break-word;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.rc-field__value--mono { font-family: var(--font-mono); }
.rc-field__value--multi {
    display: block; white-space: pre-wrap; line-height: 1.5;
    position: relative; padding-right: 22px;
}
.rc-field__value--multi .rc-field__edit-ic {
    position: absolute; top: 2px; right: 0;
}
.rc-field__value--empty { color: var(--text-muted); font-weight: 400; font-style: italic; }
.rc-field__edit-ic {
    color: var(--text-muted); opacity: 0;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}
.rc-field:hover .rc-field__edit-ic { opacity: .6; }

.rc-field--editing { background: var(--accent-bg); padding: 8px 14px; }
.rc-field__input,
.rc-field__select,
.rc-field__textarea {
    width: 100%; padding: 6px 10px;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-xs);
    background: #fff; color: var(--text-primary);
    font: inherit; font-size: 14px;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}
.rc-field__textarea { font-size: 13px; min-height: 80px; resize: vertical; }
.rc-field__select { padding-right: 28px; appearance: auto; }
.rc-field__hint {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    display: flex; gap: 10px;
}
.rc-field__hint kbd {
    font-family: var(--font-mono); font-size: 10px;
    padding: 1px 5px; border-radius: 3px;
    background: #fff; border: 1px solid var(--gray-200);
    box-shadow: 0 1px 0 var(--gray-200);
}
.rc-field--saving { opacity: .6; pointer-events: none; }
.rc-field--saved {
    animation: rcSavedFlash .8s ease;
}
@keyframes rcSavedFlash {
    0% { background: var(--success-bg); }
    100% { background: transparent; }
}

/* Phones list redesign */
.rc-phones { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rc-phone-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
}
.rc-phone-row__ic {
    width: 32px; height: 32px; border-radius: 8px;
    background: #fff; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}
.rc-phone-row__ic--primary {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.rc-phone-row__main { flex: 1; min-width: 0; }
.rc-phone-row__num {
    font-family: var(--font-mono); font-weight: 600;
    color: var(--text-primary); font-size: 14px;
}
.rc-phone-row__lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.rc-tag {
    font-size: 10.5px; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
    background: var(--gray-200); color: var(--gray-700);
    text-transform: uppercase; letter-spacing: .3px;
}
.rc-tag--accent { background: var(--accent-bg); color: var(--accent); }

.rc-empty-inline { font-size: 13px; color: var(--text-muted); padding: 10px 0; font-style: italic; }
.rc-field--readonly { background: var(--gray-50); cursor: default !important; }
.rc-field--readonly:hover { background: var(--gray-50); }

/* === Contracts tab CRUD === */
.rc-contracts-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}

.rc-contract {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.rc-contract__head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; padding: 14px 18px;
    background: linear-gradient(180deg, #fafbff, #fff);
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}
.rc-contract__title-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.rc-contract__ic {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent-bg); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rc-contract__title {
    font-size: 15px; font-weight: 700; margin: 0;
    font-family: var(--font-mono); color: var(--text-primary);
}
.rc-contract__meta {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.rc-contract__chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--text-secondary);
    background: var(--gray-100);
    padding: 2px 8px; border-radius: 999px;
}
.rc-contract__chip .rc-ic { color: var(--text-muted); opacity: .8; }
.rc-contract__actions { display: flex; align-items: center; gap: 4px; }

.rc-iconbtn {
    width: 30px; height: 30px; border-radius: 8px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition-fast);
}
.rc-iconbtn:hover { background: var(--gray-100); color: var(--text-primary); border-color: var(--border-color); }
.rc-iconbtn--danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.rc-contract__body { padding: 14px 18px; }
.rc-contract__products {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}
.rc-product-empty {
    grid-column: 1/-1;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 24px; color: var(--text-muted);
    background: var(--gray-50); border-radius: var(--radius-xs);
    font-size: 13px;
}
.rc-product-empty svg { opacity: .5; }

.rc-product2 {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.rc-product2__head { display: flex; align-items: flex-start; gap: 10px; }
.rc-product2__ic {
    width: 28px; height: 28px; border-radius: 6px;
    background: #fff; color: var(--accent);
    border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rc-product2__main { flex: 1; min-width: 0; }
.rc-product2__name {
    font-size: 13.5px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
}
.rc-product2__meta {
    display: flex; flex-wrap: wrap; gap: 4px 10px;
    margin-top: 4px;
    font-size: 11.5px; color: var(--text-muted);
}
.rc-product2__metait {
    display: inline-flex; align-items: center; gap: 4px;
}
.rc-product2__metait .rc-ic { color: var(--text-muted); opacity: .8; }
.rc-product2__actions { display: flex; gap: 2px; flex-shrink: 0; }

.rc-product2__progress { display: flex; flex-direction: column; gap: 4px; }
.rc-product2__progress-row {
    display: flex; justify-content: space-between; align-items: baseline;
}
.rc-product2__progress-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); font-weight: 600;
}
.rc-product2__progress-val { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }

.rc-product2__codeslink {
    background: transparent; border: 0; padding: 4px 0;
    color: var(--accent); font-size: 12px; font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    text-align: left;
}
.rc-product2__codeslink:hover { color: var(--accent-hover); }

.rc-add-product-btn {
    margin-top: 14px; width: 100%;
    padding: 10px;
    background: transparent;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-weight: 500; font-size: 12.5px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.rc-add-product-btn:hover {
    background: var(--accent-bg); color: var(--accent);
    border-color: var(--accent);
    border-style: solid;
}

/* CRUD modal form grid */
.rc-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.rc-form-field { display: flex; flex-direction: column; gap: 4px; }
.rc-form-field--wide { grid-column: 1/-1; }
.rc-form-field label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted);
}
.rc-form-field .form-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-xs); font-size: 13.5px; }
.rc-form-field .form-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.rc-form-field .rc-mono { font-family: var(--font-mono); }
@media (max-width: 560px) {
    .rc-form-grid { grid-template-columns: 1fr; }
    .rc-form-field--wide { grid-column: 1; }
}

/* === Personal tab — стэк блоков без огромных промежутков === */
.rc-grid2 + .rc-grid2,
.rc-grid2--stacked { margin-top: 10px; }

/* === HERO v3 — компактный, с инфографикой и графиками === */
.rc-hero3 {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 22px 20px;
    display: flex; flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.rc-hero3::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), #8b8df0 60%, transparent);
    opacity: .9;
}

.rc-hero3__top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    font-size: 12px; color: var(--text-muted);
}
.rc-hero3__top a { color: var(--accent); text-decoration: none; }
.rc-hero3__top a:hover { text-decoration: underline; }

.rc-hero3__id {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap;
}
.rc-hero3__avatar {
    flex: 0 0 auto;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b8df0);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
    letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(99,102,241,.25);
    text-transform: uppercase;
}
.rc-hero3__id-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-hero3__name {
    font-size: 22px; font-weight: 700; line-height: 1.15;
    color: var(--text-primary);
    margin: 0;
    word-wrap: break-word;
}
.rc-hero3__meta {
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    font-size: 12.5px; color: var(--text-secondary);
}
.rc-hero3__metait {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 0;
}
.rc-hero3__metait svg { color: var(--text-muted); flex: 0 0 auto; }
.rc-hero3__metait--link { color: var(--accent); text-decoration: none; }
.rc-hero3__metait--link:hover { text-decoration: underline; }
.rc-hero3__metait-btn {
    background: transparent; border: 1px solid var(--border-color);
    border-radius: 4px; padding: 1px 4px; margin-left: 4px;
    cursor: pointer; color: var(--text-muted);
    display: inline-flex; align-items: center;
    transition: var(--transition-fast);
}
.rc-hero3__metait-btn:hover { color: var(--accent); border-color: var(--accent); }
.rc-hero3__metait--btn {
    background: var(--accent-bg); color: var(--accent);
    border: 1px dashed var(--accent); cursor: pointer;
    font-weight: 600;
}
.rc-hero3__metait--btn:hover { background: var(--accent); color: #fff; }
.rc-hero3__metahint {
    color: var(--text-muted); font-size: 11.5px;
    margin-left: 2px;
}

/* Полный адрес — отдельной строкой, не обрезается */
.rc-hero3__address {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 13px; line-height: 1.45;
    color: var(--text-primary);
}
.rc-hero3__address-ic {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent); margin-top: 2px; flex: 0 0 auto;
}
.rc-hero3__address-text {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1;
}

/* Инфографика — 3 метрик-карточки */
.rc-hero3__metrics {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.1fr;
    gap: 14px;
}
@media (max-width: 1100px) { .rc-hero3__metrics { grid-template-columns: 1fr; } }

.rc-metric {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 132px;
}
.rc-metric__label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-muted);
}
.rc-metric__label svg { color: var(--accent); }

/* Donut chart (SVG) */
.rc-metric__donut-row {
    display: flex; align-items: center; gap: 14px;
    flex: 1;
}
.rc-svgdonut { flex: 0 0 auto; display: block; }
.rc-svgdonut circle { transition: stroke-dashoffset .6s ease; }
.rc-metric__legend {
    display: flex; flex-direction: column; gap: 5px;
    flex: 1; min-width: 0;
    font-size: 12px;
}
.rc-metric__row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.rc-metric__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.rc-metric__row--ok   .rc-metric__dot { background: #16a34a; }
.rc-metric__row--warn .rc-metric__dot { background: #f59e0b; }
.rc-metric__row--err  .rc-metric__dot { background: #ef4444; }
.rc-metric__rlbl { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Черта в легенде: отделяет план из 1С от фактических точек рейса */
.rc-metric__sep { height: 1px; background: var(--border-color); margin: 3px 0 1px; }
.rc-metric__rval { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ── Эффективность (1С): плитки на всю ширину ──
   Блок стоит второй строкой в сетке метрик. Вертикальным списком в трети
   экрана он оставлял две пустые колонки справа, поэтому занимает всю
   ширину, а цифры разложены плитками. */
.rc-metric--wide { grid-column: 1 / -1; min-height: 0; }

.tr-eff {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.tr-eff__tile {
    display: flex; flex-direction: column; gap: 6px;
    padding: 11px 12px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    min-width: 0;
}
/* Факт — главная цифра блока, выделяем фоном, а не размером */
.tr-eff__tile--accent { background: var(--surface-2); border-color: var(--accent); }
.tr-eff__tile--warn   { border-color: #f59e0b; }

.tr-eff__tile-top {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-muted);
    min-width: 0;
}
.tr-eff__ic { display: flex; color: var(--text-muted); flex: 0 0 auto; }
.tr-eff__lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-eff__delta { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.tr-eff__val {
    font-size: 24px; font-weight: 700; line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.tr-eff__val--sm { font-size: 18px; }
.tr-eff__val small { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }

.tr-eff__bar {
    height: 4px; border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}
.tr-eff__bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }

.tr-eff__note { font-size: 10.5px; color: var(--text-muted); }
.tr-eff__foot {
    display: flex; align-items: center; gap: 5px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 11px; color: var(--text-muted);
}

/* Sparkbars (горизонтальные полоски) */
.rc-sparkbars { display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: center; }
.rc-sparkbar { display: grid; grid-template-columns: 80px 1fr 36px; gap: 8px; align-items: center; }
.rc-sparkbar__lbl { font-size: 11.5px; color: var(--text-muted); }
.rc-sparkbar__track {
    height: 8px; border-radius: 999px; background: var(--border-color);
    overflow: hidden;
}
.rc-sparkbar__fill {
    height: 100%; border-radius: 999px;
    background: var(--accent);
    transition: width .5s ease;
}
.rc-sparkbar__fill--ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.rc-sparkbar__fill--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rc-sparkbar__fill--err  { background: linear-gradient(90deg, #ef4444, #f87171); }
.rc-sparkbar__val { font-size: 12px; font-weight: 700; text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Quickgrid (3 быстрые ячейки) */
.rc-quickgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1;
}
.rc-quickcell {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 10px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}
.rc-quickcell:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-1px);
}
.rc-quickcell--static { cursor: default; }
.rc-quickcell--static:hover { transform: none; border-color: var(--border-color); background: var(--surface-1); }
.rc-quickcell__ic {
    width: 28px; height: 28px;
    border-radius: var(--radius-xs);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-bg); color: var(--accent);
}
.rc-quickcell__ic--info { background: rgba(56, 189, 248, .14); color: #0284c7; }
.rc-quickcell__ic--mute { background: var(--surface-2); color: var(--text-muted); }
.rc-quickcell__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-quickcell__n { font-size: 17px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.rc-quickcell__n--sm { font-size: 12.5px; font-weight: 600; }
.rc-quickcell__l { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

/* Alerts под метриками */
.rc-hero3__alerts { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 720px) {
    .rc-hero3 { padding: 14px; }
    .rc-hero3__name { font-size: 18px; }
    .rc-hero3__avatar { width: 48px; height: 48px; font-size: 17px; }
    .rc-quickgrid { grid-template-columns: 1fr; }
    .rc-sparkbar { grid-template-columns: 70px 1fr 32px; }
}

/* ============================================================
   TABS REDESIGN v3 — unified bento + charts + infographics
   ============================================================ */

/* Shared building blocks */
.rc-bento--accent { border-color: rgba(99,102,241,.25); background: linear-gradient(180deg, rgba(99,102,241,.04), var(--surface-1)); }
.rc-bento--alerts { margin-top: 14px; }

.rc-row2 {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}
.rc-row2--stacked { margin-top: 12px; }
@media (max-width: 1100px) { .rc-row2 { grid-template-columns: 1fr; } }

.rc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); margin-right: 6px; }
.rc-dot--ok   { background: #16a34a; }
.rc-dot--warn { background: #f59e0b; }
.rc-dot--err  { background: #ef4444; }

.rc-empty-inline { color: var(--text-muted); font-size: 13px; padding: 14px 4px; }

.rc-jump-btn {
    margin-top: 12px; width: 100%;
    padding: 9px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 12.5px; font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.rc-jump-btn:hover {
    color: var(--accent); border-color: var(--accent); background: var(--accent-bg);
}

/* --- KPI tiles --- */
.rc-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 920px) { .rc-kpis { grid-template-columns: repeat(2, 1fr); } }
.rc-kpi {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
    min-height: 116px;
    transition: var(--transition-fast);
}
.rc-kpi:hover { border-color: var(--accent); }
.rc-kpi--accent {
    background: linear-gradient(180deg, rgba(99,102,241,.06), var(--surface-1));
    border-color: rgba(99,102,241,.25);
}
.rc-kpi__top { display: flex; align-items: center; justify-content: space-between; }
.rc-kpi__ic {
    width: 32px; height: 32px;
    border-radius: var(--radius-xs);
    background: var(--accent-bg); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
}
.rc-kpi__delta {
    font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.rc-kpi__delta--up   { background: rgba(22,163,74,.14);  color: #15803d; }
.rc-kpi__delta--flat { background: rgba(245,158,11,.14); color: #b45309; }
.rc-kpi__delta--down { background: rgba(239,68,68,.14);  color: #b91c1c; }
.rc-kpi__val {
    font-size: 26px; font-weight: 700; color: var(--text-primary);
    font-variant-numeric: tabular-nums; line-height: 1.05;
    margin-top: 6px;
}
.rc-kpi__val--sm { font-size: 15px; font-weight: 600; }
.rc-kpi__sub { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.rc-kpi__lbl { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .35px; }
.rc-kpi__hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.rc-kpi__bar {
    margin-top: 8px; height: 4px;
    border-radius: 999px; background: var(--border-color); overflow: hidden;
}
.rc-kpi__bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), #8b8df0);
    transition: width .5s ease;
}

/* --- Status card (overview) --- */
.rc-status-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    margin-bottom: 14px;
}
.rc-status-card__meta { font-size: 12px; color: var(--text-muted); }
.rc-status-card__btn { margin-top: 4px; align-self: flex-start; }

.rc-progressbar { display: flex; flex-direction: column; gap: 8px; }
.rc-progressbar__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-muted); }
.rc-progressbar__head strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rc-progressbar__track {
    display: flex; height: 10px;
    border-radius: 999px; overflow: hidden;
    background: var(--border-color);
}
.rc-progressbar__seg { height: 100%; transition: width .5s ease; }
.rc-progressbar__seg--ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.rc-progressbar__seg--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rc-progressbar__seg--err  { background: linear-gradient(90deg, #ef4444, #f87171); }
.rc-progressbar__legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-muted); flex-wrap: wrap; }
.rc-progressbar__legend strong { color: var(--text-primary); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* --- Sparkline (bar chart) --- */
.rc-sparkline {
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 4px;
    height: 110px;
    align-items: end;
}
.rc-sparkline--lg { grid-template-columns: repeat(30, 1fr); gap: 3px; }
.rc-sparkline__col {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    gap: 4px;
    height: 100%;
}
.rc-sparkline__bar {
    width: 100%; min-height: 4px;
    background: var(--border-color);
    border-radius: 3px 3px 0 0;
    transition: height .4s ease, background .2s;
}
.rc-sparkline__bar.is-active { background: linear-gradient(180deg, var(--accent), #4f46e5); }
.rc-sparkline__col:hover .rc-sparkline__bar { background: var(--accent-hover, #4f46e5); }
.rc-sparkline__lbl { font-size: 9.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rc-sparkline__axis {
    display: flex; justify-content: space-between;
    font-size: 10.5px; color: var(--text-muted); margin-top: 8px;
}

/* --- Type breakdown bar --- */
.rc-typebreakdown { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.rc-typebreakdown__head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.rc-typebreakdown__bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--border-color); }
.rc-typebreakdown__seg { height: 100%; transition: width .5s ease; }
.rc-typebreakdown__legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.rc-typebreakdown__legend strong { color: var(--text-primary); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* --- Mini contracts (overview) --- */
.rc-mini-contracts { display: flex; flex-direction: column; gap: 10px; }
.rc-mini-contract {
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    display: flex; flex-direction: column; gap: 6px;
    transition: var(--transition-fast);
}
.rc-mini-contract:hover { border-color: var(--accent); }
.rc-mini-contract__head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rc-mini-contract__ic { color: var(--accent); display: inline-flex; }
.rc-mini-contract__num { font-weight: 600; color: var(--text-primary); }
.rc-mini-contract__date { color: var(--text-muted); font-size: 11.5px; }
.rc-mini-contract__pct { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.rc-mini-contract__pct--ok   { background: rgba(22,163,74,.14); color: #15803d; }
.rc-mini-contract__pct--warn { background: rgba(245,158,11,.14); color: #b45309; }
.rc-mini-contract__pct--err  { background: rgba(239,68,68,.14); color: #b91c1c; }
.rc-mini-contract__bar { height: 6px; background: var(--border-color); border-radius: 999px; overflow: hidden; }
.rc-mini-contract__fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.rc-mini-contract__fill--ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.rc-mini-contract__fill--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rc-mini-contract__fill--err  { background: linear-gradient(90deg, #ef4444, #f87171); }
.rc-mini-contract__foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

/* --- Mini timeline (overview) --- */
.rc-mini-timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 4px; }
.rc-mini-tl { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.rc-mini-tl::before {
    content: ''; position: absolute;
    left: 7px; top: 16px; bottom: -8px;
    width: 1px; background: var(--border-color);
}
.rc-mini-tl:last-child::before { display: none; }
.rc-mini-tl__dot {
    width: 10px; height: 10px; border-radius: 50%;
    margin-top: 6px;
    background: var(--accent); border: 2px solid var(--surface-1);
    box-shadow: 0 0 0 1px var(--border-color);
    z-index: 1;
}
.rc-tl--ok    .rc-mini-tl__dot { background: #16a34a; }
.rc-tl--warn  .rc-mini-tl__dot { background: #f59e0b; }
.rc-tl--err   .rc-mini-tl__dot { background: #ef4444; }
.rc-tl--info  .rc-mini-tl__dot { background: #0ea5e9; }
.rc-mini-tl__body { font-size: 12.5px; min-width: 0; }
.rc-mini-tl__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rc-mini-tl__type { font-weight: 600; color: var(--text-primary); }
.rc-mini-tl__time { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-mini-tl__by { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* --- Alerts grid (overview) --- */
.rc-alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rc-alert-card {
    display: grid; grid-template-columns: 26px 1fr; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 12.5px;
}
.rc-alert-card strong { display: block; margin-bottom: 2px; }
.rc-alert-card div { color: var(--text-muted); font-size: 11.5px; }
.rc-alert-card__ic { display: inline-flex; align-items: flex-start; }
.rc-alert-card--warn { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); }
.rc-alert-card--warn .rc-alert-card__ic { color: #b45309; }
.rc-alert-card--warn strong { color: #92400e; }
.rc-alert-card--err  { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); }
.rc-alert-card--err .rc-alert-card__ic { color: #b91c1c; }
.rc-alert-card--err strong { color: #991b1b; }

/* =================== CONTRACTS TAB v3 =================== */
.rc-contracts-head2 {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
.rc-contracts-head2__title { flex: 1 1 auto; min-width: 200px; }
.rc-contracts-head2__stats { display: flex; gap: 8px; }
.rc-cstat {
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    text-align: center;
    background: var(--surface-2);
    display: flex; flex-direction: column; align-items: center;
    min-width: 64px;
}
.rc-cstat__n { font-size: 18px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.rc-cstat__l { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.rc-cstat--ok   { background: rgba(22,163,74,.1); }
.rc-cstat--ok   .rc-cstat__n { color: #15803d; }
.rc-cstat--warn { background: rgba(245,158,11,.1); }
.rc-cstat--warn .rc-cstat__n { color: #b45309; }
.rc-cstat--mute { background: var(--surface-2); }
.rc-cstat--mute .rc-cstat__n { color: var(--text-muted); }

.rc-contract2 {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition-fast);
}
.rc-contract2:hover { border-color: var(--accent); }
.rc-contract2__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px; align-items: center;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--surface-2), transparent);
    border-bottom: 1px solid var(--border-color);
}
.rc-contract2__gauge { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.rc-contract2__title-wrap { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-contract2__title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin: 0; }
.rc-contract2__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-contract2__chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; padding: 3px 8px;
    background: var(--surface-2); border-radius: 999px;
    color: var(--text-secondary);
}
.rc-contract2__chip svg { color: var(--text-muted); }
.rc-contract2__sumline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.rc-contract2__sumchip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; padding: 3px 8px;
    background: var(--surface-2); border-radius: 999px;
    color: var(--text-secondary); font-weight: 500;
}
.rc-contract2__sumchip--accent { background: var(--accent-bg); color: var(--accent); }
.rc-contract2__sumchip--ok      { background: rgba(22,163,74,.14);  color: #15803d; }
.rc-contract2__sumchip--warn    { background: rgba(245,158,11,.14); color: #b45309; }
.rc-contract2__sumchip--partial { background: rgba(14,165,233,.14); color: #0369a1; }
.rc-contract2__sumchip--mute    { background: var(--surface-2);     color: var(--text-muted); }
.rc-contract2__actions { display: flex; gap: 6px; flex: 0 0 auto; }
.rc-contract2__body { padding: 14px 16px; }
.rc-contract2__products { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

/* =================== CODES TAB v3 =================== */
.rc-codes-dash {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 16px; align-items: center;
    padding: 16px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
@media (max-width: 920px) {
    .rc-codes-dash { grid-template-columns: 1fr; }
    .rc-codes-dash__donut { justify-self: center; }
}
.rc-codes-dash__donut { display: flex; align-items: center; justify-content: center; }
.rc-codes-dash__stats { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.rc-codestat {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    gap: 10px; align-items: center;
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition-fast);
}
.rc-codestat:hover { border-color: var(--accent); background: var(--accent-bg); }
.rc-codestat__dot { width: 8px; height: 8px; border-radius: 50%; }
.rc-codestat--ok   .rc-codestat__dot { background: #16a34a; }
.rc-codestat--warn .rc-codestat__dot { background: #f59e0b; }
.rc-codestat--err  .rc-codestat__dot { background: #ef4444; }
.rc-codestat__main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rc-codestat__n { font-size: 17px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rc-codestat__l { font-size: 12px; color: var(--text-secondary); }
.rc-codestat__pct { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.rc-codes-dash__scanners {
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
}
.rc-codes-dash__scanners-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px;
    margin-bottom: 2px;
}
.rc-scannerline { display: grid; grid-template-columns: 1fr 100px 30px; gap: 8px; align-items: center; font-size: 12px; }
.rc-scannerline__name { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-scannerline__bar { height: 6px; background: var(--border-color); border-radius: 999px; overflow: hidden; }
.rc-scannerline__fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8b8df0); border-radius: 999px; }
.rc-scannerline__n { font-weight: 700; color: var(--text-primary); text-align: right; }

.rc-codes-toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
.rc-codes-toolbar__right { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.rc-codes-toolbar__select { max-width: 240px; height: 34px; font-size: 12.5px; }

/* =================== PHOTOS TAB v3 =================== */
.rc-photos-dash { display: flex; flex-direction: column; gap: 14px; }
.rc-photos-dash__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .rc-photos-dash__kpis { grid-template-columns: 1fr; } }

.rc-monthbars {
    display: flex; gap: 8px; align-items: end;
    height: 140px; padding: 4px 0;
}
.rc-monthbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.rc-monthbar__bar { width: 100%; height: 100%; display: flex; align-items: end; }
.rc-monthbar__fill {
    width: 100%;
    background: linear-gradient(180deg, var(--accent), #4f46e5);
    border-radius: 4px 4px 0 0;
    transition: height .4s ease;
    display: flex; align-items: start; justify-content: center;
    padding-top: 4px;
}
.rc-monthbar__val { font-size: 10.5px; font-weight: 700; color: #fff; }
.rc-monthbar__lbl { font-size: 10.5px; color: var(--text-muted); }

/* =================== HISTORY TAB v3 =================== */
.rc-history-dash {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 1100px) { .rc-history-dash { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .rc-history-dash { grid-template-columns: 1fr; } }

.rc-typelist { display: flex; flex-direction: column; gap: 8px; }
.rc-typelist__row { display: grid; grid-template-columns: minmax(0,1fr) 90px 32px; gap: 10px; align-items: center; font-size: 12px; }
.rc-typelist__lbl { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-typelist__bar { height: 6px; background: var(--border-color); border-radius: 999px; overflow: hidden; }
.rc-typelist__fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8b8df0); transition: width .5s ease; }
.rc-typelist__fill--alt { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }
.rc-typelist__n { font-weight: 700; color: var(--text-primary); text-align: right; font-variant-numeric: tabular-nums; }

.rc-timeline2 { position: relative; padding-left: 0; }
.rc-timeline2__group { margin-bottom: 18px; }
.rc-timeline2__date {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    background: var(--accent-bg); color: var(--accent);
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    margin-bottom: 10px;
}
.rc-timeline2__date-ic { display: inline-flex; }
.rc-timeline2__date-count {
    margin-left: 4px;
    background: rgba(255,255,255,.5);
    padding: 0 6px; border-radius: 999px;
    font-size: 10.5px; font-weight: 700;
}
.rc-tl2 {
    display: grid;
    grid-template-columns: 56px 16px 1fr;
    gap: 10px; align-items: flex-start;
    position: relative;
    padding: 4px 0;
}
.rc-tl2::before {
    content: ''; position: absolute;
    left: 63px; top: 22px; bottom: -8px;
    width: 1px; background: var(--border-color);
}
.rc-tl2:last-child::before { display: none; }
.rc-tl2__time {
    font-size: 11px; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    padding-top: 6px;
    text-align: right;
    font-family: var(--font-mono);
}
.rc-tl2__dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface-1);
    box-shadow: 0 0 0 2px var(--border-color);
    margin-top: 5px;
    z-index: 1;
}
.rc-tl--ok    .rc-tl2__dot { background: #16a34a; }
.rc-tl--warn  .rc-tl2__dot { background: #f59e0b; }
.rc-tl--err   .rc-tl2__dot { background: #ef4444; }
.rc-tl--info  .rc-tl2__dot { background: #0ea5e9; }
.rc-tl2__card {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    font-size: 12.5px;
}
.rc-tl2__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-tl2__type { font-weight: 600; color: var(--text-primary); }
.rc-tl2__by { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-muted); margin-left: auto; }
.rc-tl2__reason { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.rc-tl2__fields { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rc-tl2__field {
    font-size: 10.5px; padding: 2px 7px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* =================== DATA TAB v3 — sidebar + sub-tabs =================== */
.rc-data-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 14px;
    align-items: start;
}
@media (max-width: 980px) {
    .rc-data-layout { grid-template-columns: 1fr; }
}

.rc-data-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Completeness card */
.rc-fill { display: flex; align-items: center; gap: 14px; }
.rc-fill svg { flex: 0 0 auto; display: block; }
.rc-fill__breakdown { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.rc-fill__row { display: grid; grid-template-columns: 56px 1fr 38px; gap: 8px; align-items: center; font-size: 11.5px; }
.rc-fill__lbl { color: var(--text-secondary); }
.rc-fill__track { height: 5px; background: var(--border-color); border-radius: 999px; overflow: hidden; }
.rc-fill__fill { height: 100%; background: linear-gradient(90deg, #16a34a, #4ade80); border-radius: 999px; transition: width .5s ease; }
.rc-fill__fill--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rc-fill__fill--info { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.rc-fill__n { font-weight: 700; color: var(--text-primary); text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }

/* Pickup point block in recipient sidebar */
.rc-pickup { padding: 14px; }
.rc-pickup--accent {
    background: linear-gradient(180deg, rgba(99,102,241,.06), var(--surface-1));
    border-color: rgba(99,102,241,.3);
}
.rc-pickup--mute { background: var(--surface-2); }
.rc-pickup--warn {
    background: rgba(245,158,11,.06);
    border-color: rgba(245,158,11,.3);
}
.rc-pickup__chip {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
    border-radius: 999px;
    background: var(--accent-bg); color: var(--accent);
}
.rc-pickup--mute .rc-pickup__chip { background: var(--border-color); color: var(--text-muted); }
.rc-pickup__name {
    font-size: 14.5px; font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px;
}
.rc-pickup__sub {
    font-size: 12px; color: var(--text-muted);
    margin-top: 2px;
}
.rc-pickup__addr {
    margin-top: 8px;
    display: flex; align-items: flex-start; gap: 6px;
    padding: 8px 10px;
    background: var(--surface-1);
    border-radius: var(--radius-xs);
    font-size: 12px; line-height: 1.45;
    color: var(--text-secondary);
}
.rc-pickup__addr .rc-ic { color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.rc-pickup__desc {
    margin-top: 6px;
    font-size: 11.5px; color: var(--text-muted); font-style: italic;
}
.rc-pickup__actions {
    margin-top: 10px;
    display: flex; gap: 12px;
    font-size: 12px;
}
.rc-pickup__link {
    color: var(--accent);
    text-decoration: none;
}
.rc-pickup__link:hover { text-decoration: underline; }

/* Inline-edit fields inside pickup block */
.rc-pickup .rc-field--compact {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--surface-1);
    border-radius: var(--radius-xs);
}
.rc-pickup .rc-field--compact .rc-field__label {
    font-size: 10.5px; margin-bottom: 2px;
    text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted);
}
.rc-pickup .rc-field__value {
    font-size: 13px; color: var(--text-primary);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rc-pickup .rc-field__value strong {
    font-weight: 600;
}
.rc-pickup__addr-inline {
    width: 100%;
    font-size: 11.5px; color: var(--text-muted);
    margin-top: 2px;
}
.rc-pickup .rc-field--empty-state .rc-field__value--empty {
    font-style: italic;
    color: var(--text-muted);
}

/* Compact metadata */
.rc-meta-mini {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
}
.rc-meta-mini__row {
    display: grid;
    grid-template-columns: 14px auto 1fr;
    gap: 8px; align-items: center;
    font-size: 11.5px;
}
.rc-meta-mini__ic { color: var(--text-muted); display: inline-flex; }
.rc-meta-mini__lbl { color: var(--text-muted); }
.rc-meta-mini__val { color: var(--text-primary); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* Main area: sub-tabs */
.rc-data-main {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.rc-data-tabs {
    display: flex; gap: 0;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-color);
    padding: 0 4px;
    align-items: center;
    flex-wrap: wrap;
}
.rc-data-tab {
    background: transparent;
    border: 0;
    padding: 12px 16px;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.rc-data-tab svg { color: var(--text-muted); }
.rc-data-tab:hover { color: var(--text-primary); }
.rc-data-tab:hover svg { color: var(--accent); }
.rc-data-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--surface-1);
    font-weight: 600;
}
.rc-data-tab.is-active svg { color: var(--accent); }
.rc-data-tab__count {
    font-size: 10.5px;
    padding: 2px 7px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 600;
}
.rc-data-tab.is-active .rc-data-tab__count {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
}
.rc-data-tabs__hint {
    margin-left: auto;
    padding: 0 14px;
    font-size: 11.5px; color: var(--text-muted);
    font-style: italic;
}

.rc-data-form { display: none; padding: 18px 20px; }
.rc-data-form.is-active { display: block; animation: rcFade .2s ease; }
@keyframes rcFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tighter field layout inside data-form */
.rc-data-form .rc-fields--cols2 { gap: 10px 18px; }

/* Subsection inside a single sub-tab (Личные + Паспорт) */
.rc-data-subsection + .rc-data-subsection {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}
.rc-data-subsection__title {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
    margin: 0 0 10px;
}
.rc-data-subsection__ic { color: var(--accent); display: inline-flex; }

/* ============================================================
   TRIPS MODULE
   ============================================================ */

/* List page: filter bar */
.tr-filter {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin: 14px 0;
    padding: 10px 12px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.tr-filter__search {
    position: relative; flex: 1 1 220px; min-width: 200px;
    display: flex; align-items: center;
}
.tr-filter__ic {
    position: absolute; left: 10px; color: var(--text-muted); display: inline-flex;
}
.tr-filter__search input {
    width: 100%; height: 36px; padding: 0 12px 0 32px;
    border: 1px solid var(--border-color); border-radius: var(--radius-xs);
    background: var(--surface-2);
    font-size: 13px;
}
.tr-filter__search input:focus { border-color: var(--accent); outline: none; background: var(--surface-1); }
.tr-filter__sel { height: 36px; max-width: 220px; font-size: 13px; }
.tr-filter__date {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted);
}
.tr-filter__date input { height: 36px; padding: 4px 8px; border: 1px solid var(--border-color); border-radius: var(--radius-xs); font-size: 12.5px; }
.tr-filter__right { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 720px) { .tr-filter__right { margin-left: 0; width: 100%; } }

/* Status filter chips */
.tr-statuschips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tr-statuschips .rc-chip {
    text-decoration: none;
}
.rc-chip--ok.is-active   { background: rgba(22,163,74,.14);  color: #15803d; border-color: rgba(22,163,74,.3); }
.rc-chip--warn.is-active { background: rgba(245,158,11,.14); color: #b45309; border-color: rgba(245,158,11,.3); }
.rc-chip--err.is-active  { background: rgba(239,68,68,.14);  color: #b91c1c; border-color: rgba(239,68,68,.3); }
.rc-chip--info.is-active { background: rgba(14,165,233,.14); color: #0369a1; border-color: rgba(14,165,233,.3); }

/* Trip cards (list) */
.tr-list { display: flex; flex-direction: column; gap: 10px; }
.tr-card {
    display: block;
    text-decoration: none; color: inherit;
    padding: 14px 16px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-xs);
}
.tr-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.tr-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.tr-card__title-wrap { min-width: 0; flex: 1; }
.tr-card__title {
    font-size: 15.5px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-card__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.tr-card__id { color: var(--text-muted); font-family: var(--font-mono); font-size: 11.5px; }
.tr-card__when { display: inline-flex; align-items: center; gap: 4px; }
.tr-card__chev { color: var(--text-muted); flex: 0 0 auto; }

.tr-card__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
@media (max-width: 720px) { .tr-card__row { grid-template-columns: repeat(2, 1fr); } }
.tr-card__cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tr-card__cell-lbl {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); font-weight: 600;
}
.tr-card__cell-val { font-size: 13px; color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-card__pts-pct { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--rc-ok, #16a34a); background: color-mix(in srgb, var(--rc-ok, #16a34a) 12%, transparent); }

.tr-card__bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tr-card__bar-track {
    flex: 1; height: 7px;
    background: var(--border-color);
    border-radius: 999px; overflow: hidden;
    /* Сегменты «доставлено» и «пропущено» лежат встык одной линией. */
    display: flex; align-items: stretch;
}
/* Скругление только у всей дорожки (overflow:hidden обрезает торцы сегментов),
   поэтому у сегментов его нет — иначе на стыке появились бы круглые вырезы. */
.tr-card__bar-fill { height: 100%; transition: width .5s ease; }
.tr-card__bar-fill--ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.tr-card__bar-fill--warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tr-card__bar-fill--err  { background: linear-gradient(90deg, #ef4444, #f87171); }
.tr-card__bar-pct { font-size: 12px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

/* Pager */
.rc-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 22px 0; }
.rc-pager__info { font-size: 12.5px; color: var(--text-muted); }

/* ===== Edit form ===== */
.tr-edit { display: flex; flex-direction: column; gap: 14px; }
.tr-edit__bar { display: flex; align-items: center; gap: 14px; }
.tr-edit__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.tr-form { display: flex; flex-direction: column; gap: 14px; }
.tr-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}
@media (max-width: 900px) { .tr-form__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tr-form__grid { grid-template-columns: 1fr; } }
.tr-form__field { display: flex; flex-direction: column; gap: 4px; }
.tr-form__field--wide { grid-column: 1/-1; }
.tr-form__field label {
    font-size: 11.5px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px;
    display: inline-flex; align-items: center; gap: 4px;
}
.tr-form__field label svg { color: var(--accent); }
.tr-form__req { color: var(--danger, #ef4444); margin-left: 4px; }
.tr-form__field .form-input {
    height: 38px; padding: 6px 10px; font-size: 13.5px;
    border: 1px solid var(--border-color); border-radius: var(--radius-xs);
    background: var(--surface-1);
}
.tr-form__field .form-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.tr-form__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; }

/* ===== Detail view ===== */

/* Hero secondary facts grid */
.tr-facts { display: flex; flex-direction: column; gap: 6px; }
.tr-fact { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--border-color); }
.tr-fact:last-child { border-bottom: 0; }
.tr-fact__lbl { color: var(--text-muted); }
.tr-fact__val { color: var(--text-primary); font-weight: 500; }

/* Points head */
.tr-points-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 14px; flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Фильтр точек по ФИО / статусу */
.tr-points-filter {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    flex: 1 1 320px; max-width: 560px;
}
.tr-points-filter__search { flex: 1 1 220px; min-width: 180px; }
.tr-points-filter__sel { height: 34px; font-size: 12.5px; width: auto; min-width: 130px; }
.tr-points-filter__count {
    font-size: 11.5px; color: var(--text-muted); white-space: nowrap;
}

/* Points list */
.tr-points { display: flex; flex-direction: column; gap: 8px; }
/* Под фильтром порядок на экране неполный — grip не должен обещать перетаскивание */
.tr-points.is-filtered .tr-point__grip { opacity: .3; cursor: default; }
.tr-point {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    gap: 14px; align-items: center;
    padding: 12px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
    cursor: default;
}
.tr-point:hover { border-color: var(--accent); box-shadow: var(--shadow-xs); }
.tr-point.is-dragging { opacity: .5; }
.tr-point.is-drop-target { border-top: 2px dashed var(--accent); }
.tr-point--ok      { border-left-color: #16a34a; }
.tr-point--warn    { border-left-color: #f59e0b; }
.tr-point--err     { border-left-color: #ef4444; }
.tr-point--info    { border-left-color: #0ea5e9; }
.tr-point--neutral { border-left-color: var(--border-color); }

.tr-point__order { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tr-point__grip { cursor: grab; color: var(--text-muted); display: inline-flex; padding: 4px; border-radius: 4px; }
.tr-point__grip:hover { color: var(--accent); background: var(--accent-bg); }
.tr-point__seq {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-bg); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.tr-point--ok .tr-point__seq   { background: rgba(22,163,74,.14);  color: #15803d; }
.tr-point--warn .tr-point__seq { background: rgba(245,158,11,.14); color: #b45309; }
.tr-point--err .tr-point__seq  { background: rgba(239,68,68,.14);  color: #b91c1c; }

.tr-point__main { min-width: 0; }
.tr-point__name {
    display: block; font-weight: 600; font-size: 13.5px;
    color: var(--text-primary); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-point__name:hover { color: var(--accent); }
.tr-point__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.tr-point__chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
}
.tr-point__chip:hover { color: var(--accent); }
.tr-point__chip--high   { background: rgba(245,158,11,.14); color: #b45309; }
.tr-point__chip--urgent { background: rgba(239,68,68,.14);  color: #b91c1c; }
.tr-point__chip--pp {
    background: rgba(99,102,241,.12);
    color: #4338ca;
    font-weight: 600;
    border: 1px dashed rgba(99,102,241,.3);
}
.tr-point__chip--pp svg { color: #4338ca; }

.tr-point__addr {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 4px;
    font-size: 11.5px; color: var(--text-muted);
}
.tr-point__addr--primary {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
}
.tr-point__addr--secondary {
    opacity: 0.7;
    font-size: 11px;
}
.tr-point__addr-tag {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(0,0,0,.05);
    color: var(--text-muted);
    margin-left: 3px;
}

.tr-point__status-wrap { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; min-width: 120px; }
.tr-point__times { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-muted); text-align: right; }
.tr-point__times svg { color: var(--text-muted); }

.tr-point__actions {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 280px;
}
.tr-point__statusel {
    height: 30px; font-size: 12px;
    min-width: 130px; max-width: 160px;
    padding: 0 24px 0 10px;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .tr-point { grid-template-columns: 48px 1fr; row-gap: 10px; }
    .tr-point__status-wrap { grid-column: 1/-1; justify-content: flex-start; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .tr-point__actions {
        grid-column: 1/-1;
        justify-content: flex-start;
        max-width: 100%;
    }
    .tr-point__times { flex-direction: row; gap: 8px; }
}
@media (max-width: 820px) {
    .tr-point { grid-template-columns: 36px 1fr; }
}

/* GPS tracks */
.tr-tracks {
    max-height: 480px; overflow: auto;
    display: flex; flex-direction: column; gap: 4px;
}
.tr-track {
    display: grid;
    grid-template-columns: 130px 1fr auto auto;
    gap: 10px; align-items: center;
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    font-size: 12px;
}
.tr-track__time  { color: var(--text-secondary); }
.tr-track__coord { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-track__speed { color: var(--accent); font-weight: 500; }
.tr-track__acc   { color: var(--text-muted); font-size: 11px; }

/* Add-recipient modal — delivery type override */
.tr-add-options {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
}
.tr-add-options__lbl {
    font-size: 12.5px; color: var(--text-secondary); font-weight: 500;
}
.tr-add-options .form-input { height: 32px; font-size: 12.5px; }

/* Inline delivery_type select in points list (legacy, can be removed later) */
.tr-point__delivsel {
    height: 30px; font-size: 12px;
    min-width: 120px; max-width: 140px;
    padding: 0 24px 0 10px;
}
.tr-point__ppsel {
    height: 30px; font-size: 12px;
    min-width: 150px; max-width: 200px;
    padding: 0 24px 0 10px;
    border-color: rgba(124,58,237,.35) !important;
    color: #6d28d9;
}
.tr-point__ppsel[data-pp-optional="1"] { opacity: .65; }
.tr-point__ppsel:hover { opacity: 1; }

/* ========================================================================
   NEW: Compact point control panel (status + delivery toggle + pickup pop)
   ======================================================================== */
.tr-point__ctl {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-width: 220px;
    max-width: 240px;
    position: relative;
}

/* ---- generic control wrapper (popover host) ---- */
.tr-ctl { position: relative; }
.tr-ctl__trigger {
    display: inline-flex; align-items: center; gap: 6px;
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text, #0f172a);
    cursor: pointer;
    transition: all .15s ease;
    text-align: left;
}
.tr-ctl__trigger:hover { background: #f8fafc; border-color: #cbd5e1; }
.tr-ctl__trigger svg { flex-shrink: 0; opacity: .65; }
.tr-ctl__trigger:hover svg { opacity: 1; }
.tr-ctl__lbl {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tr-ctl__lbl--ellipsis { max-width: 140px; }

/* status trigger — color encoded by tone */
.tr-ctl__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(148,163,184,.18);
}
.tr-ctl__trigger--status { font-weight: 600; }
.tr-ctl__trigger--neutral .tr-ctl__dot { background: #94a3b8; box-shadow: 0 0 0 2px rgba(148,163,184,.18); }
.tr-ctl__trigger--info    .tr-ctl__dot { background: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,.20); }
.tr-ctl__trigger--ok      .tr-ctl__dot { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.22); }
.tr-ctl__trigger--err     .tr-ctl__dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.22); }
.tr-ctl__trigger--warn    .tr-ctl__dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.22); }

.tr-ctl__trigger--neutral { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.tr-ctl__trigger--info    { background: #eff6ff; border-color: #bfdbfe; color: #0369a1; }
.tr-ctl__trigger--ok      { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.tr-ctl__trigger--err     { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.tr-ctl__trigger--warn    { background: #fffbeb; border-color: #fde68a; color: #b45309; }

/* pickup trigger — purple accent */
.tr-ctl__trigger--pp {
    background: #faf5ff;
    border-color: rgba(124,58,237,.30);
    color: #6d28d9;
}
.tr-ctl__trigger--pp:hover { background: #f3e8ff; border-color: rgba(124,58,237,.50); }
.tr-ctl--pp.is-muted .tr-ctl__trigger {
    background: #fafafa;
    border-color: #e2e8f0;
    color: #94a3b8;
    border-style: dashed;
}
.tr-ctl--pp.is-muted .tr-ctl__trigger:hover {
    background: #faf5ff; color: #6d28d9; border-color: rgba(124,58,237,.30); border-style: solid;
}

/* ---- popover ---- */
.tr-ctl__pop {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 28px -8px rgba(15,23,42,.22), 0 4px 10px -4px rgba(15,23,42,.12);
    padding: 6px;
    z-index: 50;
    display: none;
    animation: trCtlFade .12s ease;
}
.tr-ctl__pop--wide { min-width: 280px; max-width: 360px; }
.tr-ctl.is-open .tr-ctl__pop { display: block; }
@keyframes trCtlFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tr-ctl__search {
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: 12.5px;
    margin-bottom: 4px;
    background: #f8fafc;
}
.tr-ctl__search:focus { outline: none; border-color: #a78bfa; background: #fff; }

.tr-ctl__opts {
    max-height: 280px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 1px;
}

.tr-ctl__opt {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 12.5px;
    text-align: left;
    color: var(--text, #0f172a);
    cursor: pointer;
    transition: background .12s ease;
    line-height: 1.3;
}
.tr-ctl__opt:hover { background: #f1f5f9; }
.tr-ctl__opt.is-active { background: #eef2ff; color: #4338ca; font-weight: 600; }
.tr-ctl__opt.is-active::after {
    content: '✓';
    margin-left: auto;
    color: #6366f1;
    font-weight: 700;
}
.tr-ctl__opt-mute { color: #94a3b8; font-style: italic; }

.tr-ctl__opt--pp {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.tr-ctl__opt--pp.is-active { background: #faf5ff; color: #6d28d9; }
.tr-ctl__opt--pp.is-active::after { color: #7c3aed; }
.tr-ctl__opt-name { font-weight: 600; }
.tr-ctl__opt-sub  { font-size: 11px; color: #64748b; font-weight: 400; }

/* tone-coloured dots for status options */
.tr-ctl__opt--neutral .tr-ctl__dot { background: #94a3b8; box-shadow: 0 0 0 2px rgba(148,163,184,.18); }
.tr-ctl__opt--info    .tr-ctl__dot { background: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,.20); }
.tr-ctl__opt--ok      .tr-ctl__dot { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.22); }
.tr-ctl__opt--err     .tr-ctl__dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.22); }
.tr-ctl__opt--warn    .tr-ctl__dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.22); }

/* ---- segmented toggle: delivery type ---- */
.tr-seg {
    display: inline-flex;
    width: 100%;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.tr-seg__btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px;
    height: 26px;
    padding: 0 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.tr-seg__btn:hover { color: #0f172a; background: rgba(255,255,255,.6); }
.tr-seg__btn svg { opacity: .7; }
.tr-seg__btn.is-on {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15,23,42,.10), 0 0 0 1px rgba(15,23,42,.04);
}
.tr-seg__btn.is-on svg { opacity: 1; }
.tr-seg__btn--car.is-on {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 2px 6px -1px rgba(99,102,241,.45);
}
.tr-seg__btn--car.is-on svg { opacity: 1; color: #fff; }

/* ---- delete button ---- */
.tr-ctl__del {
    align-self: flex-end;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all .15s ease;
    margin-top: 2px;
}
.tr-ctl__del:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* compact width on small screens */
@media (max-width: 720px) {
    .tr-point__ctl { min-width: 100%; max-width: 100%; }
    .tr-ctl__pop, .tr-ctl__pop--wide { left: 0; right: 0; min-width: 0; }
}
.tr-point__chip--accent {
    background: rgba(99,102,241,.14) !important;
    color: var(--accent) !important;
}

/* Pickup point note */
.rc-pickup__note {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(99,102,241,.06);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 11.5px;
    display: flex; align-items: center; gap: 6px;
}
.rc-pickup__note svg { color: var(--accent); flex-shrink: 0; }

/* Add-recipient modal results */
.tr-recip-results {
    max-height: 380px; overflow: auto;
    display: flex; flex-direction: column; gap: 6px;
    padding: 4px;
}
.tr-recip {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px; align-items: flex-start;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition-fast);
}
.tr-recip:hover { border-color: var(--accent); background: var(--accent-bg); }
.tr-recip input { margin-top: 2px; accent-color: var(--accent); }
.tr-recip__name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.tr-recip__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tr-recip__chip {
    display: inline-block;
    font-size: 11px; padding: 2px 7px;
    background: var(--surface-1); border-radius: 999px;
    color: var(--text-secondary);
}
.tr-recip__addr { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ===== Добавить рядом: подбор с ценой заезда ===== */
.tr-nearby__panel { max-width: 860px; width: 100%; }
.tr-nearby__lead {
    font-size: 12.5px; color: var(--text-muted);
    margin: 0 0 14px; line-height: 1.5;
}
/* Два фильтра: «сколько» — узкое числовое поле, статус забирает остаток.
   auto-fit растягивал бы поле счётчика на пол-окна. */
.tr-nearby__filters {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px 16px;
    margin-bottom: 12px;
    align-items: start;
}
@media (max-width: 560px) {
    .tr-nearby__filters { grid-template-columns: 1fr; }
}
.tr-nearby__filters select[multiple] { padding: 4px; height: auto; }
.tr-nearby__optsearch { height: 28px; font-size: 12px; margin-bottom: 4px; }
.tr-nearby__bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}
.tr-nearby__all {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.tr-nearby__all input { accent-color: var(--accent); }
.tr-nearby__hint { font-size: 11.5px; color: var(--text-muted); }
.tr-nearby__results {
    max-height: 360px; overflow: auto;
    display: flex; flex-direction: column; gap: 6px;
    padding: 4px;
}
/* Третья колонка — цена заезда; из-за неё карточка кандидата шире обычной */
.tr-nearby__item { grid-template-columns: 22px 1fr auto; align-items: center; }
.tr-nearby__cost {
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
    text-align: right; white-space: nowrap;
}
.tr-nearby__detour {
    font-weight: 700; font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}
.tr-nearby__detour--ok   { color: #16a34a; }
.tr-nearby__detour--warn { color: #d97706; }
.tr-nearby__detour--err  { color: #dc2626; }
.tr-nearby__near { font-size: 11px; color: var(--text-muted); }
.tr-nearby__pos  { font-size: 11px; color: var(--text-secondary); }

@media (max-width: 640px) {
    .tr-nearby__item { grid-template-columns: 22px 1fr; }
    .tr-nearby__cost {
        grid-column: 2; flex-direction: row; align-items: center;
        justify-content: flex-start; gap: 8px; margin-top: 4px;
    }
}

/* Sticky actions strip */
.rc-tabsbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 14px 0;
}
.rc-tabsbar .rc-tabs { flex: 1; }
.rc-actions-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Couriers list (detail page) */
.tr-couriers-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tr-courier-card {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.tr-courier-card--primary {
    background: linear-gradient(180deg, rgba(99,102,241,.06), var(--surface-1));
    border-color: rgba(99,102,241,.3);
}
.tr-courier-card__avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
}
.tr-courier-card--primary .tr-courier-card__avatar {
    background: linear-gradient(135deg, var(--accent), #8b8df0);
    color: #fff;
}
.tr-courier-card__body { min-width: 0; }
.tr-courier-card__name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tr-courier-card__badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 7px;
    background: rgba(245,158,11,.18); color: #b45309;
    border-radius: 999px;
}
.tr-courier-card__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tr-courier-card__chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
}
.tr-courier-card__chip:hover { color: var(--accent); }

/* Couriers picker in edit form */
.tr-couriers-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    max-height: 380px; overflow: auto;
    padding: 4px;
}
.tr-courier-row {
    display: grid;
    grid-template-columns: 20px 1fr 20px;
    gap: 10px; align-items: center;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition-fast);
}
.tr-courier-row:hover { border-color: var(--accent); background: var(--accent-bg); }
.tr-courier-row input[type="checkbox"] { accent-color: var(--accent); }
.tr-courier-row input[type="radio"] { accent-color: #f59e0b; }
.tr-courier-row__body { min-width: 0; }
.tr-courier-row__name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.tr-courier-row__meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Single courier card (one courier per trip) */
.tr-courier-single {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
}
.tr-courier-single__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tr-courier-single__avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b8df0);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(99,102,241,.25);
}
.tr-courier-single__main { flex: 1; min-width: 200px; }
.tr-courier-single__name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.tr-courier-single__role { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.tr-courier-single__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.tr-courier-single__cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tr-courier-single__lbl {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10.5px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px;
}
.tr-courier-single__val {
    font-size: 13.5px; color: var(--text-primary); font-weight: 500;
    text-decoration: none;
}
.tr-courier-single__val:hover { color: var(--accent); }

/* Hero Yandex map placeholder */
.tr-hero-map {
    width: 100%; height: 280px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    overflow: hidden;
    position: relative;
}
.tr-hero-map__loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 12.5px;
}

/* Recipient card → Trips tab */
.tr-rec-trips { display: flex; flex-direction: column; gap: 10px; }
.tr-rec-trip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px; align-items: center;
    padding: 12px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition-fast);
}
.tr-rec-trip:hover { border-color: var(--accent); box-shadow: var(--shadow-xs); }
.tr-rec-trip__seq {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-bg); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.tr-rec-trip__main { min-width: 0; }
.tr-rec-trip__num {
    font-family: var(--font-mono); font-weight: 600; font-size: 13.5px;
    color: var(--text-primary);
}
.tr-rec-trip__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.tr-rec-trip__chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px;
    background: var(--surface-2);
    border-radius: 999px;
}
.tr-rec-trip__right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Bulk action bar (trips list) */
.tr-bulkbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 14px; margin: 0 0 14px;
    background: linear-gradient(180deg, rgba(99,102,241,.08), var(--surface-1));
    border: 1px solid rgba(99,102,241,.3);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(99,102,241,.12);
    position: sticky; top: 0; z-index: 5;
}
.tr-bulkbar[hidden] { display: none; }
.tr-bulkbar__left { display: flex; align-items: center; gap: 10px; }
.tr-bulkbar__chk {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-primary);
}
.tr-bulkbar__chk input { accent-color: var(--accent); }
.tr-bulkbar__chk strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.tr-bulkbar__actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tr-bulkbar__close {
    background: transparent; border: 0; cursor: pointer;
    width: 28px; height: 28px;
    font-size: 22px; line-height: 1;
    color: var(--text-muted); border-radius: 50%;
}
.tr-bulkbar__close:hover { background: var(--surface-2); color: var(--text-primary); }

/* Дропдаун «Статус точек» в панели списка рейсов.
   Панель sticky СВЕРХУ (в отличие от плавающей .tr-pointsbar внизу карточки),
   поэтому поп-ап раскрывается ВНИЗ. */
.tr-bulkbar__pop-wrap { position: relative; display: inline-flex; }
.tr-bulkbar__pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 200px;
    display: flex; flex-direction: column; gap: 2px;
    padding: 6px;
    background: var(--surface-1, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 16px 32px -12px rgba(15,23,42,.28), 0 4px 10px -4px rgba(15,23,42,.16);
}
.tr-bulkbar__pop[hidden] { display: none; }
.tr-bulkbar__pop-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 0; background: transparent;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary, #0f172a);
    text-align: left; cursor: pointer;
    transition: background .12s ease;
}
.tr-bulkbar__pop-opt:hover { background: var(--surface-2, #f1f5f9); }
/* Цвет точки задают .tr-ctl__opt--ok/--err/--neutral — здесь только форма */
.tr-bulkbar__pop-opt .tr-ctl__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Card with checkbox */
.tr-card {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px; align-items: stretch;
}
.tr-card__chk {
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 4px;
    cursor: pointer;
}
.tr-card__chk input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.tr-card__body { cursor: pointer; min-width: 0; }
.tr-card.is-selected {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(99,102,241,.04), var(--surface-1));
}

@media (max-width: 720px) {
    .rc-data-tabs__hint { display: none; }
    .rc-data-tab { padding: 10px 12px; font-size: 12.5px; }
    .rc-data-form { padding: 14px; }
}

/* ============================================================
   API DOCS — современная документация
   ============================================================ */
.apidocs { display: block; }

/* Hero */
.apidocs-hero {
    background: linear-gradient(135deg, #1e293b, #312e81);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    margin-bottom: 18px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 24px; flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.apidocs-hero__main { flex: 1; min-width: 280px; }
.apidocs-hero__title {
    margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.4px;
    display: flex; align-items: center; gap: 12px;
}
.apidocs-hero__ic {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255,255,255,.15);
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.apidocs-hero__sub { margin: 10px 0 0; opacity: .85; font-size: 14px; line-height: 1.5; max-width: 600px; }
.apidocs-hero__sub strong { color: #fff; }
.apidocs-hero__meta { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.apidocs-hero__metaitem {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px;
    background: rgba(255,255,255,.08);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}
.apidocs-hero__metalbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; opacity: .65; }
.apidocs-hero__metaval { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }

/* Layout: sidebar + main */
.apidocs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1100px) {
    .apidocs-layout { grid-template-columns: 1fr; }
    .apidocs-side { position: static; max-height: none; }
}

/* Sidebar */
.apidocs-side {
    position: sticky; top: 14px;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    box-shadow: var(--shadow-xs);
}
.apidocs-side__search {
    position: relative;
    display: flex; align-items: center;
    margin-bottom: 12px;
}
.apidocs-side__searchic { position: absolute; left: 10px; color: var(--text-muted); display: inline-flex; }
.apidocs-side__search input {
    width: 100%;
    height: 34px;
    padding: 0 10px 0 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    font-size: 12.5px;
}
.apidocs-side__search input:focus { border-color: var(--accent); outline: none; background: var(--surface-1); }

.apidocs-nav { display: flex; flex-direction: column; gap: 4px; }
.apidocs-nav__group { display: flex; flex-direction: column; }
.apidocs-nav__head {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 8px; align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
    transition: var(--transition-fast);
}
.apidocs-nav__head:hover { background: var(--surface-2); }
.apidocs-nav__head-ic { color: var(--g-color, var(--accent)); display: inline-flex; }
.apidocs-nav__head-count {
    font-size: 10px; padding: 2px 7px;
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-mono);
}
.apidocs-nav__items { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 8px 4px; }
.apidocs-nav__item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 6px; align-items: center;
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11.5px;
    transition: var(--transition-fast);
    min-width: 0;
}
.apidocs-nav__item:hover { background: var(--accent-bg); color: var(--accent); }
.apidocs-nav__item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Method badges */
.apidocs-method {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10.5px; font-weight: 700;
    letter-spacing: .4px;
    min-width: 56px;
    font-family: var(--font-mono);
}
.apidocs-method--sm { padding: 2px 4px; font-size: 9px; min-width: 36px; }
.apidocs-method--get    { background: rgba(22,163,74,.14);  color: #15803d; }
.apidocs-method--post   { background: rgba(14,165,233,.14); color: #0369a1; }
.apidocs-method--put    { background: rgba(245,158,11,.14); color: #b45309; }
.apidocs-method--delete { background: rgba(239,68,68,.14);  color: #b91c1c; }
.apidocs-method--info   { background: rgba(100,116,139,.14); color: #475569; }

/* Main area */
.apidocs-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Quickstart card */
.apidocs-quickstart p { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; }
.apidocs-quickstart p code { padding: 2px 6px; background: var(--surface-2); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; }
.apidocs-quickstart p a { color: var(--accent); text-decoration: none; }
.apidocs-quickstart p a:hover { text-decoration: underline; }
.apidocs-quickstart__code pre {
    margin: 0 0 12px;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 12px; line-height: 1.6;
    overflow-x: auto;
}
.apidocs-quickstart__keytest {
    display: flex; gap: 8px; align-items: center;
}
.apidocs-quickstart__keytest input { flex: 1; height: 36px; }

/* Group section */
.apidocs-group {
    display: flex; flex-direction: column; gap: 8px;
    scroll-margin-top: 14px;
}
.apidocs-group__head {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 0 6px;
    margin-top: 14px;
    border-bottom: 2px solid var(--g-color, var(--accent));
}
.apidocs-group__head-ic {
    width: 36px; height: 36px;
    border-radius: var(--radius-xs);
    display: inline-flex; align-items: center; justify-content: center;
}
.apidocs-group__title {
    margin: 0; font-size: 18px; font-weight: 700;
    color: var(--text-primary);
}
.apidocs-group__cnt { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Endpoint card */
.apidocs-ep {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
    scroll-margin-top: 14px;
}
.apidocs-ep:hover { border-color: var(--g-color, var(--accent)); box-shadow: var(--shadow-xs); }
.apidocs-ep__head {
    width: 100%;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 14px; align-items: center;
    padding: 14px 18px;
    background: transparent;
    border: 0; cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}
.apidocs-ep__head:hover { background: var(--surface-2); }
.apidocs-ep__path {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis;
}
.apidocs-ep__title { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apidocs-ep__chev { color: var(--text-muted); transition: transform .2s; }
.apidocs-ep.is-open .apidocs-ep__chev { transform: rotate(180deg); }
/* Метки контура/аутентификации (внутренняя документация) */
.apidocs-authbadge { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: #fff; background: var(--ab, #64748b); white-space: nowrap; }
.apidocs-contbadge { flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; color: var(--text-secondary); background: var(--gray-100); border: 1px solid var(--border-color); white-space: nowrap; }

.apidocs-ep__body {
    display: none;
    padding: 4px 22px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-2);
}
.apidocs-ep.is-open .apidocs-ep__body { display: block; }
.apidocs-ep__desc { font-size: 13px; color: var(--text-secondary); margin: 14px 0; line-height: 1.55; }
.apidocs-ep__desc code, .apidocs-cell-desc code {
    padding: 1px 6px; background: var(--surface-1);
    border-radius: 4px; font-family: var(--font-mono); font-size: 11.5px;
    color: var(--accent);
}
.apidocs-ep__desc strong { color: var(--text-primary); }
.apidocs-ep__subtitle {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 18px 0 10px;
    font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-muted);
}
.apidocs-ep__subtitle svg { color: var(--accent); }

/* Tables */
.apidocs-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-xs); background: var(--surface-1); }
.apidocs-table {
    width: 100%; border-collapse: collapse;
    font-size: 12.5px;
}
.apidocs-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--surface-2);
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.apidocs-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.apidocs-table tr:last-child td { border-bottom: 0; }
.apidocs-cell-desc { color: var(--text-secondary); line-height: 1.5; }

.apidocs-param-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}
.apidocs-type {
    font-size: 11px;
    padding: 2px 7px;
    background: var(--surface-2);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}
.apidocs-req {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.apidocs-req--yes  { background: rgba(239,68,68,.14);  color: #b91c1c; }
.apidocs-req--cond { background: rgba(245,158,11,.14); color: #b45309; }
.apidocs-req--no   { background: rgba(100,116,139,.14); color: #475569; }

.apidocs-errcode {
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(239,68,68,.14);
    color: #b91c1c;
    border-radius: 4px;
    font-size: 11.5px;
}

/* Code blocks */
.apidocs-code {
    margin: 10px 0;
    background: #0f172a;
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.apidocs-code__head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}
.apidocs-code__title {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}
.apidocs-copy {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.apidocs-copy:hover { background: #334155; color: #fff; }
.apidocs-copy.is-copied { background: rgba(22,163,74,.3); color: #4ade80; border-color: #16a34a; }
.apidocs-code pre {
    margin: 0;
    padding: 14px 16px;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 12px; line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}
.apidocs-code--response pre { color: #a7f3d0; }

/* Empty state */
.apidocs-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.apidocs-empty__ic {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.apidocs-empty__title {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 4px;
}

/* hidden by search */
.apidocs-ep.is-hidden { display: none; }
.apidocs-group.is-hidden { display: none; }
.apidocs-nav__item.is-hidden { display: none; }
.apidocs-nav__group.is-hidden { display: none; }

/* ========================================================================
   Trip points: bulk selection + floating action bar
   ======================================================================== */
.tr-bulk-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12.5px; font-weight: 500; color: #475569;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.tr-bulk-toggle:hover { background: #eef2ff; border-color: #a5b4fc; color: #4338ca; }
.tr-bulk-toggle input { margin: 0; cursor: pointer; accent-color: #6366f1; }

.tr-point__select {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    cursor: pointer;
}
.tr-point__cb {
    width: 16px; height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #6366f1;
}
.tr-point { position: relative; }
.tr-point.is-selected {
    background: linear-gradient(180deg, #eef2ff 0%, #fff 50%) !important;
    border-color: #a5b4fc !important;
    box-shadow: 0 0 0 1px #6366f1 inset !important;
}
.tr-point.is-selected::before {
    content: '';
    position: absolute;
    left: -1px; top: -1px; bottom: -1px;
    width: 3px;
    background: #6366f1;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    pointer-events: none;
}

/* Floating bulk action bar (trip points) — renamed to tr-pointsbar to avoid
   conflict with .tr-bulkbar (trips list bulk panel above) */
.tr-pointsbar {
    position: fixed;
    left: 50%; bottom: 24px;
    transform: translate(-50%, 140%);
    z-index: 200;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
    margin: 0;
    width: max-content;
    max-width: calc(100vw - 32px);
}
.tr-pointsbar.is-show {
    transform: translate(-50%, 0);
    pointer-events: auto;
}
/* Исключение из глобального [hidden]{display:none!important} ниже:
   видимостью панели управляет класс .is-show, иначе ломается анимация
   выезда — элемент должен оставаться в потоке и при hidden. */
.tr-pointsbar[hidden] { display: block !important; }
.tr-pointsbar__inner {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 10px 8px 16px;
    background: #0f172a;
    color: #f1f5f9;
    border-radius: 14px;
    box-shadow:
        0 20px 40px -10px rgba(15,23,42,.45),
        0 8px 20px -6px rgba(15,23,42,.35),
        inset 0 1px 0 rgba(255,255,255,.08);
}
.tr-pointsbar__count {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px;
    white-space: nowrap;
}
.tr-pointsbar__badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px;
    padding: 0 8px;
    background: #6366f1;
    border-radius: 8px;
    font-weight: 700; font-size: 13px;
    box-shadow: 0 2px 6px rgba(99,102,241,.45);
}
.tr-pointsbar__lbl { color: #cbd5e1; font-weight: 500; }
.tr-pointsbar__actions {
    display: flex; gap: 4px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.10);
}
.tr-pointsbar__btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #f1f5f9;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
    white-space: nowrap;
}
.tr-pointsbar__btn:hover { background: rgba(255,255,255,.14); }
.tr-pointsbar__btn:disabled { opacity: .5; cursor: not-allowed; }
.tr-pointsbar__btn svg { opacity: .8; }
.tr-pointsbar__btn--accent { background: #6366f1; }
.tr-pointsbar__btn--accent:hover { background: #4f46e5; }
.tr-pointsbar__btn--pp { background: rgba(167,139,250,.16); color: #ddd6fe; }
.tr-pointsbar__btn--pp:hover { background: rgba(167,139,250,.28); }
.tr-pointsbar__btn--danger { background: rgba(239,68,68,.16); color: #fecaca; }
.tr-pointsbar__btn--danger:hover { background: rgba(239,68,68,.28); color: #fff; }

.tr-pointsbar__close {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all .12s ease;
    margin-left: 2px;
}
.tr-pointsbar__close:hover { background: rgba(255,255,255,.08); color: #fff; }

.tr-pointsbar__pp { position: relative; }
.tr-pointsbar__pp-pop {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px; max-width: 360px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    box-shadow:
        0 20px 40px -10px rgba(15,23,42,.30),
        0 6px 14px -4px rgba(15,23,42,.20);
}
.tr-pointsbar__pp-search {
    width: 100%; height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
    margin-bottom: 6px;
}
.tr-pointsbar__pp-search:focus { outline: none; border-color: #a78bfa; background: #fff; }
.tr-pointsbar__pp-opts {
    max-height: 320px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px;
}
.tr-pointsbar__pp-opt {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
    line-height: 1.3;
    transition: background .12s ease;
}
.tr-pointsbar__pp-opt:hover { background: #faf5ff; color: #6d28d9; }
.tr-pointsbar__pp-opt--mute { color: #94a3b8; font-style: italic; }
.tr-pointsbar__pp-name { font-weight: 600; font-size: 13px; }
.tr-pointsbar__pp-sub  { font-size: 11.5px; color: #64748b; font-weight: 400; }

/* Массовая смена статуса точек */
.tr-pointsbar__btn--status { background: rgba(56,189,248,.16); color: #bae6fd; }
.tr-pointsbar__btn--status:hover { background: rgba(56,189,248,.30); }
.tr-pointsbar__st-pop { min-width: 200px; max-width: 240px; }
.tr-pointsbar__st-opt {
    flex-direction: row; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
}
.tr-pointsbar__st-opt:hover { background: #f1f5f9; color: #0f172a; }
/* Цвет точки задают .tr-ctl__opt--ok/--err/--neutral выше — здесь только форма */
.tr-pointsbar__st-opt .tr-ctl__dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
}

@media (max-width: 760px) {
    .tr-pointsbar { left: 8px; right: 8px; transform: translateY(140%); width: auto; }
    .tr-pointsbar.is-show { transform: translateY(0); }
    .tr-pointsbar__inner { flex-wrap: wrap; }
    .tr-pointsbar__actions { padding-left: 0; border-left: none; flex-wrap: wrap; }
}

/* ========================================================================
   Trip page: detailed planned distance card (4 segments + actual)
   ======================================================================== */
.tr-dist {
    display: flex; flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.tr-dist__row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 12px;
    transition: background .15s ease;
}
.tr-dist__row:hover { background: rgba(99,102,241,.06); }
.tr-dist__ic {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.tr-dist__ic--start { background: #ecfdf5; color: #047857; }
.tr-dist__ic--mid   { background: #eff6ff; color: #1d4ed8; }
.tr-dist__ic--end   { background: #fef3c7; color: #b45309; }
.tr-dist__ic--total { background: #eef2ff; color: #4338ca; }
.tr-dist__lbl {
    color: #475569; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-dist__val {
    font-size: 13px; font-weight: 600; color: #0f172a;
    white-space: nowrap;
}
.tr-dist__val small { color: #94a3b8; font-weight: 500; font-size: 10.5px; margin-left: 2px; }

.tr-dist__row--total {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
    font-weight: 700;
}
.tr-dist__row--total .tr-dist__lbl { color: #0f172a; font-weight: 700; }
.tr-dist__row--total .tr-dist__val { color: #4338ca; font-size: 14.5px; }

.tr-dist__sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
.tr-dist__sub-cell {
    display: flex; flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.tr-dist__sub-lbl {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
    color: #94a3b8; font-weight: 600;
}
.tr-dist__sub-val {
    font-size: 14px; font-weight: 600; color: #0f172a;
}
.tr-dist__sub-val small { color: #94a3b8; font-weight: 500; font-size: 10.5px; margin-left: 2px; }

.tr-dist__sub-time {
    font-style: normal;
    font-size: 10.5px;
    color: #94a3b8;
    margin-left: 6px;
    font-weight: 500;
}

.tr-dist__ic--time { background: #fef3c7; color: #b45309; }
.tr-dist__row--time {
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
}
.tr-dist__row--time .tr-dist__lbl { color: #0f172a; font-weight: 700; }
.tr-dist__row--time .tr-dist__val { color: #b45309; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tr-dist__row--time .tr-dist__sub-time {
    display: block;
    margin-top: 2px;
    margin-left: 0;
    line-height: 1.35;
}

/* Часть точек не вошла в расчёт — итог неполный, и это должно быть видно */
.tr-dist__warn {
    padding-top: 6px;
    border-top: 1px dashed #fca5a5;
}
.tr-dist__warn .tr-dist__ic { background: #fee2e2; color: #b91c1c; }
.tr-dist__warn .tr-dist__lbl { color: #b91c1c; font-weight: 700; }
.tr-dist__warn .tr-dist__sub-time {
    display: block;
    margin-top: 2px;
    margin-left: 0;
    color: #dc2626;
    line-height: 1.35;
}

/* ============================================================
   АДАПТИВ-ФИКСЫ @360-768 (аудит 2026-07-06): убрать горизонт. overflow
   ============================================================ */
@media (max-width: 768px) {
    /* 1. Таблицы в скролл-обёртке не должны распирать body */
    .table-container { max-width: 100%; overflow-x: auto; }
    /* 2. Вкладки карточки: контейнер и flex-родители держат min-width:0 */
    .rc-tabs { min-width: 0; max-width: 100%; }
    .rc-strip, .rc, .rc-panels { min-width: 0; }
    /* 3. Код-блоки API-доков переносятся/скроллятся, не распирают */
    .apidocs-code, .apidocs-quickstart__code { min-width: 0; max-width: 100%; }
    .apidocs-code pre, .apidocs-quickstart__code pre { white-space: pre-wrap; word-break: break-word; max-width: 100%; }
    .apidocs-layout, .apidocs-hero { min-width: 0; }
    .apidocs-hero__main, .apidocs-hero__meta { min-width: 0; }
    /* 4. Страховка: .data-table не распирает узкий экран */
    .content-area .data-table { max-width: 100%; }
}

/* ============================================================
   Зоны доставки (/v2/zones)
   ============================================================ */

.zn-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: stretch;
    min-height: 640px;
}

.zn-side {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.zn-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.zn-count {
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
}

.zn-list { overflow-y: auto; flex: 1; padding: 8px; }

.zn-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: background .15s, border-color .15s;
}
.zn-item:hover { background: var(--bg-secondary); }
.zn-item.is-active { background: var(--primary-bg); border-color: var(--primary-light); }

.zn-item__dot {
    width: 12px; height: 12px;
    border-radius: 4px;
    margin-top: 3px;
    flex: 0 0 auto;
}

.zn-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zn-item__name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.zn-item__meta { font-size: 11px; color: var(--text-muted); }
.zn-off { color: var(--warning); }

.zn-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- карта --- */

.zn-map-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    min-height: 640px;
}

.zn-map { width: 100%; height: 100%; min-height: 640px; background: var(--bg-secondary); }

.zn-hint {
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--text-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
}

/* Автозона: подсказка синяя, чтобы режим выбора центра не путался
   с режимом ручного обвода — действия разные, а место на экране одно */
.zn-hint--auto { background: #1d4ed8; }

/* Панель автозоны — слева, чтобы не перекрывать панель сохранения справа */
.zn-auto-panel {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 11;
    width: 300px;
    background: var(--surface, #fff);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.zn-auto-panel__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 14px;
}
.zn-auto-panel__body { padding: 12px 14px; }
.zn-auto-panel__foot { padding: 0 14px 14px; }
.zn-auto-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zn-auto-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border: 1px solid var(--border, #e5e7eb);
    border-radius: 9px; font-size: 12.5px;
}
.zn-auto-wait { font-size: 12.5px; color: var(--text-secondary, #6b7280); }

.zn-hint__cancel {
    background: rgba(255,255,255,.18);
    border: 0;
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
}
.zn-hint__cancel:hover { background: rgba(255,255,255,.3); }

/* --- панель редактирования --- */

.zn-panel {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 12;
    width: 320px;
    max-height: calc(100% - 24px);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}

.zn-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.zn-panel__close {
    background: none; border: 0;
    font-size: 22px; line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}
.zn-panel__close:hover { color: var(--text-primary); }

.zn-panel__body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.zn-panel__foot {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.zn-field { display: flex; flex-direction: column; gap: 5px; }
.zn-field > span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.zn-field--color { flex: 0 0 64px; }
.zn-field--color input[type=color] {
    width: 100%; height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    cursor: pointer;
}

.zn-row { display: flex; gap: 10px; align-items: flex-end; }
.zn-help { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.zn-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

.zn-stat {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.zn-err {
    padding: 10px 12px;
    background: var(--danger-bg, #fef2f2);
    border: 1px solid var(--danger-border, #fecaca);
    color: var(--danger, #dc2626);
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.5;
}

.zn-danger { color: var(--danger, #dc2626); margin-left: auto; }
.zn-danger:hover { background: var(--danger-bg, #fef2f2); }

@media (max-width: 900px) {
    .zn-layout { grid-template-columns: 1fr; }
    .zn-side { max-height: 240px; }
    .zn-panel { position: static; width: auto; max-height: none; margin-top: 12px; box-shadow: var(--shadow-sm); }
    .zn-map-wrap, .zn-map { min-height: 420px; }
}

/* Атрибут hidden обязан побеждать любой display.
   По умолчанию `hidden` задаёт лишь `display:block`, и любое
   правило вида `.foo { display:flex }` его перебивает — скрытый
   элемент остаётся видимым, а если он ещё и position:fixed, то
   перехватывает клики по всей странице. Ловилось дважды: панель
   зон показывалась при загрузке, модалка истории блокировала форму.
   Правило общее, чтобы новые компоненты не повторяли ошибку. */
[hidden] { display: none !important; }

    margin-top:1px; white-space:nowrap; cursor:help }

/* ─────────────────────────────────────────────────────────────────────────
   Подсветка логов обмена с 1С (.log-view)
   Используется модалками «Отправка в 1С» и «Обмены с 1С».
   Логика подсветки — assets/js/log-highlight.js.

   Палитра тёмная (One Dark): простыня JSON на белом читается хуже, глазу
   нужен контраст токенов, а не фона. Модалка — единственное тёмное место
   в панели, и это помогает: видно, что смотришь сырые данные.
   ───────────────────────────────────────────────────────────────────────── */
.log-view {
    overflow: auto;
    padding: 16px;
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    background: #282c34;
    color: #abb2bf;
    font-family: 'Cascadia Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;
    tab-size: 2;
}
/* Шапка лога: ключ-значение до начала JSON */
.log-view .lg-head-key { color: #7f848e }
.log-view .lg-head-val { color: #e5c07b }
/* Разделители секций === ЗАПРОС === */
.log-view .lg-section  { color: #61afef; font-weight: 700; display: inline-block; margin-top: 4px }
/* Статусы: зелёный — успех, красный — отказ, жёлтый — промежуточный */
.log-view .lg-ok       { color: #98c379; font-weight: 700 }
.log-view .lg-err      { color: #e06c75; font-weight: 700 }
.log-view .lg-warn     { color: #e5c07b; font-weight: 700 }
/* Токены JSON */
.log-view .lg-key      { color: #e06c75 }
.log-view .lg-str      { color: #98c379 }
.log-view .lg-num      { color: #d19a66 }
.log-view .lg-bool     { color: #c678dd; font-weight: 600 }
.log-view .lg-null     { color: #7f848e; font-style: italic }
.log-view .lg-punc     { color: #abb2bf }
/* Строка отклонённого получателя */
.log-view .lg-reject   { color: #e06c75 }
/* Строка запроса: POST http://… — метод отдельно от URL */
.log-view .lg-method   { color: #c678dd; font-weight: 700 }
.log-view .lg-url      { color: #61afef; text-decoration: underline; text-decoration-color: #3d4451 }

