/* Дополнения к app.css из дизайна (design/src/app.css копируется без изменений):
   настоящее приложение без полосы прототипа, ссылки вместо кнопок-переключателей, формы настроек. */
:root { --pbar-h: 0px; }
body { background: var(--bg); }
.device { min-height: 100vh; }
.layer { inset: 0; }

/* переключатели-ссылки выглядят как кнопки .seg из макета */
.seg a { display: inline-flex; align-items: center; border: 0; background: none; padding: 4px 11px; min-height: 30px; border-radius: 4px; font-weight: 600; font-size: var(--fs-s); color: var(--muted); white-space: nowrap; text-decoration: none; }
.seg a[aria-pressed="true"] { background: var(--navy); color: #fff; }
.m .seg a { min-height: 38px; }

/* таблица на компьютере, карточки на телефоне */
.device:not(.m) .only-mob { display: none; }
.device.m .only-desk { display: none; }
.tbl tr.link, .card-row.link { cursor: pointer; }
.card-row.link:hover { background: var(--surface-2); }

/* формы */
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); align-items: end; }
.form-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-top: var(--sp-3); }
.hours-row { display: grid; grid-template-columns: 140px 110px 110px auto; gap: var(--sp-2); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.m .hours-row { grid-template-columns: 1fr 1fr 1fr; }
.m .hours-row > :first-child { grid-column: 1 / -1; }
.check-lbl { display: inline-flex; gap: 8px; align-items: center; font-size: var(--fs-s); }
.errors { color: var(--bad); font-size: var(--fs-s); }
.flash { margin-bottom: var(--sp-3); }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; word-break: break-all; }
.pagination { display: flex; gap: 6px; align-items: center; }
.stage-off { max-width: 720px; }
.tel.shown { color: var(--ink); font-weight: 700; }
.chart { width: 100%; height: auto; }

/* меню на телефоне: кнопка «Ещё» открывает боковое меню */
.device.m.menu-open .nav { display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 85vw); height: 100vh; z-index: 80; }
.device.m.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(14, 37, 49, .45); z-index: 70; }
.m-top button { margin-left: auto; border: 0; background: none; color: #fff; }
.nav-logout:hover { color: #fff; }

/* строка вкладок настроек: на компьютере переносится, а не уходит за край (в макете полоса прокрутки скрыта) */
.device:not(.m) .tabs { flex-wrap: wrap; overflow: visible; }
.device.m .tabs { scrollbar-width: thin; }
.device.m .tabs::-webkit-scrollbar { display: block; height: 4px; }

/* ФИО звонящего из 1С — строкой под номером */
.pt { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--ink); white-space: normal; }
.pt svg { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; color: var(--muted, #6b7280); }
.pt-more { font-weight: 500; color: var(--muted, #6b7280); white-space: nowrap; }
.call-meta .pt { margin-top: 0; font-size: inherit; }

/* Пациент в 1С: ближайшие записи и последние приёмы */
.visits { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.visits h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted, #6b7280); text-transform: none; }
.visits h3 svg { width: 14px; height: 14px; }
.visits ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.visits li { font-size: 14px; line-height: 1.35; }
.visits li .sub { display: block; font-size: 13px; color: var(--text, #374151); }
@media (max-width: 640px) { .visits { grid-template-columns: 1fr; } }
.m .visits { grid-template-columns: 1fr; }

/* История звонков с номера — таймлайн */
.hist { position: relative; height: 112px; overflow-x: auto; overflow-y: hidden; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); cursor: grab; touch-action: pan-y; user-select: none; scrollbar-width: thin; }
.hist.grabbing { cursor: grabbing; }
.hist-in { position: relative; height: 100%; }
.hist .ht { position: absolute; top: 0; bottom: 18px; border-left: 1px dashed var(--line-strong); }
.hist .ht.strong { border-left: 1px solid var(--navy-300); }
.hist .ht span { position: absolute; bottom: -17px; left: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.hist .hnow { position: absolute; top: 0; bottom: 18px; border-left: 2px solid var(--gold); }
.hist .hlane { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.hist .hm { position: absolute; top: 30px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.hist .hm:hover { transform: scale(1.35); z-index: 2; }
.hist .hm.cur { width: 20px; height: 20px; margin: -10px 0 0 -10px; box-shadow: 0 0 0 3px var(--navy-900); z-index: 3; }
.hist .hv { position: absolute; top: 72px; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 3px; transform: rotate(45deg); border: 2px solid #fff; }
.hm.in, .hdot.in { background: var(--ok); }
.hm.missed, .hdot.missed { background: var(--bad); }
.hm.voicemail, .hdot.voicemail { background: var(--c-third); }
.hm.short, .hdot.short { background: #A3AFB6; }
.hm.out, .hdot.out { background: var(--c-accepted); }
.hm.out_noanswer, .hdot.out_noanswer { background: var(--gold); }
.legend i.hdot { border-radius: 50%; }
.legend i.hdot.cur { background: #fff; box-shadow: inset 0 0 0 3px var(--navy-900); }
.hist-zoom { display: flex; gap: 4px; flex-wrap: wrap; }
.btn.sm { min-height: 28px; padding: 2px 9px; font-size: 12px; }

/* Записи и приёмы 1С — карточки, цвет по статусу */
.hv.ok, .vdot.ok, .vcard.ok, .vchip.ok { --vc: #2E8B57; }
.hv.warn, .vdot.warn, .vcard.warn, .vchip.warn { --vc: #D9921A; }
.hv.done, .vdot.done, .vcard.done, .vchip.done { --vc: #2A6F97; }
.hv.bad, .vdot.bad, .vcard.bad, .vchip.bad { --vc: #A93028; }
.hist .hv, .legend i.vdot { background: var(--vc); }
.legend i.vdot { transform: rotate(45deg); width: 9px; height: 9px; }
.vh { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.vh svg { width: 14px; height: 14px; }
.vh + p { margin-top: 0; }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 14px; }
.vcard { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); border-left: 5px solid var(--vc); background: color-mix(in srgb, var(--vc) 7%, var(--surface)); }
.vcard-d { display: flex; flex-direction: column; min-width: 86px; }
.vcard-d b { font-size: 15px; color: var(--ink); }
.vcard-d span { font-size: 12px; color: var(--muted); }
.vcard-d .vcard-rel { color: var(--vc); font-weight: 700; margin-top: 2px; }
.vcard-b { min-width: 0; }
.vcard-doc { font-weight: 700; color: var(--ink); }
.vchip { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--vc); }
.vcard .small svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }

/* ───────── «Диалоги»: шкала дня ───────── */
.kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.kind i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tl { display: grid; grid-template-columns: 112px minmax(0, 1fr); --lane: 30px; --hrow: 22px; }
.tl-labels { display: flex; flex-direction: column; }
.tl-lab { height: var(--lane); display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tl-lab i { width: 10px; height: 10px; border-radius: 3px; }
.tl-hrow { height: var(--hrow); position: relative; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; border-left: 1px solid var(--line); }
.tl-in { position: relative; min-width: 100%; width: calc(100% * var(--z)); }
.tl-h { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-lane { position: relative; height: var(--lane); border-top: 1px solid var(--line); background: var(--surface); }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-b { position: absolute; top: 5px; bottom: 5px; min-width: 3px; border-radius: 3px; opacity: .9; }
.tl-b:hover { opacity: 1; outline: 2px solid var(--navy); outline-offset: 1px; z-index: 2; }
.tl-b.cam-phone { opacity: .5; }
.tl:not(.show-o) .tl-o { display: none; }
.m .tl { grid-template-columns: 84px minmax(0, 1fr); }
/* ───────── реплики ───────── */
.dlg { display: flex; flex-direction: column; gap: 8px; }
.dlg-l { display: flex; }
.dlg-l.p { justify-content: flex-end; }
.dlg-b { max-width: 78%; padding: 8px 12px; border-radius: 10px; background: #EEF3F5; line-height: 1.45; }
.dlg-l.p .dlg-b { background: #E3F1E8; }
.dlg-l.o .dlg-b { background: none; border: 1px dashed var(--line-strong); }
.dlg-who { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.dlg-who .tr-t { padding: 0 4px; min-height: 0; }
.m .dlg-b { max-width: 92%; }
.tl-lab { border-top: 1px solid transparent; }
.tl-in > .tl-hrow .tl-h:first-child { transform: none; }
