/* ES-TE CRM — стилі інтерфейсу. Без зовнішніх залежностей. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px;
  --sb-w: 264px; --top-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);

  /* брендові кольори (торгова марка: червоний, синій, зелений, жовтий) */
  --red: #e5483c; --blue: #2563eb; --green: #16a34a; --yellow: #eab308;
  --teal: #0ea5b7; --violet: #7c3aed; --pink: #db2777; --orange: #ea7a12; --indigo: #4f46e5; --gray: #64748b;

  --primary: #1d4ed8; --primary-2: #2563eb; --primary-soft: #e8efff; --primary-ink: #fff;
  --bg: #eef2f8; --bg-2: #e6ebf3; --surface: #fff; --surface-2: #f7f9fc; --surface-3: #eff3f9;
  --line: #e2e8f0; --line-2: #cfd8e5;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 40px rgba(15,23,42,.16);
  --ok: #16a34a; --ok-soft: #e7f7ec; --warn: #d97706; --warn-soft: #fff4e0; --err: #dc2626; --err-soft: #fdecec; --info-soft: #e8f1ff;
  color-scheme: light;
}
[data-mode="dark"] {
  --primary: #3b82f6; --primary-2: #60a5fa; --primary-soft: #1a2a4a; --primary-ink: #fff;
  --bg: #0b1120; --bg-2: #0e1628; --surface: #121a2c; --surface-2: #162036; --surface-3: #1b2640;
  --line: #233049; --line-2: #2e3d5c;
  --text: #e6ecf5; --text-2: #c3cddd; --muted: #8a99b3; --faint: #5f6f8d;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  --ok-soft: #10301c; --warn-soft: #3a2a0e; --err-soft: #3b1515; --info-soft: #14264a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
pre { background: var(--surface-3); padding: 12px 14px; border-radius: var(--radius-xs); overflow: auto; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86em; }
.pad { padding: 16px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt0 { margin-top: 0; } .gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico.big { width: 48px; height: 48px; stroke-width: 1.4; color: var(--faint); }
.ico.sm { width: 16px; height: 16px; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .25s var(--ease), width .2s var(--ease);
}
.main { flex: 1; min-width: 0; margin-left: var(--sb-w); display: flex; flex-direction: column; transition: margin .2s var(--ease); }
.brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; color: var(--text); text-decoration: none !important; }
.brand img { border-radius: 10px; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.28rem; letter-spacing: .02em; color: var(--primary); }
.brand-text small { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.menu-search { margin: 4px 14px 8px; position: relative; }
.menu-search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.menu-search input[type=search] { width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 10px 0 32px; color: var(--text); font: inherit; font-size: .9rem; }
.menu-search input[type=search]:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.menu { flex: 1; overflow-y: auto; padding: 4px 10px 16px; overscroll-behavior: contain; }
.menu-link, .menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left;
  color: var(--text-2); border-radius: 10px; padding: 9px 10px; text-decoration: none !important; font-weight: 500;
}
.menu-link:hover, .menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-link.active { color: var(--primary); }
.menu-link.active > .ico:first-child { color: var(--primary); }
a.menu-link.active { background: var(--primary-soft); }
.menu-link span { flex: 1; }
.menu-link .chev { width: 16px; color: var(--faint); transition: transform .2s; }
.menu-group.open .chev { transform: rotate(180deg); }
.menu-sub { display: none; padding: 2px 0 6px 12px; }
.menu-group.open .menu-sub { display: block; }
.menu-item { font-weight: 450; font-size: .93rem; padding: 7px 10px; color: var(--muted); }
.menu-item .ico { width: 17px; height: 17px; }
.menu-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.menu-item.is-soon { opacity: .72; }
.soon { font-style: normal; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--warn-soft); color: var(--warn); padding: 2px 6px; border-radius: 6px; }
.menu-hidden { display: none !important; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: .8rem; }
.sidebar-backdrop { display: none; }

html.sb-collapsed { --sb-w: 76px; }
html.sb-collapsed .brand-text, html.sb-collapsed .menu-search, html.sb-collapsed .menu-link span, html.sb-collapsed .menu-link .chev,
html.sb-collapsed .soon, html.sb-collapsed .sidebar-foot span, html.sb-collapsed .menu-sub { display: none; }
html.sb-collapsed .menu-link { justify-content: center; padding: 11px; }
html.sb-collapsed .brand { justify-content: center; padding-inline: 0; }
html.sb-collapsed .sidebar-foot { justify-content: center; }
html.sb-collapsed .sb-collapse .ico { transform: scaleX(-1); }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.28rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs b { font-weight: 500; color: var(--text-2); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface); box-shadow: var(--shadow); }
.burger { display: none; }
[data-mode="dark"] .only-light, [data-mode="light"] .only-dark { display: none; }
.dot-count { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.dot-count.sm { top: 2px; right: 50%; margin-right: -22px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; font-style: normal; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 8px 4px 4px; border-radius: 24px; cursor: pointer; color: var(--text); font: inherit; }
.user-btn:hover { background: var(--surface); box-shadow: var(--shadow); }
.user-btn .chev { width: 16px; color: var(--muted); }
.avatar { --av: var(--primary); width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--av); color: #fff; font-weight: 700; font-size: .8rem; flex: 0 0 auto; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }

.content { padding: 8px 24px 40px; width: 100%; max-width: 1600px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-sub { color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 .92rem/1 var(--font); cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 9px; }
.btn-lg { height: 50px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; height: 34px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

/* ---------- Картки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 14px; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { color: var(--muted); }
.card-head .sub { color: var(--muted); font-size: .85rem; font-weight: 400; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px 0; margin: 0 0 12px; }
.grid { display: grid; gap: 18px; }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.dash { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0,1fr)); }
.span3 { grid-column: span 3; } .span4 { grid-column: span 4; } .span5 { grid-column: span 5; } .span6 { grid-column: span 6; } .span7 { grid-column: span 7; } .span8 { grid-column: span 8; } .span12 { grid-column: span 12; }

/* ---------- KPI-плитки ---------- */
.kpi { --c: var(--blue); position: relative; overflow: hidden; display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--radius); color: #fff; text-decoration: none !important;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 72%, #000)); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 28%, transparent); min-height: 104px; transition: transform .2s var(--ease); }
a.kpi:hover { transform: translateY(-2px); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.12); }
.kpi-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: 0 0 auto; }
.kpi-ico .ico { width: 26px; height: 26px; }
.kpi-value { font-size: 1.85rem; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; }
.kpi-label { opacity: .9; font-weight: 500; margin-top: 3px; }
.kpi-sub { opacity: .85; font-size: .82rem; margin-top: 2px; }
.kpi-blue { --c: #2563eb; } .kpi-teal { --c: #0ea5b7; } .kpi-pink { --c: #db2777; } .kpi-orange { --c: #ea7a12; } .kpi-green { --c: #16a34a; }
.kpi-violet { --c: #7c3aed; } .kpi-red { --c: #e5483c; } .kpi-indigo { --c: #4f46e5; } .kpi-yellow { --c: #ca8a04; } .kpi-gray { --c: #475569; }

/* світлі KPI з трендом */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-left: 4px solid var(--c, var(--primary)); background: var(--surface); border-radius: var(--radius-sm); }
.stat-value { font-size: 1.6rem; font-weight: 750; color: var(--c, var(--primary)); letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.trend .ico { width: 13px; height: 13px; stroke-width: 2.5; }
.trend.up { color: var(--ok); background: var(--ok-soft); } .trend.down { color: var(--err); background: var(--err-soft); } .trend.flat { color: var(--muted); background: var(--surface-3); }

/* ---------- Таблиці ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-weight: 650; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table th a { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.table th a .ico { width: 13px; height: 13px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions .btn { margin-left: 4px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-main { font-weight: 600; color: var(--text); }
.table .cell-sub { color: var(--muted); font-size: .84rem; }
.table-compact td, .table-compact th { padding: 8px 12px; }
.row-link { cursor: pointer; }
.inbar { position: relative; min-width: 90px; }
.inbar i { position: absolute; left: 0; top: 50%; height: 22px; transform: translateY(-50%); border-radius: 5px; background: color-mix(in srgb, var(--c, var(--primary)) 22%, transparent); }
.inbar span { position: relative; padding-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Списки CRUD ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 420px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--faint); }
.toolbar .search input { padding-left: 36px; }
.toolbar select, .toolbar input { height: 38px; }
.toolbar select { width: auto; min-width: 150px; max-width: 240px; }
.toolbar .spacer { flex: 1; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; text-decoration: none !important; }
.pager .cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .dis { opacity: .4; }

/* ---------- Форми ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px 18px; }
.form-grid > .c12 { grid-column: span 12; } .form-grid > .c10 { grid-column: span 10; } .form-grid > .c9 { grid-column: span 9; } .form-grid > .c8 { grid-column: span 8; } .form-grid > .c7 { grid-column: span 7; }
.form-grid > .c6 { grid-column: span 6; } .form-grid > .c5 { grid-column: span 5; } .form-grid > .c4 { grid-column: span 4; } .form-grid > .c3 { grid-column: span 3; } .form-grid > .c2 { grid-column: span 2; } .form-grid > .c1 { grid-column: span 1; }
.form-section { grid-column: span 12; font-weight: 700; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); display: flex; align-items: center; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child, .field-label { font-weight: 600; font-size: .86rem; color: var(--text-2); }
.field .req { color: var(--err); }
.field .help { font-size: .8rem; color: var(--muted); }
.field .err-text { font-size: .82rem; color: var(--err); font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); background: var(--err-soft); }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=time], input[type=month], input[type=datetime-local], input[type=url], input[type=color], input:not([type]), select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 900px) { input, select, textarea { font-size: .94rem !important; } }
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
input[readonly], input:disabled, select:disabled, textarea[readonly] { background: var(--surface-3); color: var(--muted); }
input[type=color] { padding: 4px; width: 64px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-weight: 500; min-height: 42px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; flex: 0 0 auto; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 42px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); position: relative; transition: background .2s; flex: 0 0 auto; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.pass-wrap { position: relative; display: block; }
.pass-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.form-actions .spacer { flex: 1; }
.form-card { max-width: 1100px; }
.meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; margin-top: 14px; }

/* ---------- Бейджі та повідомлення ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; font-size: .78rem; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.badge-gray { background: var(--surface-3); color: var(--muted); } .badge-green { background: var(--ok-soft); color: var(--ok); } .badge-red { background: var(--err-soft); color: var(--err); }
.badge-orange { background: var(--warn-soft); color: var(--warn); } .badge-blue { background: var(--info-soft); color: var(--primary); } .badge-violet { background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet); }
.badge-solid-green { background: #22c55e; color: #fff; } .badge-solid-orange { background: #f07c2a; color: #fff; } .badge-solid-red { background: var(--err); color: #fff; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.alert .ico { margin-top: 1px; }
.alert span { flex: 1; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 20%, transparent); }
.alert-x { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .6; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; stroke-width: 1.3; color: var(--faint); margin-bottom: 8px; }
.error-card { max-width: 520px; margin: 8vh auto; text-align: center; padding: 40px 28px; }

/* ---------- Випадаючі меню ---------- */
.dropdown { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dropdown.open .dd-menu { display: block; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dd-menu > a, .dd-menu button:not(.link) { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-decoration: none !important; text-align: left; }
.dd-menu > a:hover, .dd-menu button:not(.link):hover { background: var(--surface-3); }
.dd-menu form { margin: 0; }
.dd-user { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-user small { display: block; color: var(--muted); }
.dd-notif { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dd-foot { display: block !important; text-align: center; padding: 11px !important; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px !important; font-weight: 600; color: var(--primary) !important; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; position: relative; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.notif.unread::before { content: ""; position: absolute; left: 5px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.notif-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: var(--info-soft); color: var(--primary); }
.notif-ico.success { background: var(--ok-soft); color: var(--ok); } .notif-ico.warning { background: var(--warn-soft); color: var(--warn); } .notif-ico.danger { background: var(--err-soft); color: var(--err); } .notif-ico.birthday { background: color-mix(in srgb, var(--pink) 14%, transparent); color: var(--pink); }
.notif b { display: block; font-weight: 600; font-size: .92rem; }
.notif p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.notif time { font-size: .76rem; color: var(--faint); }

/* ---------- Стрічка подій ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: 0 0 auto; }
.feed-ico .ico { width: 16px; height: 16px; }
.feed-ico.create { background: var(--ok-soft); color: var(--ok); } .feed-ico.delete { background: var(--err-soft); color: var(--err); } .feed-ico.update { background: var(--info-soft); color: var(--primary); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 550; font-size: .9rem; overflow-wrap: anywhere; }
.feed-meta { color: var(--muted); font-size: .8rem; }

/* ---------- Модальне вікно ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.5); display: grid; place-items: center; padding: 16px; animation: fade .15s; overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
/* довге вікно (картка канбану, рахунок) гортається саме, а не сторінка позаду; на телефоні — на всю ширину */
.modal-box { background: var(--surface); border-radius: 18px; padding: 24px; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); }
@supports (height: 100dvh) { .modal-box { max-height: calc(100dvh - 32px); } }
body.modal-open { overflow: hidden; touch-action: none; }
body.modal-open .modal-box { touch-action: pan-y; }
@media (max-width: 640px) { .modal { padding: 8px; align-items: end; } .modal-box { padding: 16px; border-radius: 16px; max-height: calc(100vh - 16px); } @supports (height: 100dvh) { .modal-box { max-height: calc(100dvh - 16px); } } .modal-box .form-actions { position: sticky; bottom: -16px; background: var(--surface); padding: 10px 0; margin-bottom: -16px; } }
.modal-box.wide { max-width: 720px; }
.modal-box.kb-box { max-width: min(960px, 96vw); }
.kb-pl td { vertical-align: middle; } .kb-mpick { max-width: 100%; justify-content: flex-start; white-space: normal; text-align: left; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs::-webkit-scrollbar { height: 4px; } .tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: 600 .92rem var(--font); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 7px; align-items: center; }
.tabs .active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Графіки ---------- */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart canvas { display: block; width: 100%; height: 100%; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); padding: 7px 10px; border-radius: 9px; font-size: .8rem; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-lg); z-index: 5; opacity: 0; transition: opacity .12s; }
.chart-tip.show { opacity: 1; }
.chart-tip b { font-weight: 700; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--text-2); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.chart-hint { position: absolute; right: 6px; bottom: 4px; font-size: .72rem; color: var(--faint); pointer-events: none; display: flex; gap: 4px; align-items: center; }
.chart-hint .ico { width: 13px; height: 13px; }
.gauge-wrap { text-align: center; }
.spark-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spark-row:last-child { border-bottom: 0; }
.spark-row .stat { border-radius: 0; padding: 2px 0 2px 12px; background: none; min-width: 130px; }
.spark-row .chart { flex: 1; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c, var(--primary)); border-radius: 4px; }

/* ---------- Дашборд ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius); margin-bottom: 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 45%, #0ea5b7 100%); box-shadow: 0 10px 30px rgba(29,78,216,.25); }
.hello::before, .hello::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.hello::before { width: 260px; height: 260px; right: 8%; top: -140px; } .hello::after { width: 180px; height: 180px; right: -40px; bottom: -110px; }
.hello h2 { margin: 0; font-size: 1.45rem; }
.hello p { margin: 4px 0 0; opacity: .9; }
.hello-rates { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.rate-pill { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 14px; min-width: 120px; backdrop-filter: blur(4px); }
.rate-pill small { opacity: .8; font-size: .75rem; display: block; }
.rate-pill b { font-size: 1.2rem; }
.rate-pill em { font-style: normal; font-size: .76rem; font-weight: 700; margin-left: 4px; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: 0; }
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row .grow b { display: block; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .grow small { color: var(--muted); }
.soon-card { border: 1px dashed var(--line-2); background: var(--surface-2); box-shadow: none; }
.soon-card .ico.big { color: var(--primary); opacity: .5; }
.section-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent); color: var(--c, var(--primary)); }
.tile b { font-size: 1rem; }
.tile small { color: var(--muted); }
.tile .tile-num { font-size: 1.5rem; font-weight: 750; margin-left: auto; color: var(--c, var(--primary)); }
.tile-top { display: flex; align-items: center; gap: 10px; }

/* ---------- Матриця прав ---------- */
.perm-table td:first-child { min-width: 240px; }
.perm-table .sec-row td { background: var(--surface-3); font-weight: 700; }
.perm-levels { display: flex; gap: 4px; }
.perm-levels label { cursor: pointer; }
.perm-levels input { position: absolute; opacity: 0; }
.perm-levels span { display: inline-block; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; }
.perm-levels input:checked + span { color: #fff; border-color: transparent; }
.perm-levels .l0 input:checked + span { background: #94a3b8; } .perm-levels .l1 input:checked + span { background: var(--teal); }
.perm-levels .l2 input:checked + span { background: var(--blue); } .perm-levels .l3 input:checked + span { background: var(--green); }
.perm-levels input:focus-visible + span { outline: 2px solid var(--primary); }

/* ---------- 3D склад ---------- */
.wh3d { height: min(70vh, 640px); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 30%, var(--surface) 0%, var(--surface-3) 100%); border: 1px solid var(--line); position: relative; overflow: hidden; }
.wh3d-panel { position: absolute; left: 12px; top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); max-width: 280px; font-size: .88rem; }
.wh3d-legend { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .8rem; box-shadow: var(--shadow); }
.wh3d-legend span { display: flex; align-items: center; gap: 7px; }
.wh3d-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.wh3d-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }

/* ---------- Сторінка входу / інсталятор ---------- */
body.bare { min-height: 100vh; }
.bare-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bare-bg i { position: absolute; width: 90px; border-radius: 45px; opacity: .14; filter: blur(2px); transform: rotate(18deg); }
.bare-bg i:nth-child(1) { background: var(--red); height: 420px; left: 6%; top: 18%; } .bare-bg i:nth-child(2) { background: var(--blue); height: 480px; left: 16%; top: 30%; }
.bare-bg i:nth-child(3) { background: var(--green); height: 520px; right: 18%; top: -8%; } .bare-bg i:nth-child(4) { background: var(--yellow); height: 380px; right: 7%; top: 12%; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 22px; padding: 30px 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.auth-card h2 { margin: 6px 0 0; }
.auth-logo { display: flex; gap: 14px; align-items: center; }
.auth-logo img { border-radius: 14px; box-shadow: 0 4px 14px rgba(15,23,42,.14); }
.auth-logo b { font-size: 1.35rem; color: var(--primary); display: block; }
.auth-logo small { color: var(--muted); }
.auth-foot { text-align: center; font-size: .85rem; margin: 0; }
.install { max-width: 880px; margin: 30px auto; padding: 0 16px 60px; }
.install .card { margin-bottom: 18px; }
.steps { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.steps span { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--muted); }
.steps span b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: .8rem; }
.req-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.req-item { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.req-item.ok .ico { color: var(--ok); } .req-item.bad .ico { color: var(--err); } .req-item.warn .ico { color: var(--warn); }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mode-card { position: relative; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card div { border: 2px solid var(--line); border-radius: 14px; padding: 14px; height: 100%; transition: border-color .15s, background .15s; }
.mode-card b { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.mode-card small { color: var(--muted); display: block; line-height: 1.4; }
.mode-card input:checked + div { border-color: var(--primary); background: var(--primary-soft); }
.mode-panel { display: none; } .mode-panel.show { display: block; }

/* ---------- Нижня панель (телефон) ---------- */
.bottombar { display: none; }

/* ---------- Адаптивність ---------- */
@media (max-width: 1200px) {
  .span3 { grid-column: span 6; } .span4 { grid-column: span 6; } .span5, .span7 { grid-column: span 12; } .span8 { grid-column: span 12; }
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  :root, html.sb-collapsed { --sb-w: 284px; }
  html.sb-collapsed .brand-text, html.sb-collapsed .menu-search, html.sb-collapsed .menu-link span, html.sb-collapsed .menu-link .chev, html.sb-collapsed .soon, html.sb-collapsed .sidebar-foot span { display: revert; }
  html.sb-collapsed .menu-group.open .menu-sub { display: block; }
  html.sb-collapsed .menu-link { justify-content: flex-start; padding: 9px 10px; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
  .sb-collapse { display: none; }
  .main { margin-left: 0; }
  .burger { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 6px; padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
  .topbar-title h1 { font-size: 1.08rem; }
  .user-name, .user-btn .chev { display: none; }
  .content { padding: 4px 12px calc(96px + env(safe-area-inset-bottom)); }
  .dash, .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .dash > * { grid-column: span 1 !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .kpi { padding: 14px; min-height: 92px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi-ico { width: 38px; height: 38px; border-radius: 11px; } .kpi-ico .ico { width: 21px; height: 21px; }
  .kpi-value { font-size: 1.45rem; }
  .card { padding: 16px; border-radius: 16px; }
  .form-grid > * { grid-column: span 12 !important; }
  .form-grid > [class~="c1"], .form-grid > [class~="c2"], .form-grid > [class~="c3"], .form-grid > [class~="c4"], .form-grid > [class~="c5"], .form-grid > [class~="c6"] { grid-column: span 6 !important; }
  .form-grid { gap: 14px 12px; }
  .form-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: var(--surface); margin: 18px -16px -16px; padding: 12px 16px; border-radius: 0 0 16px 16px; z-index: 5; }
  .form-actions .btn { flex: 1; height: 48px; }
  .btn { height: 44px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .hello { padding: 18px; } .hello h2 { font-size: 1.2rem; }
  .rate-pill { min-width: 0; flex: 1; }
  .bottombar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottombar a, .bottombar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font: 600 .68rem var(--font); text-decoration: none !important; border-radius: 12px; }
  .bottombar .ico { width: 23px; height: 23px; }
  .bottombar .active { color: var(--primary); }
  .bottombar span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* таблиці → картки на телефоні */
  table.table.stack thead { display: none; }
  table.table.stack, table.table.stack tbody, table.table.stack tr, table.table.stack td { display: block; width: 100%; }
  table.table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  table.table.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; flex: 0 0 40%; }
  table.table.stack td.cell-first { font-size: 1rem; text-align: left; display: block; padding-bottom: 6px; }
  table.table.stack td.cell-first::before { display: none; }
  table.table.stack td.actions { justify-content: flex-end; padding-top: 8px; width: 100%; }
  table.table.stack td.actions::before { display: none; }
  table.table.stack tbody tr:hover td { background: none; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  .toolbar select { max-width: none; min-width: 0; }
  .section-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .dd-notif { position: fixed; left: 12px; right: 12px; top: calc(var(--top-h) + env(safe-area-inset-top)); width: auto; }
  .wh3d { height: 62vh; }
  .wh3d-panel { right: 12px; max-width: none; top: auto; bottom: 60px; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; } .kpi-value { font-size: 1.25rem; } }

@media print {
  .sidebar, .topbar, .bottombar, .page-actions, .toolbar, .list-foot, .actions { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; border: 0; } body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Робочий календар ---------- */
.cal-brush { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cal-b { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: .9rem; user-select: none; }
.cal-b input { position: absolute; opacity: 0; pointer-events: none; }
.cal-b i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.cal-b:has(input:checked) { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); font-weight: 600; }
.cal-work { --c: var(--ok); --cs: var(--ok-soft); } .cal-company { --c: var(--warn); --cs: var(--warn-soft); } .cal-off { --c: var(--faint); --cs: var(--surface-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 4px 0; } .cal-wd.we { color: var(--err); }
.cal-day { position: relative; min-height: 64px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: var(--cs); color: var(--text); border-radius: var(--radius-sm); padding: 6px; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; font: inherit; user-select: none; transition: transform .1s; }
.cal-day:active { transform: scale(.96); }
.cal-day b { font-size: 1.1rem; } .cal-day small { font-size: .68rem; color: var(--c); font-weight: 600; line-height: 1.15; }
.cal-day.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-day[disabled] { cursor: default; }
.cal-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .9rem; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; }
.cal-card + .card .mini-row { justify-content: space-between; padding: 9px 0; color: inherit; text-decoration: none; }
@media (max-width: 600px) { .cal-day { min-height: 50px; padding: 4px; } .cal-day small { display: none; } .cal-grid { gap: 4px; } }
.odo-fixed { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 1.05rem; }
.odo-fixed b { font-size: 1.6rem; font-variant-numeric: tabular-nums; } .odo-fixed .ico { margin-left: auto; color: var(--faint); }
.odo-diff { margin-top: 8px; } .odo-diff summary { cursor: pointer; color: var(--primary); font-size: .9rem; padding: 4px 0; }

/* ---------- Сканер талонів ---------- */
.scan{position:relative;margin-top:12px}
.scan input{height:52px!important;font-size:1.1rem!important;padding-left:44px;font-family:var(--mono)}
.scan .ico{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;max-height:260px;overflow:auto}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 6px 4px 10px;border-radius:8px;background:var(--surface);border:1px solid var(--line);font:600 .82rem var(--mono)}
.chip.new{border-color:var(--ok);background:var(--ok-soft)}
.chip.bad{border-color:var(--err);background:var(--err-soft);color:var(--err)}
.chip.locked{opacity:.7}
.chip small{font:500 .75rem var(--font);color:var(--muted)} .chip.bad small{color:var(--err)}
.chip button{border:0;background:none;cursor:pointer;color:var(--muted);font-size:16px;line-height:1;padding:0 4px}
.flash-ok{animation:fok .5s}.flash-bad{animation:fbad .6s}
@keyframes fok{from{box-shadow:0 0 0 4px color-mix(in srgb,var(--ok) 40%,transparent)}}
@keyframes fbad{0%,100%{transform:none}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.period-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.period-label { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
@media (max-width: 600px) { .period-label { margin-left: 0; width: 100%; } }
.grp-sum{display:flex;gap:6px 14px;flex-wrap:wrap;margin-top:10px;font-weight:600}

/* ---------- Талони (картки для вибору) ---------- */
.coupon-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.coupon-list label{cursor:pointer}.coupon-list input{position:absolute;opacity:0}
.coupon-list span{display:block;padding:10px;border:2px dashed var(--line-2);border-radius:12px;font-size:.85rem}
.coupon-list input:checked+span{border-style:solid;border-color:var(--ok);background:var(--ok-soft)}
.coupon-list .off{opacity:.35;pointer-events:none}

/* ---------- Чат ---------- */
.chat-page .content { max-width: none; padding-bottom: 12px; }
.chat-page .page-head { display: none; }
.chat-app { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100dvh - var(--top-h) - var(--wtabs-h, 0px) - 34px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.chat-app:has(.chat-thread:not([hidden])) { grid-template-columns: 330px minmax(0, 1fr) 360px; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-side-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.chat-search { position: relative; flex: 1; }
.chat-search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }
.chat-search input { padding-left: 32px !important; height: 40px; }
.chat-side-head .dd-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.chat-side-head .dd-menu button:hover { background: var(--surface-2); }
.chat-list { flex: 1; overflow-y: auto; padding: 6px; }
.chat-list-sep { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 12px 10px 4px; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none !important; width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-soft); }
.chat-av { width: 44px; height: 44px; font-size: .9rem; }
.chat-av.company { border-radius: 14px; font-size: 1.2rem; }
.chat-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-item-top, .chat-item-bot { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.chat-item-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chat-item-top time { font-size: .74rem; color: var(--faint); flex: 0 0 auto; }
.chat-item-bot > span { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; min-width: 0; }
.chat-unread { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font: 700 .72rem/20px var(--font); text-align: center; flex: 0 0 auto; }
.chat-unread.muted { background: var(--faint); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--surface-2); }
.chat-main.drop::after { content: 'Відпустіть, щоб прикріпити файли'; position: absolute; inset: 10px; border: 3px dashed var(--primary); border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary-soft) 85%, transparent); color: var(--primary); font-weight: 700; z-index: 5; }
.chat-placeholder { margin: auto; text-align: center; color: var(--muted); } .chat-placeholder .ico { width: 56px; height: 56px; color: var(--faint); stroke-width: 1.3; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 62px; }
.chat-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .chat-head-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-head-t small { color: var(--muted); font-size: .8rem; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px 8px; overscroll-behavior: contain; }
.chat-more { text-align: center; color: var(--faint); }
.chat-hello { text-align: center; color: var(--muted); padding: 60px 10px; }
.msg-day, .msg-new { text-align: center; margin: 14px 0 8px; } .msg-day span { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.msg-new { border-top: 1px solid var(--err); height: 0; margin: 18px 0; } .msg-new span { position: relative; top: -10px; background: var(--surface-2); color: var(--err); font-size: .75rem; font-weight: 700; padding: 0 8px; }
.msg-sys { text-align: center; margin: 8px 0; } .msg-sys span { color: var(--muted); font-size: .8rem; background: var(--surface-3); padding: 3px 10px; border-radius: 999px; display: inline-block; }
.msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; position: relative; }
.msg.cont { margin-top: 2px; }
.msg.mine { flex-direction: row-reverse; }
.msg-av, .msg-av-sp { width: 30px; height: 30px; flex: 0 0 30px; }
.msg-col { display: flex; flex-direction: column; max-width: min(620px, 78%); min-width: 0; }
.msg.mine .msg-col { align-items: flex-end; }
.bubble { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; padding: 7px 11px 6px; min-width: 70px; max-width: 100%; box-shadow: 0 1px 1px rgba(15,23,42,.04); overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 16px 16px 6px 16px; }
.msg.flash .bubble { animation: fok 1.5s; }
/* пошук у переписці */
.chat-hit .chat-hit-t { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.chat-hit .chat-hit-t em { font-style: normal; color: var(--text); }
.chat-hit mark, .msg-text mark.cf { background: #fde68a; color: #111; border-radius: 3px; padding: 0 1px; }
.msg.hit-cur .msg-text mark.cf { background: #f59e0b; color: #111; }
.chat-find { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-find > .ico { color: var(--faint); flex: none; }
.chat-find input { flex: 1; min-width: 0; height: 34px; }
.chat-find .cf-n { font-size: .8rem; color: var(--muted); white-space: nowrap; min-width: 64px; text-align: center; }
.chat-find .cf-n.none { color: var(--err); }
.chat-find .icon-btn:disabled { opacity: .35; }

.bubble.media { padding: 3px; }
.msg-author { font-weight: 700; font-size: .8rem; margin-bottom: 2px; }
.msg-text { white-space: normal; line-height: 1.45; } .msg-text.deleted { color: var(--faint); font-style: italic; }
.msg-meta { float: right; margin: 6px 0 -3px 10px; font-size: .7rem; color: var(--faint); white-space: nowrap; }
.bubble.media .msg-meta { position: absolute; right: 8px; bottom: 7px; margin: 0; background: rgba(0,0,0,.45); color: #fff; padding: 1px 6px; border-radius: 8px; }
.msg-quote { display: flex; flex-direction: column; text-align: left; border: 0; border-left: 3px solid var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: 6px; padding: 4px 8px; margin: 2px 0 6px; width: 100%; font: inherit; cursor: pointer; color: var(--text); }
.msg-quote b { font-size: .78rem; color: var(--primary); } .msg-quote span { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-imgs { display: grid; gap: 3px; border-radius: 13px; overflow: hidden; margin-bottom: 4px; max-width: 420px; }
.msg-imgs.n2, .msg-imgs.n4 { grid-template-columns: 1fr 1fr; } .msg-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.msg-imgs img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; background: var(--surface-3); }
.msg-imgs.n2 img, .msg-imgs.n3 img, .msg-imgs.n4 img { aspect-ratio: 1; height: 100%; }
.msg-video { display: block; width: 100%; max-width: 420px; max-height: 360px; border-radius: 12px; background: #000; margin-bottom: 4px; }
.msg-file { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 4px; color: var(--text); text-decoration: none !important; min-width: 200px; }
.msg-file span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .msg-file b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .msg-file small { color: var(--muted); font-size: .75rem; }
.msg-replies { border: 0; background: none; color: var(--primary); font: 600 .78rem var(--font); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; padding: 4px 6px; }
.msg-acts { display: none; gap: 2px; align-self: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px; box-shadow: var(--shadow); }
.msg-acts button { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.msg-acts button:hover { background: var(--surface-2); color: var(--text); }
@media (hover: hover) { .msg:hover .msg-acts { display: flex; } }
.msg.show-acts .msg-acts { display: flex; }
.poll { min-width: min(320px, 70vw); margin: 2px 0 4px; }
.poll-q { display: flex; gap: 6px; align-items: flex-start; } .poll-sub { font-size: .75rem; color: var(--muted); margin: 2px 0 8px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; overflow: hidden; flex-wrap: wrap; background: var(--surface); }
.poll-opt input { position: relative; z-index: 1; width: 18px; height: 18px; }
.poll-opt.on { border-color: var(--primary); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 14%, transparent); transition: width .4s var(--ease); }
.poll-t { position: relative; flex: 1; } .poll-n { position: relative; font-size: .78rem; font-weight: 700; color: var(--primary); }
.poll-who { position: relative; flex-basis: 100%; font-size: .72rem; color: var(--muted); }
.poll-foot { display: flex; gap: 10px; align-items: center; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.chat-compose-wrap { background: var(--surface); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; border-radius: 20px !important; padding: 10px 14px !important; line-height: 1.35; }
.chat-compose .icon-btn { cursor: pointer; flex: 0 0 auto; }
.chat-send { border-radius: 50% !important; width: 42px; height: 42px !important; flex: 0 0 42px; }
.chat-reply { display: flex; gap: 10px; align-items: center; padding: 6px 8px 8px; border-left: 3px solid var(--primary); margin-bottom: 6px; }
.chat-reply span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .chat-reply b { font-size: .8rem; color: var(--primary); } .chat-reply small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pending { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; position: relative; }
.chat-pf { display: flex; gap: 6px; align-items: center; padding: 4px 4px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); max-width: 220px; }
.chat-pf img { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; } .chat-pf small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pf button { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.chat-prog { flex-basis: 100%; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; } .chat-prog i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.chat-thread { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.th-root { border-bottom: 1px dashed var(--line-2); padding-bottom: 10px; }
.chat-modal-box { max-width: 520px; max-height: 90vh; overflow-y: auto; }
.up-list { max-height: 50vh; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; }
.up-row { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; cursor: pointer; }
.up-row:hover { background: var(--surface-2); } .up-row > span:not(.avatar) { flex: 1; display: flex; flex-direction: column; min-width: 0; } .up-row small { color: var(--muted); font-size: .78rem; }
.up-row input { width: 18px; height: 18px; }
.chat-lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.chat-lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.chat-lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 28px; cursor: pointer; }
.lb-x { top: 14px; right: 14px; } .lb-prev { left: 14px; top: 50%; } .lb-next { right: 14px; top: 50%; }
.lb-dl { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(255,255,255,.12); padding: 8px 14px; border-radius: 999px; display: flex; gap: 6px; align-items: center; }
.ln-totals { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .92rem; }
@media (max-width: 900px) {
  .chat-page .content { padding: 0; }
  .chat-app { grid-template-columns: minmax(0, 1fr) !important; border-radius: 0; border: 0; height: calc(100dvh - var(--top-h) - env(safe-area-inset-top) - 70px - env(safe-area-inset-bottom)); }
  body.chat-open .chat-app { height: calc(100dvh - var(--top-h) - env(safe-area-inset-top)); }
  body.chat-open .bottombar { display: none; }
  .chat-main { display: none; }
  body.chat-open .chat-side { display: none; }
  body.chat-open .chat-main { display: flex; }
  .chat-back { display: inline-grid; }
  .chat-thread { position: fixed; inset: 0; z-index: 60; padding-top: env(safe-area-inset-top); }
  .msg-col { max-width: 84%; }
  .chat-compose textarea { font-size: 16px; }
}
.dot-count.chat { background: var(--primary); } .dot-count.warn { background: var(--orange); }
.icon-btn.chat-btn { text-decoration: none !important; }

/* ---------- План складу ---------- */
.whp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.whp-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.seg-btns { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.seg-btns button { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 .86rem var(--font); color: var(--muted); cursor: pointer; }
.seg-btns button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.whp-snap { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); } .whp-snap select { width: auto; height: 34px; padding: 0 8px; }
.whp-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 280px; height: min(72vh, 760px); }
#whpSvg { width: 100%; height: 100%; touch-action: none; user-select: none; background: var(--surface-2); cursor: grab; display: block; }
#whpSvg.panning { cursor: grabbing; }
.whp-panel { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; font-size: .9rem; }
.whp-panel h4 { margin: 0 0 8px; }
.whp-panel .field { margin-bottom: 8px; }
.whp-panel .gap { margin-top: 8px; }
.whp-room { fill: color-mix(in srgb, var(--primary) 6%, var(--surface)); stroke: var(--text-2); stroke-width: 3; vector-effect: non-scaling-stroke; }
.whp-shelf rect { fill: #cbd5e1; stroke: #64748b; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: move; }
.whp-shelf.sel rect { fill: #93c5fd; stroke: var(--primary); stroke-width: 2.5; }
.whp-shelf.bad rect { fill: #fecaca; stroke: var(--err); }
.whp-shelf text { font: 700 13px var(--font); fill: #0f172a; pointer-events: none; }
.whp-v { fill: #fff; stroke: var(--primary); stroke-width: 2.5; vector-effect: non-scaling-stroke; cursor: move; }
.whp-v.sel { fill: var(--primary); }
.whp-mid { fill: var(--surface); stroke: var(--ok); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: copy; }
.whp-mid-t { fill: var(--ok); font: 700 14px var(--font); pointer-events: none; }
.whp-len { font: 600 11px var(--font); fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
@media (max-width: 900px) {
  .whp-body { grid-template-columns: minmax(0, 1fr); height: auto; }
  #whpSvg { height: 62vh; }
  .whp-panel { border-left: 0; border-top: 1px solid var(--line); }
  .seg-btns span { display: none; }
}

/* ---------- Клієнти, договори, документи ---------- */
.seg-btns a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 8px; font: 600 .86rem var(--font); color: var(--muted); text-decoration: none !important; }
.seg-btns a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.doc-info { margin-top: 12px; }
.doc-info-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .9rem; }
.doc-lines select, .doc-lines input { min-width: 0; }
.doc-lines td:first-child { min-width: 260px; }
.err-text.cell-sub, .cell-sub.err-text { color: var(--err); font-weight: 600; }
.ctr-table td, .ctr-table th { white-space: nowrap; }
.ctr-table .left-ok { color: var(--ok); font-weight: 700; } .ctr-table .left-zero { color: var(--faint); } .ctr-table .left-bad { color: var(--err); font-weight: 700; }
.client-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.client-head .grow { flex: 1; min-width: 240px; }
.client-head h2 { margin: 0 0 4px; font-size: 1.3rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .9rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
@media (max-width: 900px) { .doc-lines td:first-child { min-width: 0; } .kv { grid-template-columns: 1fr; } }
@media (max-width: 900px) { table.table.stack td .badge { white-space: normal; text-align: right; } }
.feed-ico[style*="--c"] { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
/* ---------- Сканер камерою ---------- */
.scan-overlay { position: fixed; inset: 0; z-index: 400; background: #000; display: grid; place-items: center; }
.scan-overlay video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; width: min(80vw, 420px); height: 34vw; max-height: 200px; border: 3px solid #22c55e; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-hint { position: absolute; bottom: 12%; color: #fff; font-weight: 600; background: rgba(0,0,0,.5); padding: 8px 14px; border-radius: 999px; }
.scan-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 28px; }
.scan-cam { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.scan .scan-cam .ico { position: static; transform: none; color: inherit; }
.scan:has(.scan-cam) input { padding-right: 52px; }
.track-box { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }

/* ---------- Випадаючі списки з пошуком ---------- */
.ss { position: relative; display: block; width: 100%; min-width: 0; }
.ss > select.ss-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.ss-input { text-overflow: ellipsis; cursor: pointer; padding-right: 34px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 15px; }
.ss-input:focus { cursor: text; }
.ss-list { position: fixed; z-index: 1200; max-height: 300px; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 4px; min-width: 220px; }
.ss-opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; line-height: 1.3; font-size: .93rem; color: var(--text); word-break: break-word; }
.ss-opt.hi { background: var(--primary-soft); }
.ss-opt.sel { font-weight: 650; color: var(--primary); }
.ss-opt.ss-empty { color: var(--muted); font-style: italic; }
.ss-opt mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.ss-more { padding: 8px 10px; font-size: .82rem; color: var(--muted); }
.field.has-error .ss-input { border-color: var(--err); background-color: var(--err-soft); }
@media (max-width: 700px) { .ss-opt { padding: 11px 10px; font-size: 1rem; } }
.toolbar .ss { display: block; width: 220px; flex: 0 1 220px; }
.toolbar .ss-input { height: 38px; }
@media (max-width: 900px) { .toolbar .ss { flex: 1 1 auto; width: auto; min-width: 140px; } }

/* ---------- Номенклатура ---------- */
.cat-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.cat-tree { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; padding: 14px; }
.cat-tree nav { display: flex; flex-direction: column; gap: 1px; }
.cat-f { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; color: var(--text-2); text-decoration: none !important; font-size: .92rem; }
.cat-f span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-f em { font-style: normal; font-size: .76rem; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 1px 7px; }
.cat-f:hover { background: var(--surface-3); }
.cat-f.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.cat-bulk { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 0; z-index: 4; }
.cat-bulk select { max-width: 280px; }
.cat-bulk .ss { width: 260px; flex: 0 1 260px; }
.folder-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.role-checks .check { min-height: 36px; }
@media (max-width: 900px) { .cat-layout { grid-template-columns: 1fr; } .cat-tree { position: static; max-height: 320px; } }

/* ---------- Ланцюжок документів ---------- */
.chain { display: flex; flex-direction: column; gap: 10px; }
.chain-row { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.chain-node { display: flex; flex-direction: column; gap: 3px; min-width: 150px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none !important; }
a.chain-node:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.chain-node .chain-t { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.chain-node b { font-size: .95rem; }
.chain-node small { color: var(--muted); font-size: .8rem; }
.chain-node .badge { align-self: flex-start; margin-top: 2px; }
.chain-node .btn { margin-top: 4px; align-self: flex-start; }
.chain-node.here { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.chain-node.empty { border-style: dashed; background: var(--surface-2); }
.chain-node.off { opacity: .55; }
.ch-order { border-left: 4px solid #ea7a12; } .ch-inv { border-left: 4px solid #2563eb; } .ch-act { border-left: 4px solid #16a34a; } .ch-pay { border-left: 4px solid #7c3aed; }
.ch-pay.done { background: var(--ok-soft); }
.chain-arrow { display: grid; place-items: center; color: var(--faint); }
@media (max-width: 700px) { .chain-row { flex-direction: column; } .chain-arrow { transform: rotate(90deg); height: 14px; } }
.sug-list .ss-opt .small { margin-top: 2px; }

/* ---------- Оплата праці ---------- */
.seg-btns label { display: inline-flex; cursor: pointer; }
.seg-btns label span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 8px; font: 600 .86rem var(--font); color: var(--muted); }
.seg-btns label.active span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.shift-ask { max-width: 560px; margin: 6vh auto; text-align: center; padding: 34px 28px; }
.shift-ask h2 { font-size: 1.6rem; margin: 10px 0 6px; }
.shift-ask-ico { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.shift-ask-ico .ico { width: 36px; height: 36px; }
.shift-card { border-left: 5px solid var(--line-2); }
.shift-card.state-open { border-left-color: var(--ok); } .shift-card.state-pause, .shift-card.state-lunch, .shift-card.state-break { border-left-color: var(--orange, #ea7a12); }
.shift-head { display: flex; gap: 16px; align-items: flex-start; }
.shift-ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.state-open .shift-ico { background: var(--ok-soft); color: var(--ok); }
.state-pause .shift-ico, .state-lunch .shift-ico, .state-break .shift-ico { background: var(--warn-soft); color: var(--warn); }
.shift-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; margin-left: 6px; }
.shift-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: flex-end; }
.shift-btn .shift-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px var(--bg); }
.shift-btn.st-open .shift-dot { background: var(--ok); } .shift-btn.st-pause .shift-dot, .shift-btn.st-lunch .shift-dot, .shift-btn.st-break .shift-dot { background: var(--warn); }
.shift-btn.st-none .shift-dot { background: var(--err); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ts-wrap { overflow: auto; }
.ts-table { font-size: .8rem; border-collapse: separate; border-spacing: 0; }
.ts-table th, .ts-table td { padding: 4px 3px !important; text-align: center; white-space: nowrap; }
.ts-table .ts-name { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 150px; padding-left: 12px !important; }
.ts-table .ts-name small { display: block; color: var(--muted); font-size: .72rem; }
.ts-table th.ts-d small { display: block; font-weight: 500; color: var(--faint); text-transform: none; }
.ts-table th.off, .ts-table td.off { background: var(--surface-3); }
.ts-table th.today { color: var(--primary); }
.ts-c a { display: block; min-width: 34px; padding: 4px 2px; border-radius: 6px; color: var(--muted); text-decoration: none !important; }
.ts-c.work a { background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.ts-c.live a { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.ts-c.late a { box-shadow: inset 0 0 0 2px var(--err); color: var(--err); }
.ts-c.auto a { background: var(--warn-soft); color: var(--warn); }
.ts-c.leave a { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; font-weight: 700; }
.ts-c.miss a { color: var(--err); }
.ts-c.sel a { outline: 2px solid var(--primary); }
.ts-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ts-legend .ts-c { display: inline-block; }
.ts-shift { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ts-shift .field { min-width: 0; }
.rule-card { border-top: 4px solid var(--line-2); }
.rule-card.on { border-top-color: var(--ok); }
.track-st { max-width: 260px; white-space: normal; line-height: 1.3; margin-top: 2px; }
.track-st.err { color: var(--err); }
.track-upd { animation: trackflash 1.6s ease; border-radius: 6px; }
@keyframes trackflash { 0% { background: var(--primary-soft); } 100% { background: transparent; } }

/* ---------- Системні налаштування: розділи ліворуч ---------- */
.sys-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.sys-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top-h) + 12px); }
.sys-nav button { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 11px; cursor: pointer; font: inherit; color: var(--text); }
.sys-nav button:hover { background: var(--surface-3); }
.sys-nav button b { display: block; font-weight: 650; font-size: .93rem; }
.sys-nav button small { display: block; color: var(--muted); font-size: .78rem; margin-top: 1px; }
.sys-nav .sys-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.sys-nav button.active { background: var(--primary-soft); }
.sys-nav button.active b { color: var(--primary); }
.sys-nav button.active .sys-ico { background: var(--primary); color: #fff; }
.sys-title { margin: 0 0 16px; font-size: 1.2rem; }
@media (max-width: 900px) {
  .sys-layout { grid-template-columns: 1fr; }
  .sys-nav { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sys-nav button { padding: 8px; gap: 8px; border: 1px solid var(--line); }
  .sys-nav button small { display: none; }
  .sys-nav .sys-ico { width: 30px; height: 30px; }
}
.cal-b.cal-hours { --c: #7c3aed; }
.cal-day .cal-h { font-style: normal; font-size: .64rem; color: var(--muted); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .cal-h.custom { color: #7c3aed; font-weight: 700; }
.cal-day.editing { outline: 3px solid #7c3aed; outline-offset: 1px; }
.cal-hedit { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 14px; padding: 12px 14px; border: 1px dashed #7c3aed; border-radius: 12px; background: color-mix(in srgb, #7c3aed 6%, transparent); }
.cal-hedit b { flex: 1 1 100%; }
.cal-hedit .field { width: 150px; }
@media (max-width: 600px) { .cal-day .cal-h { font-size: .58rem; } .cal-hedit .field { width: calc(50% - 8px); } }
.badge-teal { background: color-mix(in srgb, #0ea5b7 15%, transparent); color: #0e8a99; } .badge-pink { background: color-mix(in srgb, #db2777 14%, transparent); color: #db2777; }

/* 1.8.4 — відлучення та екран блокування під час паузи / обіду / перерви */
.shift-btn.st-away .shift-dot { background: var(--violet, #8b5cf6); animation: pulse 1.6s infinite; }
.away-box { flex: 1 1 100%; display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg-soft, rgba(0,0,0,.02)); }
.away-box .field { margin: 0; }
body.locked .sidebar, body.locked .sidebar-backdrop, body.locked .burger, body.locked .bottombar, body.locked .page-head,
body.locked .topbar-actions > *:not(#userMenu):not(#themeBtn) { display: none !important; }
body.locked .main { margin-left: 0 !important; }
body.locked .content { padding-bottom: 24px !important; }
.lock-screen { min-height: calc(100vh - 160px); display: flex; align-items: center; justify-content: center; padding: 12px 0; }
.lock-card { width: 100%; max-width: 480px; text-align: center; padding: 34px 28px 26px; border-top: 4px solid var(--warn); }
.lock-card.st-away { border-top-color: var(--violet, #8b5cf6); }
.lock-card.st-lunch { border-top-color: var(--ok); }
.lock-ico { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft, rgba(245,158,11,.14)); color: var(--warn); }
.lock-card.st-away .lock-ico { background: rgba(139,92,246,.14); color: var(--violet, #8b5cf6); }
.lock-card.st-lunch .lock-ico { background: rgba(34,197,94,.14); color: var(--ok); }
.lock-ico svg { width: 34px; height: 34px; }
.lock-card h2 { margin: 0 0 6px; }
.lock-note { font-style: italic; color: var(--muted); margin-bottom: 6px; }
.lock-timer { color: var(--text); font-size: 44px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.lock-text { margin: 14px 0 18px; }
.lock-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.lock-actions .btn { justify-content: center; }

/* 1.8.5 — видача зарплати, закриття місяця */
.pay-tabs small { font-weight: 500; color: var(--faint); font-size: .72rem; }
.pay-opts { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.pay-opts .field { margin: 0; min-width: 150px; }
.pay-opts .field.grow { flex: 1 1 220px; }
.pay-table .w-check { width: 34px; text-align: center; }
.pay-table .w-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.pay-col { min-width: 250px; }
.pay-box { display: flex; gap: 6px; }
.pay-box input { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.pay-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pchip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 9px; font: 600 .75rem var(--font); color: var(--muted); cursor: pointer; }
.pchip:hover { border-color: var(--primary); color: var(--primary); }
.pay-hint { color: var(--muted); margin-top: 3px; min-height: 0; }
.pay-hint b { color: var(--violet); }
.due-pos { color: var(--warn); } .due-neg { color: var(--err); } .due-zero { color: var(--ok); }
.pay-table tr.just-paid td { background: var(--ok-soft); transition: background .6s; }
.pay-table tfoot td { border-top: 2px solid var(--line); }
.pay-bar { position: sticky; bottom: 12px; z-index: 20; margin-top: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--primary); box-shadow: 0 10px 30px rgba(15,23,42,.18); }
tr.row-closed td { color: var(--muted); }
@media (max-width: 760px) {
  .pay-col { min-width: 0; }
  .pay-box input { flex: 1; width: auto; }
  .pay-bar { bottom: 74px; }
}
.ts-table tr.ts-none .ts-name a { color: var(--muted); }

/* 1.8.6 — розстрочки, історія місяців */
.loan-split { align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2, transparent); }
.loan-split select { width: auto; min-width: 150px; }
.loan-plan { max-width: 560px; }
.loan-plan select { min-width: 170px; }
.loan-plan tr.locked td { color: var(--muted); }
.loan-check { margin-top: 6px; font-weight: 600; }
.loan-check.ok { color: var(--ok); } .loan-check.warn { color: var(--warn); } .loan-check.bad { color: var(--err); }
.loan-alert { border-left: 4px solid var(--err); }
tr.row-sel td { background: var(--info-soft); }
.loan-plan-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 760px) {
  .loan-plan select { min-width: 0; width: 100%; }
  .loan-plan .lPart { max-width: 110px !important; }
  .loan-plan th, .loan-plan td { padding-left: 4px !important; padding-right: 4px !important; }
  .loan-split select { min-width: 0; flex: 1 1 140px; }
}

/* 1.8.7 — заробіток онлайн, масове внесення змін */
.earn-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 16px 28px; align-items: center; border-top: 4px solid var(--ok); }
.earn-card > .btn { grid-column: 1 / -1; justify-self: start; }
.earn-sum { font-size: 2.3rem; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--ok); line-height: 1.15; margin: 4px 0; }
.earn-sub { font-size: .9rem; }
.earn-live { color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.earn-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.earn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.earn-grid > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.earn-grid span { color: var(--muted); font-size: .78rem; } .earn-grid b { font-size: 1.05rem; font-variant-numeric: tabular-nums; } .earn-grid small { color: var(--faint); font-size: .72rem; }
@media (max-width: 900px) { .earn-card { grid-template-columns: 1fr; } .earn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .earn-sum { font-size: 2rem; } }
.bulk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bulk-grid .bulk-time { grid-column: 1 / -1; }
.bulk-users { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.bulk-users .check { min-height: 38px; } .bulk-users .check span { display: flex; flex-direction: column; line-height: 1.2; } .bulk-users small { color: var(--muted); font-weight: 400; font-size: .74rem; }
.bulk-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.bc-h { text-align: center; font-size: .72rem; color: var(--faint); text-transform: uppercase; font-weight: 700; }
.bc-d { position: relative; display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; user-select: none; background: var(--surface); }
.bc-d input { position: absolute; opacity: 0; pointer-events: none; }
.bc-d.off { background: var(--surface-3); color: var(--muted); }
.bc-d.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.bc-d.dis { opacity: .35; cursor: not-allowed; }
.bc-d i { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; display: none; background: var(--ok); }
.bc-d.has i { display: block; } .bc-d.on.has i { background: #fff; }
@media (max-width: 900px) { .bulk-grid { grid-template-columns: 1fr; } }
.tax-box { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; max-width: 460px; }
.tax-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tax-row:last-child { border-bottom: 0; }
.tax-row b { font-variant-numeric: tabular-nums; }
.tax-row.sub { color: var(--muted); } .tax-row.state { color: var(--primary); } .tax-row.state b { font-weight: 800; }
.tax-row.tot { font-weight: 800; font-size: 1rem; } 

/* 1.8.8 — самостійна реєстрація працівника */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .8rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card.wide { max-width: 640px; }
.reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.reg-grid .full { grid-column: 1 / -1; }
.reg-grid .field { margin: 0; }
.reg-sec { font-weight: 700; margin: 8px 0 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.reg-done { text-align: center; }
.reg-done .ico-big { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.reg-done .ico-big svg { width: 34px; height: 34px; }
.reg-card { border-left: 4px solid var(--warn); }
.reg-card.rej { border-left-color: var(--line-2); opacity: .85; }
.reg-data { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.reg-data div span { display: block; color: var(--muted); font-size: .75rem; }
@media (max-width: 560px) { .reg-grid { grid-template-columns: 1fr; } }
.rate-now td { background: var(--ok-soft); }
#rKids { width: 100%; } #rKids td:first-child { width: 55%; } #rKids input { width: 100%; min-width: 0; }

/* 1.8.10 — спливаючі сповіщення, смайлики, файли чату */
.pop-notifs { position: fixed; top: 70px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.pop-notif { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(15,23,42,.18); color: var(--text); text-decoration: none !important; animation: popIn .25s var(--ease, ease-out); transition: opacity .35s, transform .35s; }
.pop-notif.out { opacity: 0; transform: translateX(20px); }
.pop-notif.chat { border-left: 4px solid var(--primary); } .pop-notif.bell { border-left: 4px solid var(--warn); }
.pop-notif .avatar { flex: 0 0 auto; }
.pop-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: 0 0 auto; }
.pop-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pop-body b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-body small { color: var(--muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-x { border: 0; background: none; color: var(--faint); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes popIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.push-ask { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 250; display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--primary); box-shadow: 0 14px 40px rgba(15,23,42,.22); animation: popIn .3s; }
.push-ask > svg { color: var(--primary); flex: 0 0 auto; width: 26px; height: 26px; }
.push-ask span { flex: 1; display: flex; flex-direction: column; gap: 2px; } .push-ask small { color: var(--muted); }
@media (max-width: 900px) { .push-ask { bottom: 78px; flex-wrap: wrap; } .pop-notifs { top: 64px; right: 12px; } }
.dd-menu #soundToggle, .dd-menu #pushToggle { width: 100%; }

.emo-btn { flex: 0 0 auto; }
.chat-compose-wrap { position: relative; }
.emo-picker { position: absolute; bottom: calc(100% + 6px); left: 8px; z-index: 40; width: min(360px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 36px rgba(15,23,42,.2); overflow: hidden; animation: popIn .15s; }
.emo-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.emo-tabs button { flex: 1; border: 0; background: none; font-size: 20px; padding: 5px 0; border-radius: 8px; cursor: pointer; }
.emo-tabs button.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; max-height: 240px; overflow-y: auto; }
.emo-grid button { border: 0; background: none; font-size: 24px; line-height: 1; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.emo-grid button:hover { background: var(--surface-3); transform: scale(1.15); }

.files-tools { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 8px; }
.files-tabs { margin-bottom: 0; }
.files-tabs button small { color: var(--faint); font-weight: 500; }
.files-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.files-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.files-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.file-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.file-tile a { display: block; width: 100%; height: 100%; }
.file-tile img { width: 100%; height: 100%; object-fit: cover; }
.file-tile .ft-vid { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.file-tile button { position: absolute; right: 4px; bottom: 4px; border: 0; border-radius: 8px; background: rgba(15,23,42,.6); color: #fff; padding: 4px 5px; cursor: pointer; display: grid; place-items: center; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.file-row > svg { color: var(--primary); flex: 0 0 auto; }
.fr-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-b b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.fr-b small { color: var(--muted); font-size: .75rem; }
.files-more { align-self: center; margin-top: 6px; }

/* 1.8.11 — дерево номенклатури, що згортається */
.cat-row { display: flex; align-items: center; gap: 2px; }
.cat-row .cat-f { flex: 1; min-width: 0; padding-left: 6px; }
.cat-tg, .cat-tg-sp { flex: 0 0 22px; width: 22px; height: 22px; }
.cat-tg { border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.cat-tg:hover { background: var(--surface-3); color: var(--text); }
.cat-tg svg { transition: transform .15s; }
.cat-row.open > .cat-tg svg { transform: rotate(90deg); }
#catFq { width: 100%; }
.whats-new-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; background: linear-gradient(90deg, var(--primary-soft), var(--surface)); border: 1px solid var(--primary); }
.whats-new-bar .wn-ico { font-size: 22px; }
.whats-new-bar .grow { flex: 1; min-width: 200px; }
.wn-list { max-width: 860px; }
.wn-item.current { border-left: 4px solid var(--ok); }
.wn-ver { display: inline-block; font: 700 .8rem var(--mono, monospace); background: var(--surface-3); border-radius: 8px; padding: 2px 8px; margin-right: 6px; }
.wn-notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-foot a { color: inherit; text-decoration: none; } .sidebar-foot a:hover { color: var(--primary); }
.cat-row[hidden] { display: none; }
.cat-fb { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* 1.8.12 — аватарки завжди круглі */
.avatar { aspect-ratio: 1; flex-shrink: 0; flex-grow: 0; }
/* фото в повідомленні: одне — повністю, без обрізання; кілька — плиткою */
.msg-imgs.n1 { max-width: min(360px, 100%); background: transparent; }
.msg-imgs.n1 img { width: auto; max-width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 13px; }
.msg-imgs a { display: block; }

/* голосові повідомлення */
.voice { --p: 0%; display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 300px; padding: 4px 2px; }
.v-play { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; }
.v-play svg { width: 18px; height: 18px; }
.v-wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
.v-wave i { flex: 1; border-radius: 2px; background: var(--line-2); min-height: 4px; transition: background .15s; }
.v-wave i.on { background: var(--primary); }
.v-time { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.msg.mine .v-play { background: var(--primary); }
.rec-bar { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--err); animation: pulse 1.2s infinite; }
.rec-t { font-variant-numeric: tabular-nums; min-width: 40px; }
.rec-hint { flex: 1; color: var(--muted); font-size: .88rem; }
.rec-x { color: var(--err); }
.mic-btn { flex: 0 0 auto; }

/* 1.8.13 */
.dot-count.new { background: var(--ok); font-size: .58rem; padding: 0 4px; text-transform: uppercase; letter-spacing: .02em; }
:root { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }
.wn-btn .dot-count.new { top: 2px; right: -2px; }
@media (max-width: 520px) { .wn-btn { display: none; } }
/* чат: онлайн, галочки, закріплене, закладки, термінове */
.av-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.on-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px var(--surface); }
.on-dot.inline { position: static; display: inline-block; box-shadow: none; }
.on-txt { color: #16a34a; font-weight: 600; }
.chat-online { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
/* «Зараз онлайн»: плитки з іменем у кілька рядків, без прокрутки вбік */
.co-head { display: flex; justify-content: space-between; align-items: center; }
.co-more { border: 0; background: none; color: var(--primary); font: 600 .8rem var(--font); cursor: pointer; padding: 2px 4px; }
.co-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; padding-top: 8px; }
.chat-online.open .co-list { max-height: 260px; overflow-y: auto; }
.co-list button { position: relative; border: 0; background: none; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 10px; min-width: 0; color: var(--text); }
.co-list button:hover, .co-list button:focus-visible { background: var(--surface-2); }
.co-list .av-wrap { position: relative; display: inline-block; }
.co-list .avatar { width: 38px; height: 38px; font-size: .8rem; }
.co-n { font-size: .72rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticks { margin-left: 4px; color: var(--faint); font-size: .72rem; letter-spacing: -2px; font-weight: 700; }
.ticks.read { color: var(--muted); } .ticks.all { color: var(--primary); }
.ticks small { letter-spacing: 0; margin-left: 3px; font-weight: 600; }
.pin-bar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; cursor: pointer; padding: 2px 0; color: var(--text); border-left: 3px solid var(--primary); padding-left: 10px; }
.pin-main span { display: flex; flex-direction: column; min-width: 0; }
.pin-main b { font-size: .78rem; color: var(--primary); }
.pin-main small { color: var(--text-2, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-acts .on { color: var(--warn); fill: currentColor; }
.msg.urgent .bubble { box-shadow: 0 0 0 2px var(--err) inset; }
.msg-urgent { font-size: .72rem; font-weight: 800; color: var(--err); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.urgent-btn { font-size: 18px; filter: grayscale(1); opacity: .6; }
.urgent-btn.on { filter: none; opacity: 1; background: var(--err-soft); box-shadow: 0 0 0 2px var(--err); }
.bm-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.bm-row:hover { border-color: var(--primary); }
.bm-text { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* телефон: мікрофон на місці кнопки «Надіслати», поки поле порожнє */
@media (max-width: 900px) {
  .chat-compose:not(.has-text) .chat-send { display: none; }
  .chat-compose.has-text .mic-btn { display: none; }
  .chat-compose:not(.has-text) .mic-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; }
}

/* ---------- Тендери ---------- */
.tender-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tender-dates .td { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.tender-dates .td b { font-size: 1rem; }
.tender-dates .td.past { opacity: .6; }
.t-dlg { margin-top: 14px; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.t-dlg[hidden] { display: none; }

/* ---------- Чат з клієнтами (Viber) ---------- */
.cc-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.cc-tabs button { flex: 1; border: 0; background: none; padding: 8px 6px 10px; font: 600 .86rem var(--font); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.cc-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.cc-av { background: #7360f2; color: #fff; }
.cc-item-tags { display: flex; gap: 4px; flex-wrap: wrap; } .cc-item-tags:empty { display: none; }
.cc-tag { font-style: normal; font-size: .7rem; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; display: inline-flex; gap: 4px; align-items: center; }
.cc-tag.red { color: var(--err); background: var(--err-soft); } .cc-tag.orange { color: var(--warn); background: var(--warn-soft); }
.cc-tag .ico { width: 12px; height: 12px; }
.cc-head-tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; margin-top: 3px; } .cc-head-tags .cc-tag { white-space: nowrap; flex: 0 0 auto; }
.cc-app .chat-head-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1500px) { .cc-app:has(.cc-panel:not([hidden])) .cc-head-acts .btn span { display: none; } }
.cc-head-acts { flex-wrap: nowrap; }
.cc-on { color: var(--ok); font-weight: 600; }
.cc-menu a, .cc-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; text-decoration: none !important; }
.cc-menu a:hover, .cc-menu button:hover { background: var(--surface-2); }
.cc-author { color: var(--primary); }
.cc-tick { color: var(--faint); letter-spacing: -2px; margin-left: 2px; } .cc-tick.seen { color: #2563eb; }
.cc-fail { border: 0; background: none; color: var(--err); font: 600 .72rem var(--font); cursor: pointer; padding: 0; }
.msg.cc-call .bubble { background: var(--warn-soft); }
.cc-tpls { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; padding: 4px 4px 8px; }
.cc-tpls button { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--text); font: inherit; }
.cc-tpls button small { color: var(--muted); }
.cc-panel { overflow-y: auto; background: var(--surface); }
.cc-p-head { display: flex; flex-direction: column; gap: 2px; padding: 14px 44px 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.cc-p-close { position: absolute; right: 8px; top: 8px; }
.cc-p-body { padding: 4px 0 20px; }
.cc-p-sec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cc-p-sec h4 { margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.cc-p-sec .alert { margin: 0; }
.cc-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .cc-bal > div { display: flex; flex-direction: column; gap: 2px; }
.cc-ct { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; } .cc-ct > span { display: flex; flex-direction: column; min-width: 0; } .cc-ct small { color: var(--muted); font-size: .78rem; }
.cc-ord { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; }
.cc-ord-top { display: flex; gap: 8px; align-items: baseline; } .cc-ord-top .num { margin-left: auto; }
.cc-ord-st { font-size: .8rem; } .cc-ord-st .cell-sub { margin-top: 3px; }
.cc-find { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.cc-find-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.cc-find-row > span { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; } .cc-find-row small { color: var(--muted); font-size: .78rem; }
.cc-find-row .btn small { color: inherit; opacity: .7; margin-left: 4px; }
.cc-find-row.locked { opacity: .6; }
@media (max-width: 900px) { .cc-head-acts .btn span { display: none; } .cc-head-tags { display: none; } }
.dot-count.cc { background: #7360f2; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { cursor: pointer; } .seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 8px; font: 600 .88rem var(--font); color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }

/* ---------- Номенклатура: провідник каталогів ---------- */
.cx { display: flex; flex-direction: column; gap: 12px; }
.cx-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cx-kinds em { font-style: normal; font-size: .72rem; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 0 6px; margin-left: 2px; } .cx-kinds em:empty { display: none; }
.cx-search { position: relative; flex: 1 1 260px; min-width: 200px; } .cx-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--faint); } .cx-search input { padding-left: 36px !important; }
.cx-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.cx-tree { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.cx-tree-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .cx-tree-x { display: none; }
.cx-tree > input { margin-bottom: 8px; height: 36px; }
.cx-node { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px calc(6px + var(--d, 0) * 16px); border-radius: 9px; cursor: pointer; color: var(--text-2); font-size: .9rem; user-select: none; position: relative; }
.cx-node:hover { background: var(--surface-3); } .cx-node.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.cx-node .ico { flex: 0 0 auto; color: var(--warn); } .cx-node.cx-root .ico { color: var(--muted); } .cx-node.active .ico { color: var(--primary); }
.cx-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-node em { font-style: normal; font-size: .74rem; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 0 7px; }
.cx-tg, .cx-tg-sp { flex: 0 0 20px; width: 20px; height: 20px; } .cx-tg { border: 0; background: none; padding: 0; border-radius: 6px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.cx-tg .ico { color: var(--muted) !important; transition: transform .15s; } .cx-tg.open .ico { transform: rotate(90deg); } .cx-tg:hover { background: var(--line); }
.cx-dots { border: 0; background: none; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; flex: 0 0 26px; }
.cx-node:hover .cx-dots, .cx-tile:hover .cx-dots, .cx-dots:focus { opacity: 1; } .cx-dots:hover { background: var(--line); color: var(--text); }
@media (hover: none) { .cx-dots { opacity: 1; } }
.cx-hint { font-size: .78rem; color: var(--muted); margin: 10px 4px 0; } .cx-hint kbd { font: 600 .72rem var(--mono); background: var(--surface-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.cx-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.cx-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cx-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .95rem; } .cx-crumbs span { color: var(--faint); } .cx-crumbs a { color: var(--text-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; } .cx-crumbs a:hover { background: var(--surface-3); }
.cx-tree-btn { display: none; }
.cx-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 14px 16px 0; } .cx-folders:empty { display: none; }
.cx-tile { display: flex; gap: 10px; align-items: center; padding: 10px 8px 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: var(--text); min-width: 0; transition: border-color .12s, box-shadow .12s; }
.cx-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.cx-tile-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: 0 0 38px; }
.cx-tile-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .cx-tile-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cx-tile-t small { color: var(--muted); font-size: .78rem; }
.cx-tile-new { border-style: dashed; background: none; color: var(--muted); justify-content: center; gap: 8px; }
.cx-sub { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px 0; } .cx-sub:empty { display: none; }
.col-hidden { display: none !important; }
.col-th { position: relative; } .col-grip { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; } .col-grip:hover { background: var(--primary-soft); }
.col-bar { display: flex; justify-content: flex-end; position: relative; margin: 4px 0 -4px; } .col-menu { position: absolute; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.col-menu label { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; } .col-menu .col-reset { margin-top: 6px; }
table[style*="fixed"] td, table[style*="fixed"] th { overflow: hidden; text-overflow: ellipsis; }
.cx-table { margin-top: 10px; } .cx-table tbody tr { cursor: pointer; } .cx-table tr.off { opacity: .55; } .cx-table tr.sel td { background: var(--primary-soft); }
.cx-cb { width: 36px; } .cx-name b { font-weight: 600; }
.cx-price.editable { border-bottom: 1px dashed var(--line-2); cursor: text; } .cx-price.editable:hover { color: var(--primary); border-color: var(--primary); }
.cx-price-in { width: 110px !important; height: 32px !important; text-align: right; }
.cx-chip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; text-decoration: none !important; }
.cx-empty { text-align: center; color: var(--muted); padding: 50px 20px; } .cx-empty .ico { width: 46px; height: 46px; color: var(--faint); stroke-width: 1.3; } .cx-empty p { max-width: 460px; margin: 10px auto 0; }
.cx-sel { position: sticky; bottom: 12px; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); }
.cx-menu { position: fixed; z-index: 400; display: flex; flex-direction: column; min-width: 220px; padding: 6px; }
.cx-menu button { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.cx-menu button:hover { background: var(--surface-2); } .cx-menu button.on { color: var(--primary); font-weight: 600; } .cx-menu button.danger { color: var(--err); }
.cx-menu-t { padding: 6px 10px 8px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-menu-sep { font-size: .72rem; text-transform: uppercase; color: var(--faint); padding: 8px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.cx-pick { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow-y: auto; margin-top: 10px; }
.cx-pick button { display: flex; gap: 8px; align-items: center; border: 0; background: none; text-align: left; padding: 8px 10px 8px calc(10px + var(--d, 0) * 18px); border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; } .cx-pick button:hover { background: var(--primary-soft); } .cx-pick .ico { color: var(--warn); }
.cx.dragging .cx-node, .cx.dragging .cx-tile { transition: background .1s; }
.drop-on { background: var(--primary-soft) !important; outline: 2px dashed var(--primary); outline-offset: -2px; }
.cx-ghost { position: fixed; top: -100px; left: -100px; padding: 6px 12px; background: var(--primary); color: #fff; border-radius: 8px; font: 600 .85rem var(--font); }
@media (max-width: 900px) {
  .cx-body { grid-template-columns: 1fr; }
  .cx-tree { display: none; position: fixed; inset: 0 20% 0 0; z-index: 300; max-height: none; border-radius: 0; top: 0; padding-top: calc(12px + env(safe-area-inset-top)); }
  .cx.tree-open .cx-tree { display: block; } .cx-tree-x { display: grid; } .cx-tree-btn { display: inline-flex; }
  .cx-bar { flex-wrap: wrap; } .cx-top .btn span { display: none; } .cx-top .btn { padding: 0 12px; }
  .cx-folders { grid-template-columns: 1fr 1fr; } .cx-table thead { display: none; }
  .cx-table td:nth-child(5) { display: none; }
}
.cx-sub [data-menu] { margin-left: auto; }
@media (max-width: 900px) { .cx.tree-open .cx-tree { box-shadow: 0 0 0 100vmax rgba(15,23,42,.35); } .cx-hint { display: none; } }

/* ---------- Згадки @колега в чаті ---------- */
.mention { color: var(--primary); font-weight: 600; background: color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 5px; padding: 0 3px; }
.mention.me { color: #fff; background: var(--orange); }
.msg.mentioned .bubble { box-shadow: inset 3px 0 0 var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--surface)); }
.chat-unread.mention { background: var(--orange); }
.chat-compose { position: relative; }
.mention-pop { position: absolute; left: 40px; right: 40px; bottom: calc(100% + 6px); z-index: 50; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 300px; overflow-y: auto; }
.mention-pop button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 9px; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.mention-pop button span:last-child { display: flex; flex-direction: column; min-width: 0; } .mention-pop small { color: var(--muted); font-size: .76rem; }
.mention-pop button.hi, .mention-pop button:hover { background: var(--primary-soft); }
.mention-hint { font-size: .74rem; color: var(--muted); padding: 4px 10px 6px; }
@media (max-width: 900px) { .mention-pop { left: 0; right: 0; } }

/* ---------- Навантаження сервера ---------- */
.srv-live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.srv-tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.srv-tile > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.srv-tile small { color: var(--muted); font-size: .8rem; } .srv-tile b { font-size: 1.6rem; line-height: 1.1; font-weight: 750; } .srv-tile em { font-style: normal; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 42px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.srv-bar { display: block; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 2px 0; } .srv-bar > i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--ok); transition: width .6s var(--ease), background .3s; }
.srv-crm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.srv-crm-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; } .srv-crm-grid small { color: var(--muted); font-size: .8rem; } .srv-crm-grid b { font-size: 1.45rem; font-weight: 750; } .srv-crm-grid em { font-style: normal; font-size: .76rem; color: var(--muted); }
.srv-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; opacity: .3; }
.srv-pulse.on { animation: srvp 1s ease-out; } @keyframes srvp { 0% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { opacity: .3; box-shadow: 0 0 0 8px transparent; } }
.srv-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; } .srv-charts h4 { margin: 0 0 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.srv-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px 0 12px; }
.srv-mini .srv-tile { padding: 10px; box-shadow: none; gap: 8px; } .srv-mini .srv-ico { display: none; } .srv-mini .srv-tile b { font-size: 1.2rem; }
@media (max-width: 1100px) { .srv-live, .srv-crm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .srv-charts { grid-template-columns: 1fr; } .srv-live { gap: 10px; } .srv-tile { padding: 12px; } .srv-tile b { font-size: 1.3rem; } .srv-ico { display: none; } .srv-mini { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 700px) { .srv-crm .card-head, .card-head:has(#srvRange) { flex-wrap: wrap; gap: 8px; } #srvRange { max-width: 100%; overflow-x: auto; } #srvRange button { padding: 6px 9px; } }
/* фото номенклатури */
.cat-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-photos figure { margin: 0; width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.cat-photos img { width: 120px; height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.cat-photos figcaption { font-size: .72rem; color: var(--muted); }
.cat-photos figure .btn { position: absolute; top: 4px; background: var(--surface); box-shadow: var(--shadow); padding: 0 6px; height: 26px; }
.cat-photos figure [data-ph-del] { right: 4px; } .cat-photos figure [data-ph-main] { left: 4px; }
.cat-photo-add { width: 120px; height: 120px; border: 2px dashed var(--line-2); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: .82rem; }
.cat-photo-add:hover { border-color: var(--primary); color: var(--primary); }
.cx-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: 0 0 40px; }
.cx-ph.none { display: grid; place-items: center; color: var(--faint); background: var(--surface-2); }
.cx-namecell { display: flex; gap: 10px; align-items: center; } .cx-namecell > div { min-width: 0; }

/* ---------- Вибір з номенклатури (вікно каталогу) ---------- */
.ss-pick .ss-input { cursor: pointer; padding-right: 34px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 10px center !important; }
.cp-wrap { position: fixed; inset: 0; z-index: 500; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 20px; }
.cp { width: min(1100px, 100%); height: min(760px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.cp-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cp-search { flex: 1 1 260px; }
.cp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.cp-tree { overflow-y: auto; border-right: 1px solid var(--line); padding: 8px; background: var(--surface-2); }
.cp-node { display: flex; gap: 6px; align-items: center; width: 100%; border: 0; background: none; text-align: left; font: inherit; font-size: .88rem; color: var(--text-2); padding: 6px 6px 6px calc(6px + var(--d, 0) * 14px); border-radius: 8px; cursor: pointer; }
.cp-node:hover { background: var(--surface-3); } .cp-node.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.cp-node > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cp-node em { font-style: normal; font-size: .72rem; color: var(--muted); }
.cp-node .ico { color: var(--warn); flex: 0 0 auto; }
.cp-tg, .cp-tg-sp { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; } .cp-tg .ico { color: var(--muted) !important; transition: transform .15s; } .cp-tg.open .ico { transform: rotate(90deg); }
.cp-main { display: flex; flex-direction: column; min-height: 0; }
.cp-crumbs { padding: 10px 14px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.cp-list { flex: 1; overflow-y: auto; padding: 6px; }
.cp-item { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; text-align: left; font: inherit; color: var(--text); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.cp-item:hover, .cp-item.hi { background: var(--surface-2); } .cp-item.on { background: var(--primary-soft); } .cp-item.off { opacity: .5; }
.cp-item img, .cp-noph { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.cp-noph { display: grid; place-items: center; color: var(--faint); background: var(--surface-2); }
.cp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .cp-t b { font-weight: 600; } .cp-t small { color: var(--muted); font-size: .78rem; }
.cp-p { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; } .cp-p small { color: var(--muted); font-size: .76rem; }
.cp-check { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; color: #fff; }
.cp-item.on .cp-check { background: var(--primary); border-color: var(--primary); }
.cp-foot { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
body.cp-open { overflow: hidden; }
@media (max-width: 800px) {
  .cp-wrap { padding: 0; } .cp { height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .cp-body { grid-template-columns: 1fr; } .cp-tree { display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .cp-tree .cp-node { flex: 0 0 auto; width: auto; padding: 6px 10px !important; background: var(--surface); border: 1px solid var(--line); } .cp-tree .cp-tg, .cp-tree .cp-tg-sp { display: none; }
  .cp-kinds span { padding: 6px 10px; } .cp-search { flex-basis: 100%; order: 3; }
}
/* 1.9.6 — клієнти як провідник */
.cl-table td .badge { vertical-align: 1px; }
.cl-folders-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow: auto; margin-bottom: 4px; }
#clNav .cx-menu-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* 2.0 — посилки */
.pc-code { font: 600 1.15rem var(--mono, monospace); letter-spacing: .03em; padding: 12px 14px; }
.pc-scan textarea { width: 100%; }
.pc-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .88rem; font-weight: 600; }
.pc-step i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); font-style: normal; font-size: .8rem; }
.pc-step.done { color: var(--ok); } .pc-step.done i { background: var(--ok); color: #fff; }
.pc-step.cur { color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); } .pc-step.cur i { background: var(--primary); color: #fff; }
.pc-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.pc-act { display: flex; } .pc-act input { position: absolute; opacity: 0; pointer-events: none; }
.pc-act span { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.pc-act input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-weight: 600; }
.pc-act input:focus-visible + span { outline: 2px solid var(--primary); }
.pc-act input:disabled + span { cursor: default; }
.pc-attn { box-shadow: 0 0 0 2px var(--warn, #f59e0b); }
.pc-docs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.pc-docs .switch { margin: 0; }
.pc-scanrow { flex-wrap: wrap; } .pc-scanrow .pc-code { flex: 1; min-width: 220px; }
.pc-sum { margin-bottom: 8px; }
.pi-table select, .pi-table input { min-width: 0; }
.pi-table tr.pi-unk td { background: color-mix(in srgb, var(--warn, #f59e0b) 8%, transparent); }
/* 2.0 — канбан */
.kb-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-col { background: var(--surface-2); border-radius: 14px; padding: 10px; min-height: 200px; }
.kb-col header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 2px 4px; }
.kb-col header em { font-style: normal; color: var(--muted); font-size: .85rem; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 120px; border-radius: 10px; }
.kb-list.over { outline: 2px dashed var(--primary); outline-offset: 2px; }
.kb-empty { color: var(--faint); text-align: center; margin: 30px 0; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.kb-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.kb-card.dragging { opacity: .5; }
.kb-card.late { border-left: 3px solid var(--err); }
.kb-card b { display: block; font-size: .92rem; line-height: 1.3; }
.kb-sub { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.kb-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.kb-meta span { display: inline-flex; gap: 3px; align-items: center; }
.kb-meta .spacer { flex: 1; }
.kb-warn { color: var(--warn, #d97706); font-weight: 700; }
.kb-late { color: var(--err); font-weight: 600; }
.kb-av { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; justify-content: center; }
@media (max-width: 700px) { .kb-cols { grid-auto-columns: 82%; scroll-snap-type: x mandatory; } .kb-col { scroll-snap-align: start; } }
/* 1.10.1 — водій: спершу маршрут */
.shift-trip { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; margin: 0 auto 18px; max-width: 480px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); }
.shift-trip > div:first-child { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.shift-trip small { display: block; margin-top: 2px; }
.shift-trip .btn { flex: 1 1 100%; justify-content: center; }
.shift-trip .grow { flex: 1 1 0; min-width: 0; }
/* 1.10.2 — ящики посилки */
.pc-seats, .pc-seatbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.pc-seat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: .85rem; color: var(--text); }
.pc-seat small { color: var(--muted); font-size: .78rem; }
.pc-seat.rec { border-color: color-mix(in srgb, var(--ok) 45%, transparent); } .pc-seat.rec .ico { color: var(--ok); }
.pc-seat.unp { background: var(--ok-soft); border-color: transparent; } .pc-seat.unp .ico { color: var(--ok); }
.pc-seat.miss { border-style: dashed; color: var(--muted); } .pc-seat.miss .ico { color: var(--warn); }
.pc-seatbar .pc-seat { cursor: pointer; }
.pc-seatbar .pc-seat.cur { box-shadow: 0 0 0 2px var(--primary); }
.pc-seatact { justify-content: space-between; margin: 4px 0 10px; }
.pc-was { margin-right: 4px; }
/* 1.10.3 — коди ящиків, відправник / отримувач */
.pc-sc { font-size: .78rem; color: var(--muted); }
.pc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pc-party { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.pc-party a { display: inline-flex; gap: 5px; align-items: center; }
@media (max-width: 600px) { .pc-parties { grid-template-columns: 1fr; } }
/* 1.10.8 — фото профілю */
.avatar.has-photo { background: var(--surface-2); padding: 0; overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.pf-photo { display: flex; flex-direction: column; align-items: center; }
.pf-av { position: relative; cursor: pointer; margin: 6px auto 12px; display: inline-block; }
.pf-av .avatar { width: 96px; height: 96px; font-size: 1.7rem; }
.pf-cam { position: absolute; right: 0; bottom: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 0 0 3px var(--surface); }
.pf-crop { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 12px; width: 100%; }
.pf-stage { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--primary); touch-action: none; }
.pf-stage canvas { width: 100%; height: 100%; cursor: grab; display: block; }
.pf-stage canvas:active { cursor: grabbing; }
.pf-crop .field { width: 100%; max-width: 260px; }
/* 1.10.9 — хто відсутній */
.dot-count.abs { background: var(--warn); }
.abs-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px 4px; font-weight: 700; }
.abs-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.abs-row b { display: block; font-size: .9rem; } .abs-row small { color: var(--muted); font-size: .78rem; }
.abs-when { font-size: .8rem; font-weight: 600; color: var(--warn); white-space: nowrap; text-align: right; }
.abs-when small { display: block; color: var(--muted); font-weight: 400; }
.abs-month { margin: 0 0 12px; font-size: 1.2rem; }
.abs-grid { border-collapse: collapse; width: 100%; font-size: .82rem; }
.abs-grid th, .abs-grid td { border-bottom: 1px solid var(--line); text-align: center; padding: 6px 0; min-width: 30px; }
.abs-grid th { color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.abs-grid th b { display: block; color: var(--text); } .abs-grid th small { font-size: .68rem; }
.abs-grid .off { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.abs-grid .today { box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary); }
.abs-grid .abs-name { text-align: left; padding: 6px 12px; min-width: 200px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.abs-grid th.abs-name { background: var(--surface-2); z-index: 2; }
.abs-grid .abs-name b { display: block; font-size: .88rem; } .abs-grid .abs-name small { color: var(--muted); }
.abs-grid td.num, .abs-grid th.num { padding: 0 12px; }
.abs-bar { display: block; height: 22px; margin: 0 3px; border-radius: 6px; background: var(--warn); opacity: .85; }
.abs-bar.l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.abs-bar.r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.abs-list .mini-row.past { opacity: .55; }
.abs-row .grow { flex: 1; min-width: 0; }
.abs-grid .m1 { box-shadow: inset 2px 0 0 var(--line-2); }
/* 1.11 — смартфони (iPhone / Android) */
@media (max-width: 900px) {
  /* iPhone збільшує сторінку, якщо в полі шрифт менший за 16px — тримаємо 16px у всіх полях */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea, .ss-input { font-size: 16px !important; }
}
@media (max-width: 900px) {
  /* панель «Зберегти» поза карткою — не виходить за край екрана */
  .form-actions.card, .content > form > .form-actions, .content > .form-actions { margin-left: 0; margin-right: 0; border-radius: 16px; }
}
.m-title { display: none; }
.dd-menu .theme-mi { display: none; }
@media (max-width: 600px) {
  /* верхня панель: лише значки; назва сторінки — окремим рядком під нею */
  .topbar-title { display: none; }
  .topbar { justify-content: space-between; }
  .topbar-actions { gap: 2px; flex: 1; justify-content: flex-end; min-width: 0; }
  .topbar-actions .icon-btn { width: 38px; height: 38px; }
  #themeBtn, .topbar .wn-btn { display: none !important; }
  .dd-menu .theme-mi { display: flex; }
  .m-title { display: block; margin: 6px 2px 12px; }
  .m-title h1 { font-size: 1.3rem; margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
  .m-title .crumbs { margin-bottom: 2px; }
  body.chat-page .m-title { display: none; }
  /* поля форм: короткі — по два в рядок, решта — на всю ширину */
  .form-grid > *, .form-grid > [class~="c5"], .form-grid > [class~="c6"] { grid-column: span 12 !important; }
  .form-grid > [class~="c1"], .form-grid > [class~="c2"], .form-grid > [class~="c3"], .form-grid > [class~="c4"] { grid-column: span 6 !important; }
  /* дати й числа не обрізаються */
  input[type=date], input[type=datetime-local], input[type=month], input[type=time] { min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }
  /* фільтри й пошук у рядку — переносяться */
  form.gap, .gap { flex-wrap: wrap; }
  .toolbar { flex-wrap: wrap; }
  .tabs { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .alert { flex-wrap: wrap; }
  .alert .btn { margin-left: auto; }
}
@media (max-width: 900px) {
  a, button, [role=button], label, summary { -webkit-tap-highlight-color: rgba(37, 99, 235, .12); }
  .page-actions { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  /* кнопки форми — в один рядок, щоб не закривали пів екрана */
  .crud-actions { flex-wrap: nowrap; gap: 8px; }
  .crud-actions .spacer { display: none; }
  .crud-actions .btn { flex: 1 1 auto; min-width: 0; padding: 0 12px; height: 46px; }
  .crud-actions .btn-primary { flex: 2 1 auto; }
  .crud-actions .fa-icon { flex: 0 0 46px; padding: 0; }
  .crud-actions .fa-icon span { display: none; }
  form.gap[style*="nowrap"] { flex-wrap: wrap !important; }
}
@media (max-width: 600px) {
  /* вкладки в рядку з фільтрами — на всю ширину, гортаються пальцем */
  .gap > .tabs { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  form.gap > input[type=search] { flex: 1 1 160px; width: auto !important; }
  form.gap > select { flex: 0 1 auto; max-width: 100%; }
  .alert > div, .alert > span { min-width: 0; flex: 1 1 200px; }
}

/* ---------- Застосунок «ES-TE Чат» (тека chat/) ---------- */
body.ca { background: var(--bg); }
body.chat-standalone { overflow: hidden; overscroll-behavior: none; }
.ca-bar { position: relative; z-index: 30; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; min-height: 56px; }
.ca-logo { border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.18); flex: 0 0 auto; }
.ca-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ca-title b { font-size: 1.08rem; }
.ca-title small { opacity: .8; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-title small.off { opacity: 1; color: #fde68a; }
.ca-bar .user-btn { padding: 2px; position: relative; }
.ca-bar .user-btn:hover { background: rgba(255,255,255,.14); box-shadow: none; }
.ca-bar .user-btn .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.ca-bar .dot-count { top: -2px; right: -2px; background: var(--orange); }
.ca-bar .dd-menu { color: var(--text); min-width: 250px; }
.ca-bar .dd-menu > button, .ca-bar .dd-menu > a, .ca-bar .dd-menu form button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 14px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.ca-bar .dd-menu > button:hover, .ca-bar .dd-menu > a:hover, .ca-bar .dd-menu form button:hover { background: var(--surface-2); }
.ca-ver { padding: 8px 14px 10px; border-top: 1px solid var(--line); }
.ca-main { padding: 0; }
.chat-standalone .chat-app { height: calc(var(--app-h, 100dvh) - 56px - env(safe-area-inset-top)); border-radius: 0; border: 0; box-shadow: none; }
.chat-standalone .chat-compose-wrap { padding-bottom: env(safe-area-inset-bottom); }
.chat-standalone .chat-list { padding-bottom: env(safe-area-inset-bottom); }
.chat-standalone .push-ask { bottom: calc(16px + env(safe-area-inset-bottom)); }
.chat-standalone .pop-notifs { top: calc(62px + env(safe-area-inset-top)); }
@media (max-width: 900px) {
  body.chat-standalone.chat-open .ca-bar { display: none; }
  body.chat-standalone .chat-app { height: calc(var(--app-h, 100dvh) - 56px - env(safe-area-inset-top)); }
  body.chat-standalone.chat-open .chat-app { height: var(--app-h, 100dvh); }
  body.chat-standalone.chat-open .chat-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .chat-standalone .chat-thread { padding-bottom: env(safe-area-inset-bottom); }
}
.ca-auth .auth-wrap { min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); background: linear-gradient(160deg, #3b82f6, #1d4ed8 60%); }
.ca-form { display: flex; flex-direction: column; gap: 12px; }
.ca-sheet .modal-box { max-width: 460px; }
.ca-steps { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 12px; }
.ca-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.ca-steps .ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--primary); }
.ca-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.push-ask small .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- «Завантажити додаток» ---------- */
.ga-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ga-app { display: flex; flex-direction: column; gap: 14px; }
.ga-top { display: flex; gap: 16px; align-items: center; }
.ga-top img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 18px rgba(15,23,42,.18); flex: 0 0 auto; }
.ga-top h2 { margin: 0; font-size: 1.3rem; }
.ga-top p { margin: 2px 0 0; color: var(--muted); }
.ga-feat { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.ga-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ga-qr { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.ga-qr canvas { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 10px; flex: 0 0 auto; image-rendering: pixelated; }
.ga-qr small { color: var(--muted); }
.ga-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ga-how h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.ga-mine { outline: 2px solid var(--primary); }
.ga-badge { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft, #dbeafe); color: var(--primary); margin-left: 6px; vertical-align: 2px; }
@media (max-width: 600px) { .ga-qr { display: none; } .ga-btns .btn { flex: 1 1 100%; } }
@media (max-width: 900px) { body.chat-standalone.chat-open .ca-ask { display: none; } }
.ca-diag { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 10px; }
.ca-diag li { display: flex; gap: 10px; align-items: flex-start; }
.ca-diag li > .ico { flex: 0 0 22px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; color: #fff; background: var(--green, #16a34a); }
.ca-diag li.bad > .ico { background: var(--red, #dc2626); }
.ca-diag span { display: flex; flex-direction: column; gap: 2px; } .ca-diag small { color: var(--muted); }
.chat-draft { color: var(--red, #dc2626); font-style: normal; font-weight: 600; }

/* ---------- Панель чату поверх поточної роботи ---------- */
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--cp-w, 440px), 100vw); z-index: 95; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15,23,42,.18); animation: cpIn .18s ease-out; }
.chat-panel iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--surface); }
@keyframes cpIn { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 1500px) { body.chat-panel-open .main { margin-right: var(--cp-w, 440px); } }   /* на широкому екрані сторінка звужується, нічого не перекрито */
@media (max-width: 600px) { .chat-panel { width: 100vw; border-left: 0; padding-top: env(safe-area-inset-top); } }
body.chat-panel-open .pop-notifs { right: calc(var(--cp-w, 440px) + 16px); }
@media (max-width: 900px) { body.chat-panel-open .pop-notifs { display: none; } }
/* сама панель (chat/?embed=1) */
body.chat-embed .ca-embed-bar { min-height: 48px; padding: 6px 8px 6px 14px; gap: 6px; }
body.chat-embed .ca-embed-bar b { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
body.chat-embed .ca-embed-bar .icon-btn { color: #fff; width: 36px; height: 36px; }
body.chat-embed .ca-embed-bar .icon-btn:hover { background: rgba(255,255,255,.16); }
body.chat-embed .chat-app, body.chat-embed.chat-open .chat-app { height: calc(var(--app-h, 100vh) - 48px) !important; }
body.chat-embed.chat-open .ca-bar { display: flex !important; }
body.chat-embed.chat-open .chat-head { padding-top: 10px !important; }

/* ---------- Робочі вкладки ---------- */
.wtabs { display: flex; align-items: center; gap: 6px; margin: -10px 0 12px; overflow-x: auto; scrollbar-width: thin; padding: 6px 0; position: sticky; top: var(--top-h); z-index: 25; background: var(--bg); }   /* завжди видно — не треба гортати вгору */
.wt-label { color: var(--faint, #94a3b8); display: grid; place-items: center; flex: 0 0 auto; }
.wt { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 240px; padding: 5px 4px 5px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: .84rem; text-decoration: none !important; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.wt span { overflow: hidden; text-overflow: ellipsis; }
.wt .ico { color: var(--muted); flex: 0 0 auto; }
.wt:hover { border-color: var(--primary); }
.wt.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.wt.active .ico { color: var(--primary); }
.wt-x { border: 0; background: none; color: var(--muted); width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; flex: 0 0 auto; }
.wt-x:hover { background: var(--surface-3); color: var(--red, #dc2626); }
.wt-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; padding: 4px 6px; }
.wt-clear:hover { color: var(--primary); }
@media (max-width: 900px) { .wtabs { display: none; } }
.form-restore { margin: 0 0 14px; flex-wrap: wrap; }
.form-restore span { flex: 1 1 260px; }

/* ---------- Реакції й пересилання в чаті ---------- */
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.msg.mine .msg-reacts { justify-content: flex-end; }
.react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 8px 2px 6px; font: inherit; font-size: .95rem; line-height: 1.4; cursor: pointer; color: var(--text); }
.react b { font-size: .78rem; font-weight: 700; color: var(--muted); }
.react small { font-size: .72rem; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react.mine { border-color: var(--primary); background: var(--primary-soft); }
.react.mine b, .react.mine small { color: var(--primary); }
.react:hover { border-color: var(--primary); }
.react-pick { position: fixed; z-index: 300; display: flex; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 16px); gap: 2px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px rgba(15,23,42,.2); animation: popIn .15s; }
.react-pick button { border: 0; background: none; font-size: 1.45rem; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.react-pick button:hover { transform: scale(1.25); background: var(--surface-2); }
.react-pick button.on { background: var(--primary-soft); }
.msg-fwd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; font-size: .78rem; color: var(--muted); margin-bottom: 4px; font-style: italic; }
.msg-fwd b { font-style: normal; color: var(--primary); }
.fwd-prev { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 8px; font-size: .88rem; }
.fwd-prev span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.fwd-list { max-height: min(46vh, 380px); overflow: auto; }
@media (max-width: 600px) { .react-pick { border-radius: 22px; } .react-pick button { width: 34px; height: 34px; font-size: 1.25rem; } }

/* Панель дій біля повідомлення — поверх, не стискає саме повідомлення (телефон і комп'ютер) */
.msg-acts { position: absolute; z-index: 6; bottom: calc(100% - 12px); left: 44px; align-self: auto; flex-wrap: wrap; max-width: calc(100% - 48px); }
.msg.mine .msg-acts { left: auto; right: 0; }
.msg.acts-below .msg-acts { bottom: auto; top: calc(100% - 4px); }
.th-msgs .msg-acts, .chat-direct .msg-acts { left: 0; }
@media (max-width: 600px) { .msg-acts { left: 0; max-width: 100%; } .msg-acts button { width: 36px; height: 36px; } }
/* 1.14.0 — ремонт техніки, два склади посилок, канбан з посилки */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-3); border-radius: 12px; padding: 4px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.pc-seats .pc-seat { flex-wrap: wrap; }
.pc-dest { display: inline-flex; gap: 3px; align-items: center; }
.pc-mv { display: inline; margin: 0; }
.btn-xs { padding: 2px 8px; min-height: 26px; font-size: .78rem; border-radius: 8px; }
.pc-own > summary, .pc-tasknew > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-own > summary b, .pc-tasknew > summary b { display: inline-flex; gap: 6px; align-items: center; }
.kb-kind { margin: 0 4px 4px 0; display: inline-block; }
.kb-defect { color: var(--text); }
.kb-take { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 12px 0 4px; padding: 12px; border-radius: 12px; background: var(--primary-soft); }
a.mini-row { color: inherit; text-decoration: none; }
a.mini-row:hover b { color: var(--primary); }
.rp-head h2.rp-dev { margin: 8px 0 4px; font-size: 1.3rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-tags { display: inline-flex; gap: 4px; font-size: .8rem; }
.rp-timer { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.rp-timer small { display: block; }
.rp-timer form { margin: 0; }
.rp-run { color: var(--primary); }
.rp-run::before { content: '● '; color: var(--err); animation: rpBlink 1.2s infinite; }
@keyframes rpBlink { 50% { opacity: .2; } }
.rp-acts { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.rp-acts form { margin: 0; }
.rp-st select { width: auto; } .rp-st input { width: 220px; max-width: 100%; }
.rp-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.rp-devpick { position: relative; }
.rp-devpick input.rp-ok { border-color: var(--ok); background: var(--ok-soft); }
.rp-devlist { position: absolute; z-index: 30; left: 0; right: 0; top: 64px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg, var(--shadow)); padding: 4px; }
.rp-devlist button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.rp-devlist button small { color: var(--muted); white-space: nowrap; }
.rp-devlist button:hover, .rp-devlist button.on { background: var(--primary-soft); }
.rp-devnone { padding: 10px; color: var(--muted); font-size: .9rem; }
.rp-inline { display: inline-block; width: 200px; max-width: 100%; padding: 2px 8px; min-height: 28px; font-size: .85rem; }
.rp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 12px; }
.rp-checks .check { min-height: 34px; font-weight: 400; font-size: .92rem; }
.rp-hist { margin: 0 0 12px; }
.rp-histbox { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft, #fff7ed); border-radius: 12px; padding: 10px 14px; }
.rp-histbox > b { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.rp-checklist { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.rp-checklist .check { font-weight: 400; align-items: flex-start; padding: 6px 0; min-height: 0; }
.rp-cinfo { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.rp-cinfo p { margin: 4px 0; }
.rp-warr form .btn { background: var(--surface); }
.oi-repw { position: relative; display: inline-block; }
.oi-replist { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); width: min(460px, 86vw); max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; }
.oi-replist button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.oi-replist button small { color: var(--muted); }
.oi-replist button:hover { background: var(--primary-soft); }
tr.oi-rep td:first-child { display: flex; gap: 6px; align-items: center; }
@media (max-width: 700px) { .rp-timer { width: 100%; justify-content: space-between; } .rp-acts .spacer { display: none; } .rp-st { flex-wrap: wrap; } .rp-st input { width: 100%; } .rp-devlist button { flex-direction: column; } }
.pc-own:not([open]) > form, .pc-tasknew:not([open]) > form { display: none; }
@media (max-width: 700px) { #rpReq .grid, .rp-partf, #pcOwn, .pc-tasknew form { grid-template-columns: 1fr !important; } #rpReq .grid > *, .rp-partf > *, #pcOwn > *, .pc-tasknew form > * { grid-column: auto !important; min-width: 0; } }
/* 1.14.1 — канбан: усі стовпці на екрані, згортання */
@media (min-width: 701px) {
  .kb-cols { grid-auto-flow: row; grid-auto-columns: auto; gap: 8px; overflow-x: visible; }
  .kb-col { padding: 8px 6px; min-width: 0; }
  .kb-col header { gap: 4px; flex-wrap: nowrap; }
  .kb-col header .badge { white-space: normal; line-height: 1.2; font-size: .72rem; min-width: 0; }
  .kb-col header em { margin-left: auto; }
  .kb-card { padding: 8px 9px; overflow-wrap: anywhere; }
  .kb-card b { font-size: .86rem; }
  .kb-meta { flex-wrap: wrap; gap: 6px; }
}
.kb-tog { flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.kb-tog:hover { background: var(--surface-3); color: var(--text); }
.kb-col.kb-off { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; cursor: pointer; }
.kb-col.kb-off:hover { background: var(--surface-3); }
.kb-col.kb-off em { font-style: normal; font-weight: 700; font-size: .8rem; color: var(--muted); }
.kb-vt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.kb-col.kb-off .kb-list { min-height: 60px; width: 100%; flex: 1; }
@media (min-width: 701px) {
  .kb-col header { flex-wrap: wrap; row-gap: 2px; padding: 0 2px; }
  .kb-col header em { order: 1; margin-left: 4px; }
  .kb-col header .kb-tog { order: 2; margin-left: auto; }
  .kb-col header .badge { order: 3; flex: 1 1 100%; overflow-wrap: anywhere; hyphens: auto; text-align: left; }
}
@media (min-width: 701px) {
  .kb-card, .kb-col header .badge { overflow-wrap: break-word; hyphens: auto; }
  .kb-cols { gap: 6px; }
  .kb-col { padding: 6px 5px; }
  .kb-card { padding: 7px 8px; }
  .kb-sub, .kb-meta { font-size: .76rem; }
}
/* 1.14.2 — кілька виконавців картки */
.kb-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: .86rem; user-select: none; background: var(--surface); }
.kb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kb-chip .kb-av { background: var(--surface-3); color: var(--muted); }
.kb-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.kb-chip.on .kb-av { background: var(--primary); color: #fff; }
.kb-chip:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.kb-more { width: auto; min-height: 32px; padding: 2px 28px 2px 10px; font-size: .86rem; border-radius: 999px; }
.kb-avs { display: inline-flex; }
.kb-avs .kb-av { display: inline-flex; align-items: center; border: 2px solid var(--surface); margin-left: -6px; }
.kb-avs .kb-av:first-child { margin-left: 0; }
.kb-avn { background: var(--muted); }
.kb-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; } .kb-chip:has(input:checked) .kb-av { background: var(--primary); color: #fff; }
.kb-chip .kb-av, .kb-av { display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* 1.15.2 — поле повідомлення: у вузькому вікні (панель чату, телефон) — на всю ширину, значки під ним */
.chat-compose-wrap { container-type: inline-size; }
.cc-sp { display: none; }
@container (max-width: 900px) {
  .chat-compose { flex-wrap: wrap; row-gap: 4px; column-gap: 2px; align-items: center; }
  .chat-compose textarea { order: -1; flex: 1 1 100%; max-height: 220px; }
  .cc-sp { display: block; flex: 1 1 auto; }
}

/* межа панелі чату — тягніть, щоб змінити ширину (запам'ятовується) */
.cp-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.cp-resize::after { content: ''; position: absolute; left: 4px; top: 50%; width: 3px; height: 44px; margin-top: -22px; border-radius: 3px; background: var(--line-2); opacity: 0; transition: opacity .15s; }
.chat-panel:hover .cp-resize::after, .cp-resize.drag::after { opacity: 1; background: var(--primary); }
body.cp-dragging, body.cp-dragging * { cursor: col-resize !important; user-select: none !important; }
body.cp-dragging .chat-panel iframe { pointer-events: none; }
@media (max-width: 600px) { .cp-resize { display: none; } }
/* 1.16.1 — елементи плану складу */
.whp-obj rect { stroke-width: 1.5; }
.whp-obj text { font: 600 11px var(--font); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.whp-obj line { stroke: #78350f; stroke-width: 1; }
.whp-obj.live { cursor: move; }
.whp-obj:not(.live) { opacity: .85; }
.whp-o-stairs rect { fill: #fde68a; stroke: #b45309; }
.whp-o-gate rect { fill: #fdba74; stroke: #c2410c; }
.whp-o-opening rect { fill: #bbf7d0; stroke: #15803d; stroke-dasharray: 4 2; }
.whp-o-pillar rect { fill: #475569; stroke: #1e293b; }
.whp-o-chimney rect { fill: #b91c1c; stroke: #7f1d1d; }
.whp-o-mid { stroke: rgba(0,0,0,.45) !important; }
.whp-obj.sel rect { stroke: var(--primary); stroke-width: 3; }
.whp-oadd { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.whp-o-wall rect { fill: #64748b; stroke: #334155; }
.whp-obj rect.whp-hit, .whp-obj.sel rect.whp-hit { fill: transparent; stroke: none; }
.whp-o-arrow { fill: none; stroke: #92400e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cx-zero { color: var(--err); }

/* предмет договору поруч із номером: довгий — обрізаємо, повністю — у підказці / під вибором */
.ct-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; vertical-align: middle; }
.ct-badge .badge { flex: none; }
.ct-subj { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; min-width: 0; }
.ct-subj-full { display: block; margin-top: 6px; font-size: .82rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.ct-subj-full::before { content: 'Предмет: '; font-weight: 600; color: var(--text-2, var(--text)); }
#oContract { text-overflow: ellipsis; }
@media (max-width: 700px) { .ct-badge { flex-wrap: wrap; } .ct-subj { white-space: normal; max-width: 100%; } }
.ct-subj-full[hidden] { display: none; }
.field[hidden] { display: none !important; }
/* вибір позиції для клієнта: договір + додатково узгоджені / уся номенклатура */
.cp-scope { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 12px 14px 0; }
.cp-modes em { font-style: normal; font-size: .78rem; background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.cp-modes small { color: var(--muted); font-weight: 500; }
.cp-scope-hint { flex: 1 1 260px; }
.cp-scoped .cp-tree, .cp-scoped .cp-kinds { display: none; }
.cp-scoped .cp-body { grid-template-columns: minmax(0, 1fr); }
.cp-t small .badge { font-size: .7rem; padding: 1px 7px; }
.oi-tag { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .78rem; }
.oi-tag .badge { font-size: .7rem; }
.ci-qw { display: flex; flex-direction: column; gap: 4px; }
.ci-unl { display: inline-flex; gap: 5px; align-items: center; font-size: .8rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.ci-unl input { width: 15px; height: 15px; margin: 0; }
/* лист на погодження ремонту */
.ap-box { max-width: 980px; width: 100%; }
.ap-prev { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ap-prev-h { margin: 4px 0 6px; }
/* проблема з посилкою, претензії НП */
.pc-issue > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pc-issue.has { border: 2px solid var(--err); }
.pc-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.pc-photos figure { margin: 0; position: relative; }
.pc-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.pc-photos form { position: absolute; top: 4px; right: 4px; }
.pc-photos .icon-btn { background: var(--surface); width: 30px; height: 30px; }
.npc-prev { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 10px; padding: 28px; overflow: auto; }
.npc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .npc-grid { grid-template-columns: minmax(0, 1fr); } }
@media print { body.npc-print .npc-prev { border: 0; padding: 0; } }
/* замовлення постачальнику: ціна вища за попередню */
#poLines tr.po-up td { background: color-mix(in srgb, var(--err) 8%, transparent); }
#poLines tr.po-up .pl-p { border-color: var(--err); color: var(--err); font-weight: 600; }
#poLines .pl-prev:empty { display: none; }
#poLines .pl-prev { margin-top: 4px; }
#allocTable .al-new { color: var(--primary); }
/* план складу: палетні стелажі й палетні борти */
.whp-shelf.rack rect { fill: #fed7aa; stroke: #ea580c; }
.whp-shelf.rack.sel rect { fill: #fdba74; stroke: var(--primary); }
.whp-pallet rect { fill: #d6b98c; stroke: #92400e; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.whp-pallet text { font: 700 10px var(--font); fill: #451a03; }
/* склад → товари: ширша назва, таблиця прокручується */
.cx[data-mode=stock] .cx-namecell { min-width: 220px; }
.cx[data-mode=stock] .cx-table td.num, .cx[data-mode=stock] .cx-table th.num { white-space: nowrap; }
/* заправка картриджів */
.cr-tasks { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.cr-task { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.cr-task small { display: block; color: var(--text-2); margin-top: 3px; }
.cr-task.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.cr-input { flex: 1; font-size: 1.15rem; padding: 14px; }
.cr-msg { min-height: 26px; margin: 10px 0; font-weight: 600; }
.cr-msg.ok { color: var(--ok); } .cr-msg.err { color: var(--err); } .cr-msg.warn { color: #d97706; }
.cr-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cr-row .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.cr-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cr-d{font-style:normal}
.cr-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.cr-line { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.cr-line.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); box-shadow: 0 0 0 1px var(--primary); }
.cr-cnt { font-weight: 600; } .cr-cnt small { font-weight: 400; color: var(--text-2); }
.cr-norm { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg-2, rgba(127,127,127,.06)); }
.cr-norm-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 6px; }
.cr-norm .table { margin: 6px 0 0; }
.cr-need { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #2563eb 10%, transparent); margin: 4px 0; }
.cr-instr { margin-top: 8px; padding: 8px 10px; border-left: 3px solid #d97706; background: color-mix(in srgb, #d97706 8%, transparent); border-radius: 6px; font-size: .92rem; }
.cc-body { display: flex; gap: 4px; align-items: center; }
.cc-body select { min-width: 140px; flex: 1; padding: 4px 6px; font-size: .85rem; }
.cc-body input { width: 58px; padding: 4px 6px; font-size: .85rem; text-align: right; }
.cc-price { width: 84px; padding: 4px 6px; text-align: right; }
.cc-tbl td { vertical-align: middle; }
.cc-tbl .cc-sel { width: 28px; }
.cc-saved { outline: 2px solid #16a34a; transition: outline-color 1s; }
.kb-pl td, .kb-pl th { padding-left: 4px; padding-right: 4px; }
.itip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--primary); color: #fff; font: italic 700 11px/1 Georgia, serif; cursor: help; position: relative; vertical-align: middle; margin-left: 4px; text-transform: none; letter-spacing: 0; }
.itip:hover::after, .itip:focus::after { content: attr(data-tip); position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 50; width: max-content; max-width: min(360px, 80vw); white-space: pre-line; padding: 10px 12px; border-radius: 10px; background: #0f172a; color: #f1f5f9; font-family: system-ui, sans-serif; font-size: 13px; line-height: 1.45; font-weight: 400; font-style: normal; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-lg); text-align: left; }
.perm-legend { display: grid; gap: 6px; margin: 6px 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 6%, transparent); font-size: .9rem; }
.perm-lv { display: inline-block; min-width: 96px; font-weight: 600; }
.cpk-box { width: min(1100px, 96vw); max-width: none; }
.cpk-search { display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; }
.cpk-search input { border: 0; flex: 1; padding: 12px 0; background: transparent; box-shadow: none; }
.cpk-grid { display: grid; grid-template-columns: 280px 1fr; gap: 14px; min-height: 50vh; max-height: 66vh; }
.cpk-tree { overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.cpk-tree ul { list-style: none; margin: 0; padding: 0; } .cpk-tree li > ul { display: none; } .cpk-tree li.open > ul { display: block; }
.cpk-tree li.open > .cpk-f .cpk-tog .ico { transform: rotate(90deg); }
.cpk-f { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.cpk-f:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cpk-f.on { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 600; }
.cpk-f em { font-style: normal; font-size: .8rem; padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--text-2) 14%, transparent); }
.cpk-f .cpk-tog { width: 16px; display: inline-grid; place-items: center; } .cpk-f > .ico { color: #d97706; }
.cpk-list { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.cpk-head { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cpk-tbl tbody tr { cursor: pointer; } .cpk-tbl tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cpk-btn { margin-top: 6px; align-self: flex-start; }
.mpk-box { width: min(900px, 96vw); max-width: none; }
/* Енергія: стрічка плану по годинах */
.en-tl { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.en-h { position: relative; min-height: 62px; border-radius: 8px; padding: 4px 2px; text-align: center; font-size: .72rem; overflow: hidden; background: color-mix(in srgb, var(--text-2) 10%, transparent); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1px; }
.en-h b { font-size: .8rem; z-index: 1; } .en-h span { z-index: 1; font-weight: 600; } .en-h small { z-index: 1; font-weight: 700; }
.en-h .en-pv { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, #f59e0b 35%, transparent); z-index: 0; }
.en-h.en-charge { background: color-mix(in srgb, #3b82f6 28%, transparent); } .en-h.en-self { background: color-mix(in srgb, #16a34a 18%, transparent); }
.en-h.en-hold { background: color-mix(in srgb, #f97316 30%, transparent); } .en-h.en-ev { background: color-mix(in srgb, #0891b2 30%, transparent); } .en-h.en-outage { background: color-mix(in srgb, #ef4444 32%, transparent); }
.en-cheap { color: #16a34a; } .en-peak { color: #ef4444; } .en-cheap-bg { background: color-mix(in srgb, #16a34a 22%, transparent); } .en-peak-bg { background: color-mix(in srgb, #ef4444 22%, transparent); }
.en-tl-sm .en-h { min-height: 40px; }
.en-fc { padding: 0 16px 12px; } .en-fc-day { padding: 10px 0 6px; border-top: 1px solid var(--border); } .en-fc-day:first-child { border-top: 0; }
.en-fc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.en-fc-kpi { text-align: right; line-height: 1.1; white-space: nowrap; } .en-fc-kpi b { font-size: 1.35rem; } .en-fc-kpi small { margin-left: 3px; color: var(--text-2); } .en-fc-kpi span { display: block; font-size: .75rem; font-weight: 600; }
.en-fc-good { color: #16a34a; } .en-fc-mid { color: #d97706; } .en-fc-low { color: #ef4444; }
.en-fc-bars { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; height: 64px; align-items: end; }
.en-fc-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.en-fc-bar i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(to top, #f59e0b, #fcd34d); min-height: 0; }
.en-fc-bar span { position: absolute; top: -2px; font-size: .62rem; font-weight: 600; color: var(--text-2); } .en-fc-bar em { font-style: normal; font-size: .62rem; color: var(--text-3); margin-top: 2px; }
.en-fc-bars { padding-top: 12px; padding-bottom: 32px; box-sizing: content-box; } .en-fc-bar em { position: absolute; bottom: -14px; } .en-fc-bar u { position: absolute; bottom: -32px; text-decoration: none; font-size: .85rem; line-height: 1; } .en-fc-night i { opacity: .35; }
.en-fc-meter { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text-2) 12%, transparent); margin-top: 10px; overflow: hidden; } .en-fc-meter i { display: block; height: 100%; border-radius: 3px; } .en-fc-meter .en-fc-good { background: #16a34a; } .en-fc-meter .en-fc-mid { background: #d97706; } .en-fc-meter .en-fc-low { background: #ef4444; }
.en-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.en-dot.en-charge { background: #3b82f6; } .en-dot.en-self { background: #16a34a; } .en-dot.en-hold { background: #f97316; } .en-dot.en-ev { background: #0891b2; } .en-dot.en-outage { background: #ef4444; }
@media (max-width: 760px) { .en-tl { grid-template-columns: repeat(12, minmax(0, 1fr)); } .en-h { min-height: 54px; } }
.mpk-list { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.mpk-list tbody tr { cursor: pointer; } .mpk-list tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.mpk-box .cpk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; padding: 0 2px 8px; }
.pc-curmodel { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--line); font-size: .9rem; }
.pc-curmodel.on { border-style: solid; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pi-modelbtn { max-width: 100%; justify-content: flex-start; }
@media (max-width: 760px) { .cpk-grid { grid-template-columns: 1fr; max-height: none; } .cpk-tree { max-height: 30vh; } }
.end-list { display: grid; gap: 8px; } .end-list .btn { justify-content: flex-start; }
.sh-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sh-step { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); font-size: .88rem; color: var(--text-2); }
.sh-step.done { background: color-mix(in srgb, #16a34a 12%, transparent); color: #15803d; border-color: transparent; }
.sh-step.on { background: var(--primary); color: #fff; border-color: transparent; font-weight: 600; }
.sh-ok td:first-child { color: #15803d; }
.sh-carts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sh-cart { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, #16a34a 10%, transparent); font-size: .85rem; }
.sh-unscan { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--text-2); }
.ld-ok td:first-child { color: #15803d; font-weight: 600; } .ld-miss td:first-child { color: #d97706; } .ld-unk td:first-child { color: var(--err); }
.pic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pic-chip { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card, transparent); color: inherit; cursor: pointer; font-size: .78rem; line-height: 1.2; text-align: center; }
.pic-chip .ico { width: 30px; height: 30px; }
.pic-chip:hover { border-color: var(--primary); }
.pic-chip.on { border-color: #d97706; background: color-mix(in srgb, #d97706 14%, transparent); color: #b45309; font-weight: 600; }
.pic-chips.parts .pic-chip.on { border-color: #16a34a; background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.ms-alert { border: 2px solid #dc2626; border-radius: 16px; padding: 14px; background: color-mix(in srgb, #dc2626 8%, transparent); }
.ms-alert .pic-chips .pic-chip { cursor: default; border-color: #dc2626; color: #b91c1c; }
.ms-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cc-pr { display: grid; gap: 3px; justify-items: end; }
.cc-pr .cc-w { width: 70px; font-size: .8rem; opacity: .85; }
.cc-tbl .cc-model { min-width: 230px; max-width: 300px; }

/* 1.24.0 — каталог заправки: типи-вкладки з іконкою виду, опції моделі */
.cc-types { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cc-type { display: flex; gap: 10px; align-items: center; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none !important; white-space: nowrap; flex: 0 0 auto; transition: border-color .15s, box-shadow .15s; }
.cc-type:hover { border-color: var(--primary); }
.cc-type > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.cc-type small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.cc-type.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.cc-type-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.cc-type-ico .ico { width: 22px; height: 22px; }
.cc-type-toner .cc-type-ico { background: #e0ecff; color: #2563eb; } .cc-type-drum .cc-type-ico { background: #dcfce7; color: #15803d; }
.cc-type-tube .cc-type-ico { background: #fde7f3; color: #be185d; } .cc-type-ink .cc-type-ico { background: #e0f7fa; color: #0e7490; }
.cc-form { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; background: #e0ecff; color: #2563eb; }
.cc-form .ico { width: 17px; height: 17px; }
.cc-form-drum { background: #dcfce7; color: #15803d; } .cc-form-tube { background: #fde7f3; color: #be185d; } .cc-form-ink { background: #e0f7fa; color: #0e7490; }
[data-mode=dark] .cc-form, [data-mode=dark] .cc-type-ico { background: var(--surface-3) !important; }
.cc-mh { display: flex; gap: 8px; align-items: center; }
.cc-tbl .cc-vars { min-width: 300px; max-width: 460px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cc-chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 8px; border-radius: 8px; background: var(--surface-3); font-size: .78rem; line-height: 1.3; cursor: pointer; max-width: 100%; }
.cc-chip b { font-weight: 600; } .cc-chip i { font-style: normal; color: var(--primary); } .cc-chip em { font-style: normal; font-weight: 700; }
.cc-chip-empty { background: none; border: 1px dashed var(--line); }
.cc-chip-ic { display: inline-flex; color: var(--warn); } .cc-chip-ic .ico { width: 13px; height: 13px; }
.cc-vedit { display: inline-flex; gap: 4px; align-items: center; border: 0; background: none; color: var(--muted); font: 600 .76rem var(--font); cursor: pointer; padding: 3px 6px; border-radius: 8px; }
.cc-vedit:hover { color: var(--primary); background: var(--surface-3); }
.cc-vt input, .cc-vt select { padding: 5px 8px; font-size: .86rem; }
.cc-vt .cv-n { min-width: 190px; } .cc-vt .cv-x { min-width: 200px; } .cc-vt .check { min-height: 30px; font-size: .82rem; }
/* договір: умови по позиціях */
.ci-terms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.ci-terms select, .ci-terms input { height: 32px; padding: 4px 8px; font-size: .84rem; }
.ci-terms .ci-mode { max-width: 170px; } .ci-terms .ci-x { flex: 1 1 220px; min-width: 160px; }
.ci-terms .ci-g { display: inline-flex; gap: 4px; align-items: center; } .ci-terms .ci-g input { width: 76px; }
.ci-terms .ci-chip { display: inline-flex; gap: 5px; align-items: center; font-size: .82rem; cursor: pointer; white-space: nowrap; } .ci-terms .ci-chip span { display: inline-flex; gap: 3px; align-items: center; }
.cr-terms { background: var(--warn-soft, #fff7e6); }
.dash-switch .seg-btns span { display: inline !important; } .dash-switch .seg-btns a { padding: 8px 14px; }
.dash-sub { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; font-size: .95rem; color: var(--muted); }
.el-trace { white-space: pre-wrap; font-size: .76rem; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; max-height: 320px; overflow: auto; }
.el-tbl td { vertical-align: top; }
.ts-breaks { margin: -6px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.chat-item .cc-who { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-t .cc-who { font-weight: 600; color: var(--text); }
.abs-bar.part { width: auto; background: transparent; border: 2px dashed var(--warn); color: var(--warn); font-size: .62rem; font-weight: 700; font-style: normal; line-height: 18px; text-align: center; overflow: hidden; }
/* Розмова з клієнтом поруч із замовленням */
.oc-chat { position: fixed; right: 16px; bottom: 16px; width: 360px; max-width: calc(100vw - 32px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.oc-head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; background: var(--primary); color: #fff; }
.oc-head .icon-btn { color: #fff; }
.oc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; padding: 4px 0; }
.oc-toggle b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; }
.oc-new { font-style: normal; font-size: .7rem; font-weight: 700; background: #ef4444; color: #fff; border-radius: 10px; padding: 1px 7px; }
.oc-body { display: flex; flex-direction: column; height: 440px; max-height: calc(100vh - 140px); }
.oc-chat.min .oc-body { display: none; }
.oc-chat.min { width: 280px; }
.oc-chat.min [data-oc-toggle] .ico { transform: rotate(180deg); }
.oc-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.oc-m { display: flex; align-items: flex-end; gap: 6px; max-width: 88%; }
.oc-m.in { align-self: flex-start; }
.oc-m.out { align-self: flex-end; }
.oc-b { padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; line-height: 1.35; word-break: break-word; }
.oc-m.out .oc-b { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.oc-b img { display: block; max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 4px; }
.oc-b small { display: block; margin-top: 3px; font-size: .68rem; color: var(--muted); text-align: right; }
.oc-err { color: var(--err); font-weight: 600; }
.oc-sys { align-self: center; font-size: .72rem; color: var(--muted); }
.oc-add { flex: 0 0 auto; order: 2; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--primary); font-weight: 700; cursor: pointer; line-height: 1; }
.oc-add:hover { background: var(--primary); color: #fff; }
.oc-send { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.oc-send input { flex: 1; height: 36px; }
.oc-hint { margin: 0; padding: 0 10px 8px; font-size: .68rem; color: var(--muted); }
body.has-oc .form-actions, body.has-oc .main { padding-bottom: 70px; }
@media (max-width: 760px) { .oc-chat { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; } .oc-chat.min { width: auto; } .oc-body { height: 60vh; } }
@media (min-width: 1200px) { body.has-oc:not(.oc-min) .content { padding-right: 392px; } .oc-chat { top: calc(var(--top-h) + 12px); } .oc-chat .oc-body { height: auto; flex: 1; max-height: none; } .oc-chat.min { top: auto; } }
.cc-av { position: relative; }
.cc-av .cc-ch { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); font-size: 9px; font-style: normal; font-weight: 700; line-height: 12px; text-align: center; color: #fff; background: #7360f2; }
.cc-av.ch-telegram .cc-ch { background: #229ed9; }
.cc-av.ch-whatsapp .cc-ch { background: #25d366; }
/* ---------- Чат з клієнтами: інструменти, нотатки, відповіді, нагадування ---------- */
.cc-tools { display: flex; gap: 6px; padding: 8px 10px 0; flex-wrap: wrap; }
.cc-tools .dropdown { position: relative; }
.cc-tool { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; font: 600 .78rem var(--font); position: relative; }
.cc-tool:hover { border-color: var(--line-2); }
.cc-tool.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.cc-tool small { font-size: .74rem; }
.cc-tool .chat-unread { position: absolute; top: -6px; right: -6px; font-style: normal; }
.cc-dd { min-width: 180px; }
.cc-dd button { display: flex; align-items: center; gap: 8px; width: 100%; }
.cc-ch-dot { width: 10px; height: 10px; border-radius: 50%; background: #7360f2; display: inline-block; }
.cc-ch-dot.ch-telegram { background: #229ed9; } .cc-ch-dot.ch-whatsapp { background: #25d366; }
.cc-av .cc-ch.img { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 0; background: none; object-fit: contain; filter: drop-shadow(0 0 1px rgba(0,0,0,.25)); }
.cc-op { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font: 700 .6rem/20px var(--font); text-align: center; font-style: normal; margin-left: auto; margin-right: 6px; cursor: help; }
.chat-item-top .cc-op + time { margin-left: 0; }
.chat-item.cc-closed { opacity: .72; }
.cc-hit-t { display: block; font-size: .8rem; color: var(--text-2); line-height: 1.35; margin-top: 2px; }
.cc-hit-t mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.cc-app.cc-msgmode .cc-tabs { opacity: .45; }
/* нотатки для колег — клієнт не бачить */
.msg.cc-note .bubble { background: #fff7d6; border: 1px dashed #e0b400; border-radius: 12px; }
.cc-note-lbl { color: #9a6b00 !important; }
.cc-note-lbl span { font-weight: 400; color: var(--muted); }
:root[data-theme="dark"] .msg.cc-note .bubble { background: #3a3110; border-color: #8a6d00; }
/* дії з повідомленням */
.msg { position: relative; }
.cc-macts { position: absolute; top: 4px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); z-index: 2; }
.msg:not(.mine) .cc-macts { left: calc(min(100%, 640px) - 4px); }
.msg.mine .cc-macts { right: calc(min(100%, 640px) - 4px); }
.msg:hover .cc-macts { display: inline-flex; }
@media (hover: none) { .msg .cc-macts { display: inline-flex; position: static; margin-top: 2px; opacity: .8; } }
.cc-macts button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.cc-macts button:hover { background: var(--surface-3); color: var(--primary); }
.cc-quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 6px; padding: 4px 8px; margin: 2px 0 6px; cursor: pointer; font: inherit; color: inherit; }
.cc-quote b { display: block; font-size: .74rem; color: var(--primary); }
.cc-quote span { display: block; font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.msg.cc-flash .bubble { box-shadow: 0 0 0 3px #fbbf24; transition: box-shadow .3s; }
.cc-audio { display: block; max-width: 280px; height: 40px; margin: 2px 0; }
/* поле: кому повідомлення */
.cc-mode { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.cc-mode button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 11px; font: 600 .76rem var(--font); color: var(--muted); cursor: pointer; }
.cc-mode button span { font-weight: 400; }
.cc-mode button.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.cc-mode button[data-mode="note"].on { background: #fff7d6; color: #9a6b00; border-color: #e0b400; }
.cc-notemode .chat-compose textarea { background: #fff7d6 !important; border-color: #e0b400 !important; }
:root[data-theme="dark"] .cc-notemode .chat-compose textarea { background: #3a3110 !important; }
#ccForm.chat-compose { flex-direction: column; align-items: stretch; gap: 4px; }
#ccForm textarea { width: 100%; border-radius: 18px !important; }
.cc-cbar { display: flex; align-items: center; gap: 2px; }
.cc-cbar .icon-btn { font-size: 18px; }
.cc-reply { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 6px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 8px; }
.cc-reply span { flex: 1; min-width: 0; }
.cc-reply b { display: block; font-size: .78rem; color: var(--primary); }
.cc-reply small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-tpl { display: flex; gap: 4px; align-items: center; }
.cc-tpl > button:first-child { flex: 1; }
.cc-tpl-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 4px; flex-wrap: wrap; }
.cc-tpl-sec { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 6px 4px 2px; }
.cc-timers:empty { display: none; }
.cc-timers { padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.cc-timer { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.cc-timer span { flex: 1; }
.cc-timer.send span { color: var(--primary); }
.cc-tick { color: #94a3b8; letter-spacing: -2px; margin-left: 2px; }
.cc-tick.delivered { color: #94a3b8; }
.cc-tick.seen { color: #2563eb; font-weight: 700; }
/* 1.28: меню фільтрів не обрізається; теги в шапці переносяться */
.cc-tools .dd-menu { left: 0; right: auto; }
.cc-head-tags { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
.cc-head-tags .cc-tag { white-space: normal; flex: 0 1 auto; }
.cc-app .chat-head-t small { white-space: normal; }
.cc-app .chat-head { align-items: flex-start; }
.cc-app .cc-head-acts { flex-wrap: wrap; justify-content: flex-end; }
.drv-install { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.drv-install img { width: 36px; height: 36px; border-radius: 9px; }
.drv-install span { flex: 1; min-width: 0; } .drv-install small { display: block; color: var(--muted); font-size: .78rem; }
/* «ES-TE Чат»: вкладки Колеги / Клієнти */
.ca-tabs { display: flex; gap: 4px; margin-left: auto; margin-right: 8px; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.ca-tabs a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; font: 600 .82rem var(--font); color: var(--muted); text-decoration: none; position: relative; }
.ca-tabs a.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.ca-tabs .ca-n { font-style: normal; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .66rem; line-height: 17px; text-align: center; }
@media (max-width: 520px) { .ca-tabs a { padding: 6px 8px; } .ca-title small { display: none; } }
.voice .v-dl { flex: 0 0 auto; color: var(--muted); display: inline-flex; }
.voice .v-dl:hover { color: var(--primary); }
/* автовідповідь системи — не відповідь менеджера */
.msg.cc-auto .bubble { background: repeating-linear-gradient(135deg, #eef2f7, #eef2f7 8px, #e6ebf2 8px, #e6ebf2 16px); border: 1px dashed #94a3b8; border-radius: 12px; color: var(--text-2); }
:root[data-theme="dark"] .msg.cc-auto .bubble, :root[data-mode="dark"] .msg.cc-auto .bubble { background: repeating-linear-gradient(135deg, #1b2435, #1b2435 8px, #202a3d 8px, #202a3d 16px); border-color: #475569; }
.cc-auto-lbl { color: #64748b !important; }
.cc-auto-lbl span { font-weight: 400; }
.cc-app .chat-head { flex-wrap: wrap; }
.cc-app .chat-head-t { flex: 1 1 240px; min-width: 200px; }
.cc-app .cc-head-acts { flex: 0 1 auto; margin-left: auto; }
/* інвентаризація: підрахунок з телефона */
.inv-tree { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 0; }
.inv-f { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; }
.inv-f:hover { background: var(--surface-2); }
.inv-bar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top) + 6px); z-index: 5; }
.inv-g { margin-bottom: 14px; }
.inv-gh { font-weight: 600; font-size: .9rem; color: var(--muted); padding: 6px 2px; display: flex; align-items: center; gap: 6px; }
.inv-c { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.inv-c.done { border-left-color: var(--ok); }
.inv-c.rc { border-left-color: #7c3aed; }
.inv-c.fail { border-left-color: var(--err); background: color-mix(in srgb, var(--err) 6%, var(--surface)); }
.inv-c.saving { opacity: .65; }
.inv-n { min-width: 0; flex: 1; }
.inv-n b { word-break: break-word; }
.inv-loc { margin-top: 6px; width: 100%; max-width: 360px; }
.inv-loc.err, .inv-q input.err { border-color: var(--err); }
.inv-q { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.inv-q input { width: 74px; text-align: center; font-size: 1.15rem; font-weight: 700; padding: 8px 4px; }
.inv-m, .inv-p { width: 40px; height: 42px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--radius-sm); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--text); }
.inv-u { font-size: .8rem; color: var(--muted); min-width: 18px; }
.inv-ok { color: var(--ok); visibility: hidden; }
.inv-c.done .inv-ok { visibility: visible; }
@media (max-width: 560px) {
  .inv-c { flex-direction: column; align-items: stretch; }
  .inv-q { justify-content: flex-end; }
  .inv-q input { flex: 1; max-width: 140px; }
}
/* приймання з телефона */
.rcv-c { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.rcv-c.full { border-left-color: var(--ok); opacity: .7; }
.rcv-c.hit { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent); }
.rcv-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rcv-row .inv-q input { width: 84px; }
.rcv-row input[list] { flex: 1; min-width: 180px; }
.rcv-foot { position: sticky; bottom: 70px; z-index: 5; padding-top: 6px; }
@media (min-width: 900px) { .rcv-foot { bottom: 10px; max-width: 420px; } }
/* чат: додати співрозмовника до клієнта */
#ccAddCt input:not([type=checkbox]), #ccAddCt select { width: 100%; }
#ccAddCt .mb { margin-bottom: 6px; }
.cc-roles { display: flex; flex-direction: column; gap: 2px; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.cc-ct .badge { font-size: .7rem; vertical-align: middle; align-self: flex-start; }
/* лічильник у меню (тендери чекають цін) */
.menu-n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font: 700 .72rem/20px var(--font); font-style: normal; text-align: center; flex-shrink: 0; }
.menu-toggle .menu-n { margin-right: 6px; }
/* тендер: кілька менеджерів */
.t-mgrs { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.t-mgr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; margin-top: 6px; max-height: 180px; overflow: auto; }
/* сортування за колонками */
a.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
a.th-sort:hover, a.th-sort.on { color: var(--primary); }

/* комплект у товарах тендеру */
.ti-part{display:flex;gap:6px;align-items:center;margin-bottom:4px}
.ti-part>select,.ti-part>.cat-field,.ti-part>.ss{flex:1;min-width:0}
.ti-perw{white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.ti-perw[hidden]{display:none}
.ti-kit{margin-top:2px;font-size:.8rem}

/* фільтр «Етап» (кілька) */
.st-dd{position:relative}
.st-dd>summary{list-style:none;cursor:pointer}
.st-dd>summary::-webkit-details-marker{display:none}
.st-menu{position:absolute;z-index:40;top:calc(100% + 6px);left:0;min-width:260px;background:var(--card,#fff);border:1px solid var(--border,#e5e7eb);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:10px 12px}
.st-gl{font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#6b7280);margin:6px 0 2px}
.st-opt{display:flex;align-items:center;gap:8px;padding:5px 2px;cursor:pointer}
.st-opt span{flex:1}
@media (max-width:640px){.st-menu{position:fixed;left:16px;right:16px;top:auto;min-width:0}}

/* замовлення: «наша ціна» для агента «різниця ціни» */
.oi-ourw{display:none;align-items:center;gap:4px;margin-top:4px;font-size:.75rem;color:var(--muted,#6b7280)}
.our-on .oi-ourw{display:flex}
.oi-ourw input{max-width:96px;height:30px;font-size:.85rem}
.oi-ag{color:var(--ok,#15803d)}

/* тендер: собівартість, доставка, прибуток; підбір товарів */
.ti-econ{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-end;padding:12px 14px;border:1px solid var(--border,#e5e7eb);border-radius:12px;background:var(--bg-soft,#f8fafc)}
.ti-econ-n{display:flex;flex-wrap:wrap;gap:6px 20px;align-items:center;font-size:.92rem}
.ok-text{color:var(--ok,#15803d)}
.ti-sugb{margin:4px 0 2px}
.ti-sugb .badge{display:inline-flex;align-items:center;gap:4px}
.ti-econ .err-text,.ti-c .err-text{color:var(--err,#dc2626)}

/* резерв товарів */
.res-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;border:1px solid color-mix(in srgb,var(--warn,#d97706) 45%,transparent);background:var(--warn-soft,#fef3c7);color:var(--warn,#b45309);font-weight:700;font-size:.82rem;cursor:pointer;white-space:nowrap}
.res-btn:hover{filter:brightness(.96)}
.res-btn.res-exp{border-color:color-mix(in srgb,var(--primary,#2563eb) 35%,transparent);background:var(--info-soft,#eff6ff);color:var(--primary,#1d4ed8)}
.res-sum{display:flex;flex-wrap:wrap;gap:6px 18px;margin:4px 0 12px}
.res-pos{margin:4px 0 8px;padding-left:18px}
.rs{display:inline-block;padding:1px 7px;border-radius:6px;font-size:.8rem;margin:1px 2px 1px 0;white-space:nowrap}
.rs-stock{background:var(--ok-soft,#dcfce7);color:var(--ok,#15803d)}
.rs-po{background:var(--info-soft,#eff6ff);color:var(--primary,#1d4ed8);text-decoration:none}
.rs-short{background:var(--err-soft,#fee2e2);color:var(--err,#dc2626)}
.err-text{color:var(--err,#dc2626)}
.t-rsrc{font-size:.8rem;margin-top:4px;display:flex;flex-wrap:wrap;align-items:center;gap:4px}

/* тендер: вимоги й історія замовника */
dialog.t-modal{border:none;border-radius:18px;padding:20px 22px;width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 48px);box-shadow:var(--shadow-lg,0 20px 60px rgba(0,0,0,.25));background:var(--surface,#fff);color:inherit}
dialog.t-modal::backdrop{background:rgba(15,23,42,.45)}
.t-modal-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.t-modal-h h3{margin:0 0 10px}
.t-req-text{white-space:normal;line-height:1.5;max-height:60vh;overflow:auto;padding:10px 12px;border-radius:10px;background:var(--bg-soft,#f8fafc)}

/* ---------- Пошта ---------- */
.ml-page .content{padding-bottom:0}
.ml{display:grid;grid-template-columns:230px minmax(300px,380px) 1fr;grid-template-rows:minmax(0,1fr);gap:0;height:calc(100vh - 140px);min-height:480px;background:var(--surface,#fff);border:1px solid var(--border,#e5e7eb);border-radius:16px;overflow:hidden}
.ml-side{border-right:1px solid var(--border,#e5e7eb);padding:12px;overflow:auto;background:var(--bg-soft,#f8fafc)}
.ml-compose{width:100%;justify-content:center;margin-bottom:12px}
.ml-acc{margin-bottom:8px}
.ml-acc-h{display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:10px;cursor:pointer;font-weight:600;font-size:.88rem}
.ml-acc-h:hover{background:var(--hover,#eef2f7)}
.ml-acc.on .ml-acc-h{color:var(--primary,#1d4ed8)}
.ml-acc-h .grow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.ml-err{color:var(--err,#dc2626);display:inline-flex}
.ml-acc-err{color:var(--err,#dc2626);padding:4px 10px;line-height:1.35}
.ml-folders{display:flex;flex-direction:column;margin:2px 0 4px}
.ml-f{display:flex;align-items:center;gap:8px;padding:6px 10px 6px 14px;border-radius:9px;color:inherit;text-decoration:none;font-size:.9rem}
.ml-f:hover{background:var(--hover,#eef2f7)}
.ml-f.on{background:var(--primary-soft,#e0e7ff);color:var(--primary,#1d4ed8);font-weight:600}
.ml-n{background:var(--primary,#1d4ed8);color:#fff;border-radius:999px;font-size:.72rem;padding:1px 7px}
.ml-list{border-right:1px solid var(--border,#e5e7eb);display:flex;flex-direction:column;min-width:0}
.ml-bar{display:flex;align-items:center;gap:6px;padding:10px;border-bottom:1px solid var(--border,#e5e7eb)}
.ml-search{flex:1;display:flex;align-items:center;gap:6px;background:var(--bg-soft,#f1f5f9);border-radius:10px;padding:0 10px}
.ml-search input{border:none;background:transparent;height:36px;flex:1;min-width:0;outline:none}
.ml-bar .icon-btn.on{background:var(--primary-soft,#e0e7ff);color:var(--primary,#1d4ed8)}
.ml-bar .spin svg{animation:mlspin 1s linear infinite}
@keyframes mlspin{to{transform:rotate(360deg)}}
.ml-status{padding:0 12px}
.ml-status:not(:empty){padding:6px 12px}
.ml-rows{overflow:auto;flex:1}
.ml-row{padding:10px 14px;border-bottom:1px solid var(--border,#eef2f7);cursor:pointer}
.ml-row:hover{background:var(--hover,#f5f7fb)}
.ml-row.on{background:var(--primary-soft,#e8eeff)}
.ml-row.unread .ml-who,.ml-row.unread .ml-subj{font-weight:700}
.ml-row.unread{box-shadow:inset 3px 0 0 var(--primary,#1d4ed8)}
.ml-row-top{display:flex;align-items:center;gap:6px;font-size:.88rem}
.ml-cb{width:16px;height:16px;margin:0 2px 0 0;flex:none;accent-color:var(--primary,#1d4ed8);opacity:.35}.ml-row:hover .ml-cb,.ml-row.sel .ml-cb,.ml-cb:checked{opacity:1}.ml-row.sel{background:var(--primary-soft,#e8eeff)}
.ml-sel{display:flex;align-items:center;gap:4px;padding:6px 10px;border-bottom:1px solid var(--border,#eef2f7);background:var(--primary-soft,#e8eeff)}.ml-sel[hidden]{display:none}
.ml-who{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-date{color:var(--muted,#64748b);font-size:.78rem;white-space:nowrap}
.ml-subj{font-size:.9rem;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-star{color:#f59e0b;margin-right:4px}
.ml-snip{font-size:.8rem;color:var(--muted,#64748b);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-read{overflow:auto;min-width:0;min-height:0;padding:0 18px 18px}
.ml-side,.ml-list{min-height:0}
.ml-read-bar{position:sticky;top:0;background:var(--surface,#fff);display:flex;align-items:center;gap:6px;padding:10px 0;border-bottom:1px solid var(--border,#eef2f7);z-index:2;flex-wrap:wrap}
.ml-read-bar .icon-btn.on{color:#f59e0b}
.ml-move{width:auto;max-width:150px;height:32px;font-size:.85rem}
.ml-head{padding:14px 0 8px;display:grid;grid-template-columns:1fr auto;gap:6px 12px}
.ml-head h2{grid-column:1/-1;margin:0;font-size:1.2rem;line-height:1.35}
.ml-client{align-self:start;text-align:right}
.ml-atts{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.ml-att{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--border,#e5e7eb);border-radius:10px;text-decoration:none;color:inherit;font-size:.85rem;max-width:280px}
.ml-att span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-att em{color:var(--muted,#64748b);font-style:normal;font-size:.75rem}
.ml-att:hover{background:var(--hover,#f5f7fb)}
.ml-frame{width:100%;border:0;min-height:160px;background:#fff;border-radius:8px;display:block;overflow:auto}
.ml-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;color:var(--muted,#64748b);padding:40px 20px;height:100%}
.ml-empty svg{width:36px;height:36px;opacity:.5}
.ml-back{display:none}
.ml-modal{z-index:200}
.ml-cbox{max-width:860px;width:100%;max-height:calc(100vh - 32px);overflow:auto}
.ml-abox{max-width:720px;width:100%;max-height:calc(100vh - 32px);overflow:auto}
.ml-fld{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--border,#eef2f7);padding:4px 0}
.ml-fld span{width:80px;color:var(--muted,#64748b);font-size:.85rem;flex:none}
.ml-fld input,.ml-fld select{border:none;flex:1;min-width:0;height:34px;background:transparent;outline:none;box-shadow:none}
.ml-tools{display:flex;gap:4px;margin:8px 0 4px}
.ml-tools button{min-width:32px;height:30px;border:1px solid var(--border,#e5e7eb);background:var(--surface,#fff);border-radius:8px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.ml-editor{min-height:220px;max-height:50vh;overflow:auto;border:1px solid var(--border,#e5e7eb);border-radius:12px;padding:10px 12px;outline:none;line-height:1.5}
.ml-editor:focus{border-color:var(--primary,#1d4ed8)}
.ml-editor blockquote{margin:6px 0 0 4px;padding-left:10px;border-left:3px solid #cbd5e1;color:#475569}
.ml-q-h,.ml-sig{color:var(--muted,#64748b);font-size:.88rem}
.ml-keep{margin-top:8px;display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center}
.ml-users{margin-top:10px}
.ml-ulist{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:2px 12px;max-height:180px;overflow:auto;margin-top:4px}
@media (max-width:1100px){.ml{grid-template-columns:200px minmax(260px,320px) 1fr}}
@media (max-width:860px){
  .ml{grid-template-columns:1fr;height:calc(100vh - 120px);border-radius:12px}
  .ml-side{display:none;position:absolute;z-index:30;left:0;top:0;bottom:0;width:260px;box-shadow:0 10px 30px rgba(0,0,0,.2)}
  .ml{position:relative}
  .ml.show-side .ml-side{display:block}
  .ml-read{display:none}
  .ml.show-read .ml-list{display:none}
  .ml.show-read .ml-read{display:block}
  .ml-back{display:inline-flex}
  .ml-head{grid-template-columns:1fr}
  .ml-client{text-align:left}
}

.cc-mail{display:flex;flex-direction:column;gap:1px;padding:6px 0;border-bottom:1px dashed var(--border,#e5e7eb);text-decoration:none;color:inherit}
.cc-mail:last-child{border-bottom:none}
.cc-mail b{font-weight:500}.cc-mail b.unread{font-weight:700}
.menu-n[hidden]{display:none!important}
.ti-vat{flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 10px;padding:8px 12px;border-radius:10px;background:var(--info-soft,#eff6ff)}

/* ---------- Висувна панель «Групи клієнтів» у списках (замовлення, договори, рахунки, оплати, звіти) ---------- */
.cg-btns { display: inline-flex; gap: 4px; align-items: center; }
.cg-btns .btn[data-cg-open] .ico { color: var(--warn); }
.cg-btns .btn.cg-active { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, transparent); font-weight: 650; }
.cg-btns .btn.cg-active .ico { color: var(--primary); }
.cg-panel { position: fixed; z-index: 90; left: 0; top: 0; bottom: 0; width: min(330px, 88vw); background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(-104%); visibility: hidden; transition: transform .26s var(--ease, ease), visibility 0s linear .26s; }
.cg-panel.open { transform: none; visibility: visible; transition: transform .26s var(--ease, ease), visibility 0s; }
.cg-back { position: fixed; inset: 0; z-index: 89; background: rgba(15,23,42,.28); opacity: 0; pointer-events: none; transition: opacity .22s; }
.cg-back.open { opacity: 1; pointer-events: auto; }
.cg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; font-size: 1.02rem; }
.cg-tree { flex: 1; overflow: auto; padding: 4px 10px 10px; }
.cg-tree ul { list-style: none; margin: 0; padding: 0; } .cg-tree li > ul { display: none; } .cg-tree li.open > ul { display: block; }
.cg-n { display: flex; align-items: center; gap: 7px; padding: 8px 8px 8px calc(8px + var(--d, 0) * 18px); border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: .93rem; }
.cg-n:hover { background: var(--surface-3); text-decoration: none; }
.cg-n.on { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.cg-n > .ico { flex: 0 0 auto; color: var(--warn); } .cg-n.cg-root > .ico { color: var(--muted); } .cg-n.on > .ico { color: var(--primary); }
.cg-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-n em { font-style: normal; font-size: .76rem; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 1px 8px; }
.cg-tg { width: 18px; flex: 0 0 18px; display: inline-grid; place-items: center; color: var(--muted); border-radius: 6px; }
.cg-tg[data-cg-tg]:hover { background: var(--line); }
.cg-tg .ico { transition: transform .15s; } .cg-tree li.open > .cg-n .cg-tg .ico { transform: rotate(90deg); }
.cg-sep { margin: 12px 8px 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cg-hint { margin: 0; padding: 10px 18px 16px; font-size: .78rem; color: var(--muted); }

/* ---------- Телефонія Zadarma: «Дзвонить …», панель розмови ---------- */
.tel-rings { position: fixed; z-index: 120; right: 16px; top: 76px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.tel-ring { display: flex; gap: 12px; align-items: center; padding: 14px 14px 14px 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--ok, #16a34a); box-shadow: var(--shadow-lg); cursor: pointer; animation: telIn .25s var(--ease, ease); position: relative; }
.tel-ring.out { opacity: 0; transform: translateX(30px); transition: .3s; }
.tel-ring-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok, #16a34a); color: #fff; animation: telPulse 1.2s infinite; }
.tel-ring-b { display: flex; flex-direction: column; min-width: 0; } .tel-ring-b b { font-size: 1.08rem; line-height: 1.25; } .tel-ring-b small { color: var(--muted); }
.tel-ring .tel-black { color: var(--err); font-weight: 650; }
.tel-ring .pop-x { position: absolute; right: 6px; top: 4px; }
@keyframes telIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes telPulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 12px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.tel-panel { position: fixed; z-index: 110; right: 16px; top: 76px; bottom: 16px; width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; pointer-events: none; }
.tel-panel .tel-pbox { pointer-events: auto; display: flex; flex-direction: column; max-height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: telIn .25s var(--ease, ease); }
.tel-panel.min { top: auto; bottom: 16px; width: auto; }
.tel-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 30px; background: var(--ok, #16a34a); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; font-size: .92rem; }
.tel-pill span { opacity: .9; font-variant-numeric: tabular-nums; }
.tp-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px 16px; background: color-mix(in srgb, var(--ok, #16a34a) 10%, transparent); font-size: .85rem; color: var(--text-2); }
.tp-head b { font-variant-numeric: tabular-nums; color: var(--text); margin-left: 4px; }
.tp-dir .ico { vertical-align: -3px; color: var(--ok, #16a34a); }
.tp-who { padding: 6px 16px 12px; background: color-mix(in srgb, var(--ok, #16a34a) 10%, transparent); border-bottom: 1px solid var(--line); }
.tp-greet small { display: block; color: var(--muted); font-size: .78rem; } .tp-greet b { font-size: 1.28rem; line-height: 1.25; }
.tp-body { overflow: auto; padding: 4px 0 8px; }
.tp-sec { padding: 10px 16px; border-bottom: 1px solid var(--line); } .tp-sec:last-child { border-bottom: 0; }
.tp-sec h4 { margin: 0 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tp-sec textarea { width: 100%; }
.tp-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tp-bal div { display: flex; flex-direction: column; }
.tel-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.tel-ico.in { background: color-mix(in srgb, var(--ok, #16a34a) 15%, transparent); color: var(--ok, #16a34a); }
.tel-ico.out { background: var(--primary-soft); color: var(--primary); }
.tel-ico.miss { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
@media (max-width: 700px) { .tel-panel { top: auto; height: 70vh; right: 8px; left: 8px; width: auto; bottom: 72px; } .tel-panel.min { height: auto; left: auto; } .tel-rings { top: 64px; right: 8px; } }

/* ---------- ТТН Нової пошти в замовленні, контроль доставки ---------- */
.np-doc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.np-doc-g { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; }
.np-doc-g span { display: flex; flex-direction: column; font-size: .92rem; } .np-doc-g small { color: var(--muted); font-size: .74rem; }
.np-hist { margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line); }

/* ---------- Список замовлень: клієнт головний, деталі згорнуті ---------- */
.ord-cl { font-size: .98rem; }
details.ord-more { margin-top: 3px; }
details.ord-more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted); user-select: none; }
details.ord-more > summary::-webkit-details-marker { display: none; }
details.ord-more > summary::before { content: '▸'; font-size: .7rem; transition: transform .15s; }
details.ord-more[open] > summary::before { transform: rotate(90deg); }
details.ord-more > summary:hover { color: var(--primary); }
.ord-more-b { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.ord-warn { width: 7px; height: 7px; border-radius: 50%; background: var(--err); display: inline-block; }

/* ---------- ТТН: місця з різною вагою й розмірами ---------- */
.np-pl-head, .np-pl { display: grid; grid-template-columns: 46px 1.1fr 1fr 1fr 1fr 32px; gap: 8px; align-items: center; }
.np-pl-head { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.np-pl { margin-bottom: 6px; } .np-pl b { text-align: center; color: var(--muted); }
.np-pl input { min-width: 0; }
@media (max-width: 560px) { .np-pl-head { display: none; } .np-pl { grid-template-columns: 26px repeat(4, 1fr) 28px; gap: 4px; } }

/* ---------- Банк: виписки й оплати ---------- */
.bank-accs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.bank-acc { flex: 0 0 auto; min-width: 170px; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.bank-acc b { font-size: 1.1em; }
.bank-acc.active { border-color: var(--primary, #1d4ed8); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #1d4ed8) 20%, transparent); }
.bank-in { color: #059669; }
.bank-out { color: var(--err, #dc2626); }
.bank-purpose { max-width: 420px; }
.bank-tbl td { vertical-align: top; }
.bank-act .dropdown { position: relative; }
.bank-tx-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2, rgba(0,0,0,.02)); }

/* ---------- Блок «Чат · Пошта · Клієнти» угорі (замість трьох пунктів лівого меню) ---------- */
.topbar:has(.comm-bar) .topbar-title { flex: 0 1 auto; }
.topbar:has(.comm-bar) .topbar-actions { margin-left: auto; }
.comm-bar { margin-left: 10px; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); flex: 0 0 auto; }
.comm-grp { display: inline-flex; align-items: center; border-radius: 11px; }
.comm { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: .9rem; text-decoration: none !important; white-space: nowrap; transition: background .15s, color .15s; }
.comm:hover { background: var(--bg); color: var(--text); }
.comm.on, .comm-grp.on .comm { background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent); color: var(--primary, #2563eb); }
.comm .ico { width: 19px; height: 19px; }
.comm-n { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; line-height: 1; }
.comm-n[hidden] { display: none; }
.comm-n.chat { background: var(--red, #ef4444); }
.comm-n.mail { background: #d97706; }
.comm-n.cc { background: #7c3aed; }
.comm.has-n .ico { color: var(--text); }
.comm-ping { animation: commPing .9s var(--ease, ease) 2; }
@keyframes commPing { 0%, 100% { transform: none; } 30% { transform: translateY(-2px) scale(1.04); } 60% { transform: translateY(1px); } }
.comm-more { position: relative; }
.comm-chev { width: 24px; height: 36px; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; display: grid; place-items: center; margin-left: -6px; }
.comm-chev:hover { background: var(--bg); color: var(--text); }
.comm-more .dd-menu { left: auto; right: 0; min-width: 240px; }
@media (max-width: 1280px) {
  .comm-t { display: none; }
  .comm { padding: 0 10px; gap: 5px; }
}
@media (max-width: 600px) {
  .comm-bar { margin-left: 0; padding: 2px; gap: 0; box-shadow: none; background: transparent; }
  .comm { height: 38px; padding: 0 7px; gap: 3px; }
  .comm { width: 38px; justify-content: center; }
  .comm-n { position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; font-size: .66rem; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg); }
  .comm-chev { display: none; }
}
.bp-alloc .bp-head { margin-bottom: 6px; }
.bp-tbl td { vertical-align: middle; }
.bp-tbl .bp-amt { width: 100%; text-align: right; }
.bp-foot { padding: 6px 2px 0; }

/* ---------- Вкладки групи сторінок (Склад: склади · полиці · місця · план; Банк і оплати; Система…) ---------- */
.sec-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
@media (max-width: 760px) { .sec-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .9rem; white-space: nowrap; text-decoration: none !important; }
.sec-tabs a:hover { background: var(--bg); color: var(--text); }
.sec-tabs a.on { background: var(--primary); color: var(--primary-ink, #fff); }
.sec-tabs .sec-n { font-style: normal; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #d97706; color: #fff; font-size: .7rem; display: inline-grid; place-items: center; }
@media (max-width: 600px) { .sec-tabs { width: auto; } .sec-tabs a { padding: 7px 11px; font-size: .85rem; } }
.set-card { padding: 0; }
.set-card > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; flex-wrap: wrap; }
.set-card > summary::-webkit-details-marker { display: none; }
.set-card > summary .set-sum { flex: 1; }
.set-card > summary .chev { transition: transform .2s; }
.set-card[open] > summary .chev { transform: rotate(180deg); }
.set-card > form { padding: 0 18px 16px; margin-top: 0; }

/* ---------- Вибір місця на 3D-схемі ---------- */
.pp-btn { margin-top: 6px; width: auto !important; align-self: flex-start; justify-self: start; }
td > .pp-btn { margin-top: 4px; }
.pick3d-box { width: min(1100px, 96vw); max-width: none; height: min(780px, 92vh); display: flex; flex-direction: column; gap: 10px; }
.pick3d-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
body.pick3d { padding: 0; }
body.pick3d .bare-bg { display: none; }
.pick3d-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; min-height: 54px; }
@media (max-width: 600px) { .pick3d-box { width: 100vw; height: 100vh; border-radius: 0; } }

/* ---------- Рахунки для 1С ---------- */
.c1-list { display: grid; gap: 12px; }
.c1-card { padding: 14px 16px; transition: opacity .4s, transform .4s; }
.c1-card.c1-focus { box-shadow: 0 0 0 2px var(--primary); }
.c1-card.c1-cand { box-shadow: 0 0 0 2px #d97706; }
.c1-card.c1-done { opacity: .35; transform: scale(.98); }
.c1-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.c1-sum { text-align: right; font-size: 1.1rem; }
.c1-lines { margin-top: 8px; }
.c1-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.c1-scan { display: inline-flex; gap: 4px; align-items: center; }
.c1-scan input { width: 300px; max-width: 70vw; }
.c1-scanbar .sys-ico { flex: 0 0 auto; }
.c1-box .mini-row { flex-wrap: wrap; gap: 8px; }

/* ---------- Розрахунки клієнта в замовленні (неоплачені рахунки, аванс) ---------- */
.om-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2, transparent); }
.om-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 6px; font-size: .92em; }
.om-head .ico { vertical-align: -2px; }
.om-tbl tr.om-mine td { background: var(--primary-soft); }
.om-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.om-pay { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .92em; }
.bp-tbl tr.bp-sub td { background: var(--surface-2, transparent); padding-top: 10px; }
.sp-q.is-invalid { border-color: var(--err); }

/* ---------- Поле «клієнт»: відкриває вікно з групами клієнтів ---------- */
.ss-cpk { position: relative; }
.ss-cpk .ss-input { padding-right: 58px !important; }
.ss-cpk .ss-clr { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted, #64748b); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; cursor: pointer; padding: 0; }
.ss-cpk .ss-clr:hover { background: var(--surface-3); color: var(--text); }
.ss-cpk .ss-clr[hidden] { display: none; }
.ss-cpk .ss-input[readonly]:not(:disabled) { background-color: var(--surface) !important; color: var(--text) !important; }
.c1-how > summary { cursor: pointer; } .c1-how > summary .ico { vertical-align: -2px; }
.ph-tbl tr.ph-best td { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.plan-spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 24px; }
.plan-spark i { display: block; width: 4px; background: var(--primary); opacity: .7; border-radius: 1px; }
.plan-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.plan-bar .ss, .plan-bar select { width: auto; min-width: 220px; max-width: 360px; flex: 1 1 260px; }
.plan-tbl .plan-name { max-width: 300px; min-width: 170px; }
.plan-tbl .plan-name b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-cons { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.plan-spark { border: 0; background: none; padding: 2px; cursor: zoom-in; border-radius: 6px; }
.plan-spark:hover { background: var(--surface-3); }
.plan-q { width: 70px; text-align: right; }
.plan-price { min-width: 140px; max-width: 220px; }
.plan-pager { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 12px 16px; }
.cn-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cn-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); font-size: .85rem; }
.cn-x { border: 0; background: none; cursor: pointer; color: var(--muted, #64748b); padding: 0 2px; font-size: 1rem; line-height: 1; }
.cn-card > summary { cursor: pointer; }
.cn-merge { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 16px; }
.plan-opts { display: flex; flex-direction: column; gap: 2px; }
.plan-opt { display: flex; gap: 6px; align-items: baseline; border: 1px solid transparent; background: none; padding: 1px 4px; border-radius: 6px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.plan-opt:hover { background: var(--surface-3); }
.plan-opt.best { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.plan-opt.on { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.plan-opt .po-n { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-opt .po-d { color: var(--muted, #6b7280); white-space: nowrap; }
.plan-tbl .plan-price { min-width: 220px; max-width: 320px; }
.plan-tbl input.plan-q { width: 76px; max-width: 76px; }
.plan-opt b { white-space: nowrap; }
@media (max-width: 760px) { .plan-tbl .plan-price { max-width: none; min-width: 0; flex-wrap: wrap; } .plan-tbl .plan-price .plan-opts { flex: 1 1 100%; min-width: 0; } .plan-opt .po-n { max-width: none; flex: 1 1 auto; } }
/* інструкція */
.help-q { display: inline-flex; vertical-align: middle; margin-left: 6px; color: var(--muted, #6b7280); opacity: .75; border-radius: 50%; padding: 2px; }
.help-q:hover { opacity: 1; color: var(--primary); background: var(--surface-3); }
.help-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.help-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 100px); overflow: auto; }
.help-nav a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.help-nav a:hover { background: var(--surface-3); }
.help-nav a.on { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 600; }
#helpHits a { display: block; padding: 6px 8px; border-top: 1px solid var(--border); font-weight: 400; }
.help-doc { max-width: 900px; line-height: 1.65; font-size: 15px; }
.help-doc h2.help-title { margin-top: 0; font-size: 24px; }
.help-doc h3 { margin: 26px 0 8px; font-size: 19px; }
.help-doc h4 { margin: 18px 0 6px; font-size: 16px; }
.help-doc ul, .help-doc ol { padding-left: 22px; }
.help-doc li { margin: 3px 0; }
.help-doc code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.help-tip { border-left: 4px solid var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); padding: 8px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; }
.help-tip p { margin: 4px 0; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.help-toc a { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); text-decoration: none; color: inherit; }
@media (max-width: 900px) { .help-wrap { grid-template-columns: 1fr; } .help-nav { position: static; max-height: none; } }
/* гарантія картриджів */
.wr-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.wr-steps span { padding: 6px 12px; border-radius: 999px; background: var(--surface-3); font-size: 13px; color: var(--muted, #6b7280); }
.wr-steps span.on { background: var(--primary); color: #fff; font-weight: 600; }
.wr-steps span.skip { text-decoration: line-through; opacity: .5; }
.wr-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.wr-dl dt { color: var(--muted, #6b7280); font-size: 13px; }
.wr-dl dd { margin: 0; }
.wr-box { font-size: 16px; }
.wr-hist { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-3); display: flex; flex-direction: column; gap: 3px; }
.wr-verdicts { display: flex; flex-direction: column; gap: 6px; }
.wr-v { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.wr-v:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.wr-v-ok span { color: var(--ok); font-weight: 600; }
.wr-log { padding: 6px 0; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.wr-panel { margin-top: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
.wr-panel.has { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.wr-head { display: flex; gap: 8px; align-items: center; }
.wr-line { display: flex; margin: 4px 0; }
.wr-pack { color: var(--ok); }
.po-cmp { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.po-chip { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); }
.po-chip.po-more { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.po-chip.po-less { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.po-warn { color: var(--err); font-weight: 600; font-size: 12px; margin: 2px 0; }
/* контроль розпакування */
.up-late { border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.up-row-late td { background: color-mix(in srgb, var(--err) 5%, transparent); }
.up-person { padding: 10px 0; border-top: 1px solid var(--border); }
.up-pauses { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.up-pauses span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); }
.up-pauses span.idle { background: color-mix(in srgb, var(--err) 13%, transparent); color: var(--err); }
.pc-table tr.pc-late td { background: color-mix(in srgb, var(--err) 6%, transparent); }
.pc-late-b { color: var(--err); font-weight: 700; }
.tb-short { border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.tb-ready { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tb-row-short td { background: color-mix(in srgb, var(--err) 5%, transparent); }
.imp-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 16%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, #f59e0b 55%, transparent); }
.imp-bar .grow { flex: 1; min-width: 220px; }
.wp-list { display: flex; flex-direction: column; gap: 6px; }
.wp-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: color-mix(in srgb, var(--err) 6%, transparent); }
.wp-row.keep { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.wp-row .wp-t { flex: 1; }
.wp-row .wp-st { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--err); }
.wp-row.keep .wp-st { color: var(--ok); }
.d-block { display: block; }
.np-tbl td:not(.cell-first), .np-tbl th:not(:first-child) { text-align: center; width: 130px; }

/* ---------- Сканер складу («ES-TE Склад») ---------- */
.wh { max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
.wh-modes { width: 100%; } .wh-modes label { flex: 1; } .wh-modes label span { justify-content: center; width: 100%; padding: 10px 8px; font-size: .95rem; }
.wh-dest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wh-input { display: flex; gap: 8px; align-items: stretch; }
.wh-code { flex: 1; min-width: 0; font-size: 1.3rem !important; padding: 14px 16px !important; border: 2px solid var(--primary) !important; border-radius: 14px; }
.wh-code:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.wh-input .btn { padding: 0 16px; border-radius: 14px; }
.wh-hint { margin: 0; }
.wh-status { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--surface-3); border: 2px solid var(--line-2); min-height: 92px; }
.wh-status .wh-st-ic { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.wh-status .wh-st-ic .ico { width: 26px; height: 26px; }
.wh-status .wh-st-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .95rem; }
.wh-status .wh-st-t > b { font-size: 1.2rem; line-height: 1.2; }
.wh-status .wh-st-t > span { color: var(--muted); line-height: 1.35; }
.wh-status.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: var(--ok); } .wh-status.ok .wh-st-ic { background: var(--ok); color: #fff; }
.wh-status.place { background: color-mix(in srgb, #0ea5e9 14%, var(--surface)); border-color: #0ea5e9; } .wh-status.place .wh-st-ic { background: #0ea5e9; color: #fff; }
.wh-status.info, .wh-status.find { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); border-color: var(--primary); } .wh-status.info .wh-st-ic, .wh-status.find .wh-st-ic { background: var(--primary); color: #fff; }
.wh-status.warn { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); border-color: #f59e0b; } .wh-status.warn .wh-st-ic { background: #f59e0b; color: #fff; }
.wh-status.err { background: color-mix(in srgb, var(--err) 14%, var(--surface)); border-color: var(--err); } .wh-status.err .wh-st-ic { background: var(--err); color: #fff; }
.wh-status.flash { animation: whflash .35s; }
@keyframes whflash { from { transform: scale(.98); filter: brightness(1.15); } to { transform: none; filter: none; } }
.wh-lines { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: .88rem; } .wh-lines .ico { vertical-align: -3px; }
.wh-pending { border: 1px dashed var(--line-2); border-radius: 14px; padding: 10px 12px; background: var(--surface); }
.wh-pending-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .wh-pending-h b { display: inline-flex; align-items: center; gap: 6px; } .wh-pending-h .btn { margin-left: auto; }
.wh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: var(--surface-3); font-size: .85rem; max-width: 100%; }
.wh-chip i { font-style: normal; color: var(--muted); } .wh-chip small { color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-chip button { border: 0; background: var(--surface); color: var(--muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }
.wh-log-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; } .wh-log-h > b { white-space: nowrap; } .wh-log-h .gap { flex-wrap: nowrap; }
.wh-log { display: flex; flex-direction: column; gap: 4px; }
.wh-row { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--line-2); font-size: .9rem; }
.wh-row.ok { border-left-color: var(--ok); } .wh-row.place { border-left-color: #0ea5e9; } .wh-row.warn { border-left-color: #f59e0b; } .wh-row.err { border-left-color: var(--err); } .wh-row.info { border-left-color: var(--primary); }
.wh-row-t { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.wh-empty { margin: 4px 0; }
.wh-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; } .wh-foot .ico { vertical-align: -3px; }
.wh-cam-box video { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }
.wh-find .mini-row small { display: block; color: var(--muted); font-size: .8rem; }
@media (max-width: 640px) { .wh-page .page-head { margin-bottom: 8px; } .wh-modes label span { font-size: .88rem; padding: 10px 4px; } .wh-status .wh-st-t > b { font-size: 1.1rem; } }

/* пошта: зірочка (важливе / повернутись пізніше) */
.ml-rowstar{border:0;background:none;padding:0;width:18px;height:18px;flex:none;display:inline-grid;place-items:center;color:var(--line-2);cursor:pointer;border-radius:50%}
.ml-rowstar .ico{width:15px;height:15px}.ml-rowstar:hover{color:#f59e0b}.ml-rowstar.on{color:#f59e0b}.ml-rowstar.on .ico{fill:#f59e0b}
.ml-bar .icon-btn.ml-starbtn.on{color:#f59e0b;background:#fef3c7}.ml-bar .icon-btn.ml-starbtn.on .ico{fill:#f59e0b}
.ml-read-bar .icon-btn.ml-starbtn.on .ico{fill:#f59e0b}
@media (pointer:coarse){.ml-rowstar{width:26px;height:26px}.ml-rowstar .ico{width:18px;height:18px}}
.wh-cam-wrap { position: relative; } .wh-cam-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: rgba(239,68,68,.85); box-shadow: 0 0 6px rgba(239,68,68,.6); pointer-events: none; }
#whTorch.on { background: #fef3c7; }

/* стелажі й полиці */
.wh-places { max-width: 900px; } .wh-form .grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; } .wh-form .grid label small { font-weight: 400; }
.wh-rack { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: var(--surface); }
.wh-rack summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; } .wh-rack summary::-webkit-details-marker { display: none; } .wh-rack summary > .gap { margin-left: auto; }
.wh-rack-body { margin-top: 10px; }
.wh-grid { display: flex; flex-direction: column; gap: 6px; }
.wh-level { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .wh-lvl { font-size: .78rem; color: var(--muted); width: 64px; flex: none; }
.wh-cell { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-3); font-size: .82rem; line-height: 1.2; }
.wh-cell b { font-family: var(--mono, monospace); } .wh-cell i { font-style: normal; color: #0ea5e9; font-size: .72rem; } .wh-cell.blk { opacity: .45; text-decoration: line-through; }
.wh-resize { flex-wrap: wrap; align-items: end; } .wh-resize label { display: flex; flex-direction: column; gap: 2px; }
.wh-copy { background: var(--surface-3); border-radius: 10px; padding: 8px 10px; }
.whp-o-desk rect { fill: #e7d3b4; stroke: #8b6b45; } .whp-o-cabinet rect { fill: #d6bfa3; stroke: #6b5138; } .whp-o-pc rect { fill: #cbd5e1; stroke: #334155; }
.whp-o-tools rect { fill: #fecaca; stroke: #b91c1c; } .whp-o-radiator rect { fill: #e2e8f0; stroke: #64748b; }
.whp-o-door rect { fill: #fcd9b6; stroke: #92400e; }
.wh3d-parcel { padding: 4px 6px; border-radius: 6px; margin-top: 3px; } .wh3d-parcel.hi { background: #ffedd5; }
/* розпакування на телефоні */
@media (max-width: 640px) {
  .pi-table.stack td { align-items: center; } .pi-table.stack td .pi-in { flex: 1 1 auto; max-width: 62%; } .pi-table.stack td .pi-in.mt { margin-top: 0; }
  .pi-table.stack td[data-label="Модель"] { flex-wrap: wrap; } .pi-table.stack td[data-label="Модель"] .pi-model { width: 100%; max-width: 100%; }
  .pi-table.stack tr { padding: 10px 6px; border-radius: 10px; margin-bottom: 6px; border: 1px solid var(--line-2); }
  .pc-scanrow .pc-code { min-width: 0; flex-basis: 100%; }
  .pc-seatbar .pc-seat { flex: 1 1 45%; }
}
@media (max-width: 640px) { .pi-table.stack td:empty { display: none; } }
.err-entry { padding: 10px 16px; border-top: 1px solid var(--line); } .err-entry summary { cursor: pointer; font-size: .9rem; } .err-entry pre { font-family: var(--mono, monospace); color: var(--muted); max-height: 320px; overflow: auto; }
.pn-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text-2) 12%, transparent); overflow: hidden; min-width: 90px; } .pn-bar i { display: block; height: 100%; border-radius: 3px; } .pn-bar.big { height: 12px; border-radius: 6px; }
.poll-pop .modal-box { text-align: center; border-top: 6px solid var(--primary); } .poll-pop-ico { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); } .poll-pop-ico .ico { width: 28px; height: 28px; }

i.dot{display:inline-block;width:10px;height:10px;border-radius:50%;vertical-align:middle;margin-right:2px}
.table td.pl{padding-left:22px}
.an-page .table td.num,.an-page .table th.num{white-space:nowrap}
.an-page .table td{vertical-align:middle}
.an-page .kpi-value{white-space:nowrap;font-size:1.45rem;overflow:hidden;text-overflow:ellipsis}
.an-page .kpi-sub{white-space:normal}
.an-page .card .table-wrap{margin:0 -4px}
.an-page .table th{white-space:nowrap}
.sd-thread{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.sd-msg{border-radius:12px;padding:10px 14px;border:1px solid var(--line-2);background:var(--surface-2)}
.sd-msg.sd-client{background:var(--surface);border-color:var(--line-2)}
.sd-msg.sd-staff{background:color-mix(in srgb,var(--blue) 8%,var(--surface));border-color:color-mix(in srgb,var(--blue) 25%,var(--line-2))}
.sd-msg.sd-note{background:color-mix(in srgb,#ca8a04 10%,var(--surface));border-style:dashed}
.sd-msg.sd-sys{background:transparent;border:0;padding:2px 14px;color:var(--muted);font-size:.85rem}
.sd-msg-head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;margin-bottom:4px}
.sd-msg-text{white-space:pre-wrap;word-break:break-word}
.sd-files{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.table tr.unread td{font-weight:600}
.sd-ctl{display:flex;flex-wrap:nowrap;align-items:center}.sd-ctl select{flex:1;min-width:0}
