/* CRM Vetteria — оформление по макету Figma «DEV Vetteria CRM».
   Цвета макета: бирюзовый #078585, салатовый #BCCF17, текст #424242, фон #F1F3F7.
   Шрифт макета Museo Sans Cyrl платный — используется бесплатный близкий Nunito Sans (лицензия OFL, файлы в /fonts). */
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/nunito-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/nunito-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/nunito-sans-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/nunito-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/nunito-sans-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/nunito-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #078585; --brand-strong: #056b6b; --brand-soft: #e6f3f3; --brand-softer: #f1f8f8;
  --lime: #bccf17; --lime-strong: #8fa000; --lime-soft: #f4f8dc;
  --orange: #f08a2e; --orange-soft: #fdeedf;
  --bg: #f1f3f7; --surface: #fff; --surface-2: #f6f7f9; --row: #f7f8fa;
  --line: #e4e7ec; --line-strong: #d5d9e0;
  --text: #424242; --text-2: #8a909a; --text-3: #b3b8c0;
  --ok: #34a853; --ok-soft: #e4f5e8; --warn: #b07600; --warn-soft: #fdf2d8; --danger: #e5484d; --danger-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 4px 14px rgba(20, 30, 50, .05);
  --shadow-pop: 0 8px 30px rgba(20, 30, 50, .16);
  --radius: 8px;
  --font: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --side-w: 228px; --side-mini: 64px;
  --bar-muted: #d7dee6; --track: #e6e9ed; --chip: #eef0f3;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; line-height: 1.25; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--text-2); } .small { font-size: 12.5px; } .grow { flex: 1; } .nowrap { white-space: nowrap; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-2); }
[hidden] { display: none !important; }
.u { text-decoration: underline; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.right { margin-left: auto; }
.center { text-align: center; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(20, 30, 50, .05); transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(7, 133, 133, .25); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.outline { border-color: var(--brand); color: var(--brand); box-shadow: none; }
.btn.outline:hover { background: var(--brand-softer); }
.btn.danger { color: var(--danger); border-color: #f2c4c5; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--brand); padding: 0; min-height: 0; font-weight: 600; }
.btn.link:hover { text-decoration: underline; }
.btn .spin, .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.add-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 13px; background: none; border: 0; padding: 4px 0; cursor: pointer; font-family: inherit; }
.add-link:hover { text-decoration: underline; }
.input { width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.invalid { border-color: var(--danger); }
textarea.input { min-height: 76px; resize: vertical; }
select.input { padding-right: 28px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a909a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--text-2); }
.field .err { font-size: 12.5px; color: var(--danger); }
.req { color: var(--danger); }
.code-input { font-size: 22px; letter-spacing: 6px; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; min-height: 30px; }
.check input, input.cb { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .knob { width: 40px; height: 22px; border-radius: 99px; background: #d9dde3; position: relative; transition: background .15s; flex: none; }
.switch .knob::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .knob { background: var(--brand); }
.switch.lime input:checked + .knob { background: var(--lime); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { box-shadow: 0 0 0 3px var(--brand-soft); }
.switch input:disabled + .knob { opacity: .5; }

/* ---------- каркас: меню слева, шапка, страница ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30; transition: width .15s; }
.side-head { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 12px 0 16px; flex: none; }
.side-logo { display: flex; align-items: center; min-width: 0; }
.side-logo img { height: 46px; max-width: 170px; object-fit: contain; }
.side-collapse { color: var(--text-2); }
.nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav a, .nav .nav-grp { display: flex; align-items: center; gap: 9px; padding: 0 12px 0 16px; min-height: 40px; color: var(--text); font-size: 13.5px; position: relative;
  border: 0; background: none; width: 100%; font-family: inherit; cursor: pointer; text-align: left; }
.nav a:hover, .nav .nav-grp:hover { background: var(--surface-2); text-decoration: none; }
.nav .icon { color: #6b7280; flex: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav a.active::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--lime); }
.nav a.active .icon { color: var(--brand); }
.nav .chev { margin-left: auto; color: var(--text-2); transition: transform .15s; }
.nav .nav-grp.open .chev { transform: rotate(180deg); }
.nav .nav-grp.has-active { color: var(--brand); font-weight: 700; }
.nav .nav-grp.has-active .icon { color: var(--brand); }
.nav .sub a { padding-left: 30px; min-height: 36px; font-size: 13px; }
.nav .sub a::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); flex: none; margin-right: 4px; }
.nav .sub a.active::before { background: var(--brand); }
.nav .sub a .soon { margin-left: auto; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.nav-count { background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; margin-left: auto; }
.side-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.side-foot .org-dot { width: 22px; height: 22px; flex: none; }
.side-foot .ver { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--text-3); }
.side-logo .logo-mini { display: none; height: 32px; width: 32px; }
.side-toggle { flex: none; display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 16px; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.side-toggle:hover { background: var(--surface-2); color: var(--brand); }
.side-toggle .icon { flex: none; transition: transform .15s; }
.nav-dot { display: none; }
/* Всплывающее название и подпункты у свёрнутого меню */
.nav-fly { position: fixed; left: calc(var(--side-mini) + 6px); min-width: 220px; max-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-pop); padding: 6px; z-index: 45; }
.nav-fly::before { content: ''; position: absolute; left: -8px; top: 0; bottom: 0; width: 8px; }
.nav-fly-title { display: block; padding: 8px 10px; font-weight: 700; font-size: 13.5px; color: var(--text); }
a.nav-fly-title:hover { color: var(--brand); text-decoration: none; }
.nav-fly > div.nav-fly-title { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-fly a:not(.nav-fly-title) { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
.nav-fly a:not(.nav-fly-title):hover { background: var(--surface-2); text-decoration: none; }
.nav-fly a.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.nav-fly .soon { margin-left: auto; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
@media (min-width: 861px) {
  [data-side="mini"] .side { width: var(--side-mini); }
  [data-side="mini"] .side-head { justify-content: center; padding: 0; }
  [data-side="mini"] .side-logo .logo-full { display: none; }
  [data-side="mini"] .side-logo .logo-mini { display: block; }
  [data-side="mini"] .nav { overflow-x: hidden; }
  [data-side="mini"] .nav a, [data-side="mini"] .nav .nav-grp { justify-content: center; padding: 0; min-height: 44px; }
  [data-side="mini"] .nav .grow, [data-side="mini"] .nav .chev, [data-side="mini"] .nav .sub, [data-side="mini"] .nav .nav-count { display: none; }
  [data-side="mini"] .nav a:has(.nav-count)::before, [data-side="mini"] .nav-dot { content: ''; display: block; position: absolute; top: 9px; left: calc(50% + 5px); width: 8px; height: 8px;
    border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
  [data-side="mini"] .side-toggle { justify-content: center; padding: 0; }
  [data-side="mini"] .side-toggle span { display: none; }
  [data-side="mini"] .side-toggle .icon { transform: scaleX(-1); }
  [data-side="mini"] .side-foot { justify-content: center; padding: 12px 0; }
  [data-side="mini"] .side-foot .org-name, [data-side="mini"] .side-foot .ver { display: none; }
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.back-btn { color: var(--text); }
.burger { display: none; }
.gsearch { position: relative; width: 300px; }
.gsearch-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid transparent; border-radius: 8px; padding: 0 12px; height: 38px; color: var(--text-2); }
.gsearch-box:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.gsearch-box input { border: 0; outline: 0; background: none; font: inherit; flex: 1; min-width: 0; color: var(--text); }
.gsearch-pop { position: absolute; top: 44px; right: 0; width: 420px; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 8px; z-index: 40; max-height: 70vh; overflow: auto; }
.gs-sec { font-size: 11.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px 4px; }
.gs-item { display: flex; flex-direction: column; padding: 7px 8px; border-radius: 6px; color: var(--text); cursor: pointer; }
.gs-item:hover, .gs-item.hl { background: var(--brand-softer); text-decoration: none; }
.gs-item b { font-weight: 700; }
.gs-empty { padding: 12px; color: var(--text-2); text-align: center; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--text); position: relative; }
.round-btn:hover { background: var(--brand-soft); color: var(--brand); }
.bell-count { position: absolute; top: -3px; right: -3px; background: var(--lime); color: #2e3400; border-radius: 99px; font-size: 10.5px; font-weight: 700; line-height: 18px; min-width: 18px; padding: 0 4px; text-align: center; border: 2px solid #fff; }
.bell-area { position: relative; }
.user-area { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-btn:hover { background: var(--surface-2); }
.user-name { text-align: right; line-height: 1.2; }
.user-name b { font-size: 13.5px; }
.user-name span { font-size: 11.5px; color: var(--text-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 130px; height: 130px; font-size: 40px; background: #eef0f3; color: #c3c8cf; }
.avatar.md { width: 48px; height: 48px; font-size: 16px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.menu-pop { position: absolute; right: 0; top: 50px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-pop); min-width: 210px; padding: 6px; z-index: 30; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.menu-pop a .icon, .menu-pop button .icon { color: var(--brand); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-softer); text-decoration: none; }
.content { padding: 24px 24px 48px; width: 100%; max-width: 1500px; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; min-height: 40px; }
.page-head h1 { margin-right: auto; }
.page-sub { display: flex; align-items: center; gap: 18px; margin: -6px 0 14px; flex-wrap: wrap; font-size: 13.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: 180px; }
.toolbar .search { flex: 1 1 300px; min-width: 220px; }
.nav-back { display: none; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: var(--lime); color: #2e3400; font-size: 11.5px; font-weight: 700; padding: 0 6px; vertical-align: middle; margin-left: 6px; }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs button, .tabs a { border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-2); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs button.on, .tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 11.5px; margin-left: 4px; }
.tabs .count.red { background: var(--danger); color: #fff; }
/* «Папки» в карточке клиента */
.ftabs { display: flex; gap: 6px; padding: 0 0; overflow-x: auto; position: relative; z-index: 1; margin-bottom: -1px; }
.ftabs button { border: 1px solid var(--line); border-bottom: 0; background: #eef0f3; color: var(--text); font: inherit; font-size: 13.5px; padding: 9px 22px; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; min-width: 150px; }
.ftabs button.on { background: var(--surface); font-weight: 700; padding-bottom: 10px; }
.ftab-body { border: 1px solid var(--line); border-radius: 0 8px 8px 8px; padding: 22px; background: var(--surface); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.subtabs button { border: 0; background: none; font: inherit; color: var(--text); padding: 8px 18px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

/* ---------- таблицы ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.table-wrap.dim { opacity: .6; transition: opacity .15s; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 13px; color: var(--text); font-weight: 700; padding: 12px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--brand); }
.table th .sort { font-size: 10px; color: var(--brand); margin-left: 3px; }
.table td { padding: 10px 12px; border-bottom: 0; vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: var(--row); }
.table tbody tr.sel td { background: var(--lime-soft); }
.table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--brand-softer); }
.table tr.off td { color: var(--text-2); }
.table td.cb, .table th.cb { width: 44px; padding-right: 0; }
.table td.num, .table th.num { width: 40px; color: var(--text-2); }
.table td.acts { width: 1%; white-space: nowrap; text-align: right; }
.table .strong { font-weight: 700; }
.table .ellipsis { max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .client-name { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.table td { white-space: nowrap; }
.table td.wrap, .table td .changes, .table td.ellipsis-wrap { white-space: normal; }
.table tr.total td { background: var(--surface-2); font-weight: 700; }
.table-scale { transform-origin: top left; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); }
/* В широкой таблице на телефоне надпись «нет данных» видна у левого края, а не в середине прокрутки */
@media (max-width: 900px) { td.empty { text-align: left; } }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }
.pager .info { color: var(--text-2); }
.pager .info b { color: var(--text); }
.pager .pages { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.pager .pg { min-width: 28px; height: 28px; border-radius: 6px; border: 0; background: none; font: inherit; cursor: pointer; color: var(--text); }
.pager .pg.on { background: var(--surface); box-shadow: 0 1px 4px rgba(20,30,50,.15); font-weight: 700; }
.pager .pg:disabled { color: var(--text-3); cursor: default; }
.pager .dots { color: var(--text-2); letter-spacing: 2px; }
.pager select.input { width: auto; min-height: 30px; padding: 2px 26px 2px 8px; font-size: 12.5px; }
.selbar { display: flex; align-items: center; gap: 20px; margin: -6px 0 12px; font-size: 13.5px; flex-wrap: wrap; }
.selbar .btn.link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.selbar .btn.link .icon { color: var(--brand); }
.row-menu { position: absolute; right: 8px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 5; min-width: 190px; }
.row-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; background: none; border: 0; font: inherit; cursor: pointer; border-radius: 6px; text-align: left; color: var(--text); }
.row-menu button:hover { background: var(--brand-softer); }

/* ---------- метки ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text); white-space: nowrap; line-height: 18px; }
.badge.ok, .badge.active { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger, .badge.inactive { background: var(--danger-soft); color: var(--danger); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.lime { background: var(--lime-soft); color: #5d6a00; }
.badge.orange { background: var(--orange-soft); color: #b85d0c; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 99px; font-size: 12px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tag.peach { background: #fde3d8; color: #d0602f; }
.tag .x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; opacity: .7; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.abc { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex: none; }
.abc.A { background: var(--orange); } .abc.B { background: var(--lime); } .abc.C { background: var(--brand); }
.abc.none { background: #e1e4e8; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; }
.prio::before { content: ''; width: 10px; height: 10px; clip-path: polygon(0 0, 100% 0, 75% 50%, 100% 100%, 0 100%); background: currentColor; }
.prio.low { color: #8fa000; } .prio.medium { color: #d4b106; } .prio.high { color: var(--orange); } .prio.critical { color: var(--danger); }
.prio span { color: var(--text); }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.alert.error { background: var(--danger-soft); color: #b3262b; }
.alert.info { background: var(--brand-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.ok { background: var(--ok-soft); }
.alert .grow { min-width: 0; }

/* ---------- окна ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 32, 36, .55); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.modal.wide { max-width: 780px; }
.modal.form { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 22px 24px 6px; position: relative; }
.modal-head h2 { margin: 0; flex: 1; text-align: center; font-size: 20px; font-weight: 600; }
.modal-head .btn.ghost { position: absolute; right: 12px; top: 12px; }
.modal-body { padding: 14px 24px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 22px; flex-wrap: wrap; }
.modal-foot .btn { min-width: 110px; }
.stepdots { display: flex; gap: 4px; justify-content: center; margin: 4px 0 6px; }
.stepdots span { width: 8px; height: 4px; border-radius: 2px; background: #e3e6ea; }
.stepdots span.on { width: 16px; background: var(--brand); }
.stepdots span.done { background: #a7d4d4; }
.dropzone { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 16px; text-align: center; color: var(--text-2); font-size: 12.5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-softer); }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.file-chip .grow { min-width: 0; }
.file-chip b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: #2c3236; color: #fff; padding: 11px 15px; border-radius: 9px; box-shadow: var(--shadow-pop); max-width: 420px; display: flex; align-items: center; gap: 14px; }
.toast-act { border: 0; background: none; color: #8fe3e1; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 2px; min-height: 32px; }
.toast.error { background: var(--danger); }
/* Всплывающее уведомление (закрывается само через минуту) */
.npop { position: fixed; right: 20px; top: 76px; z-index: 55; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 24px); }
.npop-item { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-pop); border: 1px solid var(--brand); padding: 12px 14px; display: flex; gap: 10px; animation: slidein .2s ease-out; }
.npop-item .grow { min-width: 0; cursor: pointer; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 30px 28px; }
.auth-card .auth-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-card .auth-logo img { height: 76px; }
.auth-card h1 { font-size: 18px; margin-bottom: 18px; text-align: center; font-weight: 600; }
.auth-card .brand { display: none; }
.qr { display: grid; place-items: center; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 10px auto; width: 216px; }
.qr svg { width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px; background: var(--surface-2); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; margin: 10px 0; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 6px; }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.tight { grid-template-columns: 200px 1fr; }
.link-box { display: flex; gap: 8px; align-items: center; padding: 10px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; margin: 10px 0; }
.link-box code { flex: 1; overflow-wrap: anywhere; font-size: 13px; }
.changes { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.changes li { margin: 2px 0; }
.welcome { max-width: 640px; }
.show-sm { display: none; }
.show-md { display: none; }

/* ---------- клиенты ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2 .span2 { grid-column: 1 / -1; }
.grid2 > .card + .card { margin-top: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.seg { display: inline-flex; border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 14px; background: var(--bg); flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 600; flex: 1; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg.block { display: flex; width: 100%; }
.optbtns { display: flex; gap: 8px; }
.optbtns button { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.optbtns button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-softer); font-weight: 600; }
.contact-edit { border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px 0; margin: 8px 0 10px; background: var(--surface-2); }
.contact-edit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.matches { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 12px; background: var(--surface); }
.matches-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.match { padding: 7px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.match:first-of-type { border-top: 0; }
.match .badge { align-self: flex-start; }
.dup-box { margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--warn-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badges:empty { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-weight: 600; }
.client-name { font-weight: 700; color: var(--text); }
.cl-name { display: flex; align-items: center; gap: 8px; }
.cl-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.cl-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-title h1 { font-size: 20px; font-weight: 700; }
.cl-title .abc { width: 22px; height: 22px; font-size: 12px; }
.cl-meta { display: flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.cl-meta b { color: var(--text); }
.cl-side { margin-left: auto; font-size: 13px; color: var(--text-2); text-align: right; }
.cl-side b { color: var(--text); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 36px; }
.info-block { display: flex; gap: 16px; }
.info-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.info-block h3 { font-size: 16px; font-weight: 600; margin: 6px 0 8px; }
.ikv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.ikv.wide { grid-template-columns: 200px minmax(0, 1fr); gap: 8px 14px; }
.ikv dt { color: var(--text-2); }
.ikv dd { margin: 0; overflow-wrap: anywhere; }
.ikv dd small { color: var(--text-2); }
.comments { margin-top: 22px; }
.comments-head { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.cm { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; padding: 8px 0 8px 54px; font-size: 13px; align-items: start; }
.cm .who { color: var(--text-2); }
.cm .who b { color: var(--text); font-weight: 600; display: block; }
.cm .when { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.cm .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-actions { display: flex; gap: 2px; margin-top: 2px; }
.editor { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; background: var(--surface); }
.editor:focus-within { border-color: var(--brand); }
.editor-tools { display: flex; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.editor-tools b, .editor-tools i, .editor-tools u { cursor: default; }
.editor-row { display: flex; align-items: flex-end; gap: 8px; padding: 4px 8px 4px 12px; }
.editor textarea { border: 0; outline: 0; flex: 1; resize: none; font: inherit; font-size: 13.5px; min-height: 40px; padding: 8px 0; background: none; color: var(--text); }
.chart { display: flex; align-items: flex-end; gap: 22px; height: 180px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); position: relative; }
.chart .bar { flex: 1; max-width: 64px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .bar span { width: 100%; border-radius: 3px 3px 0 0; }
.chart .bar small { position: absolute; bottom: -22px; font-size: 11px; color: var(--brand); white-space: nowrap; }
.chart .bar b { font-size: 11px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.chart-wrap { padding-bottom: 28px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.contact-cards .card + .card { margin-top: 0; }
.contact-card.off { opacity: .6; }
.contact-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.contact-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channels { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.channels a { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li + li::before { background: var(--line-strong); }
.list-info { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-bottom: 8px; }
.dict-list { list-style: none; margin: 0 0 8px; padding: 0; }
.dict-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.dict-list li.off { color: var(--text-2); }
.dict-list .input { flex: 1; }
.req-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.req-row:first-child { border-top: 0; }
.group-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px 2px; margin-bottom: 12px; position: relative; }
.group-box .rm { position: absolute; top: 6px; right: 6px; }
.pop { position: absolute; z-index: 45; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 8px; min-width: 220px; }
.pop .opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pop .opt:hover { background: var(--brand-softer); }
.pop .find { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 4px 6px 8px; margin-bottom: 4px; color: var(--text-2); }
.pop .find input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; }
.msel { position: relative; }
.msel-box { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 30px 4px 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: pointer; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a909a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.msel-box .ph { color: var(--text-3); padding-left: 5px; font-size: 13.5px; }
.msel .pop { left: 0; right: 0; top: 42px; max-height: 260px; overflow: auto; }
.filter-pop { position: absolute; right: 0; top: 46px; width: 300px; padding: 16px; z-index: 40; }
.filter-pop .field { margin-bottom: 12px; }
.filter-pop .check { display: flex; }
.cols-pop { position: absolute; right: 0; top: 46px; width: 260px; z-index: 40; }
.cols-pop .opt { cursor: grab; }
.rel { position: relative; }

/* ---------- история общения и задачи (этап 1) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.radio-list { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.sub-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px 0; margin-top: 6px; }
.field.sub-card { padding-bottom: 12px; }
.due-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.due-row .input { width: auto; flex: 1 1 200px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed .card + .card { margin-top: 0; }
.act { display: flex; gap: 12px; padding: 14px 16px; }
.act-icon { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.act-body { flex: 1; min-width: 0; }
.act-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.act-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 4px; }
.act-task { font-size: 13px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--brand-strong); }
.act-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.act.cancelled { opacity: .65; }
.act.cancelled .act-text { text-decoration: line-through; }
.task-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.task-row.overdue { border-left: 3px solid var(--danger); }
.task-row.off { opacity: .75; }
.task-row.click { cursor: pointer; }
.task-row.click:hover { border-color: var(--brand); }
.task-actions { display: flex; gap: 6px; }
.task-due { width: 118px; flex: none; font-weight: 700; font-size: 13.5px; color: var(--brand-strong); }
.task-due.late { color: var(--danger); }
.task-title { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.task-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.seg4 button { padding: 7px 10px; }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 12px; }
.flag { align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.flag > span { display: flex; flex-direction: column; gap: 1px; }
.flag.on { border-color: var(--ok); background: var(--ok-soft); }
.flag input { margin-top: 3px; }
.base-switch { min-height: 26px; padding: 0 8px; font-size: 12px; }
.demo-card .alert { margin: 10px 0; }

/* ---------- уведомления ---------- */
.bell-pop { position: absolute; right: -40px; top: 52px; width: min(400px, calc(100vw - 24px)); max-height: 76vh; overflow: hidden; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-pop); z-index: 30; display: flex; flex-direction: column; }
.bell-pop .bp-head { text-align: center; font-weight: 700; font-size: 15px; padding: 14px 40px 4px; position: relative; }
.bell-pop .bp-head .btn { position: absolute; right: 6px; top: 6px; }
.bell-pop .tabs { margin: 0 14px; justify-content: space-around; flex-shrink: 0; }
.bell-pop .bp-head, .bell-pop .bp-foot { flex-shrink: 0; }
.bell-pop .bp-list { overflow: auto; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ncard { background: var(--row); border-radius: 8px; padding: 12px 14px; border: 1px solid transparent; cursor: pointer; }
.ncard:hover { border-color: var(--line-strong); }
.ncard.unread { border-color: var(--brand); background: var(--brand-softer); }
.ncard-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.ncard-title .rd { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.ncard-body { font-size: 12.5px; margin: 4px 0 6px; color: var(--text); overflow-wrap: anywhere; }
.ncard-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; flex-wrap: wrap; }
.notif { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 6px; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-softer); }
.notif-icon { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.notif.task\.overdue .notif-icon { color: var(--danger); background: var(--danger-soft); }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-all { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line); font-weight: 600; }

/* ---------- главная: вкладки и виджеты ---------- */
.home-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; }
.home-tabs button { border: 0; background: none; font: inherit; font-size: 15px; padding: 10px 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.home-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.widget { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; }
.widget.w2 { grid-column: span 2; }
.widget.w3 { grid-column: 1 / -1; }
.w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 26px; }
.w-head h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.w-head .right { display: flex; align-items: center; gap: 8px; }
.w-more { font-size: 12.5px; font-weight: 700; text-decoration: underline; }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; font-size: 12.5px; color: var(--text-2); }
.w-body { max-height: 330px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.wtabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.wtabs button { flex: 1; border: 0; background: none; font: inherit; padding: 6px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.wtabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.wt { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wt:last-child { border-bottom: 0; }
.wt:hover .wt-title { color: var(--brand); }
.wt-check { width: 20px; height: 20px; border-radius: 50%; border: 0; background: #e7e9ec; flex: none; margin-top: 1px; cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0; }
.wt-check:hover { background: #cfd4d9; }
.wt-check.on { background: var(--brand); }
.wt-main { flex: 1; min-width: 0; }
.wt-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt.done .wt-title { text-decoration: line-through; color: var(--text-2); }
.wt-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text); margin-top: 3px; }
.wt-meta .who { display: inline-flex; align-items: center; gap: 5px; }
.wt-meta .who::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #d9dde2; }
.wt-meta .late { color: var(--danger); font-weight: 700; }
.wt-meta .client { color: var(--brand); }
.wt-mark { font-size: 10.5px; padding: 0 6px; border-radius: 4px; background: var(--lime-soft); color: #5d6a00; }
.note { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; min-height: 120px; border: 1px solid transparent; }
.note:hover { border-color: var(--brand); }
.note-head { display: flex; align-items: flex-start; gap: 8px; }
.note-head b { flex: 1; font-size: 13.5px; }
.note-text { font-size: 12.5px; margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.note-date { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.notes-grid .note { background: var(--bg); margin: 0; }
.soon-w { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--text-2); min-height: 150px; font-size: 13px; }
.soon-w .icon { color: var(--text-3); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 8px; background: var(--row); cursor: pointer; font: inherit; color: inherit; text-align: left; border: 1px solid transparent; }
.kpi:hover { border-color: var(--brand); }
.kpi b { font-size: 24px; line-height: 1.1; font-weight: 700; }
.kpi small { color: var(--text-2); font-size: 12px; }
.kpi.red b { color: var(--danger); } .kpi.teal b { color: var(--brand); } .kpi.lime b { color: var(--lime-strong); } .kpi.green b { color: var(--ok); }
.kpis.five { grid-template-columns: repeat(5, 1fr); }
.kpi { flex-direction: row; align-items: center; gap: 12px; background: var(--surface); }
.kpi .kpi-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--row); color: var(--text-2); }
.kpi > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi.red .kpi-ic { background: var(--danger-soft); color: var(--danger); }
.kpi.teal .kpi-ic { background: var(--brand-soft); color: var(--brand); }
.kpi.green .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi.lime .kpi-ic { background: var(--lime-soft); color: var(--lime-strong); }
.ctl .seg button { white-space: nowrap; flex: none; }
.ctl .kpis { margin-bottom: 14px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px 0; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.wd:hover { background: var(--surface-2); }
.wd-bar { width: 14px; height: 56px; border-radius: 7px; background: var(--bg); display: flex; align-items: flex-end; overflow: hidden; }
.wd-bar span { width: 100%; background: var(--brand); border-radius: 7px; }
.wd.today .wd-bar span { background: var(--lime); }
.wd b { font-size: 12.5px; min-height: 18px; }
.wd small { font-size: 11px; color: var(--text-2); }
.wd.today small { color: var(--brand); font-weight: 700; }
.base-bar { height: 12px; border-radius: 99px; background: #e6e9ed; overflow: hidden; }
.base-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--lime)); border-radius: 99px; }
.base-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.base-legend a { color: var(--text); display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.akb { background: var(--brand); } .dot.okb { background: #d3d8de; }
.nn { display: flex; flex-direction: column; padding: 7px 0; border-top: 1px solid var(--line); color: var(--text); }
.nn:first-of-type { border-top: 0; }
.nn:hover { text-decoration: none; color: var(--brand); }
.wlist-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.wlist-row:last-child { border-bottom: 0; }
.wm-list { display: flex; flex-direction: column; gap: 8px; }
.wm-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13.5px; }
.wm-item.drag { opacity: .5; }
.wm-item .handle { cursor: grab; color: var(--text-3); }

/* ---------- контроль команды (этап 1) ---------- */
.ctl { max-width: 1400px; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.period .seg { margin: 0; }
.period .input { width: auto; }
.table .num { text-align: center; width: 1%; white-space: nowrap; }
.pill { min-width: 44px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.pill:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pill:disabled { cursor: default; color: var(--text-2); font-weight: 500; }
.pill.flat { display: inline-block; cursor: default; }
.pill.red { background: var(--danger); border-color: var(--danger); color: #fff; }
.pill.green { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.mini-base { height: 8px; width: 140px; border-radius: 99px; background: #e6e9ed; overflow: hidden; margin: 3px 0 4px; }
.mini-base span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--lime)); }
.ctl-cards { display: none; }
.ctl-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ctl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ctl-grid button { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border: 0; border-radius: 9px; padding: 8px 4px; font: inherit; cursor: pointer; color: var(--text); }
.ctl-grid b { font-size: 20px; }
.ctl-grid small { color: var(--text-2); font-size: 11px; }
.ctl-grid .red { background: var(--danger-soft); color: var(--danger); }
.ctl-grid .green { background: var(--ok-soft); color: var(--ok); }
.ctl-grid .warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- профиль, пользователи, роли, настройки ---------- */
.profile-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-grid > .card + .card, .settings + .card { margin-top: 0; }
.profile-side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 34px 20px; }
.avatar-edit { position: relative; margin-bottom: 14px; }
.avatar-edit .cam { position: absolute; right: 2px; bottom: 2px; width: 38px; height: 38px; border-radius: 50%; background: var(--lime); color: #fff; border: 3px solid #fff; display: grid; place-items: center; cursor: pointer; }
.perm-group { border-bottom: 1px solid var(--line); padding: 10px 0; }
.perm-group summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.perm-group summary::-webkit-details-marker { display: none; }
.perm-group .items { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 0 4px; }
.settings { display: grid; grid-template-columns: 250px 1fr; min-height: 520px; padding: 0; overflow: hidden; }
.settings-menu { border-right: 1px solid var(--line); padding: 10px 0; }
.settings-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; background: none; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; color: var(--text); }
.settings-menu button:hover { background: var(--surface-2); }
.settings-menu button.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.settings-menu button .soon { margin-left: auto; font-size: 10.5px; color: var(--text-3); }
.settings-body { padding: 24px 28px; }
.settings-body h2 { font-size: 18px; font-weight: 600; margin-bottom: 18px; }
.nrow { display: flex; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.nrow:last-child { border-bottom: 0; }
.nrow .grow small { display: block; color: var(--text-2); font-size: 11.5px; }
.logo-prev { height: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: inline-flex; align-items: center; }
.logo-prev img { max-height: 44px; }
.soon-page { max-width: 760px; }
.soon-hero { display: flex; gap: 18px; align-items: flex-start; }
.soon-hero .info-ic { width: 52px; height: 52px; }
.soon-list { margin: 12px 0 0; padding-left: 18px; }
.soon-list li { margin: 4px 0; }

@media (max-width: 1200px) {
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.w2 { grid-column: 1 / -1; }
  .kpis.five { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .hide-md { display: none; }
  .show-md { display: inline; }
  .gsearch { width: 220px; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .shell.navopen .side { transform: none; }
  .side-toggle, .nav-fly { display: none; }
  .shell.navopen .nav-back { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 35; }
  .burger { display: inline-flex; }
  .back-btn { display: none; }
  .top { padding: 0 10px; gap: 8px; }
  .gsearch { width: auto; flex: 1; }
  .gsearch-pop { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
  .content { padding: 16px 12px 40px; }
  .user-name { display: none; }
  .toolbar .input, .toolbar .search { min-width: 0; width: 100%; flex: 1 1 100%; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .modal-back { padding: 0; align-items: end; }
  .modal, .modal.form { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .kv.tight { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .widgets { grid-template-columns: 1fr; }
  .widget.w2, .widget.w3 { grid-column: auto; }
  .kpis, .kpis.five { grid-template-columns: 1fr 1fr; }
  .profile-grid, .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-menu { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .settings-menu button { white-space: nowrap; }
  .ftabs button { min-width: 0; flex: none; padding: 8px 12px; }
  .ftab-body { padding: 14px; }
  .ikv, .ikv.wide { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .ikv dd { margin-bottom: 6px; }
  .cm { grid-template-columns: 1fr; padding-left: 0; gap: 2px; }
  .cl-side { margin-left: 0; text-align: left; }
  .ctl-table { display: none; }
  .ctl-cards { display: flex; flex-direction: column; gap: 10px; }
  .ctl-cards .card + .card { margin-top: 0; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .flags { grid-template-columns: 1fr; }
  .task-due { width: 100%; }
  .task-actions { width: 100%; }
  .task-actions .btn { flex: 1; }
  .act { padding: 12px; }
  .act-icon { display: none; }
  .bell-pop { position: fixed; right: 8px; left: 8px; top: 60px; width: auto; }
  .page-head .btn { flex: 1 1 auto; }
  .filter-pop, .cols-pop { position: fixed; left: 8px; right: 8px; top: 70px; width: auto; }
}
.audit-bar .input { min-width: 0; }
.audit-bar select.input { flex: 0 1 170px; }
.audit-bar input[type=date] { flex: 0 0 140px; }
.audit-bar .search { flex: 1 1 200px; min-width: 160px; }
.table.tight-head th { white-space: normal; }
.table.tight-head .ellipsis { max-width: 170px; }

/* ===== Этап 2: продукты, заказы, бронь, отчёты, воронка, план ===== */
.table tr.grp td { background: #eef1f5; font-weight: 700; }
.table tr.grp.l0 td { background: #e4e8ee; }
.table tr.grp.l-1 td { background: var(--brand-soft); font-weight: 700; }
.table tr.grp .caret { display: inline-block; width: 16px; cursor: pointer; color: var(--text-2); transition: transform .15s; }
.table tr.grp .caret.closed { transform: rotate(-90deg); }
.table td.sub { padding-left: 28px; }
.table td.sub2 { padding-left: 44px; }
.trend { display: inline-flex; flex-direction: column; align-items: center; font-size: 10.5px; line-height: 1.1; cursor: pointer; min-width: 44px; }
.trend b { font-size: 13px; }
.trend.up { color: var(--ok); } .trend.down { color: var(--danger); } .trend.flat { color: var(--text-3); }
.neg { color: var(--danger); } .pos { color: var(--ok); }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.r, .table th.r { text-align: right; }
.st { display: inline-flex; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 18px; background: var(--surface-2); }
.st-created { background: #e8f5e9; color: #2e7d32; }
.st-confirmed { background: #fff6cc; color: #8a6d00; }
.st-docs { background: #fde2e2; color: #c62828; }
.st-docsdone { background: #ede7f6; color: #5e35b1; }
.st-ready { background: #e3f0fb; color: #1565c0; }
.st-shipping { background: #fde8d7; color: #c25a0c; }
.st-shipped { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: #eceff1; color: #78909c; text-decoration: line-through; }
.bk-in_progress { background: #fde8d7; color: #c25a0c; } .bk-waiting { background: #fff6cc; color: #8a6d00; } .bk-done { background: var(--ok-soft); color: var(--ok); } .bk-cancelled { background: #fde2e2; color: #c62828; }
.pay-cash { background: var(--ok-soft); color: var(--ok); } .pay-card { background: var(--lime-soft); color: #5d6a00; } .pay-transfer { background: #e3f0fb; color: #1565c0; } .pay-credit { background: #fde2e2; color: #c62828; } .pay-payment { background: var(--brand-soft); color: var(--brand); }
.st-select { border: 0; font: inherit; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 2px 8px; cursor: pointer; }
.doc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 30px; margin: 10px 0 16px; }
.doc-head dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.doc-head dt { color: var(--text-2); } .doc-head dd { margin: 0; font-weight: 600; }
.totals { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 36px; font-size: 13.5px; margin: 14px 0; }
.totals span { color: var(--text-2); margin-right: 10px; }
/* minmax(0, 1fr): широкий график или таблица не растягивают колонку и страницу */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.two-col > * { min-width: 0; }
.timeline2 { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline2 li { position: relative; padding: 0 0 14px 14px; }
.timeline2 li::before { content: ''; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #cfd6dd; border: 2px solid #fff; }
.timeline2 li:first-child::before { background: var(--brand); }
.timeline2 .who { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.hint-red { color: var(--danger); font-size: 12px; } .hint-ok { color: var(--text-2); font-size: 12px; }
.qty-input { width: 92px; padding: 6px 8px; min-height: 0; }
.picker-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.picker-list .table td { padding-top: 6px; padding-bottom: 6px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 248px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kcol.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.kcol-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 8px; font-weight: 700; font-size: 13.5px; }
.kcol-head .cnt { color: var(--brand); }
.kcol-head .sp { margin-left: auto; }
.kcol-body { overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 10px 8px; background: #fff; cursor: grab; font-size: 12.5px; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard.stale { border-left-color: var(--danger); background: #fffafa; }
.kcard b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.kcard .ln { display: flex; gap: 6px; align-items: center; color: var(--text-2); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kcard .ft { display: flex; gap: 10px; align-items: center; margin-top: 8px; color: var(--text-3); font-size: 11.5px; }
.kcard .ft .sp { margin-left: auto; }
.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg text { font-family: inherit; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sum-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sum-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sum-tile b { display: block; font-size: 20px; margin-top: 2px; }
.sum-tile small { color: var(--text-2); font-size: 12px; }
.sum-tile.abc-a b { color: var(--ok); } .sum-tile.abc-b b { color: #c28a00; } .sum-tile.abc-c b { color: var(--danger); }
.abcb { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; }
.abcb.A { background: #2e9d5b; } .abcb.B { background: #e0a200; } .abcb.C { background: #e0573d; }
.report-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 30px; font-size: 13px; margin: 8px 0 14px; }
.report-meta span { color: var(--text-2); margin-right: 8px; }
.plan-table th, .plan-table td { white-space: nowrap; }
.plan-table td.edit { cursor: text; }
.plan-table td.edit:hover { outline: 1px dashed var(--brand); }
.plan-table input { width: 80px; padding: 4px 6px; min-height: 0; }
.progress { height: 8px; border-radius: 99px; background: #e9edf1; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--lime)); }
.funnel-bars .fb { display: grid; grid-template-columns: 210px 1fr 60px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.funnel-bars .fb .bar { height: 26px; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #2bb3a3); min-width: 3px; }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 4px; }
.gantt-track { position: relative; height: 16px; background: #f1f3f6; border-radius: 4px; }
.gantt-track span { position: absolute; top: 2px; bottom: 2px; background: #e0573d; border-radius: 3px; }
.wplan .big { font-size: 22px; font-weight: 700; }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 10px; }
.mini-bars div { flex: 1; display: flex; gap: 1px; align-items: flex-end; height: 100%; }
.mini-bars i { flex: 1; background: #d7dee6; border-radius: 2px 2px 0 0; }
.mini-bars i.f { background: var(--brand); }
.mini-bars-lbl { display: flex; gap: 4px; font-size: 10px; color: var(--text-3); } .mini-bars-lbl span { flex: 1; text-align: center; }
.chg { position: relative; } .chg::after { content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange, #f08c2e); }
@media (max-width: 900px) { .doc-head, .two-col, .report-meta { grid-template-columns: minmax(0, 1fr); } .totals { grid-template-columns: 1fr; } .funnel-bars .fb { grid-template-columns: 120px 1fr 40px; } .gantt-row { grid-template-columns: 120px 1fr; } }
.warn-t { color: #c28a00; }
.table.dense th, .table.dense td { padding: 9px 8px; font-size: 12.5px; }
.table.dense td.wrap { white-space: normal; }
.table.dense .client-name { max-width: 220px; }
.table .st-select { width: auto; max-width: 175px; }
.table.dense .client-name { max-width: 190px; }
/* Закреплённая шапка таблиц: таблица прокручивается внутри своей рамки, заголовки остаются видны */
.table-wrap { max-height: calc(100vh - 150px); }
.table th { position: static; }
.table thead { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.table thead tr:last-child th { box-shadow: inset 0 -1px 0 var(--line); }
/* Отчёт по ценам: изменение, стрелки, мини-график */
.pchg { display: inline-block; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pchg.up { color: #137a50; background: #e3f5ec; } .pchg.down { color: #b93232; background: #fdeaea; } .pchg.flat { color: var(--text-3); background: var(--bg); }
.tarr { font-size: 10px; } .tarr.up { color: #1E9E6A; } .tarr.down { color: #D64545; }
.spark { display: block; margin-left: auto; }
.chart-title { font-weight: 700; font-size: 14px; margin: 4px 0 6px; }
.sum-tile.pos-tile b { color: #1E9E6A; } .sum-tile.neg-tile b { color: #D64545; }
/* Защита экрана: водяной знак и затемнение */
.wm { position: fixed; inset: 0; z-index: 9000; pointer-events: none; background-repeat: repeat; }
.shield { position: fixed; inset: 0; z-index: 9999; background: #050807; color: #F5F7F4; display: grid; place-items: center; text-align: center; cursor: pointer; }
.shield div { display: flex; flex-direction: column; gap: 10px; }
.shield b { font-size: 56px; letter-spacing: 6px; color: #BCCF17; }
.shield span { font-size: 26px; }
.shield small { font-size: 14px; color: #8FAFAB; margin-top: 18px; }
.hint-list { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 13.5px; }
@media print {
  body * { display: none !important; }
  body::after { content: 'VETTERIA запрещает печать и снимки экрана CRM'; display: block; font: 700 28px sans-serif; padding: 40px; }
}

/* ============ Тёмная тема всей CRM (переключатель в шапке; data-theme ставится на <html>) ============
   Цвета берутся из тех же переменных, что и светлая тема, поэтому новые страницы темнеют сами.
   Ниже — только места, где в светлой теме цвет записан напрямую. */
:root[data-theme="dark"] {
  --brand: #2aaeac; --brand-strong: #46c2bf; --brand-soft: rgba(42, 174, 172, .18); --brand-softer: rgba(42, 174, 172, .1);
  --lime: #bccf17; --lime-strong: #cddf3c; --lime-soft: rgba(188, 207, 23, .15);
  --orange: #f39a4a; --orange-soft: rgba(243, 154, 74, .16);
  --bg: #0f1315; --surface: #171c1f; --surface-2: #1f2529; --row: #1b2023;
  --line: #2b3236; --line-strong: #3a4247;
  --text: #e4e8e9; --text-2: #9aa4a9; --text-3: #6f797e;
  --ok: #4cc472; --ok-soft: rgba(76, 196, 114, .15); --warn: #e6b04a; --warn-soft: rgba(230, 176, 74, .15); --danger: #f2696d; --danger-soft: rgba(242, 105, 109, .15);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-pop: 0 10px 34px rgba(0, 0, 0, .55);
  --bar-muted: #3a4349; --track: #262d31; --chip: #232a2e;
  color-scheme: dark;
}
[data-theme="dark"] .btn { box-shadow: none; }
[data-theme="dark"] .btn.primary { background: #078585; border-color: #078585; box-shadow: none; }
[data-theme="dark"] .btn.primary:hover { background: #0a9a9a; }
[data-theme="dark"] .btn.danger { border-color: rgba(242, 105, 109, .45); }
[data-theme="dark"] .chip.on, [data-theme="dark"] .stepdots span.on { background: #078585; border-color: #078585; }
[data-theme="dark"] .switch .knob { background: #3a4247; }
[data-theme="dark"] .switch input:checked + .knob { background: #078585; }
[data-theme="dark"] .nav .icon { color: #9aa4a9; }
[data-theme="dark"] .side-logo .logo-full { background: #f1f3f7; border-radius: 8px; padding: 4px 8px; height: 44px; }
[data-theme="dark"] .bell-count { border-color: var(--surface); }
[data-theme="dark"] .avatar.lg, [data-theme="dark"] .ftabs button { background: var(--chip); }
[data-theme="dark"] .avatar.lg { color: #5f696e; }
[data-theme="dark"] .ftabs button.on { background: var(--surface); }
[data-theme="dark"] .pager .pg.on { background: var(--surface-2); box-shadow: none; }
[data-theme="dark"] .seg button.on { background: var(--surface-2); }
[data-theme="dark"] .badge.lime, [data-theme="dark"] .wt-mark, [data-theme="dark"] .pay-card { color: #cddf3c; }
[data-theme="dark"] .badge.orange { color: #f6ad6a; }
[data-theme="dark"] .tag.peach { background: rgba(240, 120, 70, .16); color: #f39a72; }
[data-theme="dark"] .abc.none { background: #3a4247; }
[data-theme="dark"] .prio.low { color: #bccf17; }
[data-theme="dark"] .alert.error { color: #f6a0a3; }
[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .65); }
[data-theme="dark"] .stepdots span { background: #333b40; }
[data-theme="dark"] .stepdots span.done { background: #1f6a69; }
[data-theme="dark"] .toast { background: #2c3438; border: 1px solid var(--line-strong); }
[data-theme="dark"] .toast.error { background: #b8383c; border-color: #b8383c; }
[data-theme="dark"] .wt-check, [data-theme="dark"] .wt-meta .who::before, [data-theme="dark"] .dot.okb, [data-theme="dark"] .timeline2 li::before { background: #3a4247; }
[data-theme="dark"] .wt-check:hover { background: #4a5358; }
[data-theme="dark"] .timeline2 li::before { border-color: var(--surface); }
[data-theme="dark"] .base-bar, [data-theme="dark"] .mini-base, [data-theme="dark"] .progress, [data-theme="dark"] .gantt-track { background: var(--track); }
[data-theme="dark"] .mini-bars i { background: var(--bar-muted); }
[data-theme="dark"] .mini-bars i.f { background: var(--brand); }
[data-theme="dark"] .avatar-edit .cam { border-color: var(--surface); }
[data-theme="dark"] .table tr.grp td { background: #20272b; }
[data-theme="dark"] .table tr.grp.l0 td { background: #262e33; }
[data-theme="dark"] .kcard { background: var(--surface-2); }
[data-theme="dark"] .kcard.stale { background: rgba(242, 105, 109, .08); }
[data-theme="dark"] .st-created { background: rgba(76, 196, 114, .15); color: #74d394; }
[data-theme="dark"] .st-confirmed, [data-theme="dark"] .bk-waiting { background: rgba(230, 190, 60, .15); color: #e9c75c; }
[data-theme="dark"] .st-docs, [data-theme="dark"] .bk-cancelled, [data-theme="dark"] .pay-credit { background: rgba(242, 105, 109, .15); color: #f58b8e; }
[data-theme="dark"] .st-docsdone { background: rgba(149, 117, 205, .18); color: #b9a3e8; }
[data-theme="dark"] .st-ready, [data-theme="dark"] .pay-transfer { background: rgba(80, 150, 230, .16); color: #7fb5f0; }
[data-theme="dark"] .st-shipping, [data-theme="dark"] .bk-in_progress { background: rgba(243, 154, 74, .16); color: #f6ad6a; }
[data-theme="dark"] .st-cancelled { background: #262d31; color: #8a959b; }
[data-theme="dark"] .sum-tile.abc-b b, [data-theme="dark"] .warn-t { color: #e6b04a; }
[data-theme="dark"] .pchg.up { color: #5fd09a; background: rgba(76, 196, 114, .14); }
[data-theme="dark"] .pchg.down { color: #f58b8e; background: rgba(242, 105, 109, .14); }
[data-theme="dark"] .tarr.up, [data-theme="dark"] .sum-tile.pos-tile b { color: #4cc98f; }
[data-theme="dark"] .tarr.down, [data-theme="dark"] .sum-tile.neg-tile b { color: #f2696d; }
[data-theme="dark"] .logo-prev { background: #f1f3f7; }
[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4a9' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator, [data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
/* На бумаге всегда светлая тема */
@media print {
  :root[data-theme="dark"] { --brand: #078585; --brand-soft: #e6f3f3; --brand-softer: #f1f8f8; --bg: #fff; --surface: #fff; --surface-2: #f6f7f9; --row: #f7f8fa;
    --line: #e4e7ec; --line-strong: #d5d9e0; --text: #424242; --text-2: #8a909a; --text-3: #b3b8c0; color-scheme: light; }
}
/* Подписи и сетка графиков в отчётах */
.ch-grid { stroke: #e7ebef; } .ch-axis { fill: #8a94a0; } .ch-label { fill: #6b7682; }
[data-theme="dark"] .ch-grid { stroke: var(--line); } [data-theme="dark"] .ch-axis, [data-theme="dark"] .ch-label { fill: var(--text-2); }

/* ============ Пульт продаж: приборная панель (тёмная по умолчанию, есть светлая) ============ */
/* 3.11: пульт в общем стиле CRM — те же шрифт и цвета, тема переключается вместе со всем приложением */
.pulse {
  --pl-bg: var(--bg); --pl-frame: var(--surface); --pl-tile: var(--surface); --pl-tile-2: var(--surface-2); --pl-line-c: var(--line);
  --pl-text: var(--text); --pl-text-2: var(--text-2); --pl-text-3: var(--text-2); --pl-line: var(--brand); --pl-grid: var(--line);
  --pl-accent: var(--brand); --pl-alert: var(--orange); --pl-alert-soft: var(--orange-soft); --pl-cell: var(--track);
  --pl-mono: var(--font);
  margin: -24px -24px -48px; padding: 22px; min-height: calc(100vh - 56px); background: var(--pl-bg); color: var(--pl-text);
  font-variant-numeric: tabular-nums;
}
.pl-frame { background: var(--pl-frame); border: 1px solid var(--pl-line-c); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.pl-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; flex-wrap: wrap; }
.pl-head h1 { font-size: 20px; font-weight: 600; letter-spacing: .2px; color: var(--pl-text); }
.pl-head p { margin: 2px 0 0; font: 12px var(--pl-mono); color: var(--pl-text-2); }
.pl-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--pl-tile-2); border: 1px solid var(--pl-line-c); color: var(--pl-text); }
.pl-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--pl-line-c); background: var(--pl-tile); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pl-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--pl-text); box-shadow: 0 0 0 0 currentColor; animation: plPing 2s infinite; }
.pl-chip.hot { color: var(--pl-alert); border-color: color-mix(in srgb, var(--pl-alert) 45%, transparent); background: var(--pl-alert-soft); }
.pl-chip.hot i { background: var(--pl-alert); }
.pl-hint { font: 11.5px var(--pl-mono); color: var(--pl-text-3); }
.pl-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--pl-tile-2); border: 1px solid var(--pl-line-c); }
.pl-seg button { border: 0; background: transparent; color: var(--pl-text-2); font: 600 12px var(--font); padding: 6px 13px; border-radius: 99px; cursor: pointer; transition: .2s; }
.pl-seg button.on { background: var(--pl-text); color: var(--pl-bg); }
.pl-round { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--pl-line-c); background: var(--pl-tile-2); color: var(--pl-text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.pl-round:hover { color: var(--pl-text); }

.pl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(196px, auto); grid-auto-flow: dense; gap: 14px; }
.pl-tile { display: flex; flex-direction: column; position: relative; background: linear-gradient(180deg, var(--pl-tile-2), var(--pl-tile)); border: 1px solid var(--pl-line-c); border-radius: 16px; padding: 16px 18px; cursor: pointer;
  transition: opacity .35s, filter .35s, border-color .3s, box-shadow .3s, transform .2s; outline: none; overflow: hidden; animation: plIn .5s both; }
.pl-tile:nth-child(2) { animation-delay: .04s; } .pl-tile:nth-child(3) { animation-delay: .08s; } .pl-tile:nth-child(4) { animation-delay: .12s; } .pl-tile:nth-child(5) { animation-delay: .16s; }
.pl-tile:nth-child(6) { animation-delay: .2s; } .pl-tile:nth-child(7) { animation-delay: .24s; } .pl-tile:nth-child(8) { animation-delay: .28s; } .pl-tile:nth-child(9) { animation-delay: .32s; }
.pl-tile:hover:not(.open) { border-color: color-mix(in srgb, var(--pl-text) 22%, var(--pl-line-c)); transform: translateY(-1px); }
.pl-tile:focus-visible { box-shadow: 0 0 0 2px var(--pl-accent); }
.pl-tile.dim { opacity: .32; filter: saturate(.4); }
.pl-tile.dim:hover { opacity: .6; }
.pl-tile.hot { border-color: color-mix(in srgb, var(--pl-alert) 38%, var(--pl-line-c)); }
.pl-tile.open { grid-column: span 2; grid-row: span 2; cursor: default; background: linear-gradient(180deg, var(--pl-tile-2), var(--pl-tile)); }
.pl-tile.open.hot { border-color: color-mix(in srgb, var(--pl-alert) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--pl-alert) 40%, transparent), 0 18px 50px -30px var(--pl-alert); }
.pl-tile.skel { background: linear-gradient(90deg, var(--pl-tile) 0%, var(--pl-tile-2) 50%, var(--pl-tile) 100%); background-size: 200% 100%; animation: plSkel 1.4s infinite; }
.pl-t { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pl-text-2); font-weight: 600; }
.pl-blip { width: 7px; height: 7px; border-radius: 50%; background: var(--pl-alert); animation: plPing 1.6s infinite; color: var(--pl-alert); }
.pl-v { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; font: 700 30px/1.1 var(--pl-mono); letter-spacing: -.5px; color: var(--pl-text); font-variant-numeric: tabular-nums; }
.pl-v.big { font-size: 46px; }
.pl-v small { font: 12px var(--pl-mono); color: var(--pl-text-2); letter-spacing: 0; }
.pl-d { font: 11.5px var(--pl-mono); color: var(--pl-text-2); margin: 4px 0 10px; }
.pl-d.neg { color: var(--pl-alert); }
.pl-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pl-kv { margin: 6px 0 0; display: grid; gap: 4px; }
.pl-kv div { display: flex; gap: 14px; justify-content: space-between; font: 11.5px var(--pl-mono); color: var(--pl-text-2); }
.pl-kv dt { margin: 0; } .pl-kv dd { margin: 0; color: var(--pl-text); }

.pl-tile:not(.open) .pl-svg { margin-top: auto; }
.pl-svg { width: 100%; display: block; overflow: visible; touch-action: none; }
.pl-line { fill: none; stroke: var(--pl-line); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.pl-line.hot { stroke: var(--pl-alert); }
.pl-line.draw { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: plDraw 1.4s ease-out forwards; }
.pl-gl { stroke: var(--pl-grid); stroke-width: 1; }
.pl-tick { font: 10.5px var(--pl-mono); fill: var(--pl-text-3); }
.pl-target { stroke: var(--pl-alert); stroke-width: 1.3; stroke-dasharray: 4 4; opacity: .9; }
.pl-tag rect { fill: var(--pl-alert); } .pl-tag text { font: 700 9.5px var(--pl-mono); fill: #1a0d05; letter-spacing: .4px; }
.pl-tag.grab { cursor: ns-resize; }
.pl-dot { fill: var(--pl-line); } .pl-dot.hot { fill: var(--pl-alert); }
.pl-halo { fill: var(--pl-line); opacity: .25; transform-box: fill-box; transform-origin: center; animation: plHalo 1.8s infinite; }
.pl-halo.hot { fill: var(--pl-alert); }

.pl-bars { display: flex; align-items: flex-end; gap: 3px; margin-top: auto; }
.pl-bars i { flex: 1; min-width: 2px; border-radius: 3px; background: var(--pl-cell); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.pl-bars i.on { background: var(--pl-line); }
.pl-bars i.hot { background: var(--pl-alert); }

.pl-dial .tk { stroke: var(--pl-cell); stroke-width: 2.2; stroke-linecap: round; transition: stroke .4s; }
.pl-dial .tk.on { stroke: var(--pl-line); } .pl-dial .tk.on.hot { stroke: var(--pl-alert); }
.pl-dial .mk { stroke: var(--pl-accent); stroke-width: 2.4; stroke-linecap: round; }
.pl-dial .v { font: 600 17px var(--pl-mono); fill: var(--pl-text); } .pl-dial .u { font: 8px var(--pl-mono); fill: var(--pl-text-2); }

.pl-glass .glass { fill: none; stroke: var(--pl-text-2); stroke-width: 1.3; }
.pl-glass .cap { stroke: var(--pl-text-2); stroke-width: 2; stroke-linecap: round; }
.pl-glass .sand { fill: var(--pl-line); opacity: .75; }
.pl-glass .stream { stroke: var(--pl-line); stroke-width: 1.2; stroke-dasharray: 2 3; animation: plFall .8s linear infinite; }

.pl-heat { display: grid; gap: 4px; margin-top: auto; }
.pl-heat .hr { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 8px; font: 10.5px var(--pl-mono); color: var(--pl-text-3); }
.pl-heat .hc { display: grid; grid-template-columns: repeat(22, minmax(0, 1fr)); gap: 2px; min-width: 0; }
.pl-heat i { height: 11px; min-width: 0; border-radius: 2px; background: var(--pl-cell); transition: background .5s; }
.pl-heat i.on { background: var(--pl-line); opacity: .8; } .pl-heat i.hot { background: var(--pl-alert); opacity: 1; }

.pl-dh { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pl-dh h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--pl-text); }
.pl-dh p { margin: 2px 0 0; font: 12px var(--pl-mono); color: var(--pl-text-2); }
.pl-body { display: grid; grid-template-columns: minmax(220px, 260px) 1fr; gap: 26px; margin-top: 16px; align-items: start; }
.pl-left { display: flex; flex-direction: column; gap: 4px; }
.pl-stats { margin: 10px 0 0; display: grid; }
.pl-stats div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--pl-line-c); font-size: 13px; color: var(--pl-text-2); }
.pl-stats dd { margin: 0; font-family: var(--pl-mono); color: var(--pl-text); font-variant-numeric: tabular-nums; }
.pl-keys { margin-top: 14px; font: 11.5px/2 var(--pl-mono); color: var(--pl-text-3); }
.pl-keys a { color: var(--pl-accent); margin-left: 6px; }
.pulse kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin-right: 3px; border: 1px solid var(--pl-line-c); border-bottom-width: 2px; border-radius: 5px; font: 10.5px var(--pl-mono); color: var(--pl-text-2); background: var(--pl-tile-2); }
.pl-right { min-width: 0; }
.pl-rt { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pl-state { display: inline-flex; align-items: center; gap: 8px; font: 12px var(--pl-mono); color: var(--pl-text-2); }
.pl-state i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--pl-text); }
.pl-state.hot { color: var(--pl-alert); } .pl-state.hot i { border-color: var(--pl-alert); background: var(--pl-alert); animation: plPing 1.6s infinite; }
.pl-hbars { display: grid; gap: 10px; margin-top: 6px; width: 100%; }
.pl-hbars .hb { display: grid; grid-template-columns: minmax(64px, 150px) minmax(80px, 1fr) 78px 38px; align-items: center; gap: 12px; font-size: 13px; color: var(--pl-text-2); }
.pl-hbars .hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-hbars .ht { position: relative; width: 100%; min-width: 60px; height: 16px; border-radius: 4px; background: var(--pl-cell); overflow: hidden; }
.pl-hbars .ht i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--pl-line); transition: width .8s cubic-bezier(.2, .8, .2, 1); animation: plGrow .9s both; transform-origin: left; }
.pl-hbars .ht i.hot { background: var(--pl-alert); }
.pl-hbars .ht i.ghost { background: transparent; border: 1.5px dashed var(--pl-text-2); z-index: 1; }
.pl-hbars b { font: 400 13px var(--pl-mono); color: var(--pl-text); text-align: right; }
.pl-hbars small { font: 11px var(--pl-mono); color: var(--pl-text-3); }
.pl-legend { margin: 14px 0 0; font: 11.5px var(--pl-mono); color: var(--pl-text-2); display: flex; gap: 8px; align-items: center; }
.pl-legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; } .pl-legend .f { background: var(--pl-line); } .pl-legend .p { border: 1.5px dashed var(--pl-text-2); margin-left: 10px; }

@keyframes plPing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes plHalo { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes plDraw { to { stroke-dashoffset: 0; } }
@keyframes plIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes plSkel { to { background-position: -200% 0; } }
@keyframes plFall { to { stroke-dashoffset: -10; } }
@keyframes plGrow { from { transform: scaleX(0); } }
@media (max-width: 1100px) { .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pl-body { grid-template-columns: 1fr; } .pl-hint { display: none; } }
@media (max-width: 700px) { .pulse { margin: -16px -12px -40px; padding: 12px; } .pl-grid { grid-template-columns: 1fr; } .pl-tile.open { grid-column: auto; grid-row: auto; } .pl-hbars .hb { grid-template-columns: 90px 1fr 70px; } .pl-hbars small { display: none; } }
@media (prefers-reduced-motion: reduce) { .pulse *, .pulse *::before { animation: none !important; transition: none !important; } .pl-line.draw { stroke-dashoffset: 0; } }
@media print { .pulse { background: #fff; } }

/* Тестовая копия: заметная плашка, чтобы её не перепутать с рабочей CRM. Не перехватывает нажатия */
.staging-bar { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 9999; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 5px 14px; border-radius: 999px; background: #BCCF17; color: #263238;
  font-weight: 700; font-size: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.18); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ «Мой день» — первая вкладка главной (3.10.0) ============
   Крупный заголовок, одна главная кнопка, задачи слева, план и выезды справа. Только переменные темы — тёмная тема работает сама. */
.myday { display: flex; flex-direction: column; gap: 18px; }
.md-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.md-date { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.md-title { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.md-sub { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.md-actions { display: flex; gap: 8px; }
.md-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.md-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.md-stat:hover { border-color: var(--brand); }
.md-stat b { font-size: 28px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.md-stat span { font-size: 13px; color: var(--text-2); }
.md-stat.bad b { color: var(--danger); }
.md-stat.good b { color: var(--ok); }
.md-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.md-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.md-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.md-ctitle { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.md-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--chip); margin-bottom: 8px; }
.md-seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--text-2); padding: 7px 16px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.md-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 30, 50, .12); }
.md-n { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.md-group { margin-top: 10px; }
.md-gtitle { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.md-gtitle::first-letter { text-transform: uppercase; }
.md-gtitle span { font-weight: 600; margin-left: 4px; }
.md-gtitle.late { color: var(--danger); }
.md-task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.md-task:last-child { border-bottom: 0; }
.md-task:hover .md-ttitle { color: var(--brand); }
.md-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: transparent; position: relative; }
.md-check::after { content: ''; position: absolute; inset: -10px; } /* зона нажатия 44 px */
.md-check:hover { border-color: var(--brand); color: var(--brand); }
.md-check.late { border-color: var(--danger); }
.md-check.on { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.task-row > .md-check { align-self: center; }
.md-tmain { flex: 1; min-width: 0; }
.md-ttitle { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-tmeta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12.5px; margin-top: 2px; }
.md-when { flex: none; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-when.late { color: var(--danger); font-weight: 700; }
.md-rec { flex: none; }
.md-foot { margin-top: 10px; font-size: 13px; }
.md-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 12px; }
.md-empty-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.md-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.md-big b { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.md-bar { position: relative; height: 10px; border-radius: 99px; background: var(--track); margin: 10px 0 8px; }
.md-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--brand); }
.md-bar span.behind { background: var(--orange); }
.md-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; opacity: .55; }
.md-visit { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.md-visit:last-child { border-bottom: 0; }
.md-visit a { color: inherit; }
.md-nn { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid var(--line); color: inherit; min-width: 0; }
.md-nn:last-child { border-bottom: 0; }
.md-nn:hover { text-decoration: none; } .md-nn:hover b { color: var(--brand); }
.myday .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1100px) { .md-grid { grid-template-columns: minmax(0, 1fr); } .md-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 860px) {
  .md-title { font-size: 26px; }
  .md-actions { width: 100%; } .md-actions .btn { flex: 1; min-height: 44px; }
  .md-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .md-stat { padding: 10px 12px; } .md-stat b { font-size: 24px; }
  .md-card { padding: 14px; border-radius: 12px; }
  .md-seg { display: flex; } .md-seg button { flex: 1; justify-content: center; min-height: 36px; }
  .md-rec { min-width: 44px; min-height: 40px; }
  .md-visit .btn { min-height: 40px; min-width: 52px; }
}

/* ============ Телефон: нижнее меню и клиенты карточками (3.10.0) ============ */
.tabbar, .cl-cards { display: none; }
@media (max-width: 860px) {
  .top-burger { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px;
    border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-2); cursor: pointer; text-decoration: none; }
  .tabbar .on { color: var(--brand); }
  .tabbar a:hover { text-decoration: none; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .staging-bar { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .home-tabs { overflow-x: auto; scrollbar-width: none; }
  .home-tabs button { white-space: nowrap; }
  .cl-table { display: none; }
  .cl-cards { display: flex; flex-direction: column; gap: 8px; }
  .cl-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; min-width: 0; }
  .cl-card.off { opacity: .6; }
  .cl-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .cl-card-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; min-width: 0; }
  .cl-card-name a { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cl-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
  .cl-call { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
  .page-sub .input { max-width: none !important; flex: 1 1 100%; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* Дата дд.мм.гггг (DateInput): поле + кнопка календаря; системный выбор даты спрятан под кнопкой */
.date-in { position: relative; display: inline-flex; align-items: center; width: 150px; flex: none; }
.date-in .input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.date-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: none; color: var(--text-2); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.date-btn:hover { color: var(--brand); background: var(--brand-softer); }
.date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.btn.on { border-color: var(--brand); color: var(--brand); }
@media (max-width: 860px) { .date-in { flex: 1 1 40%; width: auto; } .task-row { padding: 12px; } .task-row .task-due { width: auto; } }

/* ---------- 3.11: шапка карточки клиента — сводка и шкала этапов ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cl-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0 12px; }
.cl-sum-i { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-sum-i > span { font-size: 12px; color: var(--text-2); }
.cl-sum-i > a { color: inherit; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-sum-i b { font-size: 15px; }
.cl-sum-i small { color: var(--text-2); }
.cl-sum-i .bad, .cl-sum-i .bad b { color: var(--danger); }
.cl-sum-i .warn-t { color: var(--warn); }
.cl-path { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 6px; overflow-x: auto; }
.cl-path li { flex: 1 1 0; min-width: 110px; display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 13px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.cl-path li:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.cl-path li:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); border-radius: 0 10px 10px 0; }
.cl-path li .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cl-path li.done { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand); }
.cl-path li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.cl-path li.cur { background: var(--brand); color: #fff; font-weight: 700; }
.cl-path-hint { margin-bottom: 12px; }

/* ---------- 3.11: доступность — видимый фокус с клавиатуры, меньше движения по желанию пользователя ---------- */
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pl-tile:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.cl-path li.miss { color: var(--warn); }
.cl-path li.miss .dot { border-style: dashed; }
.cl-path li { position: relative; }
@media (max-width: 860px) { .cl-sum { grid-template-columns: 1fr 1fr; } .cl-path li { min-width: 120px; } }
