:root{--bg:#f5f6f8;--card:#fff;--ink:#1b2433;--muted:#667085;--line:#e3e7ee;--accent:#2457d6;--side:#111827} *{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif} .shell{display:flex;min-height:100vh} .side{width:220px;background:var(--side);color:#cfd6e4;padding:18px 12px;display:flex;flex-direction:column;gap:4px} .side-foot{margin-top:auto;padding:10px;color:#667085;font-size:11px} @media(max-width:720px){.side-foot{display:none}} .skeleton{display:flex;flex-direction:column;gap:10px;min-height:88px} .sk-line{height:14px;border-radius:6px;background:linear-gradient(90deg,var(--line),#eef2f7,var(--line));background-size:200% 100%;animation:sk 1.2s ease-in-out infinite} .sk-line:nth-child(2){width:70%}.sk-line:nth-child(3){width:45%} @keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}} @media(prefers-reduced-motion:reduce){.sk-line{animation:none}} .brand{color:#fff;text-decoration:none;font-weight:700;font-size:16px;padding:6px 10px 16px} .brand span{color:#7ea2ff} .nav-link{color:#cfd6e4;text-decoration:none;padding:9px 10px;border-radius:8px} .nav-link:hover{background:#1f2937;color:#fff} .nav-link.active{background:#2457d6;color:#fff} .main{flex:1;min-width:0;padding:22px 26px} .top h1{margin:0 0 4px;font-size:22px} .top p{margin:0 0 18px;color:var(--muted)} .top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px} .back-to-chat{font-size:13px;color:var(--muted);text-decoration:none;padding:6px 10px; border:1px solid var(--line);border-radius:8px;white-space:nowrap;background:var(--card)} .back-to-chat:hover{color:var(--accent);border-color:var(--accent)} .card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;max-width:760px} .card h2{margin:0 0 6px;font-size:16px} .card p{margin:0;color:var(--muted)} @media (max-width:720px){.shell{flex-direction:column}.side{width:auto;flex-direction:row;flex-wrap:wrap;align-items:center}.brand{padding:4px 10px;width:100%}.main{padding:16px}} .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-bottom:16px} .card-head{display:flex;justify-content:space-between;gap:8px;align-items:center} .card-head h2{margin:0;font-size:14px;color:var(--muted);font-weight:600} .value{font-size:24px;font-weight:700;margin:8px 0 4px;font-variant-numeric:tabular-nums} .badge{background:#fff4e5;color:#b54708;border-radius:999px;padding:2px 8px;font-size:11px} .note{color:var(--muted);margin:0;font-size:12px} .queue{margin-top:8px} .task{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:10px 0;border-top:1px solid var(--line)} .task:first-of-type{border-top:0} .task p{margin:2px 0 0;color:var(--muted);font-size:12px} .task-actions{display:flex;gap:6px;flex-shrink:0} .task button{font:inherit;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer} .error{color:#b42318;border-color:#fda29b} .toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px} .toolbar input{flex:1;min-width:180px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font:inherit} .toolbar select,.toolbar button{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff} .toolbar button:disabled{opacity:.45} .table-wrap{overflow-x:auto;background:var(--card);border:1px solid var(--line);border-radius:12px} table{width:100%;border-collapse:collapse;min-width:820px} th,td{padding:9px 10px;text-align:left;white-space:nowrap;border-bottom:1px solid var(--line)} th{font-size:12px;color:var(--muted);background:#f9fafb;position:sticky;top:0} tr:last-child td{border-bottom:0} td.num,th.num{text-align:right;font-variant-numeric:tabular-nums} .row-client{display:flex;flex-direction:column;min-width:0} .row-client small{color:var(--muted);font-size:11px} .badge{padding:2px 8px;border-radius:999px;font-size:11px;background:#eef2f6;color:#475467} .s-active{background:#e7f6ec;color:#067647}.s-blocked,.s-exhausted{background:#fde8e7;color:#b42318} .s-trial{background:#fff4e5;color:#b54708}.s-deleted{background:#f2f4f7;color:#667085} .empty{text-align:center;color:var(--muted);padding:24px} tr.clickable{cursor:pointer} tr.clickable:hover td{background:#f3f6ff} .overlay{position:fixed;inset:0;background:rgba(16,24,40,.35);z-index:60;display:flex;justify-content:flex-end} .drawer{width:min(680px,100%);height:100%;background:var(--card);padding:18px;overflow:auto;box-shadow:-12px 0 30px rgba(16,24,40,.16)} /* Карточка клиента. Общие правила таблиц (не уже 820 px, ячейки без переноса) рассчитаны на широкие страницы: в колонке карточки они уводили правый край за окно, и «Последний вопрос» обрезался без видимой прокрутки (жалоба 18.11.2026). Здесь таблица ужимается по карточке, длинный вопрос переносится, дата и «Открыть» держат свою ширину. */ .drawer table{min-width:0;table-layout:fixed} .drawer th,.drawer td{white-space:normal;overflow-wrap:anywhere;vertical-align:top} /* Колонки диалогов — по замеру: дата «18.11.2026, 02:26:04» 135 px, шапка «Сообщений» 79 px (обе с полями). В em нельзя: у шапки свой кегль 12 px. */ .drawer table.dialogs th:nth-child(1),.drawer table.dialogs td:nth-child(1){width:156px} .drawer table.dialogs th:nth-child(2),.drawer table.dialogs td:nth-child(2){width:100px} .drawer table.dialogs th:nth-child(4),.drawer table.dialogs td:nth-child(4){width:84px;white-space:nowrap} /* Счёт: примечание — самое важное, поэтому широкое; сумма держит знак и разряды. */ .drawer table.ledger th:nth-child(1),.drawer table.ledger td:nth-child(1){width:156px} .drawer table.ledger th:nth-child(2),.drawer table.ledger td:nth-child(2){width:120px} .drawer table.ledger th:nth-child(4),.drawer table.ledger td:nth-child(4){width:160px} .drawer table.files th:nth-child(2),.drawer table.files td:nth-child(2){width:90px} .drawer table.files th:nth-child(3),.drawer table.files td:nth-child(3){width:156px} .drawer table.history th:nth-child(1),.drawer table.history td:nth-child(1){width:156px} .drawer table.history th:nth-child(2),.drawer table.history td:nth-child(2){width:160px} .drawer table.history th:nth-child(4),.drawer table.history td:nth-child(4){width:70px} .sub{color:var(--muted);font-size:11px} .table-wrap > .note{padding:10px} @media(max-width:600px){ .drawer table thead{display:none} /* Диалоги: строка — карточка, дата и «Открыть» сверху, вопрос под ними во всю ширину. */ .drawer table.dialogs tbody tr{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px; padding:8px 10px;border-bottom:1px solid var(--line)} .drawer table.dialogs tbody tr:last-child{border-bottom:0} .drawer table.dialogs tbody td{border:0;padding:0;width:auto!important} .drawer table.dialogs tbody td:nth-child(3){flex:0 0 100%;order:3} .drawer table.dialogs tbody td:nth-child(4){margin-left:auto;order:2} /* Остальные: каждое поле своей строкой — вбок ничего не уезжает. */ .drawer table:not(.dialogs) tbody tr{display:block;padding:8px 10px; border-bottom:1px solid var(--line)} .drawer table:not(.dialogs) tbody tr:last-child{border-bottom:0} .drawer table:not(.dialogs) tbody td{display:block;border:0;padding:1px 0;width:auto!important} } .drawer-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px} .drawer-head h2{margin:0;font-size:18px} .drawer-close{font:inherit;font-size:22px;line-height:1;border:0;background:transparent;cursor:pointer} .tabs{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0} .tab{font:inherit;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer} .tab.active{background:#2457d6;color:#fff;border-color:#2457d6} .kv{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px} .kv div{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line);padding:6px 0} .kv span{color:var(--muted)} .json{white-space:pre-wrap;font-size:12px;background:#f8fafc;padding:10px;border-radius:8px;overflow:auto} .actions-bar{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0} .actions-bar button{font:inherit;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer} .actions-bar button:disabled{opacity:.5} .toast{display:flex;gap:8px;align-items:center;background:#ecfdf3;border:1px solid #abefc6;color:#067647;padding:8px 10px;border-radius:8px;margin:8px 0} .toast button{font:inherit;border:0;background:transparent;color:#067647;text-decoration:underline;cursor:pointer} .toast-close{margin-left:auto;text-decoration:none;font-size:18px} .toolbar button.active{background:#2457d6;color:#fff;border-color:#2457d6} .charts{display:grid;grid-template-columns:1fr 1fr;gap:12px} .chart{margin:0;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px} .chart figcaption{font-size:12px;color:var(--muted);margin-bottom:6px} .chart svg{width:100%;height:auto;display:block} @media(max-width:700px){.charts{grid-template-columns:1fr}} .s-succeeded{background:#e7f6ec;color:#067647}.s-pending{background:#fff4e5;color:#b54708} .s-refunded{background:#f2f4f7;color:#667085}.s-canceled{background:#fde8e7;color:#b42318} .s-low{background:#fff4e5;color:#b54708}.s-ok{background:#e7f6ec;color:#067647} .s-new{background:#fff4e5;color:#b54708}.s-resolved{background:#e7f6ec;color:#067647} .s-deferred,.s-ignored{background:#f2f4f7;color:#667085} .badge.ok,.ok{color:#067647}.bad,.badge.bad{color:#b42318} @media(max-width:600px){ .task{flex-direction:column} .task-actions{width:100%} .task-actions button{flex:1} .actions-bar button{flex:1 1 45%} .drawer{padding:12px} .toolbar input{min-width:0} }