/* Portal design system: shared rhythm, readable data and task-specific density. */
:root { --product-accent:#255ed6; --product-ink:#182b43; --product-muted:#566a83; --product-line:#dce4ee; }
body[data-workspace] { background:#f3f6fa; color:var(--product-ink); font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body[data-workspace] .wrap { padding:20px 24px 36px!important; }
.workspace-sidebar { background:#132238; }
.workspace-brand { padding:20px 18px; }
.workspace-nav-group a { gap:11px; padding:10px 12px; min-height:42px; }
.workspace-nav-group a[aria-current=page] { background:#234879; box-shadow:inset 3px 0 #75a7ff; }
.nav-icon { width:20px; height:20px; flex:none; }
.workspace-bar { height:44px; background:transparent; border-bottom:0; }
body[data-workspace] h1,body[data-workspace] .title { font-size:26px!important; line-height:1.25!important; letter-spacing:-.025em; }
body[data-workspace] h2 { font-size:19px; line-height:1.35; }
body[data-workspace] h3 { font-size:16px; line-height:1.4; }
body[data-workspace] .wrap>.header,body[data-workspace] .wrap>.topbar { padding-bottom:16px!important; gap:12px!important; }
body[data-workspace] .card { border-color:var(--product-line)!important; border-radius:12px!important; margin-bottom:16px; }
body[data-workspace] .section-heading,body[data-workspace] .form-intro,body[data-workspace] .form-actions { padding:16px 20px; }
body[data-workspace] .section-heading h2,body[data-workspace] .form-intro h2 { margin:0 0 6px; }
body[data-workspace] p { line-height:1.6; }
body[data-workspace] .btn,body[data-workspace] button { min-height:42px; font-weight:600; }
body[data-workspace] a:focus-visible,body[data-workspace] summary:focus-visible,body[data-workspace] input:focus-visible,body[data-workspace] select:focus-visible,body[data-workspace] textarea:focus-visible { outline:3px solid #719eec!important; outline-offset:3px; }
body[data-workspace] input[type=checkbox],body[data-workspace] input[type=radio] { width:18px!important; height:18px!important; min-height:0!important; flex:none; accent-color:var(--product-accent); }
body[data-workspace] textarea { line-height:1.6; }
body[data-workspace] .structured-form fieldset { padding:16px 20px; min-width:0; }
body[data-workspace] .form-grid,body[data-workspace] .grid-2,body[data-workspace] .org-grid,body[data-workspace] .finance-entry-grid { gap:16px; }
body[data-workspace] label { line-height:1.45; }
body[data-workspace] th { padding:11px 14px!important; font-size:11px!important; letter-spacing:.035em; color:#4c607c!important; }
body[data-workspace] td { padding:12px 14px!important; font-size:14px!important; line-height:1.5; overflow-wrap:anywhere; }
body[data-workspace] thead th { position:sticky; top:0; z-index:1; }
body[data-workspace] tr:focus-within td { background:#eef4ff; }
.workspace-table-scroll { border:1px solid var(--product-line); background:#fff; }
body[data-workspace] .table-scroll .workspace-table-scroll { border:0; }
body[data-workspace] .badge { font-size:12px; line-height:1.35; padding:5px 9px; border-radius:6px; }
body[data-workspace] .empty { padding:24px; color:var(--product-muted); }
body[data-workspace] details>summary { cursor:pointer; line-height:1.5; }
body[data-workspace] details.card>summary { padding:12px 16px; min-height:44px; box-sizing:border-box; }
body[data-workspace] .org-tabs { background:#e7edf6; gap:4px; padding:5px; }
body[data-workspace] .org-tabs a { min-height:40px; display:flex; align-items:center; box-sizing:border-box; }
body[data-workspace] .entity-summary { gap:12px; }
body[data-workspace] .entity-summary>div { padding:14px 16px; }
body[data-workspace] .org-requisites { grid-template-columns:minmax(140px,1fr) 3fr; }
body[data-workspace] .org-requisites dd { font-weight:500; }
body[data-workspace] .finance-kpis { gap:12px; }
body[data-workspace] .finance-kpis .overview-card { padding:16px!important; min-height:100px; }
body[data-workspace] .finance-kpis strong { font-size:26px; font-variant-numeric:tabular-nums; }
/* Queue first: auxiliary settings no longer consume the first screen. */
body[data-section=tickets]:not(.ticket-page) .eyebrow { display:none; }
body[data-section=tickets]:not(.ticket-page) .header .sub { font-size:12px; margin-top:4px; }
body[data-workspace] .overview-grid { gap:10px; margin-bottom:12px; }
body[data-workspace] .overview-grid .overview-card { min-height:86px!important; padding:12px 14px!important; border-top-width:3px; }
body[data-workspace] .overview-grid .overview-card strong { font-size:26px!important; margin:4px 0!important; }
body[data-workspace] .overview-grid .overview-card small { font-size:11px; }
.queue-tools { display:flex; align-items:flex-start; gap:8px; margin:0 0 12px; flex-wrap:wrap; }
body[data-workspace] .queue-tools .desk-home-actions,body[data-workspace] .queue-tools .desk-notification-settings { margin:0!important; padding:0!important; flex:1 1 220px; min-width:0; }
body[data-workspace] .queue-tools details>summary { min-height:44px!important; line-height:1.45!important; padding:11px 14px; }
.queue-tools details[open] nav,.queue-tools details[open]>p,.queue-tools details[open]>.notification-actions,.queue-tools details[open]>.notification-phone-guide { margin:0 14px 12px; }
body[data-workspace] .searchbar { margin-bottom:12px; }
body[data-workspace] .toolbar { margin:0 0 10px; padding-bottom:6px; }
/* Settings: grouped destinations with whole-row targets. */
.settings-search { display:block; max-width:520px; width:100%; margin:0 0 16px; box-sizing:border-box; }
.settings-directory ul { list-style:none; padding:0; margin:0; }
.settings-directory li+li { border-top:1px solid #edf1f6; }
.settings-directory li a { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:8px 0; text-decoration:none; color:#284c7c; }
.settings-directory li a:after { content:'›'; font-size:22px; color:#7186a1; }
.settings-directory h2 { margin:0 0 10px; }
.settings-directory>section { padding:20px!important; }
.settings-empty { padding:16px; }
/* Client area uses the same components without introducing staff controls. */
body[data-workspace=client] .workspace-sidebar { background:#173449; }
body[data-workspace=client] .wrap { max-width:1280px!important; }
@media(max-width:1100px) { body[data-workspace] .grid-2,body[data-workspace] .finance-entry-grid { grid-template-columns:1fr; } }
@media(max-width:900px) {
 .workspace-bar { height:56px; background:#fff; border-bottom:1px solid var(--product-line); }
 body[data-workspace] .wrap { padding:16px 12px 28px!important; }
 body[data-workspace] input:not([type=checkbox]):not([type=radio]),body[data-workspace] select,body[data-workspace] textarea { font-size:16px!important; }
 body[data-workspace] .btn,body[data-workspace] button { min-height:44px; }
 body[data-workspace] h1,body[data-workspace] .title { font-size:23px!important; }
 body[data-workspace] .org-grid { grid-template-columns:1fr; }
}
@media(max-width:600px) {
 body[data-workspace] .overview-grid { grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:6px; }
 body[data-workspace] .overview-grid .overview-card { min-height:68px!important; padding:8px!important; }
 body[data-workspace] .overview-grid .overview-card span { font-size:11px; }
 body[data-workspace] .overview-grid .overview-card strong { font-size:22px!important; }
 body[data-workspace] .overview-grid .overview-card small { display:none; }
 .queue-tools { gap:6px; }
 body[data-workspace] .queue-tools .desk-home-actions,body[data-workspace] .queue-tools .desk-notification-settings { flex-basis:140px; }
 body[data-workspace] .queue-tools summary { font-size:12px; }
 body[data-workspace] .queue-tools .desk-notification-settings summary>span:last-of-type { display:none; }
 body[data-workspace] .form-grid { grid-template-columns:1fr!important; }
 body[data-workspace] .form-grid .field-wide { grid-column:auto!important; }
 body[data-workspace] .entity-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 body[data-workspace] .entity-summary>div { padding:10px; }
 body[data-workspace] .finance-kpis { grid-template-columns:1fr!important; }
 body[data-workspace] .org-requisites { display:block; }
 body[data-workspace] .org-tabs { flex-wrap:nowrap; overflow:auto; }
 body[data-workspace] .org-tabs a { white-space:nowrap; }
}
@media(prefers-reduced-motion:reduce) { body[data-workspace] *,body[data-workspace] *:before,body[data-workspace] *:after { animation:none!important; scroll-behavior:auto!important; transition:none!important; } }
body[data-workspace] [hidden] { display:none!important; }
body[data-workspace] .workspace-nav-group h2 { font-size:10px!important; letter-spacing:.12em; }
body[data-workspace] .badge { white-space:nowrap; overflow-wrap:normal; }
body[data-section=tickets] td:first-child { min-width:44px; white-space:nowrap; }
body[data-workspace] [data-bank-overview]>.card:first-of-type { padding:16px 20px!important; }
body[data-workspace] [data-bank-overview]>.card:first-of-type>h2 { margin:0 0 8px; }
body[data-workspace] [data-bank-overview]>.card:first-of-type>p { font-size:13px; color:var(--product-muted); margin:8px 0; }
.client-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:16px 20px; margin:0; }
.client-facts dt { color:var(--product-muted); font-size:12px; }
.client-facts dd { margin:4px 0 0; font-weight:600; overflow-wrap:anywhere; }
.client-edit { border-top:1px solid var(--product-line); }
.client-edit>summary { min-height:44px; padding:12px 20px; box-sizing:border-box; color:#25549b; font-weight:600; }
.client-merge .merge-card { padding:0 20px 16px; border:0; }
.work-history ul { padding:0 32px 16px; }
.client-request-list { display:grid; gap:10px; }
.client-request-row { display:block; padding:16px 20px; border:1px solid var(--product-line); border-radius:12px; background:#fff; color:var(--product-ink); text-decoration:none; }
.client-request-row:hover { border-color:#93b3e9; background:#fafdff; }
.client-request-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.client-request-preview { margin:10px 0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; color:#344a65; line-height:1.55; }
.client-request-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px 16px; color:var(--product-muted); font-size:12px; overflow-wrap:anywhere; }
.client-list-limit { color:var(--product-muted); font-size:12px; }
body[data-workspace=client] .client-page-actions { padding:16px 20px!important; }
body[data-workspace=client] .client-page-actions h2 { margin:0 0 6px; }
body[data-workspace=client] .ticket-form-guide { display:block!important; padding:0!important; }
.ticket-form-guide>div,.ticket-form-guide>ol { margin:12px 20px; }
.personal-request-note { border-left:3px solid #6b94d8; background:#f3f7ff; padding:12px 16px; margin-bottom:16px; }
.personal-request-note h3 { margin:0 0 6px; }
.personal-request-note p { margin:6px 0; font-size:13px; }
body[data-workspace=client] .client-ticket-form textarea { min-height:140px; }
body[data-workspace] .org-grid>section>dl { display:grid; grid-template-columns:minmax(90px,1fr) 2fr; gap:8px 16px; }
body[data-workspace] .org-grid>section>dl dt,body[data-workspace] .org-grid>section>dl dd { margin:0; overflow-wrap:anywhere; }
@media(max-width:600px) {
 body[data-workspace] [data-bank-overview] form.form-grid { display:grid!important; grid-template-columns:1fr 1fr!important; gap:8px; }
 body[data-workspace] [data-bank-overview] form.form-grid .field:last-child { grid-column:1/-1; }
 body[data-section=organizations] .org-workspace>.org-tabs { display:grid; grid-template-columns:1fr 1fr; overflow:visible; }
 body[data-section=organizations] .org-workspace>.org-tabs a { white-space:normal; justify-content:center; text-align:center; padding:8px; }
 .client-facts { grid-template-columns:1fr; gap:10px; padding:12px 20px; }
 .client-facts>div { display:grid; grid-template-columns:90px minmax(0,1fr); gap:10px; }
 .client-facts dd { margin:0; }
}

/* Client conversation: compact context, chronological history, persistent draft. */
.client-dialog-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.client-dialog-details { margin-left:auto; position:relative; }
.client-dialog-details>summary { padding:10px 14px; border:1px solid var(--product-line); border-radius:9px; background:#fff; cursor:pointer; }
.client-dialog-details>div { padding:16px; background:#fff; border:1px solid var(--product-line); border-radius:12px; }
.client-dialog-details[open] { flex-basis:100%; }
.client-dialog-timeline { height:clamp(240px,44dvh,520px); overflow:auto; overscroll-behavior:contain; padding:16px; border:1px solid var(--product-line); border-radius:12px; background:#f8fafc; }
body[data-workspace=client] .client-dialog-timeline>.card { max-width:82%; padding:12px 16px!important; margin:0 0 12px!important; overflow-wrap:anywhere; }
body[data-workspace=client] .client-dialog-timeline>.msg-client { margin-left:auto!important; background:#eef4ff; border:1px solid #cdddf6; }
body[data-workspace=client] .client-dialog-timeline>.msg-spec { background:#fff; border:1px solid var(--product-line); }
.client-dialog-timeline .client-message-body { margin:7px 0; line-height:1.55; }
.client-dialog-timeline .client-attachment a { overflow-wrap:anywhere; }
.client-dialog-page .chat-live-bar { display:flex; justify-content:space-between; align-items:center; gap:8px; min-height:40px; color:var(--product-muted); font-size:12px; }
.client-dialog-page .chat-live-bar button { padding:7px 10px; border:1px solid var(--product-line); border-radius:8px; background:#fff; color:#2159a6; }
.client-dialog-page .chat-live-bar button[hidden] { display:none; }
body[data-workspace=client].client-dialog-page .client-dialog-composer .card { padding:16px!important; }
body[data-workspace=client].client-dialog-page .client-dialog-composer textarea { min-height:80px; }
.client-dialog-empty { color:var(--product-muted); text-align:center; }
@media(max-width:600px) {
 body[data-workspace=client] .client-dialog-timeline>.card { max-width:94%; padding:10px 12px!important; }
 .client-dialog-timeline { padding:10px; }
 .client-dialog-page .chat-live-bar { flex-wrap:wrap; }
 .client-dialog-toolbar { gap:6px; }
}

/* Client profile/report: labels stay with fields and long identity values wrap. */
.client-profile-page .section-heading { flex-wrap:wrap; gap:16px; }
.client-profile-page .section-heading>div:first-child { flex:1 1 220px; min-width:0; }
.profile-access-actions { display:flex; flex-wrap:wrap; gap:8px; }
.client-profile-page .profile-facts { grid-template-columns:repeat(3,minmax(0,1fr)); }
.client-profile-page .profile-facts>div,.client-profile-page .profile-facts b { min-width:0; overflow-wrap:anywhere; white-space:normal!important; text-overflow:clip!important; overflow:visible!important; }
.client-profile-form { display:grid; gap:16px; }
.client-profile-form h2 { margin:0; }
.client-profile-form .field { display:grid; gap:6px; }
body[data-workspace] .client-profile-form input { width:100%; box-sizing:border-box; }
.client-profile-form .meta { margin:0; }
.client-profile-form button { justify-self:start; }
.client-report-filters { display:grid!important; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:12px; }
.client-report-filters>div { min-width:0; display:grid; gap:6px; }
body[data-workspace] .client-report-filters input { width:100%; box-sizing:border-box; min-width:0; }
body[data-workspace] .client-report-grid { grid-template-columns:repeat(4,minmax(0,1fr))!important; }
body[data-workspace].client-report-page .table { min-width:0!important; table-layout:fixed; }
.client-report-page .table th:first-child { width:45%; }
@media(max-width:600px) {
 .client-profile-page .profile-facts { grid-template-columns:minmax(0,1fr); }
 .profile-access-actions { width:100%; }
 .profile-access-actions a { flex:1; }
 .client-report-filters { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .client-report-filters>div:last-child { grid-column:1/-1; }
 body[data-workspace] .client-report-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
 body[data-workspace].client-report-page .table th,body[data-workspace].client-report-page .table td { padding:10px 8px; font-size:12px!important; }
}

body[data-workspace].client-report-page .table th,body[data-workspace].client-report-page .table td { white-space:normal!important; overflow-wrap:anywhere; }

/* Compact service overview and own-session list. */
body[data-workspace] .service-intro { padding:14px 18px!important; }
.service-intro>p { margin:0 0 12px; }
.service-actions { display:flex; flex-wrap:wrap; gap:8px; }
.service-filter>.service-actions,.service-personal { padding:0 16px 16px; }
.service-filter summary { overflow-wrap:anywhere; }
.service-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.service-summary>div { border:1px solid var(--product-line); border-radius:10px; background:#fff; padding:12px; }
.service-summary span { display:block; color:var(--product-muted); font-size:12px; line-height:1.4; }
.service-summary b { display:block; margin-top:5px; font-size:24px; }
.client-service-page .client-request-list { margin:14px 0; }
.session-intro { color:var(--product-muted); max-width:65ch; }
.session-explainer>p { padding:0 16px 16px; margin:0; }
body[data-workspace] .session-card { padding:16px 20px!important; }
body[data-workspace] .session-current { border-left:4px solid #3d78d4; }
.session-card h3 { margin:0 0 12px; }
.session-dates { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0 0 14px; }
.session-dates dt { color:var(--product-muted); font-size:12px; }
.session-dates dd { margin:5px 0 0; overflow-wrap:anywhere; font-weight:600; }
@media(max-width:600px) {
 .service-actions a { flex:1 1 130px; }
 .service-summary { gap:8px; }
 .service-summary>div { padding:10px; }
}

/* Catalog separates organization-specific services from general request templates. */
.catalog-intro { color:var(--product-muted); margin:0 0 20px; }
.catalog-section { margin:0 0 24px; }
.catalog-section>h2 { margin:0 0 12px; }
.client-catalog-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
body[data-workspace] .client-catalog-grid>.card { display:flex; flex-direction:column; margin:0!important; padding:18px!important; min-width:0; }
.client-catalog-grid h3 { margin:0 0 10px; overflow-wrap:anywhere; }
.client-catalog-grid p { margin:0 0 12px; overflow-wrap:anywhere; }
.client-catalog-grid a.btn { margin-top:auto; }
body[data-workspace] .catalog-other { padding:14px 18px!important; }
.approval-history>div { padding:0 16px 16px; overflow-wrap:anywhere; }
.approval-history>div>p { border-top:1px solid var(--product-line); padding-top:12px; }
@media(max-width:1000px) { .client-catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .client-catalog-grid { grid-template-columns:minmax(0,1fr); } }

/* Compact queue counters; status labels must remain whole words. */
body[data-section=tickets]:not(.ticket-page) .overview-grid {display:flex!important;flex-wrap:wrap;gap:6px;margin-bottom:8px}
body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card {display:flex!important;flex-direction:row;align-items:center;gap:8px;min-height:44px!important;padding:6px 10px!important;border-top-width:1px;border-left-width:3px;flex:1 1 auto}
body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card strong {font-size:17px!important;margin:0!important;margin-left:auto!important}
body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card span {font-size:12px;white-space:nowrap}
body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card small {display:none}
body[data-workspace] .queue-status,body[data-workspace] .badge-status {white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;flex-shrink:0;max-width:none}
body[data-section=tickets]:not(.ticket-page) td:nth-child(4) {min-width:100px;white-space:nowrap}
body[data-section=tickets]:not(.ticket-page) th:nth-child(4) {width:108px}
body[data-workspace] tr.ticket-unread td {background:#eef5ff}
body[data-workspace] tr.ticket-unread td:first-child {box-shadow:inset 3px 0 #255ed6}
.unread-label {display:inline-block;color:#174eaa;font-size:12px;font-weight:700;margin:4px 0}
.unread-label[hidden] {display:none}
.chat-message-new {border-left:3px solid #3776e5!important;background:#edf5ff!important}
.chat-message-new::before {content:'Новое сообщение';display:block;font-size:11px;font-weight:700;color:#174eaa;margin-bottom:5px}
@media(max-width:600px){body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card {flex:1 1 calc(33.33% - 6px);box-sizing:border-box;gap:4px;padding:6px!important}body[data-section=tickets]:not(.ticket-page) .overview-grid .overview-card span {font-size:10px;white-space:normal}}
