:root {
  --navy: #1C2340;
  --bg: #EEF1F8;
  --white: #FFFFFF;
  --border: #DDE2EE;
  --text: #1A1D2E;
  --sec: #64748B;
  --muted: #94A3B8;
  --accent: #4361EE;
  --accent-h: #3451D1;
  --red: #EF4444;
  --orange: #F97316;
  --amber: #F59E0B;
  --green: #22C55E;
  --r: 10px; --rs: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui,-apple-system,sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; background: #1A1D2E; color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 13px; z-index: 9999; opacity: 0; pointer-events: none; transform: translateY(8px); transition: all 0.22s ease; max-width: 420px; }
.toast.on { opacity: 1; transform: translateY(0); }
.toast.err { background: #991B1B; }

/* Views */
.view { display: none; }
.view.active { display: flex; flex-direction: column; min-height: 100vh; }

/* Login */
#view-login.active { background: var(--navy); align-items: center; justify-content: center; }
.lcard { background: #fff; border-radius: 14px; padding: 40px; width: 360px; max-width: calc(100vw - 32px); box-shadow: 0 24px 64px rgba(0,0,0,0.4); }
.logo { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px; letter-spacing: -0.03em; }
.logo span { color: var(--accent); }
.lsub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.fg { margin-bottom: 14px; }
.fg label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; }
.fi { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--rs); font-size: 14px; color: var(--text); outline: none; font-family: inherit; }
.fi:focus { border-color: var(--accent); }
.btn-p { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--rs); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s; }
.btn-p:hover { background: var(--accent-h); }
.btn-p:disabled { opacity: .6; cursor: default; }
.lerr { font-size: 12px; color: var(--red); margin-top: 10px; text-align: center; min-height: 16px; }

/* Top nav */
.tnav { background: var(--navy); color: #fff; display: flex; align-items: center; padding: 0 18px; height: 50px; flex-shrink: 0; gap: 12px; }
.tlogo { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.tlogo span { color: #7C90F0; }
.tgroup { background: rgba(255,255,255,0.12); border-radius: 20px; padding: 3px 11px; font-size: 12px; color: rgba(255,255,255,0.8); }
.tsp { flex: 1; }
.tswitch { display: flex; background: rgba(255,255,255,0.08); border-radius: 6px; padding: 2px; }
.tswitch button { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 12px; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-family: inherit; }
.tswitch button:hover { color: #fff; }
.tswitch button.on { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; cursor: default; }
.tuser { font-size: 13px; color: rgba(255,255,255,0.6); }
.tuser strong { color: #fff; }
.tuser-btn { background: none; border: none; cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 4px; }
.tuser-btn:hover { background: rgba(255,255,255,0.1); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 800; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 16px; }
.modal { background: #fff; border-radius: 12px; max-width: 100%; max-height: calc(100vh - 80px); overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.35); }
.modal-hdr { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px 20px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.tlout { background: none; border: none; color: rgba(255,255,255,0.35); font-size: 12px; cursor: pointer; padding: 4px 8px; font-family: inherit; }
.tlout:hover { color: #fff; }

.mbody { flex: 1; overflow-y: auto; padding: 20px 24px; }
.stub { max-width: 520px; margin: 60px auto; text-align: center; color: var(--sec); line-height: 1.6; }

/* Cards, buttons */
.chart-box { background:#fff; border:1px solid var(--border); border-radius:var(--r); padding:16px 20px; margin-bottom:14px; }
.chart-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; gap: 12px; flex-wrap: wrap; }
.chart-title { font-size:13px; font-weight:600; }
.note { font-size: 12px; color: var(--sec); line-height: 1.6; }
.nd { color: #CBD5E1; }
.btn-pri { padding:7px 16px; background:var(--accent); color:#fff; border:none; border-radius:6px; cursor:pointer; font-family:inherit; font-weight:600; font-size: 13px; }
.btn-pri:hover { background:var(--accent-h); }
.btn-pri:disabled { opacity: .6; cursor: default; }
.btn-sec { padding:7px 14px; background:#fff; color:var(--accent); border:1.5px solid var(--accent); border-radius:6px; cursor:pointer; font-family:inherit; font-weight:500; font-size: 13px; }
.btn-sec:hover { background:#EEF2FF; }
.irow-toggle { background:none; border:none; cursor:pointer; color:var(--accent); font-size:12px; padding:2px 8px; border-radius:4px; font-family:inherit; }
.irow-toggle:hover { background:#EEF2FF; }
.irow-toggle.danger { color: var(--red); }
.irow-toggle.danger:hover { background: #FEF2F2; }

/* Form fields */
.ied-l { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom: 4px; }
.ied-in { padding:7px 9px; border:1.5px solid var(--border); border-radius:5px; font-size:13px; font-family:inherit; width:100%; outline:none; background:#fff; color: var(--text); }
.ied-in:focus { border-color:var(--accent); }
.ied-in[readonly] { background: #F8F9FE; color: var(--sec); }
.ied-cancel { background:none; border:none; color:var(--muted); font-size:13px; cursor:pointer; font-family:inherit; }
.ied-cancel:hover { color:var(--text); }

/* Admin */
.admin-tabs { display:flex; gap:4px; margin-bottom:16px; }
.admin-tab { padding:6px 14px; background:#fff; border:1.5px solid var(--border); border-radius:6px; font-size:13px; cursor:pointer; font-family:inherit; color:var(--sec); }
.admin-tab.on { background:var(--navy); color:#fff; border-color:var(--navy); }
.tbl-wrap { overflow-x: auto; }
.admin-tbl { width:100%; border-collapse:collapse; }
.admin-tbl th { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:9px 12px; text-align:left; border-bottom:1px solid var(--border); background:#FAFBFF; white-space: nowrap; }
.admin-tbl td { padding:10px 12px; font-size:13px; border-bottom:1px solid #F0F3FC; vertical-align: top; }
.admin-tbl tr:last-child td { border-bottom:none; }
.admin-tbl tbody tr:hover td { background:#F8F9FE; }
.admin-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.role-pill { display:inline-flex; padding:2px 9px; border-radius:10px; font-size:11px; font-weight:600; }
.role-spec { background:#EEF2FF; color:var(--accent); }
.role-mgr  { background:#ECFDF5; color:#16A34A; }
.role-adm  { background:#FFF7ED; color:#D97706; }
.inactive-row td { opacity:.45; }
.admin-form { background:#fff; border:1px solid var(--border); border-radius:var(--r); padding:20px; max-width:640px; margin-bottom:16px; }
.admin-form-title { font-size:14px; font-weight:700; margin-bottom:14px; }
.password-login > summary { cursor: pointer; color: var(--sec); font-size: 12px; margin: 12px 0 16px; }
.form-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; margin-bottom:12px; }
.form-grid > * { min-width: 0; }
.q-dir { margin-bottom: 10px; }
.q-dir-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.q-list { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 16px; }
details.q-dir { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; }
details.q-dir > summary { cursor: pointer; list-style: none; margin-bottom: 0; user-select: none; }
details.q-dir > summary::-webkit-details-marker { display: none; }
details.q-dir > summary::after { content: "▸"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.q-dir[open] > summary { margin-bottom: 6px; }
details.q-dir[open] > summary::after { transform: rotate(90deg); }
.q-count { font-weight: 400; color: var(--sec); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
/* Форма пользователя: три шага */
.uf { max-width: 720px; }
.uf-sec { border-top: 1px solid var(--border); padding: 14px 0 16px; }
.uf-sec:first-of-type { border-top: 0; padding-top: 0; }
.uf-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.uf-n { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.uf-check { display: block; font-size: 13px; }
.acc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc-card { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 13px; }
.acc-card:has(input:checked) { border-color: var(--accent); background: #F5F7FF; }
.acc-card input { margin-top: 2px; accent-color: var(--accent); }
.acc-sub { display: block; font-size: 12px; color: var(--sec); margin-top: 2px; }
.uf-row { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; padding: 10px 0; border-top: 1px dashed var(--border); }
.uf-ctl { min-width: 0; }
.uf-row:first-of-type { border-top: 0; }
.uf-sub { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.uf-lbl { font-size: 12px; font-weight: 700; color: var(--sec); padding-top: 5px; }
.uf-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--sec); }
.uf-inline .ied-in { width: auto; min-width: 150px; }
.uf-summary { margin-top: 8px; padding: 10px 12px; background: #F8F9FE; border-radius: 8px; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .acc-cards, .uf-row { grid-template-columns: 1fr; } }
.q-item { display:flex; min-width:0; overflow-wrap:anywhere; align-items:center; gap:6px; font-size:12px; padding: 2px 0; cursor:pointer; color: var(--sec); }
.q-item input, .q-dir-title input { accent-color: var(--accent); flex-shrink:0; }
.form-err { font-size: 12px; color: var(--red); min-height: 16px; margin-top: 8px; }

/* Import */
.kv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-id { font-family: monospace; font-size: 20px; font-weight: 700; color: var(--navy); background: #F1F4FD; padding: 4px 12px; border-radius: 6px; }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.stat { background: #F8F9FE; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; min-width: 96px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.good b { color: #16A34A; }
.stat.warn b { color: #D97706; }
.stat.bad b { color: var(--red); }
.err-list { font-size: 12px; color: var(--sec); margin-top: 6px; max-height: 180px; overflow-y: auto; line-height: 1.7; }
.status-ok { color: #16A34A; font-weight: 600; font-size: 12px; }
.status-rb { color: var(--muted); font-size: 12px; }

/* === Экран разметки === */
#view-work.active, #view-nps.active { height: 100vh; }
.app-layout { flex: 1; display: flex; overflow: hidden; min-height: 0; }

.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--border); padding: 14px; flex-shrink: 0; overflow-y: auto; }
.sbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; margin-top: 18px; }
.sbl:first-child { margin-top: 0; }
.fopt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--sec); user-select: none; }
.fopt:hover { background: #F0F2FA; }
.fopt.on { background: #EEF2FF; color: var(--accent); font-weight: 500; }
.fdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cnt { margin-left: auto; font-size: 11px; opacity: .6; }
.cnt.alert { opacity: 1; background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-weight: 700; }
.fchk { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 13px; color: var(--sec); cursor: pointer; border-radius: 6px; user-select: none; }
.fchk:hover { background: #F0F2FA; }
.fchk input { accent-color: var(--accent); cursor: pointer; }
.sidesel { width: 100%; margin-top: 2px; padding: 7px 9px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit; }

.cw { flex: 1; display: flex; overflow: hidden; min-width: 0; }
.elist { width: 380px; min-width: 300px; flex-shrink: 0; overflow-y: auto; padding: 14px; border-right: 1px solid var(--border); }
.lhdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ltitle { font-size: 15px; font-weight: 600; }
.lmeta { font-size: 12px; color: var(--muted); }
.lsrch { padding: 0 0 8px; }
.lsrch-in { width: 100%; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); background: #fff; }
.lsrch-in:focus { border-color: var(--accent); }
.prog-wrap { margin-bottom: 10px; }
.prog-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.prog-bg { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

.ecard { background: #fff; border: 1.5px solid var(--border); border-radius: var(--r); padding: 13px; margin-bottom: 7px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ecard:hover { border-color: #C0CBEE; box-shadow: 0 2px 8px rgba(67,97,238,.07); }
.ecard.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(67,97,238,.12); }
.ecard.done { opacity: .72; }
.ecard.locked { background: #FFFDF0; border-color: #F5E6A3; }
.etop { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 7px; }
.sbadge { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0; }
.s1 { background: var(--red); }
.s2 { background: var(--orange); }
.s3 { background: var(--green); }
.elogin { font-size: 13px; font-weight: 600; font-family: monospace; }
.etopic { font-size: 12px; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edate { font-size: 11px; color: var(--muted); }
.earrived { font-size: 11px; color: var(--muted); margin-top: 1px; }
.earrived.fresh { color: #059669; font-weight: 600; }
.earrived.fresh::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #10B981; margin-right: 5px; vertical-align: 1px; }
.pill.plate { background: #FEF3C7; color: #B45309; }
.ecmt { font-size: 12px; color: var(--sec); background: #F8F9FE; border-radius: 5px; padding: 5px 8px; font-style: italic; border-left: 2px solid #C5D0F0; margin-bottom: 7px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.eftr { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.ppending { background: #F1F5F9; color: #64748B; }
.pdone { background: #F0FDF4; color: #16A34A; }
.plocked { background: #FFFBEB; color: #D97706; }
.pcall { background: #FEF2F2; color: var(--red); }
.eempty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.vip-badge { background: #FEF3C7; color: #B45309; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 4px; font-family: system-ui, sans-serif; }
.repeat-badge { background: #FEF2F2; color: #DC2626; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 4px; font-family: system-ui, sans-serif; }

.apanel { flex: 1; background: #fff; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.apempty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; gap: 8px; }
.apempty-ico { font-size: 28px; opacity: .4; }
.aphdr { padding: 16px 18px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 13px; }
.apscore { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 800; color: #fff; flex-shrink: 0; }
.apscore-l { font-size: 10px; font-weight: 600; text-align: center; margin-top: 3px; }
.nps-score-edit { display: flex; gap: 4px; margin-top: 6px; align-items: center; }
.nps-score-edit .fi2 { width: auto; padding: 4px 6px; }
.nps-score-edit .btnc { padding: 4px 8px; }
.aplogin { font-size: 17px; font-weight: 700; font-family: monospace; letter-spacing: -.02em; }
.client-link { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.client-link:hover { color: var(--accent); border-bottom-style: solid; }
.apmeta { font-size: 12px; color: var(--sec); margin-top: 2px; }
.aplinks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.aptlink { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; text-decoration: none; padding: 3px 9px; background: #EEF2FF; border-radius: 4px; }
.aptlink:hover { background: #E0E7FF; }
.agent-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; background: #F1F5F9; color: var(--sec); border-radius: 4px; }
.agent-chip b { font-family: monospace; color: var(--text); font-weight: 600; }
.agent-chip.incident { background: #FFF7ED; color: #C2410C; font-weight: 600; }
.pincident { background: #FFF7ED; color: #C2410C; }
.pbot { background: #F1F5F9; color: #475569; }
.agent-chip.bot { background: #F1F5F9; color: #475569; }
.sb-segs { margin-top: 2px; }
.sb-segs .seg { flex: 1; }
.access-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #F1F5F9; color: var(--sec); margin-right: 4px; }

.apblock { padding: 12px 18px 0; }
/* Комментарий клиента — в том же стиле, что «Что могло повлиять» (.proc-box), только в оранжевой гамме. */
.apcmt { padding: 10px 12px; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 8px; font-size: 13px; line-height: 1.55; color: #7C2D12; font-style: italic; white-space: pre-wrap; word-break: break-word; }
.apcmtl { font-size: 10px; font-weight: 700; color: #C2410C; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; font-style: normal; }
.apnocmt { font-size: 12px; color: var(--muted); }
.proc-box { background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.55; }
.proc-box.has { background: #F5F3FF; border-color: #DDD6FE; }
.proc-t { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.proc-box.has .proc-t { color: #6D28D9; }
.proc-item + .proc-item { margin-top: 3px; }
.proc-name { font-weight: 600; color: #4C1D95; }
.proc-detail { font-weight: 500; }
.proc-hint { color: var(--sec); }
.proc-none { color: var(--sec); }
.proc-foot { margin-top: 8px; font-size: 11px; color: var(--muted); }
.apctx { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; align-items: stretch; }
.proc-item { position: relative; cursor: help; color: #4C1D95; font-weight: 600; outline: none; }
/* Своя подсказка вместо title: появляется сразу при наведении или фокусе (title — с задержкой и не везде). */
.proc-tip { display: none; position: absolute; left: -4px; right: -4px; top: calc(100% + 4px); z-index: 20;
  padding: 8px 10px; background: #1E1B4B; color: #EEF2FF; font-size: 12px; font-weight: 400; line-height: 1.5; border-radius: 6px; white-space: normal; }
.proc-item:hover .proc-tip, .proc-item:focus .proc-tip { display: block; }
.proc-ic { display: inline-block; width: 16px; color: #7C3AED; }
.proc-i { color: #A78BFA; font-weight: 400; font-size: 11px; }
.aprep-same, .aprep-other { font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.aprep-same { background: #FED7AA; color: #9A3412; }
.aprep-other { background: #F1F5F9; color: var(--sec); }
.pproc { background: #F5F3FF; color: #6D28D9; }
.smini { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; vertical-align: -2px; }

.lockp { padding: 36px 24px; text-align: center; color: var(--sec); flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lockico { font-size: 32px; margin-bottom: 12px; opacity: .7; }
.lockt { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.locks { font-size: 13px; max-width: 280px; line-height: 1.6; }
.lockby { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; background: #FFFBEB; border: 1px solid #F5E6A3; border-radius: 6px; padding: 6px 12px; font-size: 13px; color: #D97706; font-weight: 500; }

.donev { padding: 16px 18px; }
.dhr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.dby { font-size: 12px; color: var(--muted); }
.btned { padding: 5px 12px; background: #fff; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 500; font-family: inherit; }
.btned:hover { background: #EEF2FF; }
.df { margin-bottom: 14px; }
.dfl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.dfv { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.dbadge { display: inline-flex; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.bno { background: #F0FDF4; color: #16A34A; }
.byes { background: #FEF2F2; color: var(--red); }
.type-badge { display: inline-block; background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; border-radius: 5px; padding: 2px 8px; font-size: 12px; font-weight: 500; margin: 0 4px 4px 0; }

.apform { padding: 14px 18px; flex: 1; }
.fg2 { margin-bottom: 14px; }
.fl { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 5px; }
.fl i { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fta { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text); resize: vertical; min-height: 80px; font-family: inherit; outline: none; line-height: 1.5; }
.fta:focus, .fi2:focus { border-color: var(--accent); }
.fi2 { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text); font-family: inherit; outline: none; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 6px; user-select: none; color: var(--sec); }
.tchip.on { border-color: var(--accent); background: #EEF2FF; color: var(--accent); }
.tchip input { accent-color: var(--accent); }
.rgroup { display: flex; gap: 8px; }
.ropt { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--sec); user-select: none; }
.ropt:hover { border-color: var(--muted); }
.ropt.rno { border-color: var(--green); background: #F0FDF4; color: #16A34A; font-weight: 600; }
.ropt.ryes { border-color: var(--red); background: #FEF2F2; color: var(--red); font-weight: 600; }
.apacts { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; background: #fff; position: sticky; bottom: 0; }
.btns { flex: 1; padding: 9px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btns:hover { background: var(--accent-h); }
.btns:disabled { opacity: .6; cursor: default; }
.btnc { padding: 9px 14px; background: #fff; color: var(--sec); border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btnc:hover { border-color: var(--sec); }

.ichips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.ichip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px 3px 9px; background: #EEF2FF; color: var(--accent); border-radius: 12px; font-size: 12px; line-height: 1.4; }
.ichip.new { background: #F0FDF4; color: #16A34A; }
.ichip button { background: none; border: none; cursor: pointer; color: inherit; font-size: 15px; padding: 0 0 0 2px; line-height: 1; opacity: .55; }
.ichip button:hover { opacity: 1; }
.issue-wrap { position: relative; }
.issue-dd { position: absolute; top: calc(100% + 3px); left: 0; right: 0; background: #fff; border: 1.5px solid var(--border); border-radius: 6px; z-index: 300; max-height: 220px; overflow-y: auto; display: none; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.issue-dd.open { display: block; }
.iopt { padding: 7px 10px; cursor: pointer; font-size: 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; line-height: 1.4; }
.iopt:hover { background: #F0F2FA; }
.iopt.isel { background: #EEF2FF; color: var(--accent); }
.iopt-meta { font-size: 11px; color: var(--muted); flex-shrink: 0; margin-top: 1px; }
.iopt-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.iadd { padding: 7px 10px; cursor: pointer; font-size: 13px; color: var(--accent); border-top: 1px solid var(--border); }
.iadd:hover { background: #F0F2FA; }

.bulk-bar { background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: 6px; padding: 9px 12px; margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: #4338CA; }
.bulk-btn { padding: 4px 12px; background: var(--accent); color: #fff; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 600; white-space: nowrap; }
.bulk-btn:hover { background: var(--accent-h); }
.hist-wrap { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.hist-item { font-size: 11px; color: var(--muted); padding: 3px 0; border-bottom: 1px solid #F0F3FC; }
.hist-item:last-child { border-bottom: none; }

.fu-block { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 8px; padding: 12px 14px; margin: 0 18px 16px; }
.fu-block.pending { background: #FEF2F2; border-color: #FECACA; }
.fu-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #16A34A; margin-bottom: 6px; }
.fu-block.pending .fu-lbl { color: var(--red); }
.fu-btns { display: flex; gap: 6px; margin: 8px 0; }
.fu-btn { padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; background: #fff; color: var(--sec); }
.fu-btn:hover { border-color: var(--accent); color: var(--accent); }
.fu-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.fu-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

@media (max-width: 1000px) {
  #view-work.active, #view-nps.active { height: auto; }
  .app-layout, .cw { flex-direction: column; overflow: visible; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .elist { width: auto; min-width: 0; border-right: none; max-height: 50vh; }
  .apanel { overflow: visible; }
}

@media (max-width: 640px) {
  .mbody { padding: 16px; }
  .form-grid, .q-list { grid-template-columns: 1fr; }
  .tgroup { display: none; }
}

/* Статистика */
.st-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.st-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-ctrl a.btn-sec { text-decoration: none; }
.st-sel { padding: 6px 9px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff; color: var(--text); outline: none; }
.st-sel:focus { border-color: var(--accent); }
.st-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 9px; border: 1.5px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; white-space: nowrap; }
.st-check input { margin: 0; accent-color: var(--accent); }
.st-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.st-muted { color: var(--muted); font-size: 12px; }
.st-h { margin-bottom: 12px; }
.st-pad { padding: 14px 20px 0; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.st-grid .chart-box { margin-bottom: 14px; }
@media (max-width: 900px) { .st-grid { grid-template-columns: 1fr; } }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.kpi-n { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-l { font-size: 12px; font-weight: 600; margin-top: 2px; }
.kpi-d { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.c-ok { color: #16A34A; } .c-mid { color: #D97706; } .c-bad { color: #DC2626; }
td.c-ok, td.c-mid, td.c-bad { font-weight: 600; }
.dlt { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dlt.good { color: #16A34A; } .dlt.bad { color: #DC2626; }
.segs { display: flex; gap: 4px; flex-wrap: wrap; }
.seg { padding: 4px 10px; border: 1.5px solid var(--border); background: #fff; border-radius: 14px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--sec); }
.seg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-matrix td.st-name { white-space: nowrap; }
.st-matrix .st-total td { background: #F8F9FE; }
.st-matrix .st-queue td { font-size: 12px; }
.st-matrix .st-queue td.st-name { padding-left: 38px; color: var(--sec); }
.mx-toggle { background: none; border: none; cursor: pointer; color: var(--muted); width: 18px; margin-right: 4px; font-size: 12px; }
.st-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sbar { flex: 1; height: 7px; background: #EEF1F8; border-radius: 4px; overflow: hidden; display: flex; min-width: 60px; }
.sbar > div { height: 100%; border-radius: 4px; }
.sbar.split > div { border-radius: 0; }
.brow { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 36px; align-items: center; gap: 4px 10px; margin-bottom: 9px; font-size: 12px; }
.bname { display: flex; align-items: center; gap: 6px; }
.bval { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bsub { grid-column: 2 / 4; font-size: 11px; color: var(--muted); margin-top: -4px; }
.tdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.heat { border-collapse: collapse; font-size: 12px; }
.heat th { font-size: 10px; font-weight: 600; color: var(--muted); padding: 4px 6px; text-align: center; max-width: 90px; }
.heat td { padding: 2px 3px; text-align: center; }
.heat td.st-name { text-align: left; padding-right: 10px; white-space: nowrap; }
.hcell { display: inline-block; min-width: 38px; padding: 5px 4px; border-radius: 4px; font-weight: 600; }
.st-sub td { background: #FAFBFF; padding-top: 4px; }
.case-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.case-row:hover { background: #EEF2FF; }
.case-desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-qline { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; }
.st-qline span:first-child { min-width: 160px; }
.tta { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tta.fast { background: #ECFDF5; color: #16A34A; } .tta.ok { background: #FFFBEB; color: #D97706; } .tta.slow { background: #FEF2F2; color: #DC2626; }
.st-dim td { opacity: .5; }
.st-issue { max-width: 380px; }
.st-task { font-family: monospace; font-size: 11px; color: var(--accent); }
.spark { display: block; margin: 3px 0 0 auto; }
.ist-tracked { color: var(--sec); } .ist-in_work { color: #D97706; font-weight: 600; } .ist-fixed { color: #16A34A; font-weight: 600; }
.mcols { display: flex; gap: 6px; align-items: flex-end; }
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mcol-v { font-size: 11px; font-weight: 700; }
.mcol-b { width: 100%; background: #C7D2FE; border-radius: 3px 3px 0 0; }
.mcol-l { font-size: 10px; color: var(--muted); }
.case-modal .aphdr { padding-left: 0; padding-right: 0; }
.case-modal .apblock { padding-left: 0; padding-right: 0; }
.st-fixed { table-layout: fixed; }
.st-fixed td { overflow: hidden; text-overflow: ellipsis; }
.lock-checked { margin-top: 8px; font-size: 12px; color: var(--muted); }
.kpi-l { margin-top: 0; margin-bottom: 4px; line-height: 1.35; }
.kpi-pair { display: flex; gap: 18px; }
.kpi-t { font-size: 11px; color: var(--sec); }
.kc { white-space: nowrap; }
.kdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.st-legend { margin-top: 10px; }
.st-grouped th.st-gh { text-align: center; border-bottom: 1px solid var(--border); }
.st-grouped th.st-gh.neg { color: #DC2626; }
.st-grouped th.st-gh.neu { color: #EA580C; }
.st-grouped .st-gl { border-left: 1px solid var(--border); }
.mcol-stack { width: 100%; display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; }
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi-pair { flex-wrap: wrap; gap: 4px 14px; }
.kpi-pair .kpi-n { font-size: 20px; }
.type-hint { font-size: 12px; color: var(--sec); margin-top: 6px; line-height: 1.5; }
.version-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1C2340; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 9998; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.version-bar button { margin-left: 10px; background: #4361EE; color: #fff; border: none; border-radius: 5px; padding: 5px 12px; cursor: pointer; font-family: inherit; }
.proc-lead { color: var(--sec); margin-bottom: 6px; }
.info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10px; font-weight: 700; font-style: normal; cursor: help; vertical-align: 1px; text-transform: none; letter-spacing: 0; margin-left: 3px; }
.info:hover, .info:focus { border-color: var(--accent); color: var(--accent); outline: none; }
.st-tip { position: fixed; z-index: 9999; max-width: 320px; background: #1C2340; color: #fff; font-size: 12px; line-height: 1.5; padding: 9px 12px; border-radius: 7px; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sortable.sorted { color: var(--accent); }
th.sortable.sorted[data-dir="desc"]::after { content: ' ▾'; }
th.sortable.sorted[data-dir="asc"]::after { content: ' ▴'; }
.st-few { font-size: 10px; color: var(--muted); font-weight: 400; }
.kt-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #EEF1F8; margin: 6px 0 6px; }
.kt-row { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.6; }
.kt-name { color: var(--sec); flex: 1; }
.kt-share { color: var(--muted); min-width: 44px; text-align: right; }
.link-num { background: none; border: none; color: #DC2626; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: underline dotted; padding: 0; }
.seg:disabled { opacity: .45; cursor: default; }
.st-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; }
.st-dates { display: flex; align-items: center; gap: 6px; }
.st-dates .st-sel { padding: 4px 7px; font-size: 12px; }
.side-dates { display: flex; flex-direction: column; gap: 6px; }
.side-dates label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sec); }
.side-dates .sidesel { flex: 1; min-width: 0; padding: 5px 7px; }
.side-dates .irow-toggle { align-self: flex-start; padding-left: 0; }
.date-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1.5px solid var(--border); border-radius: 6px; background: #fff; color: var(--sec); font-size: 13px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.date-btn:hover { border-color: var(--accent); color: var(--accent); }
.date-btn.set { color: var(--text); }
.sidebar .date-btn { width: 100%; }
.dp-pop { position: absolute; z-index: 900; width: 262px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(28,35,64,.18); padding: 10px 12px 8px; font-size: 13px; }
.dp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.dp-title { flex: 1; text-align: center; font-weight: 600; }
.dp-nav { width: 26px; height: 26px; border: none; background: none; border-radius: 5px; cursor: pointer; color: var(--sec); font-size: 15px; font-family: inherit; }
.dp-nav:hover:not(:disabled) { background: #EEF2FF; color: var(--accent); }
.dp-nav:disabled { opacity: .3; cursor: default; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.dp-wd span { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 3px 0; }
.dp-day { height: 30px; border: none; background: none; font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dp-day:hover { background: #EEF2FF; border-radius: 6px; }
.dp-day.today { font-weight: 700; color: var(--accent); }
.dp-day.in { background: #E0E7FF; border-radius: 0; }
.dp-day.start, .dp-day.end { background: var(--accent); color: #fff; }
.dp-day.start { border-radius: 6px 0 0 6px; } .dp-day.end { border-radius: 0 6px 6px 0; } .dp-day.start.end { border-radius: 6px; }
.dp-day.off { color: #CBD5E1; cursor: default; }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* --- Уведомления: админка и окно ------------------------------------------ */
.al-page { max-width: 1180px; }
.al-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; background:#fff; border:1px solid var(--border); border-radius:var(--r); padding:12px 20px; margin-bottom:14px; font-size:13px; color:var(--sec); }
.al-status b { color: var(--text); font-weight:600; }
.al-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#16A34A; margin-right:6px; vertical-align:1px; }
.al-dot.off { background: var(--muted); }
.al-grid { display:grid; grid-template-columns: 360px minmax(0, 1fr); gap:14px; align-items:start; }
@media (max-width: 1000px) { .al-grid { grid-template-columns: 1fr; } }
.al-grid .chart-box { margin-bottom:14px; }
.al-hdr { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.al-kind { display:flex; gap:10px; align-items:flex-start; padding:9px 0; border-top:1px solid #F0F3FC; cursor:pointer; }
.al-kind:first-of-type { border-top:none; padding-top:2px; }
.al-kind input { margin-top:3px; }
.al-kind b { font-size:13px; font-weight:600; display:block; }
.al-kind span { font-size:12px; color:var(--sec); line-height:1.5; }
.al-form { display:grid; grid-template-columns: 1fr auto; gap:10px 12px; align-items:center; font-size:13px; }
.al-form .ied-in { width:72px; text-align:right; }
.al-form small { display:block; font-size:11px; color:var(--muted); }
.al-chat { border:1px solid var(--border); border-radius:8px; padding:12px 14px; margin-top:10px; }
.al-chat-top { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:10px; }
.al-row { display:flex; gap:10px; align-items:baseline; margin-bottom:8px; }
.al-row > .ied-l { width:92px; flex:none; margin:0; }
.al-actions { display:flex; gap:6px; justify-content:flex-end; align-items:center; margin-top:10px; }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border:1.5px solid var(--border); border-radius:999px; font-size:12px; color:var(--sec); cursor:pointer; user-select:none; background:#fff; }
.chip input { width:13px; height:13px; margin:0; accent-color: var(--accent); }
.chip:has(input:checked) { border-color: var(--accent); background:#EEF2FF; color: var(--accent); }
.chip:has(input:disabled) { cursor:default; opacity:.75; }
.al-sec-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:0 0 10px; }
.tg-modal .modal-body { padding:22px 26px 24px; }
.tg-section { margin-bottom:22px; }
.tg-kind { display:flex; gap:12px; align-items:flex-start; padding:10px 0; border-top:1px solid #F0F3FC; cursor:pointer; }
.tg-kind:first-of-type { border-top:none; padding-top:0; }
.tg-kind input { margin-top:3px; }
.tg-kind b { display:block; font-size:14px; font-weight:600; margin-bottom:2px; }
.tg-kind span { font-size:12px; color:var(--sec); line-height:1.5; }
.tg-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.tg-actions .danger { margin-left:auto; }

/* Показать пароль */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 38px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: none;
  color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.pw-eye:hover { color: var(--text); background: #F1F5F9; }

/* Число и доля рядом, карточки «Трендов» (ревью 30.09.2026) */
.nsh { font-size: 11px; font-weight: 600; margin-left: 5px; color: var(--muted); white-space: nowrap; }
.nsh.c-ok { color: #16A34A; } .nsh.c-mid { color: #D97706; } .nsh.c-bad { color: #DC2626; }
.kt-share { font-weight: 600; }
.kt-dlt { min-width: 70px; text-align: right; }
.kpi-of { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.csi-grid { border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 4px; }
.csi-grid th { font-size: 11px; font-weight: 500; color: var(--sec); text-align: left; padding: 2px 14px 2px 0; }
.csi-grid thead th { color: var(--muted); }
.csi-grid td { font-size: 20px; font-weight: 750; padding: 2px 18px 2px 0; }
.st-kpi-trends { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.st-them th.st-tp { font-size: 10px; max-width: 96px; white-space: normal; line-height: 1.25; }
.st-them .hcell { min-width: 28px; }
.kt-share.c-ok { color: #16A34A; } .kt-share.c-mid { color: #D97706; } .kt-share.c-bad { color: #DC2626; }

/* Путь клиента: метки событий в списках и карточке клиента */
.jchip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin: 1px 2px; white-space: nowrap; background: #F3F4F6; color: var(--sec); }
.jchip.jneg { background: #FEE2E2; color: #B91C1C; }
.jchip.jmid { background: #FEF3C7; color: #B45309; }
.jchip.jpos { background: #DCFCE7; color: #15803D; }
.jchip.jout { background: #E0E7FF; color: #3730A3; }
.j-warn { background: #FFFBEB; border-color: #FDE68A; color: #92400E; font-size: 13px; line-height: 1.5; }
.j-steps { margin: 0 0 0 18px; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.j-steps li { padding-left: 4px; }
.jlink { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.jlink:hover { color: var(--accent); }
.j-pager { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
/* Путь клиента: таблицы в карточках выровнены по отступу заголовка */
#journey-body .chart-box[style*="padding:0"] .admin-tbl th:first-child, #journey-body .chart-box[style*="padding:0"] .admin-tbl td:first-child { padding-left: 20px; }
#journey-body .chart-box[style*="padding:0"] .admin-tbl th:last-child, #journey-body .chart-box[style*="padding:0"] .admin-tbl td:last-child { padding-right: 20px; }
#journey-body .chart-box[style*="padding:0"] .chart-hdr { margin-bottom: 10px; }
#journey-body .j-foot { padding-bottom: 14px; }

/* --- Разбор NPS ----------------------------------------------------------- */
.nps-detractor { background: var(--red); }
.nps-neutral { background: var(--orange); }
.nps-promoter { background: var(--green); }
.nps-none { background: var(--muted); }
.nps-mini { display: inline-flex; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--muted); }
.nps-mini.detractor { background: var(--red); }
.nps-mini.neutral { background: var(--orange); }
.nps-mini.promoter { background: var(--green); }
.nps-check { margin: 8px 2px 0 0; flex-shrink: 0; cursor: pointer; }
.nps-all { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 14px 8px; cursor: pointer; }
.nps-bulk { margin: 0 12px 10px; }
.nps-facts { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 6px; }
.nps-fact { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; }
.nps-fact > span { color: var(--muted); min-width: 170px; flex-shrink: 0; }
.nps-fact > b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nps-fact a.smini { text-decoration: none; }
.st-tasks { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; }
.fta.nps-sum { min-height: 170px; }
.nps-links { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.nps-links a, .nps-summary a, .ecmt a { color: var(--accent); }
.nps-ftr { flex-wrap: wrap; justify-content: flex-start; gap: 4px 6px; }
.nps-ftr .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Подсказка админа: проблема и задача без полной разметки */
.pill.phint { background: #EEF2FF; color: #4338CA; }
.pill.ppost { background: #F5F3FF; color: #6D28D9; }
/* «Отложено» (с 13.10.2026) и предложение скопировать разметку оценки того же тикета */
.post-box { background: #F5F3FF; border: 1px solid #DDD6FE; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #4C1D95; line-height: 1.5; }
.post-t { font-weight: 600; margin-bottom: 6px; }
.post-note { background: #F5F3FF; color: #5B21B6; border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
.copy-bar { background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #3730A3; line-height: 1.45; }
.copy-bar span { flex: 1; min-width: 0; }
.hint-bar { background: #EEF2FF; color: #3730A3; border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }

/* Флаги разбора NPS */
.pill.pflag { background: #FEF3C7; color: #92400E; }
.pill.ptest { background: #E2E8F0; color: #334155; }
.pill.precheck { background: #FEE2E2; color: #991B1B; }

/* Фидбэк отделам */
.fb-badge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 5px; border-radius: 8px; background: #EF4444; color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.fb-block { border: 1px dashed var(--border); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }
.donev + .fb-block { margin: 0 20px 16px; }
.fb-mini { margin-top: 8px; font-size: 13px; line-height: 1.45; }
.fb-mini .pill { margin-right: 4px; }

/* Проблемы карточками */
.iss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.iss-card { background: #fff; border: 1px solid var(--border); border-top: 3px solid #94A3B8; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.iss-card.ist-top-in_work { border-top-color: #D97706; }
.iss-card.ist-top-fixed { border-top-color: #16A34A; }
.iss-head { display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.iss-status { border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; font-size: 12px; font-family: inherit; background: #F8FAFC; cursor: pointer; }
.iss-title { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.iss-small { font-size: 12px; }
.iss-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.iss-ml { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.iss-mv { font-size: 18px; font-variant-numeric: tabular-nums; }
.iss-row { display: flex; gap: 10px; font-size: 13px; align-items: baseline; }
.iss-k { color: var(--muted); min-width: 104px; flex-shrink: 0; }
.iss-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.iss-note { background: #F1F5F9; border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.iss-acts { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.nps-fresh { background: #FFF7ED; border: 1px solid #FED7AA; color: #9A3412; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.nps-fresh-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pctx { background: #FFF7ED; color: #C2410C; }
.ctx-box .proc-item a { color: inherit; text-decoration: underline; }

/* Исторические оценки (app/history.py): группа у админа, строка ручной таблицы разметки в карточке, чаты Jivo. */
.agent-chip.hist { background: #F1F5F9; color: #334155; font-weight: 600; }
.pill.phist { background: #EEF2FF; color: #4338CA; }
.pill.phist.check { background: #FFEDD5; color: #C2410C; }
.pill.phist.none { background: #FEE2E2; color: #B91C1C; }
.pill.phist.jivo { background: #E0F2FE; color: #0369A1; }
.pill.psheet { background: #FEF3C7; color: #92400E; }
.sheet-box { background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.55; }
.sheet-row + .sheet-row { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.sh-hdr { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.sh-hdr .irow-toggle { margin-left: auto; }
.sh-desc { color: var(--text); margin: 4px 0; white-space: pre-wrap; }
.sh-draft, .sh-cands { margin-top: 6px; }
.sh-cands ul { margin: 4px 0 0 18px; padding: 0; }
.sh-l { font-weight: 600; color: var(--sec); margin-right: 4px; }
.sh-note { background: #FFF7ED; color: #9A3412; border-radius: 6px; padding: 6px 9px; margin-bottom: 8px; }
.jivo-staff { background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: 8px; padding: 10px 12px; }

/* Переписка чата Jivo в карточке оценки */
.chat-log { border: 1px solid #E2E8F0; border-radius: 8px; background: #fff; }
.chat-log summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--sec); }
.chat-list { max-height: 420px; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; padding: 7px 10px; border-radius: 8px; background: #F1F5F9; font-size: 13px; line-height: 1.45; }
.chat-msg.visitor { align-self: flex-start; background: #FFF7ED; }
.chat-msg.agent, .chat-msg.bot { align-self: flex-end; }
.chat-msg.bot { background: #F8FAFC; color: var(--sec); }
.chat-msg.own { background: #E0F2FE; }
.chat-who { font-size: 11px; font-weight: 600; color: var(--sec); margin-bottom: 2px; display: flex; gap: 8px; }
.chat-who span { font-weight: 400; }
.chat-body { white-space: pre-wrap; word-break: break-word; }
/* Вкладка статистики «Чаты Jivo»: заголовки частей «Сотрудники» и «Бот» */
.st-section { font-size: 15px; font-weight: 700; margin: 18px 0 10px; color: var(--text); }

/* Support profile cases: recommendations and colleague replies remain readable on narrow screens. */
.profile-case-row { flex-wrap: wrap; }
.profile-case-row .case-desc { flex: 1 0 100%; white-space: normal; overflow-wrap: anywhere; }
.profile-case-row .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
