/* Тема: по умолчанию светлая. Переключается в «Профиле» (html[data-theme]: light | dark | auto). */
html[data-theme="light"] { color-scheme: light; } html[data-theme="dark"] { color-scheme: dark; } html[data-theme="auto"] { color-scheme: light dark; }
:root {
  --bg: #f4f5f9; --card: #ffffff; --ink: #151a2d; --muted: #6b7390; --line: #e7e9f2;
  --brand: #5b5bf0; --brand-soft: #ededff; --side: #141833; --side-ink: #aab0d0;
  --green: #12a36b; --green-bg: #e3f6ee; --red: #e0455a; --red-bg: #fde8eb;
  --amber: #c98a0a; --amber-bg: #fdf3dc; --blue: #2f7de1; --blue-bg: #e4effc;
  --violet: #8453e0; --violet-bg: #efe8fc; --gray: #636b86; --gray-bg: #eceef5;
  --orange: #c4600b; --orange-bg: #ffe8d0; --indigo: #5b5bf0; --indigo-bg: #ededff; --shadow: 0 1px 2px rgba(20,24,51,.04), 0 6px 24px rgba(20,24,51,.05);
}
/* dark: выбрана вручную */
html[data-theme="dark"] {
    --bg: #0e1124; --card: #171b34; --ink: #eceffb; --muted: #959cbd; --line: #262b4a;
    --brand-soft: #25274f; --side: #0a0d1d;
    --green-bg: #12342a; --red-bg: #3a1a22; --amber-bg: #3a2e12; --blue-bg: #15294a;
    --violet-bg: #2a2150; --gray-bg: #23283f; --indigo-bg: #25274f; --orange: #f0a35e; --orange-bg: #3d2a14; --shadow: none;
  }
/* dark: «Авто» — по настройке системы */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0e1124; --card: #171b34; --ink: #eceffb; --muted: #959cbd; --line: #262b4a;
    --brand-soft: #25274f; --side: #0a0d1d;
    --green-bg: #12342a; --red-bg: #3a1a22; --amber-bg: #3a2e12; --blue-bg: #15294a;
    --violet-bg: #2a2150; --gray-bg: #23283f; --indigo-bg: #25274f; --orange: #f0a35e; --orange-bg: #3d2a14; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); } a:hover { text-decoration: none; opacity: .85; }
.muted, .sub { color: var(--muted); } .sub { font-size: 12px; margin-top: 2px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 248px; flex: none; background: var(--side); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; opacity: 1; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #7c7cff, #4a4ae0); display: grid; place-items: center; font-weight: 700; font-size: 18px; box-shadow: 0 6px 16px rgba(91,91,240,.45); }
.brand-text { font-weight: 600; font-size: 16px; line-height: 1.15; } .brand-text small { display: block; font-weight: 400; font-size: 11px; color: var(--side-ink); letter-spacing: .02em; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.side-link i { width: 18px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; opacity: 1; }
.side-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(91,91,240,.4); }
.side-foot { margin-top: auto; padding: 12px; font-size: 11.5px; line-height: 1.5; color: #7d84a8; border-top: 1px solid rgba(255,255,255,.07); }
.main { flex: 1; min-width: 0; padding: 28px 34px 48px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 18px; }
.content-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; border: 1px solid var(--line); }
.content-card.bare { background: transparent; box-shadow: none; border: 0; padding: 0; }
@media (max-width: 860px) { .shell { flex-direction: column; } .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; padding: 12px; } .brand { padding: 0 8px; } .side-nav { flex-direction: row; } .side-foot { display: none; } .main { padding: 18px 14px 40px; } }

/* dashboard */
.hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; } .hero p { color: var(--muted); margin: 4px 0 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand); }
.kpi.warn::before { background: var(--amber); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; } .kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; } .kpi-note { color: var(--muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15px; font-weight: 600; margin: 0 0 16px; display: flex; justify-content: space-between; align-items: baseline; }
.more { font-size: 12.5px; font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar-stack { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.seg { border-radius: 6px; min-height: 0; } .seg.orders { background: var(--brand); } .seg.leads { background: #c5c8e8; }
/* dark: выбрана вручную */
html[data-theme="dark"] .seg.leads { background: #3a3f68; }
/* dark: «Авто» — по настройке системы */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .seg.leads { background: #3a3f68; }
}
.bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 12.5px; } .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; } .dot.orders { background: var(--brand); } .dot.leads { background: #c5c8e8; }
.row-bar { margin-bottom: 13px; } .row-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; } .row-top b { font-weight: 600; }
.track { height: 8px; border-radius: 99px; background: var(--gray-bg); overflow: hidden; } .fill { height: 100%; border-radius: 99px; background: var(--brand); }
.fill.green { background: var(--green); } .fill.red { background: var(--red); } .fill.amber { background: #e9a824; } .fill.blue { background: var(--blue); } .fill.violet { background: var(--violet); } .fill.gray { background: #9aa1bd; } .fill.indigo { background: var(--brand); }
.mini { width: 100%; border-collapse: collapse; } .mini th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 0 10px 10px; } .mini td { padding: 11px 10px; border-top: 1px solid var(--line); } .mini .r, .mini th.r { text-align: right; }

/* badges */
.badge-soft { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-soft.green { background: var(--green-bg); color: var(--green); } .badge-soft.red { background: var(--red-bg); color: var(--red); }
.badge-soft.amber { background: var(--amber-bg); color: var(--amber); } .badge-soft.blue { background: var(--blue-bg); color: var(--blue); }
.badge-soft.violet { background: var(--violet-bg); color: var(--violet); } .badge-soft.gray { background: var(--gray-bg); color: var(--gray); } .badge-soft.orange { background: var(--orange-bg); color: var(--orange); } .badge-soft.indigo { background: var(--indigo-bg); color: var(--brand); }

/* Flask-Admin tables, forms, buttons */
.table { color: var(--ink); margin-bottom: 0; }
.table thead th { border-top: 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; padding: 12px 12px; white-space: nowrap; }
.table thead th a { color: var(--muted); }
.table td { border-top: 1px solid var(--line); padding: 13px 12px; vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--brand-soft); }
.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.table td.list-buttons-column { white-space: nowrap; width: 1%; }
.model-list .actions-nav, .model-list > .nav-tabs { margin-bottom: 14px; }
.nav-tabs { border-bottom: 1px solid var(--line); } .nav-tabs .nav-link { color: var(--muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--brand); background: transparent; border-bottom-color: var(--brand); }
.nav-tabs .nav-link:hover { border-color: transparent transparent var(--line); }
.form-control, .select2-container--bootstrap4 .select2-selection { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--card); color: var(--ink); }
.btn { border-radius: 10px; font-weight: 500; } .btn-primary { background: var(--brand); border-color: var(--brand); } .btn-primary:hover { background: #4949d6; border-color: #4949d6; }
.btn-secondary, .btn-light { background: var(--gray-bg); border-color: transparent; color: var(--ink); }
.btn-danger { background: var(--red); border-color: var(--red); }
.dropdown-menu { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,24,51,.18); } .dropdown-item { color: var(--ink); } .dropdown-item:hover { background: var(--brand-soft); color: var(--ink); }
.pagination .page-link { background: var(--card); border-color: var(--line); color: var(--ink); } .pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-form .form-control { min-width: 260px; }
.filters-wrap, .filters { margin-bottom: 14px; }
.alert { border-radius: 12px; border: 0; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--line) !important; }
table.table-bordered th { width: 240px; color: var(--muted); font-weight: 500; background: transparent; }
.fa { font-size: 15px; }
.badge-soft + .badge-soft { margin-left: 4px; }
.modal-content { background: var(--card); color: var(--ink); border-radius: 16px; }

/* tidy-ups */
.fa_filter_container { display: none !important; }
.table td.col-created_at, .table td.col-number, .table td.col-total, .table td.col-status, .table td.col-kind, .table td.col-track { white-space: nowrap; }
.table td.col-customer { min-width: 240px; }

/* leads / tasks additions */
.kpi.link { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; } .kpi.link:hover { transform: translateY(-2px); opacity: 1; box-shadow: 0 10px 30px rgba(20,24,51,.1); }
.kpi.muted-kpi::before { background: var(--red); }
.seg.tasks { background: #f1c56b; } .dot.tasks { background: #f1c56b; }
.quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 32px; }
.clip { max-width: 360px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table td.col-created_at, .table td.col-kind, .table td.col-done, .table td.col-phone { white-space: nowrap; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row-openable { cursor: pointer; }

.catalog-actions { display: flex; align-items: center; gap: 8px; margin-right: 14px; } .catalog-actions form { margin: 0; }
.catalog-meta { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; background: var(--gray-bg); }
.edit-note { background: var(--brand-soft); color: var(--ink); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 13px; }
.inline-field .form-control, .inline-field select { min-width: 120px; }

/* ============ v2: контраст и структура (интерфейс «сливался») ============ */
:root { --line: #d9dcec; --line-strong: #c3c8e0; --muted: #566082; --ink2: #283056; --head-bg: #eceef8; --row-alt: #f7f8fd; }
/* dark: выбрана вручную */
html[data-theme="dark"] { --line: #2c3254; --line-strong: #3d4574; --muted: #a2a9cb; --ink2: #d3d8f5; --head-bg: #1e2344; --row-alt: #131730; }
/* dark: «Авто» — по настройке системы */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] { --line: #2c3254; --line-strong: #3d4574; --muted: #a2a9cb; --ink2: #d3d8f5; --head-bg: #1e2344; --row-alt: #131730; }
}
.content-card { padding: 22px 24px; }

/* панель над таблицей: заголовок-счётчик, группа действий, поиск справа */
ul.nav.nav-tabs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; border: 0; padding: 0 0 18px; margin: 0 0 6px; }
ul.nav.nav-tabs > li { margin: 0; }
ul.nav.nav-tabs .nav-link { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 14px; color: var(--ink2); background: var(--card); font-weight: 500; line-height: 1.3; }
ul.nav.nav-tabs .nav-link:hover { border-color: var(--brand); color: var(--brand); }
ul.nav.nav-tabs .nav-link.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
ul.nav.nav-tabs > li:last-child:not(.catalog-actions) { margin-left: auto; }
ul.nav.nav-tabs form.form-inline { display: flex; gap: 8px; margin: 0 !important; }
ul.nav.nav-tabs form.form-inline .form-control { min-width: 280px; background: var(--card); border: 1px solid var(--line-strong); }
ul.nav.nav-tabs form.form-inline .btn { background: var(--ink2); color: var(--card); border-color: var(--ink2); }
.catalog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 0 14px; border-left: 2px solid var(--line); border-right: 2px solid var(--line); margin: 0 4px !important; }
.catalog-actions .btn { padding: 8px 14px; border: 1px solid transparent; }
.catalog-actions .btn-light { background: var(--card); border-color: var(--line-strong); color: var(--ink2); }
.catalog-meta { flex-basis: 100%; font-size: 12px; color: var(--muted); margin: 0; }
.catalog-meta a { font-weight: 600; }

/* таблица: чёткая шапка, строки, колонка действий */
table.model-list { border: 0; border-collapse: separate; border-spacing: 0; background: transparent; }
table.model-list.table-bordered td, table.model-list.table-bordered th { border-left: 0; border-right: 0; }
table.model-list thead th { background: var(--head-bg); color: var(--ink2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 0; border-bottom: 2px solid var(--line-strong); padding: 13px 14px; }
table.model-list thead th a { color: var(--ink2); }
table.model-list thead th:first-child { border-top-left-radius: 12px; } table.model-list thead th:last-child { border-top-right-radius: 12px; }
table.model-list tbody td { padding: 14px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; }
table.model-list tbody tr:nth-child(even) td { background: var(--row-alt); }
table.model-list tbody tr:hover td { background: var(--brand-soft); }
table.model-list tbody td a { font-weight: 600; }
table.model-list td.list-buttons-column { width: 1%; white-space: nowrap; }
table.model-list td.list-buttons-column a, table.model-list td.list-buttons-column button { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--gray-bg); color: var(--ink2); border: 1px solid var(--line); padding: 0; font-weight: 400; }
table.model-list td.list-buttons-column a:hover { background: var(--brand); border-color: var(--brand); color: #fff; opacity: 1; }
table.model-list td.list-buttons-column .fa, table.model-list td.list-buttons-column .glyphicon { font-size: 14px; }
.sub { color: var(--muted); }
.muted { color: var(--muted); }

/* карточка записи и формы */
table.table-bordered:not(.model-list) { border: 1px solid var(--line-strong); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.table-bordered:not(.model-list) th { background: var(--head-bg); color: var(--ink2) !important; font-weight: 600 !important; width: 260px; }
table.table-bordered:not(.model-list) td, table.table-bordered:not(.model-list) th { border: 0 !important; border-top: 1px solid var(--line) !important; padding: 13px 16px; }
table.table-bordered:not(.model-list) tr:first-child td, table.table-bordered:not(.model-list) tr:first-child th { border-top: 0 !important; }
.form-control { border-color: var(--line-strong); }
label, .control-label { color: var(--ink2); font-weight: 600; }
.inline-field, .inline-field-list .well, .fa-inline-field { background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.pagination { margin-top: 18px; }
.badge-soft { padding: 4px 11px; }

/* ============ карточка заказа ============ */
.ocard { max-width: 1320px; padding-bottom: 90px; }
.o-crumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; } .o-crumbs span { margin: 0 8px; opacity: .6; }
.o-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.o-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; }
.o-meta { display: flex; gap: 28px; flex-wrap: wrap; } .o-meta span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; } .o-meta b { font-size: 16px; font-weight: 600; }
.o-status { min-width: 260px; } .o-status label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.status-select { width: 100%; height: 44px; border-radius: 12px; border: 2px solid transparent; padding: 0 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.status-select.green { background: var(--green-bg); color: var(--green); border-color: var(--green); } .status-select.red { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.status-select.amber { background: var(--amber-bg); color: var(--amber); border-color: #e0a526; } .status-select.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue); }
.status-select.violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet); } .status-select.gray { background: var(--gray-bg); color: var(--gray); border-color: #9aa1bd; } .status-select.indigo { background: var(--indigo-bg); color: var(--brand); border-color: var(--brand); }
.status-select option { background: var(--card); color: var(--ink); font-weight: 500; }

.o-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; flex-wrap: wrap; background: var(--bg); padding: 8px 0 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.o-tabs a { padding: 8px 14px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 13px; text-decoration: none; } .o-tabs a:hover { background: var(--brand-soft); color: var(--brand); opacity: 1; }
.o-errors { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; } .o-errors ul { margin: 6px 0 0 18px; padding: 0; } .o-errors li { color: var(--ink); }
.o-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .o-layout { grid-template-columns: 1fr; } }
.o-main, .o-aside { display: flex; flex-direction: column; gap: 18px; } .o-aside { position: sticky; top: 62px; }
.o-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); scroll-margin-top: 70px; }
.o-card h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; } .o-card h2 small { color: var(--muted); font-weight: 500; }
.o-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; } .o-card-head h2 { margin: 0; }
.o-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 36px; } @media (max-width: 900px) { .o-grid { grid-template-columns: 1fr; } }
.f-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; } .f-row.wide { grid-column: 1 / -1; grid-template-columns: 150px 1fr; }
.f-row > label:first-child { color: var(--muted); font-weight: 500; font-size: 13px; margin: 0; } .req { color: var(--red); font-style: normal; }
.pill { display: inline-block; background: var(--gray-bg); color: var(--ink2); padding: 8px 14px; border-radius: 10px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
.topay { font-size: 18px; }
.switch { position: relative; width: 46px; height: 26px; margin: 0; } .switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #b9bed6; border-radius: 99px; transition: .15s; } .switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--green); } .switch input:checked + span::after { left: 23px; }

.lines-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.lines { width: 100%; border-collapse: collapse; min-width: 640px; }
table.lines thead th { background: var(--head-bg); color: var(--ink2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 11px 12px; text-align: left; border-bottom: 2px solid var(--line-strong); }
table.lines td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; } table.lines tbody tr:first-child td { border-top: 0; }
table.lines .r, table.lines th.r { text-align: right; } table.lines td.n { width: 34px; color: var(--muted); }
table.lines .prod { display: flex; align-items: center; gap: 12px; min-width: 240px; } table.lines .prod img, table.lines .noimg { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--gray-bg); flex: none; }
table.lines .prod a, table.lines .prod b { font-weight: 600; color: var(--ink); } table.lines .prod a:hover { color: var(--brand); }
table.lines td.stock { color: var(--muted); font-size: 13px; white-space: nowrap; } .no { color: var(--red); font-weight: 600; }
table.lines input.form-control { width: 96px; height: 38px; text-align: right; padding: 0 10px; } table.lines input.in-qty { width: 76px; }
table.lines td.sum { font-weight: 700; white-space: nowrap; }
.del { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--gray-bg); color: var(--muted); cursor: pointer; } .del:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.lines-empty { padding: 28px; text-align: center; color: var(--muted); }
.totals { margin: 16px 0 0 auto; width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); } .totals b { color: var(--ink); font-weight: 600; }
.totals .grand { border-top: 2px solid var(--line-strong); padding-top: 10px; margin-top: 4px; color: var(--ink); font-size: 18px; font-weight: 700; } .totals .grand b { font-size: 22px; font-weight: 700; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow: auto; }
.history li { border-left: 3px solid var(--brand); padding-left: 12px; font-size: 13px; white-space: pre-line; } .history time { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }

.o-bar { position: fixed; left: 248px; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 34px; background: var(--card); border-top: 1px solid var(--line-strong); box-shadow: 0 -8px 24px rgba(20,24,51,.08); }
@media (max-width: 860px) { .o-bar { left: 0; padding: 12px 14px; } }
.o-dirty { margin-right: auto; color: var(--amber); font-weight: 600; font-size: 13px; }
.o-bar .btn { padding: 10px 20px; }

.picker { position: fixed; inset: 0; z-index: 100; background: rgba(15,18,40,.55); display: grid; place-items: center; padding: 20px; }
.picker[hidden] { display: none; }
.picker-box { width: min(980px, 100%); max-height: 88vh; background: var(--card); border-radius: 18px; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.4); overflow: hidden; }
.picker-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.picker-head h3 { font-size: 18px; font-weight: 700; margin: 0 auto 0 0; } .picker-head h3 small { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 10px; }
.picker-head .form-control { width: 280px; } .chk { margin: 0; font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.x { border: 0; background: var(--gray-bg); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--ink2); }
.picker-list { overflow: auto; flex: 1; } .picker-list table { width: 100%; border-collapse: collapse; }
.picker-list th { position: sticky; top: 0; background: var(--head-bg); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); padding: 10px 12px; text-align: left; z-index: 1; }
.picker-list td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; } .picker-list .r { text-align: right; white-space: nowrap; }
.picker-list tbody tr { cursor: pointer; } .picker-list tbody tr:hover { background: var(--row-alt); } .picker-list tbody tr.on { background: var(--brand-soft); }
.picker-list img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; } .picker-list .nm { font-weight: 600; } .picker-list .art { color: var(--muted); font-size: 12.5px; }
.picker-list .qty { width: 70px; height: 34px; text-align: right; } .picker-list .empty { text-align: center; color: var(--muted); padding: 30px; }
.picker-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }

/* ============ профиль и переключатель темы ============ */
.profile-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: auto; border-radius: 12px; color: #fff; text-decoration: none; background: rgba(255,255,255,.06); transition: background .15s; }
.profile-chip:hover { background: rgba(255,255,255,.12); color: #fff; opacity: 1; }
.profile-chip .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #7c7cff, #4a4ae0); display: grid; place-items: center; font-weight: 700; flex: none; }
.profile-chip .who { line-height: 1.2; min-width: 0; } .profile-chip .who b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; } .profile-chip .who small { color: var(--side-ink); font-size: 11.5px; }
.side-foot { margin-top: 12px; }
.prof { display: grid; gap: 18px; max-width: 760px; }
.prof-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow); }
.prof-card h2 { font-size: 17px; font-weight: 700; margin: 0 0 6px; } .prof-card .hint { margin: 0 0 18px; }
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.theme-opt { text-align: left; background: var(--card); border: 2px solid var(--line-strong); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 4px; }
.theme-opt:hover { border-color: var(--brand); }
.theme-opt.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.theme-opt b { font-size: 14px; margin-top: 8px; } .theme-opt small { color: var(--muted); font-size: 12px; }
.swatch { display: grid; grid-template-columns: 26% 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 5px; height: 84px; border-radius: 9px; padding: 7px; border: 1px solid rgba(120,125,160,.35); }
.swatch i { border-radius: 4px; } .swatch i:first-child { grid-row: 1 / 4; }
.swatch.light { background: #f4f5f9; } .swatch.light i:first-child { background: #141833; } .swatch.light i:nth-child(2) { background: #fff; border: 1px solid #e0e3ee; } .swatch.light i:nth-child(3) { background: #5b5bf0; }
.swatch.dark { background: #0e1124; } .swatch.dark i:first-child { background: #070918; } .swatch.dark i:nth-child(2) { background: #171b34; } .swatch.dark i:nth-child(3) { background: #7c7cff; }
.swatch.auto { position: relative; display: block; padding: 0; overflow: hidden; background: none; } .swatch.auto > .swatch { position: absolute; inset: 0; border: 0; } .swatch.auto > .light { clip-path: inset(0 50% 0 0); } .swatch.auto > .dark { clip-path: inset(0 0 0 50%); }
.saved { color: var(--green); font-weight: 600; font-size: 13px; margin: 14px 0 0; }

/* ============ карточка клиента ============ */
.ccard { max-width: 1320px; }
.who-head { display: flex; gap: 18px; align-items: center; } .who-head h1 { margin-bottom: 8px; }
.big-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #7c7cff, #4a4ae0); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 700; flex: none; }
.warn-text { color: var(--amber); }
.cl-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cl-layout { grid-template-columns: 1fr; } }
.cl-left, .cl-right { display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack .f-row { grid-template-columns: 110px 1fr; }
.flags { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.sw-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .sw-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; } .sw-row b { font-weight: 600; }
.phone-row { display: flex; gap: 8px; margin-bottom: 10px; } .phone-row .form-control { flex: 1; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); } .kv:first-of-type { border-top: 0; padding-top: 0; }
.kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; } .muted-kv b { font-weight: 500; color: var(--muted); }
.composer .form-control { margin-bottom: 10px; } .row-end { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.due { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font-weight: 500; color: var(--muted); } .due .form-control { margin: 0; width: 170px; }
.tabs2 { display: inline-flex; gap: 4px; background: var(--gray-bg); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.tabs2 button { border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; } .tabs2 button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(20,24,51,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips button { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink2); border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; } .chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px 34px; } .tl-item[hidden] { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--card); background: var(--brand); box-shadow: 0 0 0 2px var(--line-strong); }
.t-task .tl-dot { background: #e9a824; } .t-lead .tl-dot { background: var(--blue); } .t-note .tl-dot { background: var(--gray); } .t-log .tl-dot { background: var(--violet); }
.tl-body { background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; } .tl-head time { margin-left: auto; color: var(--muted); font-size: 12px; } .tl-head .amt { font-weight: 700; }
.tl-text { margin-top: 8px; color: var(--ink2); white-space: pre-line; font-size: 13.5px; }
.tl-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; } .tl-actions form { margin: 0; }
.tl-empty { color: var(--muted); padding: 20px 0; }
.t-log .tl-body { background: transparent; border-style: dashed; } .t-log .tl-text { color: var(--muted); font-size: 12.5px; }
.cl-left .o-bar { left: 248px; }

/* таблица состава заказа: кнопка удаления больше не обрезается */
table.lines { min-width: 0; table-layout: auto; }
table.lines input.form-control { width: 84px; padding: 0 8px; } table.lines input.in-qty { width: 64px; }
table.lines .prod { min-width: 190px; } table.lines td, table.lines thead th { padding-left: 10px; padding-right: 10px; }
table.lines td:last-child { width: 44px; padding-right: 12px; }

/* значки «глаз/карандаш» в списках скрыты: строка открывается кликом */
table.model-list td.list-buttons-column { display: none; }
.row-openable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* нижняя панель списка: счётчик, размер страницы, пагинация */
.list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.foot-count { color: var(--muted); font-size: 13px; } .foot-count b { color: var(--ink); font-weight: 600; }
.foot-size { display: inline-flex; align-items: center; gap: 4px; background: var(--gray-bg); border-radius: 11px; padding: 4px; }
.foot-size span { color: var(--muted); font-size: 12.5px; padding: 0 8px 0 10px; }
.foot-size a { min-width: 40px; text-align: center; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink2); text-decoration: none; }
.foot-size a:hover { background: var(--card); opacity: 1; } .foot-size a.on { background: var(--brand); color: #fff; }
.list-foot .pagination { margin: 0 0 0 auto; gap: 4px; flex-wrap: wrap; }
.list-foot .pagination .page-link { border: 1px solid var(--line-strong); border-radius: 9px !important; min-width: 38px; text-align: center; font-weight: 600; color: var(--ink2); }
.list-foot .pagination .page-item.disabled .page-link { opacity: .45; }
@media (max-width: 760px) { .list-foot .pagination { margin-left: 0; } }

.table-scroll { overflow-x: auto; border-radius: 12px; }
table.model-list { margin-bottom: 0; }
table.model-list thead th { padding: 12px 10px; letter-spacing: .03em; white-space: nowrap; }
table.model-list tbody td { padding: 12px 10px; }
.table td.col-customer { min-width: 200px; }

/* ============ задачи: список и боковая панель ============ */
.tasks-page { max-width: 1320px; }
.t-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; } .t-top .page-title { margin: 0; }
.seg-tabs { display: inline-flex; gap: 4px; background: var(--gray-bg); padding: 4px; border-radius: 12px; }
.seg-tabs a { padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; } .seg-tabs a b { margin-left: 6px; font-weight: 600; opacity: .75; }
.seg-tabs a.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(20,24,51,.12); opacity: 1; } .seg-tabs a:hover { opacity: 1; color: var(--brand); }
.t-filters { display: grid; grid-template-columns: 1.4fr 1.2fr 150px 150px auto; gap: 12px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.t-filters label { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 5px; } .t-filter-btns { display: flex; gap: 8px; }
@media (max-width: 1100px) { .t-filters { grid-template-columns: 1fr 1fr; } }
.t-list { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.t-day { background: var(--head-bg); color: var(--ink2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); } .t-day:first-child { border-top: 0; }
.t-row { display: grid; grid-template-columns: 34px 150px minmax(180px, 1.6fr) minmax(160px, 1.1fr) 170px 120px; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; outline: none; }
.t-row:hover, .t-row:focus-visible { background: var(--brand-soft); } .t-row:last-child { border-bottom: 0; }
.t-row time { font-variant-numeric: tabular-nums; color: var(--ink2); font-weight: 500; } .t-row time.late { color: var(--red); font-weight: 700; }
.t-title { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; } .t-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .t-title small { color: var(--muted); font-weight: 600; } .t-ico { font-style: normal; opacity: .7; font-size: 13px; }
.t-client { display: flex; flex-direction: column; min-width: 0; } .t-client a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .t-client small { color: var(--muted); }
.t-assignee { color: var(--muted); font-size: 13px; text-align: right; }
.t-row.done .t-title span, .t-row.done time { text-decoration: line-through; color: var(--muted); } .t-row.done { opacity: .75; }
.t-check-wrap { position: relative; width: 22px; height: 22px; margin: 0; cursor: pointer; } .t-check-wrap input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.t-check-wrap span { position: absolute; inset: 0; border: 2px solid var(--line-strong); border-radius: 7px; background: var(--card); transition: .12s; }
.t-check-wrap input:checked + span { background: var(--green); border-color: var(--green); } .t-check-wrap input:checked + span::after { content: '✓'; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.t-empty { padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 1000px) { .t-row { grid-template-columns: 34px 1fr; } .t-row time, .t-client, .t-kind, .t-assignee { grid-column: 2; text-align: left; } }
.tasks-page .list-foot { margin-top: 18px; padding-top: 0; border-top: 0; }

.no-scroll { overflow: hidden; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,18,40,.5); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer-w, 580px), 100vw); background: var(--card); z-index: 100; box-shadow: -20px 0 60px rgba(0,0,0,.3); animation: slide-in .18s ease-out; }
.drawer[hidden], .drawer-overlay[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(32px); } to { transform: none; } }
.d-form { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; }
.d-loading { padding: 40px; text-align: center; color: var(--muted); }
.d-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); } .d-head h2 { font-size: 19px; font-weight: 700; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-link { border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; } .d-x { border: 0; background: var(--gray-bg); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--ink2); }
.d-actions { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--row-alt); border-bottom: 1px solid var(--line); }
.btn-done { border: 0; background: var(--green); color: #fff; font-weight: 700; border-radius: 10px; padding: 10px 22px; cursor: pointer; box-shadow: 0 4px 12px rgba(18,163,107,.3); } .btn-done.is-done { background: var(--gray-bg); color: var(--ink2); box-shadow: none; }
.d-scroll { overflow-y: auto; padding: 20px 24px 28px; }
.d-label { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin: 18px 0 6px; } .d-label:first-of-type { margin-top: 0; }
.due-row { display: flex; gap: 10px; } .due-row .form-control { flex: 1; } .due-row .form-control[type=time] { flex: 0 0 140px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .quick button { border: 1px solid var(--line-strong); background: var(--card); color: var(--brand); border-radius: 99px; padding: 5px 13px; font-size: 13px; font-weight: 600; cursor: pointer; } .quick button:hover { background: var(--brand-soft); }
.d-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); margin-top: 6px; } .d-kv span { color: var(--muted); } .d-kv b { font-weight: 600; text-align: right; }
.d-h3 { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }
.d-comments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.d-comments li { background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; white-space: pre-line; } .d-comments time { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.d-comments.log li { background: transparent; border-style: dashed; color: var(--muted); font-size: 12.5px; }
.d-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line-strong); background: var(--card); }
.d-foot .btn { padding: 10px 20px; } .d-foot .trash { margin-left: auto; border: 1px solid var(--line); background: var(--gray-bg); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; } .d-foot .trash:hover { background: var(--red-bg); border-color: var(--red); }

/* счётчики на вкладках истории клиента */
.chips button b { margin-left: 6px; min-width: 20px; display: inline-block; text-align: center; padding: 0 6px; border-radius: 99px; background: var(--gray-bg); color: var(--ink2); font-size: 11.5px; font-weight: 700; line-height: 19px; }
.chips button.on b { background: rgba(255,255,255,.25); color: #fff; }
.chips button.zero:not(.on) { opacity: .55; }
.chips .dot-open { margin-left: 4px; font-style: normal; background: var(--amber-bg); color: var(--amber); border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 19px; }
.chips button.on .dot-open { background: #fff; color: var(--amber); }
#t-drawer-body { height: 100%; } .drawer { overflow: hidden; } .d-form { min-height: 0; } .d-scroll { min-height: 0; }

/* ============ собственные выпадающие списки (вместо браузерных) ============ */
.ui-select-wrap { position: relative; }
.ui-select-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; bottom: 0; }
.ui-select { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; text-align: left; padding: 0 12px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ui-select:hover { border-color: var(--brand); } .ui-select:focus-visible, .ui-select-wrap.open .ui-select { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ui-select .ui-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ui-select.is-empty .ui-label { color: var(--muted); }
.ui-caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; opacity: .7; transition: transform .15s; flex: none; }
.ui-select-wrap.open .ui-caret { transform: rotate(180deg); }
.ui-ico { font-style: normal; flex: none; width: 20px; text-align: center; } .ui-ico[hidden] { display: none; }

/* цвета групп статусов (справочник в настройках) */
.g-new { --gbg: var(--orange-bg); --gfg: var(--orange); } .g-approval { --gbg: var(--amber-bg); --gfg: var(--amber); } .g-assembling { --gbg: var(--violet-bg); --gfg: var(--violet); }
.g-delivery { --gbg: var(--blue-bg); --gfg: var(--blue); } .g-complete { --gbg: var(--green-bg); --gfg: var(--green); } .g-cancel { --gbg: var(--red-bg); --gfg: var(--red); }
/* список статусов выглядит как плашки статусов в таблицах: тот же цвет у каждого статуса, та же форма */
.v-status .ui-select { min-height: 40px; border-radius: 99px; padding: 0 16px; font-weight: 600; font-size: 14px; background: var(--gray-bg); color: var(--gray); border-color: transparent; }
.v-status .ui-select:hover { filter: brightness(.97); border-color: transparent; } .v-status .ui-ico { display: none; }
.v-status .ui-select .ui-label::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 9px; vertical-align: 1px; flex: none; }
.v-status .ui-select.c-green { background: var(--green-bg); color: var(--green); } .v-status .ui-select.c-red { background: var(--red-bg); color: var(--red); }
.v-status .ui-select.c-amber { background: var(--amber-bg); color: var(--amber); } .v-status .ui-select.c-blue { background: var(--blue-bg); color: var(--blue); }
.v-status .ui-select.c-violet { background: var(--violet-bg); color: var(--violet); } .v-status .ui-select.c-gray { background: var(--gray-bg); color: var(--gray); } .v-status .ui-select.c-orange { background: var(--orange-bg); color: var(--orange); } .v-status .ui-select.c-indigo { background: var(--indigo-bg); color: var(--indigo); }
.ui-stages { display: none; }

.ui-menu { position: fixed; z-index: 300; overflow-y: auto; background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 50px rgba(15,18,40,.28); padding: 6px; outline: none; }
.ui-opt { padding: 9px 12px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--ink); line-height: 1.3; }
.ui-opt.empty { color: var(--muted); } .ui-opt.dis { opacity: .45; cursor: not-allowed; }
.ui-opt.act { background: var(--brand-soft); } .ui-opt.sel { font-weight: 700; } .ui-opt.sel::after { content: '✓'; margin-left: auto; color: var(--brand); font-weight: 700; }
.ui-group { border-radius: 11px; padding: 6px 6px 8px; margin: 0 0 6px; background: var(--gbg); color: var(--gfg); } .ui-group:last-child { margin-bottom: 0; }
.ui-group-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 6px 8px 4px; }
.ui-group .ui-opt { color: inherit; padding: 7px 12px 7px 38px; } .ui-group .ui-opt.act { background: rgba(255,255,255,.35); } .ui-group.g-new .ui-opt.act { background: rgba(255,255,255,.25); }
.ui-group .ui-opt.sel { font-weight: 800; } .ui-group .ui-opt.sel::after { color: inherit; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .ui-group .ui-opt.act { background: rgba(255,255,255,.12); } }
html[data-theme="dark"] .ui-group .ui-opt.act { background: rgba(255,255,255,.12); }

/* панель задачи: содержимое не может стать шире панели (длинные имена клиентов, поля срока) */
.d-form { grid-template-columns: minmax(0, 1fr); }
.d-head h2 { min-width: 0; } .d-head, .d-actions, .d-scroll, .d-foot { min-width: 0; }
.due-row .form-control { min-width: 0; } .d-kv b { min-width: 0; overflow-wrap: anywhere; }

/* блок «Клиент» в заказе и окно выбора клиента */
.client-sum { display: flex; gap: 16px; align-items: flex-start; background: var(--row-alt); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.big-avatar.sm { width: 48px; height: 48px; font-size: 20px; }
.cs-main { min-width: 0; flex: 1; } .cs-name { font-size: 17px; font-weight: 700; }
.client-sum dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 24px; margin: 10px 0 0; }
.client-sum dt { color: var(--muted); font-size: 12px; font-weight: 500; } .client-sum dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cs-warn { margin: 12px 0 0; background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: 13px; padding: 9px 14px; border-radius: 10px; }
.cur { background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.cnew { padding: 16px 22px; border-top: 1px solid var(--line); background: var(--row-alt); } .cnew b { display: block; margin-bottom: 10px; }
.cnew-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; } .cnew .o-errors { margin: 0 0 10px; padding: 10px 14px; } .cnew .o-errors ul { margin: 4px 0 8px 18px; }
.picker-foot .muted { margin-right: auto; font-size: 13px; }

/* ============ настройки, интеграции, триггеры ============ */
.set-page, .trg-page { max-width: 1320px; }
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; } @media (max-width: 900px) { .set-layout { grid-template-columns: 1fr; } }
.set-nav { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); position: sticky; top: 16px; }
.set-nav a { padding: 11px 14px; border-radius: 10px; font-weight: 600; color: var(--ink2); text-decoration: none; } .set-nav a:hover { background: var(--brand-soft); opacity: 1; } .set-nav a.on { background: var(--brand); color: #fff; }
.set-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.set-table td, .set-table th { white-space: nowrap; } .set-table .form-control { min-width: 200px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; } .add-row { margin-top: 16px; } .add-row .form-control { max-width: 320px; }
.dict-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dict-group { background: var(--gbg); color: var(--gfg); border-radius: 14px; padding: 12px 14px 14px; } .dict-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.dict-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 5px 0; font-size: 13.5px; align-items: center; border-top: 1px solid rgba(120,120,160,.18); } .dict-row code { font-size: 11px; opacity: .7; background: none; color: inherit; } .dict-row b { min-width: 28px; text-align: right; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin-top: 18px; } .kv-grid > div { display: flex; flex-direction: column; background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kv-grid span { color: var(--muted); font-size: 12px; } .kv-grid b { font-size: 16px; margin-top: 2px; }
.mode-banner { background: var(--green-bg); color: var(--green); border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 13.5px; margin-bottom: 16px; } .mode-banner a { margin-left: 12px; white-space: nowrap; } .mode-banner.live { background: var(--red-bg); color: var(--red); }
.modes { display: flex; flex-wrap: wrap; gap: 10px; } .mode { margin: 0; cursor: pointer; } .mode input { position: absolute; opacity: 0; }
.mode span { display: block; padding: 10px 16px; border: 2px solid var(--line-strong); border-radius: 12px; font-weight: 600; background: var(--card); }
.mode input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); } .mode.live input:checked + span { border-color: var(--red); background: var(--red-bg); color: var(--red); } .mode input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.integ-tools, .integ-test { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; } .integ-tools { flex-direction: row; align-items: center; flex-wrap: wrap; }
.test-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; } @media (max-width: 800px) { .test-row { grid-template-columns: 1fr; } }
.ok-text { color: var(--green) !important; font-weight: 600; } .bad-text { color: var(--red) !important; font-weight: 600; }
.trg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; } .trg-actions form { margin: 0; }
.trg-row, .log-row { display: grid; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; outline: none; } .trg-row:hover, .log-row:hover { background: var(--brand-soft); }
.trg-row { grid-template-columns: 56px minmax(220px, 1fr) auto 50px; } .trg-row.off .trg-main b { color: var(--muted); }
.trg-main b { display: block; } .trg-main small { color: var(--muted); } .trg-act { display: flex; gap: 6px; } .trg-runs { text-align: right; color: var(--muted); font-weight: 600; }
.log-row { grid-template-columns: 150px minmax(220px, 1fr) minmax(200px, 1fr) 110px; } .log-row time { color: var(--ink2); font-variant-numeric: tabular-nums; } .lg-main small { display: block; color: var(--muted); }
.log-body { grid-column: 1 / -1; background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; cursor: default; } .log-body[hidden] { display: none; }
.log-text { white-space: pre-line; } .log-filters { grid-template-columns: 200px 200px auto; }
.ph-chips { margin: 10px 0 0; } .ph-chips button { font-family: ui-monospace, Menlo, monospace; font-size: 12px; } .preview { margin-top: 14px; background: var(--row-alt); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; } .preview small { display: block; margin-top: 6px; }
[data-show][hidden], [data-show-text][hidden] { display: none !important; }
.d-form .ui-select-wrap { margin-top: 0; }

/* раскрывающиеся группы бокового меню */
.side-parent { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.side-caret { margin-left: auto; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; opacity: .6; transition: transform .2s; }
.side-group.open > .side-parent .side-caret { transform: rotate(180deg); }
.side-group.open > .side-parent { color: #fff; }
.side-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.side-sub > div { overflow: hidden; margin-left: 27px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 2px; }
.side-group.open > .side-sub { grid-template-rows: 1fr; } .side-group.open > .side-sub > div { padding-top: 4px; padding-bottom: 6px; margin-top: 2px; }
.side-sublink { padding: 8px 12px; border-radius: 9px; color: var(--side-ink); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.side-sublink:hover { background: rgba(255,255,255,.07); color: #fff; opacity: 1; } .side-sublink.active { background: rgba(124,124,255,.22); color: #fff; font-weight: 600; }
.set-layout.one { display: block; } .set-layout.one .set-nav { display: none; }
@media (max-width: 860px) { .side-group { display: contents; } .side-sub, .side-group.open > .side-sub { display: contents; } .side-sub > div { display: contents; margin: 0; padding: 0; border: 0; } .side-parent { display: none; } .side-sublink { white-space: nowrap; } }

/* меню: надёжное раскрытие (без анимации высоты) и ровная стрелка */
.side-link .side-caret { width: 0; height: 0; text-align: left; }
.side-sub, .side-group.open > .side-sub { display: none; grid-template-rows: none; transition: none; }
.side-group.open > .side-sub { display: block; }
.side-sub > div { overflow: visible; }
@media (max-width: 860px) { .side-sub, .side-group.open > .side-sub { display: contents; } }

/* боковая панель на невысоких окнах: пункты прокручиваются внутри, профиль всегда виден */
.sidebar { overflow: hidden; }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; padding-right: 2px; }
.side-nav::-webkit-scrollbar { width: 6px; } .side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 6px; }
.profile-chip { margin-top: 10px; flex: none; } .side-foot { flex: none; margin-top: 10px; }
@media (max-height: 860px) { .brand { padding-bottom: 10px; } .side-link { padding-top: 9px; padding-bottom: 9px; } .side-sublink { padding-top: 6px; padding-bottom: 6px; } .side-foot { display: none; } }
@media (max-height: 640px) { .side-link { padding-top: 7px; padding-bottom: 7px; } .profile-chip { padding: 8px 10px; } }
@media (max-width: 860px) { .sidebar { overflow-x: auto; overflow-y: hidden; } .side-nav { overflow: visible; flex: none; } .profile-chip { margin-top: 0; } }

/* окно «Тарифы на доставку» и блок пункта выдачи в заказе */
.ship-row { align-items: start; } .ship-row > label:first-child { padding-top: 10px; }
.ship-card { background: var(--row-alt); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.ship-info { display: flex; flex-direction: column; min-width: 0; flex: 1; } .ship-info b { font-size: 15px; } .ship-info span { color: var(--ink2); overflow-wrap: anywhere; } .ship-info small { color: var(--muted); margin-top: 4px; } .ship-info small.warn { color: var(--amber); font-weight: 600; }
.ship-empty { color: var(--muted); flex: 1; } .ship-btns { display: flex; gap: 8px; } [hidden] { display: none !important; }
.picker-box.wide { width: min(1180px, 100%); }
.sdt-filters { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr 1.5fr auto; gap: 12px; align-items: end; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--row-alt); }
.sdt-filters label { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 5px; }
@media (max-width: 900px) { .sdt-filters { grid-template-columns: 1fr 1fr; } }
.sdt-status { padding: 10px 22px; font-size: 13px; font-weight: 600; background: var(--blue-bg); color: var(--blue); } .sdt-status.bad { background: var(--red-bg); color: var(--red); } .sdt-status.wait { background: var(--amber-bg); color: var(--amber); } .sdt-status.info { background: var(--blue-bg); color: var(--blue); }
#sdt-body td small { display: block; font-size: 12px; margin-top: 2px; } #sdt-body td.nm { max-width: 260px; }

/* подменю существует только у открытой группы (раскрытие определяется текущей страницей) */
a.side-parent { text-decoration: none; } a.side-parent:hover { opacity: 1; }
.side-group.open > .side-sub { display: block; }
@media (max-width: 860px) { .side-group { display: contents; } .side-parent { display: flex; } .side-sub, .side-group.open > .side-sub { display: contents; } }

/* редактируемые справочники */
.dict-edit h2 { margin-bottom: 12px; }
.dict-head-row, .dict-line { display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(110px, .9fr) 90px 70px 44px 150px; gap: 10px; align-items: center; }
.dict-head-row.st, .dict-line.st { grid-template-columns: minmax(170px, 1.5fr) minmax(100px, .8fr) minmax(150px, 1fr) minmax(120px, .8fr) 80px 70px 44px 150px; }
.dict-head-row { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 0 8px; border-bottom: 2px solid var(--line-strong); }
.dict-line { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; } .dict-line.off .form-control:first-of-type { color: var(--muted); } .dict-line code { font-size: 12px; background: var(--gray-bg); padding: 3px 7px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; }
.dict-line.add { border-bottom: 0; padding-top: 14px; } .dict-line .r, .dict-head-row .r { text-align: right; } .dict-btns { display: flex; gap: 6px; justify-content: flex-end; }
.dict-line .ui-select { min-height: 38px; } .dict-line .form-control { height: 38px; } .del-btn[disabled] { opacity: .4; cursor: not-allowed; }
@media (max-width: 1100px) { .dict-head-row { display: none; } .dict-line, .dict-line.st { grid-template-columns: 1fr 1fr; } }

/* API: ключи и справочник по методам */
.key-new { border-color: var(--green); background: var(--green-bg); } .key-box { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px dashed var(--green); border-radius: 12px; padding: 12px 14px; } .key-box code { flex: 1; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; background: none; color: var(--ink); }
tr.off-row td { opacity: .55; } .api-rules { margin: 0 0 16px 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; } .api-rules code, .hint code { background: var(--gray-bg); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.api-ep { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--card); } .api-ep summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; } .api-ep summary::-webkit-details-marker { display: none; }
.api-ep .sum { color: var(--muted); font-size: 13px; flex: 1; min-width: 200px; } .api-ep[open] summary { border-bottom: 1px solid var(--line); background: var(--row-alt); border-radius: 12px 12px 0 0; }
.mth { font-weight: 800; font-size: 11px; letter-spacing: .04em; border-radius: 6px; padding: 3px 8px; min-width: 52px; text-align: center; color: #fff; } .mth.get { background: var(--blue); } .mth.post { background: var(--green); }
.api-body { padding: 12px 16px 16px; } .api-body b { display: block; margin: 8px 0 4px; font-size: 12px; color: var(--muted); } .api-body pre { background: #141833; color: #dfe3ff; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ============ вход в CRM ============ */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, var(--brand-soft), transparent), var(--bg); }
.login-wrap { width: min(420px, 100%); display: flex; flex-direction: column; gap: 22px; }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; } .login-brand .brand-mark { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #7c7cff, #4a4ae0); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; box-shadow: 0 8px 20px rgba(91,91,240,.4); }
.login-brand b { display: block; font-size: 18px; line-height: 1.1; } .login-brand small { color: var(--muted); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 28px 24px; box-shadow: 0 20px 60px rgba(20,24,51,.12); display: flex; flex-direction: column; gap: 6px; }
.login-card h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em; } .login-sub { color: var(--muted); margin: 0 0 12px; font-size: 13.5px; }
.login-card label { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink2); } .login-card .form-control { height: 46px; }
.pw-wrap { position: relative; } .pw-wrap .form-control { padding-right: 88px; } .pw-toggle { position: absolute; right: 6px; top: 6px; height: 34px; border: 0; background: var(--gray-bg); color: var(--ink2); border-radius: 8px; padding: 0 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.login-card label.remember { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--muted); margin-top: 14px; } .login-btn { height: 46px; margin-top: 14px; font-weight: 600; font-size: 15px; }
.login-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; } .login-error code { display: block; margin-top: 6px; font-size: 12px; word-break: break-all; }
.login-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; text-align: center; }

.profile-box { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; flex: none; } .profile-box .profile-chip { margin-top: 0; flex: 1; min-width: 0; }
.logout-btn { border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: var(--side-ink); font-weight: 600; font-size: 12px; padding: 0 12px; cursor: pointer; } .logout-btn:hover { background: rgba(224,69,90,.3); color: #fff; }
@media (max-width: 860px) { .profile-box { margin-top: 0; } }

.user-add { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr 190px auto; gap: 10px; margin-top: 16px; align-items: center; } @media (max-width: 1000px) { .user-add { grid-template-columns: 1fr 1fr; } }

.cred-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; } .cred-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* login: fields fill the card, the show-password button sits inside the field */
.login-card .form-control { width: 100%; box-sizing: border-box; }
.pw-wrap { width: 100%; } .pw-wrap .form-control { padding-right: 96px; }
.pw-toggle { right: 6px; top: 50%; transform: translateY(-50%); height: 34px; }
.login-card .login-btn { width: 100%; color: #fff; }
.login-card label.remember input { width: 16px; height: 16px; margin: 0; flex: none; }
/* login: inner padding of fields, custom checkbox, calmer vertical rhythm */
.login-card { padding: 36px 36px 30px; gap: 0; }
.login-card .login-sub { margin-bottom: 18px; }
.login-card label { margin: 16px 0 8px; }
.login-card .form-control { padding: 0 16px; font-size: 15px; border-radius: 12px; }
.pw-wrap .form-control { padding-right: 104px; }
.pw-toggle { right: 8px; padding: 0 14px; }
.login-card label.remember { position: relative; gap: 10px; margin: 20px 0 0; padding-left: 0; cursor: pointer; font-size: 13.5px; user-select: none; }
.login-card label.remember input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.login-card label.remember input::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); opacity: 0; }
.login-card label.remember input:checked { background: var(--brand); border-color: var(--brand); }
.login-card label.remember input:checked::after { opacity: 1; }
.login-card label.remember input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.login-card .login-btn { margin-top: 24px; }
.login-note { margin-top: 20px; }
.login-wrap { width: min(440px, 100%); }
.login-card h1 { margin-bottom: 6px; }
.login-card label.remember { white-space: nowrap; }
.login-card label.remember input { border-color: #b4b9d0; }
/* sidebar user block: profile on top, full-width logout below */
.profile-box { margin-top: auto; display: flex; flex-direction: column; gap: 8px; flex: none; }
.profile-box .profile-chip { margin-top: 0; min-width: 0; padding: 10px 12px; gap: 10px; }
.profile-box .profile-chip .who { flex: 1; min-width: 0; } .profile-box .profile-chip .who b { max-width: none; }
.profile-box .profile-chip .who small { display: block; white-space: nowrap; }
.profile-box form { margin: 0; }
.logout-btn { width: 100%; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
@media (max-width: 860px) { .profile-box { margin-top: 0; flex-direction: row; align-items: center; } .logout-btn { width: auto; padding: 0 14px; } }
/* dictionaries: inline autosave note */
.dict-line { position: relative; }
.save-mark { position: absolute; right: 0; top: -4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; opacity: 0; transform: translateY(2px); transition: opacity .15s, transform .15s; pointer-events: none; background: var(--card); }
.save-mark.show { opacity: 1; transform: none; } .save-mark.ok { color: var(--green); } .save-mark.bad { color: var(--red); }
/* ---- «Новое SMS / письмо» и «Коммуникации» */
body.cmp-lock { overflow: hidden; }
.cmp-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15,18,40,.55); display: grid; place-items: center; padding: 20px; }
.cmp-box { width: min(720px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); overflow: hidden; }
.cmp-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px 16px; border-bottom: 1px solid var(--line); }
.cmp-head h3 { margin: 0; font-size: 22px; font-weight: 700; } .cmp-x { border: 0; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; border-radius: 8px; width: 34px; height: 34px; } .cmp-x:hover { background: var(--gray-bg); color: var(--ink); }
.cmp-body { padding: 18px 26px 6px; overflow: auto; flex: 1; }
.cmp-for { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.cmp-banner { background: var(--blue-bg); color: var(--blue); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin-bottom: 8px; } .cmp-banner.off { background: var(--amber-bg, #fff4e0); color: var(--amber, #b86e00); }
.cmp-field { margin-bottom: 14px; } .cmp-field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; } .cmp-field .form-control { width: 100%; box-sizing: border-box; padding: 10px 14px; }
.cmp-field textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.45; } .cmp-field.has-err .form-control { border-color: var(--red); }
.cmp-chips, .cmp-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.cmp-chip { border: 1px solid var(--line); background: var(--gray-bg); color: var(--brand); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; cursor: pointer; } .cmp-chip:hover { background: var(--brand-soft); }
.cmp-meta { display: flex; justify-content: space-between; align-items: center; background: var(--gray-bg); border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink2); }
.cmp-link { border: 0; background: transparent; color: var(--brand); font-weight: 600; cursor: pointer; font-size: 13.5px; }
.cmp-preview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--card); } .cmp-pv-subj { font-weight: 700; margin-bottom: 6px; } .cmp-pv-body { white-space: pre-wrap; line-height: 1.45; } .cmp-pv-warn { margin-top: 8px; color: var(--red); font-size: 12.5px; font-weight: 600; }
.cmp-err, .cmp-ferr { color: var(--red); font-size: 13px; font-weight: 600; margin: 6px 0 10px; } .cmp-ferr { margin: 5px 0 0; font-size: 12.5px; }
.cmp-foot { display: flex; gap: 10px; padding: 16px 26px 20px; border-top: 1px solid var(--line); background: var(--head-bg); }
.cmp-toast { position: fixed; right: 24px; bottom: 24px; z-index: 300; background: var(--side); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(8px); transition: .25s; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.3); } .cmp-toast.show { opacity: 1; transform: none; } .cmp-toast.bad { background: var(--red); }
.comms .o-card-head { margin-bottom: 4px; } .comms-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.comms-tab { border: 0; background: transparent; padding: 8px 0 9px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; } .comms-tab.on { color: var(--brand); border-bottom-color: var(--brand); } .comms-tab .cnt { margin-left: 6px; background: var(--gray-bg); color: var(--ink2); border-radius: 6px; padding: 0 6px; font-size: 12px; }
.comms-new { padding: 12px 0 6px; } .comms-row { border-bottom: 1px solid var(--line); } .comms-head { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px 0; cursor: pointer; color: var(--ink); }
.comms-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--brand); } .comms-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.comms-st { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; } .comms-st.ok { background: var(--green-bg); color: var(--green); } .comms-st.gray { background: var(--gray-bg); color: var(--ink2); } .comms-st.bad { background: var(--red-bg); color: var(--red); } .comms-st.warn { background: #fff4e0; color: #b86e00; }
.comms-detail { padding: 0 0 12px; font-size: 13px; } .comms-kv { color: var(--muted); font-size: 12px; margin-bottom: 4px; } .comms-kv.bad { color: var(--red); } .comms-text { white-space: pre-wrap; background: var(--gray-bg); border-radius: 10px; padding: 9px 12px; line-height: 1.45; }
/* settings: message templates */
.tpl-sec .tpl-form { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; } .tpl-form.off .form-control { opacity: .6; }
.tpl-top { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; } .tpl-btns { display: flex; gap: 8px; justify-content: flex-end; }
.tpl-sec .form-control { width: 100%; box-sizing: border-box; padding: 9px 14px; } .tpl-sec textarea.form-control { resize: vertical; line-height: 1.45; }
.tpl-add { border-bottom: 0 !important; background: var(--row-alt); border-radius: 12px; padding: 14px !important; margin-top: 10px; }
.mode-banner code { background: rgba(255,255,255,.55); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
@media (max-height: 1020px) { .side-foot { display: none; } .side-sublink { padding-top: 5px; padding-bottom: 5px; } .side-link { padding-top: 9px; padding-bottom: 9px; } .brand { padding-bottom: 8px; } }

/* ---- История изменений (audit) ---- */
.au-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1200; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; }
.au-win { background: var(--card, #fff); color: inherit; border-radius: 12px; width: min(980px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.au-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line, #e5e7eb); }
.au-head h3 { margin: 0; font-size: 17px; }
.au-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted, #6b7280); }
.au-tabs { display: flex; gap: 6px; padding: 10px 20px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.au-tab { border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted, #6b7280); font-size: 14px; }
.au-tab.on { color: inherit; border-bottom-color: var(--brand, #4f46e5); font-weight: 600; }
.au-tab b { font-weight: 600; margin-left: 4px; font-size: 12px; color: var(--muted, #6b7280); }
.au-pane { max-height: 65vh; overflow: auto; padding: 0 20px 16px; }
.au-pane .hint { padding: 16px 0; }
.au-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.au-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted, #6b7280); padding: 10px 10px 8px 0; position: sticky; top: 0; background: var(--card, #fff); }
.au-table td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line, #eef0f3); vertical-align: top; white-space: pre-line; word-break: break-word; }
.au-table td.nw { white-space: nowrap; color: var(--muted, #6b7280); }
.au-table tr.k-create td:nth-child(3), .au-table tr.k-delete td:nth-child(3) { font-weight: 600; }
.au-wide { margin-top: 12px; }
.au-pager { display: flex; gap: 14px; align-items: center; margin-top: 14px; color: var(--muted, #6b7280); }
.history .au-who { color: var(--muted); font-size: 11.5px; }
.history-more { display: inline-block; margin-top: 8px; font-size: 13px; }

.au-filters { grid-template-columns: 260px 300px auto; }
@media (max-width: 900px) { .au-filters { grid-template-columns: 1fr; } }

/* кнопка «История» в шапках карточек и окно как в RetailCRM */
.o-head-right { display: flex; align-items: flex-start; gap: 14px; }
.o-hist { white-space: nowrap; }
.lead-details-bar { margin: 0 0 12px; }
.au-table .au-arrow { font-style: normal; color: var(--muted, #6b7280); margin-right: 8px; }
.au-table td.au-new { white-space: pre-line; }
.au-table td.au-actor { color: var(--brand, #4f46e5); }
.au-table th { font-weight: 500; }

/* панель задачи: комментарии и коммуникации */
.d-notes { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.d-notes .d-h3 { margin: 0 0 10px; } .d-notes .d-h3 small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 4px; }
.note-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.note-list li { border-left: 3px solid var(--brand); padding-left: 12px; font-size: 13px; white-space: pre-line; }
.note-list time { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.note-list .note-empty { border-left-color: var(--line); color: var(--muted); }
.d-comms { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.d-comms .o-card-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.d-comms .o-card-head { margin-bottom: 6px; }
/* page-transition indicator (loading.js): overlay over .main + thin top bar + highlight of the clicked menu item */
#nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1000; pointer-events: none; opacity: 0; background: linear-gradient(90deg, var(--brand), #9a9aff); box-shadow: 0 0 10px rgba(91,91,240,.55); border-radius: 0 3px 3px 0; }
.main-loader { position: fixed; z-index: 900; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s;
  background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); cursor: progress; }
.main-loader.show { opacity: 1; visibility: visible; transition: opacity .25s; }
/* спиннер без рамки: 12 скруглённых лучей с затухающим «хвостом» */
.ml-spin { position: relative; width: 56px; height: 56px; transform: scale(1.35); }
.ml-spin i { position: absolute; left: calc(50% - 2.5px); top: calc(50% - 7px); width: 5px; height: 14px; border-radius: 3px; background: var(--brand); opacity: .12; animation: ml-fade 1.2s linear infinite; }
.ml-spin i:nth-child(1) { transform: rotate(0deg) translateY(-19px); animation-delay: -1.2s; }
.ml-spin i:nth-child(2) { transform: rotate(30deg) translateY(-19px); animation-delay: -1.1s; }
.ml-spin i:nth-child(3) { transform: rotate(60deg) translateY(-19px); animation-delay: -1.0s; }
.ml-spin i:nth-child(4) { transform: rotate(90deg) translateY(-19px); animation-delay: -0.9s; }
.ml-spin i:nth-child(5) { transform: rotate(120deg) translateY(-19px); animation-delay: -0.8s; }
.ml-spin i:nth-child(6) { transform: rotate(150deg) translateY(-19px); animation-delay: -0.7s; }
.ml-spin i:nth-child(7) { transform: rotate(180deg) translateY(-19px); animation-delay: -0.6s; }
.ml-spin i:nth-child(8) { transform: rotate(210deg) translateY(-19px); animation-delay: -0.5s; }
.ml-spin i:nth-child(9) { transform: rotate(240deg) translateY(-19px); animation-delay: -0.4s; }
.ml-spin i:nth-child(10) { transform: rotate(270deg) translateY(-19px); animation-delay: -0.3s; }
.ml-spin i:nth-child(11) { transform: rotate(300deg) translateY(-19px); animation-delay: -0.2s; }
.ml-spin i:nth-child(12) { transform: rotate(330deg) translateY(-19px); animation-delay: -0.1s; }
@keyframes ml-fade { 0% { opacity: 1; } 100% { opacity: .12; } }
.ml-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.is-navigating, html.is-navigating a { cursor: progress; }
.side-link.is-pending, .side-sublink.is-pending { background: rgba(255,255,255,.12); color: #fff; }
@keyframes nav-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ml-spin i { animation-duration: 3s; } }
/* lists: the «Список (N)» tab and «Экспортировать» are not needed - the list is the page itself */
.content-card > .nav-tabs > li.nav-item:has(> a.nav-link.active[href^="javascript"]) { display: none; }
/* no layout jumps: reveal the page once its scripts have built rows/lists; CSS fallback shows it anyway after 1.2 s */
html.js-pending .main { visibility: hidden; animation: main-reveal 0s linear 1.2s forwards; }
@keyframes main-reveal { to { visibility: visible; } }
/* «Коммуникации»: the list has a fixed height (scrolls inside) so the late answer from the server cannot push the blocks below */
.comms-list { height: 176px; overflow-y: auto; overscroll-behavior: contain; }
.comms-tabs { min-height: 38px; } .comms-new { min-height: 50px; }
#phones, #emails { min-height: 48px; }
select[data-ui="select"]:not([data-ui-ready]) { height: 40px; } .v-status select[data-ui="select"]:not([data-ui-ready]), select[data-variant="status"]:not([data-ui-ready]) { height: 46px; }
/* lead card */
.lcard .lead-badge { font-size: 14px; vertical-align: middle; margin-left: 8px; font-weight: 500; }
.lead-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.45; } .lead-banner a { font-weight: 600; }
.lead-banner.ok { background: var(--green-bg); color: var(--green); } .lead-banner.bad { background: var(--red-bg); color: var(--red); } .lead-banner.warn { background: #fff4e0; color: #b86e00; }
.lead-msg { white-space: pre-wrap; background: var(--gray-bg); border-radius: 12px; padding: 12px 14px; line-height: 1.5; margin-bottom: 12px; max-height: 280px; overflow: auto; }
.f-static { padding: 8px 0; } .f-hint { color: var(--muted); display: block; margin-top: 4px; }
.lcard .o-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.lead-task { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.lead-task:hover { background: var(--row-alt); } .lead-task .lt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); } .lead-task.done .lt-dot { background: var(--green); } .lead-task.done .lt-title { color: var(--muted); text-decoration: line-through; }
.lead-task small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.lead-task-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; } .lead-task-form .form-control { width: 100%; box-sizing: border-box; }
.lead-actions { display: flex; flex-direction: column; gap: 12px; } .lead-actions form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .lead-actions small { color: var(--muted); }
.btn-danger-soft { color: var(--red); }

/* resizable side panel */
.drawer-grip { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 5; touch-action: none; }
.drawer-grip::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .15s; }
.drawer-grip:hover::after, .drawer-grip:focus-visible::after, .drawer.resizing .drawer-grip::after { background: var(--brand); }
.drawer-grip:focus-visible { outline: none; }
.drawer.resizing { animation: none; } body.drawer-resizing { user-select: none; cursor: col-resize; }
@media (max-width: 860px) { .drawer-grip { display: none; } }
/* task panel: «Клиент / Лид» field and its picker */
.owner-picker { z-index: 150; }
.owner-field { display: flex; align-items: center; gap: 10px; }
.owner-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); }
.oc-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #7c7cff, #4a4ae0); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; flex: none; }
.oc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; } .oc-text a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .oc-text small { color: var(--muted); }
.oc-kind { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); } .oc-kind.lead { background: #fff4e0; color: #b86e00; }
.owner-tabs { display: flex; gap: 6px; padding: 10px 22px 0; border-bottom: 1px solid var(--line); }
.owner-tabs button { border: 0; background: transparent; padding: 10px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.owner-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); } .owner-tabs b { margin-left: 6px; background: var(--gray-bg); color: var(--ink2); border-radius: 6px; padding: 0 7px; font-size: 12px; } .owner-tabs b:empty { display: none; }
/* navigation links inside histories */
.au-open { margin-left: auto; margin-right: 14px; font-size: 13px; font-weight: 600; } .au-head { display: flex; align-items: center; }
.au-goto { margin-left: 4px; font-weight: 700; text-decoration: none; }
.au-table td a { font-weight: 600; }
/* «Связанное» */
.rel-who { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; text-decoration: none; font-weight: 600; } .rel-who small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.rel-h { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); margin: 10px 0 4px; font-weight: 700; } .rel-h small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.rel-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; } .rel-row:hover { background: var(--row-alt); }
.rel-row span { color: var(--muted); font-size: 12.5px; } .rel-row span.late { color: var(--red); } .rel-row em { font-style: normal; font-weight: 600; } .rel-row.task { grid-template-columns: 1fr auto; } .rel-row.task b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-more { display: block; padding: 6px; font-size: 13px; font-weight: 600; }
.comms-links, .tj-links { display: flex; gap: 12px; margin: 6px 0; font-size: 12.5px; font-weight: 600; }

/* «＋ Новый …» next to the page title */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; } .page-head .page-title { margin: 0; }

.cl-layout.one { grid-template-columns: minmax(0, 760px); }
.owner-chip.empty .oc-avatar { background: var(--gray-bg); color: var(--muted); } .owner-chip.empty .oc-text a { color: var(--muted); pointer-events: none; }

/* обзор: переключатель периода, блок «требует внимания», дельты, график выручки, воронка */
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.seg-switch { display: inline-flex; background: var(--gray-bg); border-radius: 12px; padding: 3px; }
.seg-switch a { padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.seg-switch a.on { background: var(--card); color: var(--text, inherit); box-shadow: var(--shadow); }
.attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.attn-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.attn-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.attn-card.bad::before { background: var(--red); }
.attn-card.bad .kpi-value { color: var(--red); }
.attn-card:hover { opacity: 1; box-shadow: 0 10px 30px rgba(20,24,51,.1); }
.delta { font-size: 12px; font-weight: 600; } .delta.up { color: var(--green); } .delta.down { color: var(--red); } .delta.flat { color: var(--muted); }
.panel { min-width: 0; } .panel h2 small { font-weight: 400; margin-left: 8px; margin-right: auto; }
.dash { padding-bottom: 56px; }
.chart-sum { display: flex; gap: 14px 40px; flex-wrap: wrap; margin: -6px 0 18px; } .chart-sum div { display: flex; flex-direction: column; } .chart-sum b { font-size: 26px; letter-spacing: -.02em; } .chart-sum small { font-size: 12.5px; } .chart-sum .c-done { color: var(--brand); }
.chart { position: relative; }
.plot { position: relative; height: 210px; margin: 8px 0 0 78px; border-bottom: 1px solid var(--line); }
.gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; } .gl span { position: absolute; right: 100%; top: -8px; margin-right: 10px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars2 { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 3px; }
.bar2 { flex: 1 1 0; min-width: 0; position: relative; display: block; text-decoration: none; border-radius: 4px 4px 0 0; }
.bar2:hover { background: var(--gray-bg); opacity: 1; }
.bar2-fill { position: absolute; left: 0; right: 0; background: var(--brand); } .bar2-fill.done { bottom: 0; height: var(--hd); min-height: 2px; }
.bar2-fill.rest { bottom: var(--hd); height: var(--hr); background: #c5c8e8; border-radius: 4px 4px 0 0; } .bar2-fill.done { border-radius: 0 0 0 0; }
.bar2:hover .bar2-fill.done { filter: brightness(1.1); } .bar2:hover .bar2-fill.rest { filter: brightness(.95); }
html[data-theme="dark"] .bar2-fill.rest, html[data-theme="dark"] .dot.rest-dot { background: #3a3f68; }
.dot.rest-dot { background: #c5c8e8; } .legend { flex-wrap: wrap; }
.tip { display: none; position: absolute; bottom: calc(var(--h) + 8px); z-index: 5; white-space: nowrap; background: #141833; color: #fff; border-radius: 10px; padding: 8px 12px; box-shadow: 0 8px 24px rgba(20,24,51,.25); pointer-events: none; }
.tip b { display: block; font-size: 14px; } .tip small { color: #aab0d6; font-size: 11.5px; }
.tip-c { left: 50%; transform: translateX(-50%); } .tip-l { left: 0; } .tip-r { right: 0; }
.bar2:hover .tip { display: block; }
.xlabels { display: flex; gap: 3px; margin: 6px 0 0 78px; } .xlabels span { flex: 1 1 0; min-width: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.fn-group { margin-bottom: 14px; } .fn-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); } .fn-head span { color: var(--muted); }
.row-top small { margin-left: 6px; }
.outcome { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dot.green-dot { background: var(--green); } .dot.red-dot { background: var(--red); } .dot.amber-dot { background: #e9a824; }
.table-wrap { overflow-x: auto; } .mini .r, .mini th.r { text-align: right; white-space: nowrap; }
.note-stale { margin: 12px 0 0; font-size: 12.5px; }

.ff-multi { display: inline-block; max-width: 420px; padding: 8px 12px; border-radius: 10px; background: var(--gray-bg); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

.bar2-fill.cancel { bottom: calc(var(--hd) + var(--hr)); height: var(--hc); background: #f0a3ad; border-radius: 4px 4px 0 0; } .bar2-fill.rest { border-radius: 0; }
.dot.cancel-dot { background: #f0a3ad; } .chart-sum .c-cancel { color: var(--red); } .tip .t-cancel { color: #f0a3ad; }
html[data-theme="dark"] .bar2-fill.cancel, html[data-theme="dark"] .dot.cancel-dot { background: #8a3a48; }

.dash > .panel { margin-bottom: 16px; }

.chart-sum a { display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 6px 10px; margin: -6px -10px; border-radius: 10px; transition: background .15s; } .chart-sum a:hover { background: var(--gray-bg); opacity: 1; }
