/* CRM UI 1.1.0. Additive visual layer; business forms and data columns are preserved. */
:root { --crm-ink:#172a43; --crm-muted:#53647b; --crm-line:#dce4ee; --crm-blue:#2459a6; --crm-topbar-height:50px; }
body.crm-compact {overflow-x:clip;font-size:14px;line-height:1.45;background:#f1f4f8;color:var(--crm-ink);}
body.crm-compact [hidden] {display:none!important;}
.crm-icon {display:inline-block;vertical-align:middle;flex:0 0 auto;}
body.crm-compact :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible {outline:3px solid #2c6ec3!important;outline-offset:2px;}
body.crm-compact :is(button,a,input,select,textarea,summary,[tabindex]) {scroll-margin-top:calc(var(--crm-topbar-height) + 10px);scroll-margin-bottom:80px;}
.crm-skip-link {position:fixed;left:12px;top:-90px;z-index:2000;background:#fff;padding:10px 16px;border:2px solid var(--crm-blue);border-radius:6px;}
.crm-skip-link:focus {top:8px;}
body.crm-compact .custom-topbar {min-height:50px;height:auto;padding:5px 0;box-shadow:none;border-bottom:1px solid var(--crm-line);}
body.crm-compact .custom-topbar>.container-fluid {display:flex;align-items:center;gap:14px;padding:0 12px;min-width:0;}
.crm-desktop-brand {display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;letter-spacing:.06em;flex:0 0 auto;}
body.crm-compact .custom-topbar .topbar-link {display:inline-flex;align-items:center;gap:6px;padding:8px 10px;min-height:36px;font-size:13px;border-radius:6px;white-space:nowrap;}
body.crm-compact .custom-topbar .topbar-link .me-2 {margin:0!important;display:flex;}
body.crm-compact .custom-topbar .topbar-link.active {background:#e5eefb;box-shadow:inset 0 -2px 0 #2459a6;}
body.crm-compact .crm-account-actions {gap:8px!important;}
.crm-account-label {max-width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}
body.crm-compact .main-content {margin-top:var(--crm-topbar-height);margin-right:0;padding:12px;min-height:calc(100dvh - var(--crm-topbar-height));min-width:0;}
body.crm-compact .main-content> :is(.container,.container-fluid,.form-card,.order-main-card,.service-builder-card) {max-width:none;}
body.crm-compact :is(.content-card,.page-header-card,.sidebar-card) {border:1px solid var(--crm-line);border-radius:9px;box-shadow:none;}
body.crm-compact .content-card {padding:14px;}
body.crm-compact .page-header-card {padding:12px 14px;gap:10px;}
body.crm-compact .page-title {font-size:1.4rem;line-height:1.25;letter-spacing:-.025em;color:#163451;}
body.crm-compact .section-title {font-size:1.02rem;line-height:1.35;color:#213e5c;}
body.crm-compact .main-content .mb-4 {margin-bottom:12px!important;}
body.crm-compact .main-content .mb-3 {margin-bottom:10px!important;}
body.crm-compact .main-content .mt-4 {margin-top:12px!important;}
body.crm-compact .main-content .mt-3 {margin-top:10px!important;}
body.crm-compact .main-content :is(.p-4,.p-5) {padding:14px!important;}
body.crm-compact .main-content :is(.g-3,.g-4) {--bs-gutter-x:12px;--bs-gutter-y:12px;}
body.crm-compact .text-muted {color:var(--crm-muted)!important;}
body.crm-compact .btn {border-radius:6px;min-height:32px;line-height:1.3;font-size:13px;padding:6px 10px;}
body.crm-compact .btn-lg {font-size:14px;min-height:36px;padding:7px 12px;}
body.crm-compact .btn-sm {font-size:12px;padding:5px 8px;}
body.crm-compact .btn-primary {background:var(--crm-blue);border-color:var(--crm-blue);}
body.crm-compact .btn-primary:hover {background:#1c4786;border-color:#1c4786;}
body.crm-compact :is(.form-control,.form-select) {border-radius:6px;min-height:34px;font-size:14px;padding-top:6px;padding-bottom:6px;}
body.crm-compact :is(.form-control-sm,.form-select-sm) {font-size:13px;min-height:32px;}
body.crm-compact .form-label {font-size:13px;margin-bottom:4px;}
body.crm-compact .form-check-input {width:1.15em;height:1.15em;}
body.crm-compact .badge {font-weight:600;line-height:1.35;}
body.crm-compact .status-badge {font-size:12px;padding:4px 8px;}
body.crm-compact .mini-card {padding:10px 12px;border-radius:7px;box-shadow:none;}
body.crm-compact .customer-orders-card {padding:12px;}
body.crm-compact .customer-orders-tabs {gap:6px;}
body.crm-compact .customer-orders-toolbar {gap:8px;align-items:center;}
body.crm-compact .customer-orders-search-wrap {max-width:none;flex:1 1 380px;min-width:0;}
body.crm-compact .customer-orders-table-wrap {max-width:100%;border:1px solid var(--crm-line);border-radius:7px;overflow:auto;}
body.crm-compact .table-responsive {max-width:100%;}
body.crm-compact .table {font-size:13px;margin-bottom:0;--bs-table-bg:transparent;}
body.crm-compact .table>:not(caption)>*>* {padding:7px 8px;border-bottom-color:#e6ebf2;vertical-align:middle;}
body.crm-compact .table thead th {font-size:12px;line-height:1.3;color:#415574;background:#f2f6fa;padding-top:9px;padding-bottom:9px;}
body.crm-compact .customer-orders-table thead th {position:sticky;top:0;z-index:2;}
body.crm-compact .customer-orders-table tbody tr:nth-child(even) {background:#fafbfd;}
body.crm-compact .customer-orders-table tbody tr:hover {background:#f0f5fd;}
body.crm-compact .order-table-adaptive {font-size:13px;table-layout:auto;min-width:960px;}
body.crm-compact .order-table-adaptive .orders-col-date {width:90px;min-width:82px;}
body.crm-compact .order-table-adaptive .orders-col-unread {width:30px;min-width:30px;}
body.crm-compact .order-table-adaptive .orders-col-name {min-width:150px;max-width:220px;}
body.crm-compact .order-table-adaptive .orders-col-number {min-width:80px;}
body.crm-compact .order-table-adaptive .orders-col-status {min-width:132px;}
body.crm-compact .order-table-adaptive .orders-col-payment {min-width:78px;}
body.crm-compact .order-table-adaptive .orders-col-amount {min-width:78px;}
body.crm-compact .order-table-adaptive .orders-col-executor {min-width:132px;}
body.crm-compact .order-table-adaptive .orders-col-customer {min-width:100px;}
body.crm-compact .order-table-adaptive .orders-col-actions {min-width:204px;width:204px;}
body.crm-compact .compact-inline-select {max-width:190px;padding-left:8px;}
body.crm-compact .customer-orders-actions .btn {padding:5px 6px;font-size:12px;}
body.crm-compact :is(.order-main-card,.service-builder-card,.form-card,.order-create-layout-expanded,.request-detail-compact-page) {max-width:none;}
body.crm-compact :is(.order-main-card,.service-builder-card) {padding:14px;}
body.crm-compact :is(.file-list,.selected-file-list) {overflow-wrap:anywhere;}
body.crm-compact .preview-frame {max-width:100%;}
body.crm-compact .order-catalog-accordion .accordion-button {padding:12px 14px;font-size:14px;}
body.crm-compact .order-catalog-accordion .accordion-body {padding:12px;}
body.crm-compact .consultant-note-editor {border-radius:7px;margin:8px 0;}
body.crm-compact .consultant-note-editor summary {padding:9px 11px;}
body.crm-compact .empty-state {padding:20px 12px;}
body.crm-compact .empty-state h3 {font-size:18px;}
body.crm-compact .empty-state-icon {font-size:28px;margin-bottom:8px;}
.crm-icon-button {display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:32px;height:32px;padding:4px;border:1px solid transparent;border-radius:6px;background:transparent;color:#425c7e;cursor:pointer;}
.crm-icon-button:hover {background:#eaf1fa;border-color:#c9d9ee;}
.crm-workspace-toggle {display:inline-flex;align-items:center;gap:7px;white-space:nowrap;position:relative;}
.crm-unread-count {display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;border-radius:10px;padding:0 5px;font-size:11px;font-weight:700;background:#b42336;color:#fff;line-height:1;}
body.crm-compact .custom-sidebar-right.crm-workspace {display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:6px;position:fixed;top:var(--crm-topbar-height);right:0;bottom:0;width:var(--workspace-sidebar-width,440px);height:auto;min-height:0;overflow:hidden!important;padding:6px 6px 6px 8px!important;background:#e9eff6;border-left:1px solid #d3dce9;box-shadow:none;z-index:130;}
body.crm-compact .custom-sidebar-right.crm-workspace-chat-only {grid-template-rows:minmax(0,1fr);}
body.crm-compact .crm-workspace .sidebar-chat-card {display:flex;flex-direction:column;min-width:0;min-height:0!important;height:auto!important;max-height:none;margin:0!important;padding:0;overflow:hidden;border-radius:7px;}
body.crm-compact .crm-workspace .chat-hub-header {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;flex:0 0 auto;padding:5px 10px;background:#fff;border-bottom:1px solid var(--crm-line);}
body.crm-compact .crm-workspace .chat-hub-header>.min-w-0 {display:flex;align-items:baseline;gap:8px;min-width:0;}
body.crm-compact .crm-workspace .chat-hub-title {font-size:14px;font-weight:700;margin:0;white-space:nowrap;color:#1d3a57;}
body.crm-compact .crm-workspace .chat-hub-subtitle {font-size:11px;color:var(--crm-muted);}
body.crm-compact .crm-workspace .chat-hub-body {display:flex!important;flex-direction:row;flex:1 1 0;height:auto;min-height:0;overflow:hidden;}
body.crm-compact .crm-workspace .chat-hub-list {display:block;width:var(--chat-list-width,145px);min-width:105px;max-width:none;flex:0 0 var(--chat-list-width,145px);height:auto;max-height:none;overflow-y:auto;overscroll-behavior:contain;background:#f6f8fb;border:0;}
body.crm-compact .crm-workspace .chat-hub-item {padding:9px 8px;min-height:44px;border-bottom:1px solid #e4eaf2;}
body.crm-compact .crm-workspace .chat-hub-item-title {font-size:12px;line-height:1.4;font-weight:600;-webkit-line-clamp:unset;display:block;overflow-wrap:anywhere;}
body.crm-compact .crm-workspace .chat-hub-item.active {box-shadow:inset 3px 0 0 var(--crm-blue);}
body.crm-compact .crm-workspace .chat-hub-unread-dot {display:none;}
body.crm-compact .crm-workspace .chat-hub-panel {display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;container-type:normal;}
body.crm-compact .crm-workspace .chat-hub-panel-header {display:flex;align-items:center;gap:7px;min-height:31px;padding:5px 9px;font-size:12px;flex:0 0 auto;background:#fafbfd;}
body.crm-compact .crm-workspace .chat-hub-messages {flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:8px;background:#fff;font-size:13px;}
body.crm-compact .crm-workspace .chat-message {padding:7px 8px;margin-bottom:7px;border-radius:7px;font-size:12px;overflow-wrap:anywhere;}
body.crm-compact .crm-workspace .chat-meta {gap:5px;font-size:10px;flex-wrap:wrap;margin-bottom:4px;}
body.crm-compact .crm-workspace .chat-hub-form {flex:0 0 auto;padding:6px 8px!important;border-top:1px solid var(--crm-line);margin:0;background:#fff;}
body.crm-compact .crm-workspace .chat-hub-form textarea {font-size:13px;min-height:40px!important;height:40px;max-height:80px;border-radius:6px!important;padding:5px 7px;resize:vertical;margin:0!important;}
body.crm-compact .crm-workspace .chat-hub-form-footer {display:flex!important;flex-direction:row!important;align-items:center;gap:4px;margin-top:5px!important;}
body.crm-compact .crm-workspace .chat-hub-form-status {font-size:11px;flex:1 1 0;}
body.crm-compact .crm-workspace .chat-hub-form-status:empty {display:none;}
body.crm-compact .crm-workspace .chat-hub-actions {display:flex!important;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;gap:5px;width:auto;margin-left:auto;}
body.crm-compact .crm-workspace .chat-hub-actions .btn {width:auto;min-height:30px;white-space:nowrap;font-size:12px;padding:5px 7px;}
body.crm-compact .crm-workspace .chat-hub-attach-button {display:inline-flex;align-items:center;gap:4px;}
body.crm-compact .crm-workspace .chat-hub-list-resizer {flex:0 0 6px;width:6px;background:#eaf0f7;}
body.crm-compact .crm-workspace .workspace-sidebar-resizer {width:8px;}
body.crm-compact .crm-workspace .workspace-sidebar-resizer:focus-visible {outline-offset:-3px;}
body.crm-compact .crm-workspace .consultant-card {display:flex!important;flex-direction:column;flex:initial;min-height:0;height:auto;margin:0!important;border-radius:7px;overflow:hidden;}
body.crm-compact .crm-workspace .consultant-header {min-height:38px;padding:5px 10px;flex:0 0 auto;}
body.crm-compact .crm-workspace .consultant-heading {gap:7px;}
body.crm-compact .crm-workspace .consultant-heading h2 {font-size:14px;}
body.crm-compact .crm-workspace .consultant-mark {width:24px;height:24px;flex-basis:24px;font-size:18px;border-radius:6px;}
body.crm-compact .crm-workspace .consultant-icon-button {min-width:30px;min-height:30px;font-size:20px;}
body.crm-compact .crm-workspace .consultant-scroll {flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
body.crm-compact .crm-workspace .consultant-log {overflow:visible;min-height:0;max-height:none;font-size:13px;padding:0 10px;}
body.crm-compact .crm-workspace .consultant-intro {padding:10px 10px 4px;font-size:12px;}
body.crm-compact .crm-workspace .consultant-intro p {margin-bottom:7px;}
body.crm-compact .crm-workspace .consultant-chips button {min-height:30px;padding:5px 8px;font-size:12px;}
body.crm-compact .crm-workspace .consultant-consent {margin:6px 10px;padding:10px;}
body.crm-compact .crm-workspace .consultant-turn {margin:10px 0 14px;}
body.crm-compact .crm-workspace .consultant-question {padding:8px 10px;margin-bottom:9px;font-size:13px;}
body.crm-compact .crm-workspace .consultant-service {padding:9px;margin:7px 0;}
body.crm-compact .crm-workspace .consultant-service-price {margin:5px 0;}
body.crm-compact .crm-workspace .consultant-about {padding:0 10px 7px;font-size:11px;}
body.crm-compact .crm-workspace .consultant-about summary {min-height:24px;}
body.crm-compact .crm-workspace .consultant-status {min-height:0;max-height:50px;overflow-y:auto;padding:0 10px;flex:0 0 auto;}
body.crm-compact .crm-workspace .consultant-status:not(:empty) {padding-top:4px;padding-bottom:4px;}
body.crm-compact .crm-workspace .consultant-form {padding:6px 8px;flex:0 0 auto;}
body.crm-compact .crm-workspace .consultant-form textarea {font-size:13px;min-height:40px;height:40px;max-height:80px;border-radius:6px;padding:5px 7px;}
body.crm-compact .crm-workspace .consultant-compose-footer {margin-top:5px;}
body.crm-compact .crm-workspace .consultant-compose-footer button {min-height:30px;font-size:12px;}
.crm-workspace-mobile-header {display:none;}
.crm-workspace-backdrop {position:fixed;inset:0;background:rgba(15,31,51,.36);z-index:129;}
body.crm-compact.crm-workspace-modal-open {overflow:hidden;}
/* Closed means absent from both the layout and the focus order. */
body.crm-compact.crm-workspace-ready:not(.crm-workspace-open) .crm-workspace {display:none!important;}
@media (min-width:1440px) {
  body.crm-compact:not(.crm-workspace-ready) .main-content:has(~script) {margin-right:var(--workspace-sidebar-width,440px);}
  body.crm-compact.crm-workspace-open .main-content {margin-right:var(--workspace-sidebar-width,440px);}
}
@media (max-width:1439.98px) {
  body.crm-compact:not(.crm-workspace-ready) .crm-workspace {display:none!important;}
  body.crm-compact .crm-workspace {box-shadow:-8px 0 28px #14294024!important;max-width:calc(100vw - 20px);}
}
@media (min-width:901px) and (max-width:1170px) {
  .crm-desktop-brand>span {display:none;}
  body.crm-compact .custom-topbar>.container-fluid {gap:8px;}
  body.crm-compact .custom-topbar .topbar-link {padding:7px;font-size:12px;gap:4px;}
  body.crm-compact .crm-account-actions {gap:5px!important;}
  .crm-account-label {max-width:75px;}
}
/* Mouse-operated tables use compact controls; touch layouts keep larger targets. */
@media (min-width:901px) and (pointer:fine) {
  body.crm-compact .table tbody td {padding:3px 8px;}
  body.crm-compact .table :is(.btn-sm,.form-select-sm,.form-control-sm) {min-height:28px;padding-top:3px;padding-bottom:3px;}
  body.crm-compact .table .btn-sm {font-size:12px;}
}
@media (pointer:coarse) { body.crm-compact :is(.btn,.crm-icon-button) {min-height:44px;} }
@media (max-width:900px) {
  body.crm-compact {padding-bottom:0;}
  body.crm-compact .custom-topbar,.crm-desktop-brand {display:none;}
  body.crm-compact .mobile-app-header {transition:none;height:50px;padding:6px 12px;background:#fff;box-shadow:none;border-bottom:1px solid var(--crm-line);}
  body.crm-compact .mobile-app-title {gap:7px;font-size:12px;font-weight:800;letter-spacing:.04em;min-width:0;}
  body.crm-compact .mobile-app-user {gap:6px;min-width:0;}
  body.crm-compact .mobile-app-username {max-width:90px;overflow:hidden;text-overflow:ellipsis;font-size:12px;}
  body.crm-compact :is(.mobile-app-notify,.mobile-app-logout) {display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:36px;border-radius:6px;box-shadow:none;}
  body.crm-compact .main-content {margin-top:50px!important;margin-right:0;padding:8px 8px calc(74px + env(safe-area-inset-bottom))!important;min-height:calc(100dvh - 50px);}
  body.crm-compact .content-card {padding:10px;border-radius:8px;}
  body.crm-compact .page-header-card {padding:10px;flex-wrap:wrap;}
  body.crm-compact .page-title {font-size:1.22rem;}
  body.crm-compact .section-title {font-size:1rem;}
  body.crm-compact .btn,body.crm-compact .form-select,body.crm-compact .form-control {min-height:40px;}
  body.crm-compact :is(input.form-control,select.form-select,textarea.form-control) {font-size:16px;}
  body.crm-compact .mobile-bottom-tabs {display:flex!important;transition:none;transform:none!important;opacity:1!important;visibility:visible!important;gap:0;border-top:1px solid var(--crm-line);border-radius:0;box-shadow:none;background:#fff;min-height:60px;padding:4px 4px calc(4px + env(safe-area-inset-bottom));}
  body.crm-compact .mobile-tab {min-width:0;flex:1 1 0;min-height:48px;padding:5px 1px;gap:4px;border-radius:7px;}
  body.crm-compact .mobile-tab-label {font-size:10px;line-height:1.15;letter-spacing:0;}
  body.crm-compact .mobile-tab-icon {font-size:19px;height:20px;}
  body.crm-compact .mobile-tab.active {background:#eaf1fc;}
  body.crm-compact .chat-notification-badge {top:0;right:4px;}
  body.crm-compact.crm-workspace-open :is(.mobile-bottom-tabs,.mobile-app-header) {visibility:hidden!important;}
  body.crm-compact .custom-sidebar-right.crm-workspace {top:var(--crm-visual-top,0px)!important;bottom:auto;left:0;right:0;width:100%;max-width:none;height:var(--crm-visual-height,100dvh)!important;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)!important;grid-template-rows:48px minmax(0,1fr)!important;gap:0;border:0;background:#fff;box-shadow:none!important;display:grid!important;border-radius:0;}
  body.crm-compact .crm-workspace-mobile-header {display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:0;padding:4px 8px;border-bottom:1px solid var(--crm-line);}
  .crm-workspace-tabs {display:flex;align-items:center;gap:4px;min-width:0;}
  .crm-workspace-tabs button {display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:40px;padding:7px 10px;font-size:13px;font-weight:600;border:0;border-radius:6px;background:transparent;color:#466080;}
  .crm-workspace-tabs button[aria-selected=true] {background:#eaf1fc;color:#18447e;}
  .crm-workspace-mobile-header .crm-icon-button {width:40px;height:40px;}
  body.crm-compact .crm-workspace .crm-workspace-desktop-close {display:none;}
  body.crm-compact .crm-workspace :is(.sidebar-chat-card,.consultant-card) {grid-row:2;border:0;border-radius:0;min-height:0!important;flex:initial!important;}
  body.crm-compact[data-workspace-section=consultant] .crm-workspace .sidebar-chat-card {display:none!important;}
  body.crm-compact[data-workspace-section=chat] .crm-workspace .consultant-card {display:none!important;}
  body.crm-compact .crm-workspace .chat-hub-header {min-height:40px;padding:7px 12px;}
  body.crm-compact .crm-workspace .chat-hub-body {display:block!important;position:relative;min-height:0;height:auto;}
  body.crm-compact .crm-workspace .chat-hub-list {width:100%!important;height:100%!important;max-width:none!important;min-width:0!important;background:#fff;}
  body.crm-compact .crm-workspace .chat-hub-item {padding:12px 14px;min-height:54px;}
  body.crm-compact .crm-workspace .chat-hub-item-title {font-size:14px;}
  body.crm-compact .crm-workspace .chat-hub-panel {display:none;height:100%;}
  body.crm-compact .crm-workspace .chat-hub-panel-header {min-height:44px;padding:4px 10px;}
  body.crm-compact .crm-workspace .chat-hub-back-button {display:inline-flex;min-width:36px;min-height:36px;border-radius:6px;}
  body.crm-compact .crm-workspace .chat-hub-panel-title {font-size:14px;}
  body.crm-compact .crm-workspace .chat-message {font-size:14px;}
  body.crm-compact .crm-workspace .chat-meta {font-size:11px;}
  body.crm-compact .crm-workspace .chat-hub-messages {padding:10px 12px;}
  body.crm-compact .crm-workspace .sidebar-chat-card.mobile-chat-conversation-open>.chat-hub-header {display:none!important;}
  body.crm-compact .crm-workspace .sidebar-chat-card.mobile-chat-conversation-open .chat-hub-list {display:none!important;}
  body.crm-compact .crm-workspace .sidebar-chat-card.mobile-chat-conversation-open .chat-hub-panel {display:flex!important;}
  body.crm-compact .crm-workspace :is(.workspace-sidebar-resizer,.chat-hub-list-resizer) {display:none!important;}
  body.crm-compact .crm-workspace .consultant-header {min-height:44px;padding:6px 12px;}
  body.crm-compact .crm-workspace .consultant-scroll {font-size:14px;}
  body.crm-compact .crm-workspace :is(.chat-hub-form,.sidebar-chat-card.mobile-chat-conversation-open .chat-hub-form,.consultant-form) {padding:8px 10px!important;}
  body.crm-compact .crm-workspace :is(.chat-hub-form textarea,.sidebar-chat-card.mobile-chat-conversation-open .chat-hub-form textarea,.consultant-form textarea) {font-size:16px!important;min-height:44px!important;height:44px;max-height:90px;margin:0!important;resize:vertical;}
  body.crm-compact .crm-workspace :is(.chat-hub-actions .btn,.consultant-compose-footer button,.consultant-consent .btn,.consultant-chips button,.consultant-rating button) {min-height:40px;}
  body.crm-compact .crm-workspace .consultant-rating button {min-width:44px;}
  body.crm-compact .crm-workspace .chat-hub-actions {width:auto!important;grid-template-columns:none;}
  body.crm-compact .crm-workspace .chat-hub-form-footer {flex-direction:row!important;gap:6px!important;}
  body.crm-compact .crm-workspace .consultant-about summary {min-height:32px;}
  body.crm-compact .crm-workspace .consultant-compose-footer small {font-size:11px;}
  body.crm-compact .team-search-form {max-width:100%;flex-wrap:wrap;}
  body.crm-compact .team-search-form input {flex:1 1 150px;min-width:0;}
}
/* Dense mobile cards keep every value and every existing form control. */
@media (max-width:767.98px) {
  body.crm-compact .customer-orders-search-wrap {flex-basis:100%;}
  body.crm-compact .customer-orders-tabs {display:flex;flex-wrap:wrap;gap:5px;}
  body.crm-compact .customer-orders-tabs .btn {font-size:12px;min-height:38px;padding:5px 7px;}
  body.crm-compact .customer-orders-table-wrap {border:0;background:transparent;border-radius:0;}
  body.crm-compact .order-table-adaptive {min-width:0!important;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody {gap:8px;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody tr {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:10px;row-gap:3px;padding:10px;border-radius:8px;box-shadow:none;background:#fff;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody td {min-width:0!important;width:auto!important;padding:3px 0!important;gap:3px;font-size:13px;text-align:left!important;display:block;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody td[data-mobile-label]::before {display:block;font-size:10px;font-weight:500;line-height:1.3;text-transform:none;letter-spacing:0;max-width:none;min-width:0;margin-bottom:3px;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-name {grid-column:1/-1;grid-row:1;padding-right:32px!important;font-size:15px;font-weight:700;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-name::before {display:none;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-unread {position:absolute;top:8px;right:9px;display:block!important;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-date {padding-right:0!important;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-service {grid-column:1/-1;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-actions {grid-column:1/-1;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:5px!important;padding-top:8px!important;border-top:1px solid #e8edf4!important;margin-top:3px;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-actions::before {display:none!important;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-actions :is(.btn,form) {margin:0!important;min-width:0;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-actions .btn {font-size:12px;min-height:40px;padding:6px 8px;}
  body.crm-compact .customer-orders-table.order-table-adaptive :is(.compact-inline-select,.form-select-sm) {width:100%;max-width:none;margin-left:0;min-height:40px;font-size:16px;}
  body.crm-compact .customer-orders-table.order-table-adaptive .customer-orders-name {text-align:left!important;}
  body.crm-compact .archive-period-controls {gap:8px;flex-wrap:wrap;}
  body.crm-compact .archive-period-field {min-width:0;flex:1 1 110px;}
  body.crm-compact .archive-period-summary {flex-basis:100%;}
}
@media (prefers-reduced-motion:reduce) {
  body.crm-compact *, body.crm-compact *::before, body.crm-compact *::after {scroll-behavior:auto!important;transition:none!important;}
}
@media print {
  body.crm-compact :is(.custom-topbar,.mobile-app-header,.mobile-bottom-tabs,.crm-workspace,.crm-workspace-backdrop,.crm-skip-link) {display:none!important;}
  body.crm-compact .main-content {margin:0!important;padding:0!important;}
}

@media (max-width:900px) {
 body.crm-compact.mobile-chat-open .custom-sidebar-right.workspace-sidebar-only.crm-workspace {display:grid!important;grid-template-rows:48px minmax(0,1fr)!important;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)!important;overflow:hidden!important;}
 body.crm-compact.mobile-chat-open[data-workspace-section=consultant] .custom-sidebar-right.workspace-sidebar-only.crm-workspace .sidebar-chat-card {display:none!important;}
 body.crm-compact.mobile-chat-open[data-workspace-section=chat] .custom-sidebar-right.workspace-sidebar-only.crm-workspace .consultant-card {display:none!important;}
}
@media(max-width:767.98px){
 body.crm-compact .customer-orders-table.order-table-adaptive tbody td.orders-col-name::before {display:none!important;}
}
/* Do not remove the main page from layout while the mobile drawer is open. */
@media (max-width:900px) {
 body.crm-compact.mobile-chat-open .main-content {display:block;}
}


/* CRM UI 1.2.0: one-line dashboard controls */
.orders-dashboard-head{display:grid;grid-template-columns:auto auto minmax(220px,1fr) auto;align-items:center;gap:8px;min-width:0;}
.orders-dashboard-title{margin:0!important;white-space:nowrap;font-size:1.22rem!important;line-height:1.2;}
.orders-dashboard-tabs{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;margin:0!important;}
.orders-dashboard-tabs .btn{white-space:nowrap;}
.orders-dashboard-search{min-width:180px;max-width:none!important;margin:0!important;}
.orders-dashboard-actions{display:flex;align-items:center;gap:6px;white-space:nowrap;}
.orders-dashboard-period{padding-top:2px;border-top:1px solid rgba(15,23,42,.06);}
.crm-desktop-brand>span,.mobile-app-title>span{white-space:nowrap;letter-spacing:.03em;}
@media (max-width:1199.98px){
  .orders-dashboard-head{grid-template-columns:auto auto minmax(180px,1fr);}
  .orders-dashboard-actions{grid-column:1/-1;justify-content:flex-end;margin-top:-2px;}
  .orders-dashboard-head:not(.orders-dashboard-head-staff){grid-template-columns:auto auto minmax(180px,1fr);}
}
@media (max-width:900px){
  .orders-dashboard-head,.orders-dashboard-head-staff{display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px;}
  .orders-dashboard-head::-webkit-scrollbar{display:none;}
  .orders-dashboard-title{font-size:1.05rem!important;flex:0 0 auto;}
  .orders-dashboard-tabs{flex:0 0 auto;}
  .orders-dashboard-search{flex:1 0 180px;min-width:180px;}
  .orders-dashboard-actions{flex:0 0 auto;margin:0;}
  .orders-dashboard-period .archive-period-controls{gap:6px;}
  .orders-dashboard-period .archive-period-summary{display:none;}
  .crm-desktop-brand>span,.mobile-app-title>span{letter-spacing:0;font-size:.78rem;}
}
@media (max-width:390px){
  .orders-dashboard-title{font-size:1rem!important;}
  .orders-dashboard-tabs .btn{padding-left:.5rem;padding-right:.5rem;}
  .orders-dashboard-search{flex-basis:165px;min-width:165px;}
  .orders-dashboard-search .input-group-text{display:none;}
}

/* CRM UI 1.3.0: compact dashboard, mobile three-line customer cards and aligned actions. */
.crm-brand-link {color:inherit;text-decoration:none;cursor:pointer;}
.crm-brand-link:hover,.crm-brand-link:focus {color:inherit;text-decoration:none;}
body.crm-compact .orders-clickable-row {cursor:pointer;}
body.crm-compact .orders-clickable-row:focus-visible {outline:3px solid #2c6ec3!important;outline-offset:-3px;}
body.crm-compact .orders-col-actions {vertical-align:middle;}
body.crm-compact .orders-col-actions > :is(form,a,button) {vertical-align:middle;}
body.crm-compact .orders-col-actions > form {display:inline-flex!important;align-items:center;margin:0!important;}
body.crm-compact .orders-col-actions .btn {display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;}
.orders-mobile-service-prefix {display:none;}

@media (max-width:900px) {
  html,body,body.crm-compact {max-width:100%;overflow-x:clip!important;}
  body.crm-compact .main-content,body.crm-compact .main-content>* {min-width:0;max-width:100%;}
  body.crm-compact :is(.content-card,.page-header-card,.row,[class*="col-"],form,.input-group,.table-responsive) {min-width:0;max-width:100%;}
  body.crm-compact :is(input,textarea,select,.form-control,.form-select) {max-width:100%;}
  body.crm-compact :is(.customer-orders-service-title,.customer-orders-name,.chat-text,.selected-file-name,.form-text,.text-muted) {overflow-wrap:anywhere;word-break:normal;}
  body.crm-compact .mobile-bottom-tabs {overflow-x:hidden!important;}
  body.crm-compact .mobile-tab {min-width:0!important;flex:1 1 0!important;}

  /* Dashboard controls use two compact rows instead of a horizontal scroller. */
  body.crm-compact .orders-dashboard-head,
  body.crm-compact .orders-dashboard-head-staff {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px!important;
    align-items:center;
    overflow:visible!important;
    padding-bottom:0;
  }
  body.crm-compact .orders-dashboard-title {grid-column:1;grid-row:1;margin:0!important;min-width:0;}
  body.crm-compact .orders-dashboard-title-customer {display:none!important;}
  body.crm-compact .orders-dashboard-tabs {grid-column:1/-1;grid-row:1;display:flex;gap:5px;min-width:0;flex-wrap:wrap;}
  body.crm-compact .orders-dashboard-head-staff .orders-dashboard-title:not(.orders-dashboard-title-customer) {display:none;}
  body.crm-compact .orders-dashboard-tabs .btn {flex:0 1 auto;min-width:0;min-height:36px;padding:5px 8px;}
  body.crm-compact .orders-dashboard-search {grid-column:1/-1;grid-row:2;min-width:0!important;width:100%;max-width:none!important;flex-basis:auto!important;}
  body.crm-compact .orders-dashboard-actions {grid-column:1/-1;grid-row:3;justify-content:flex-start;flex-wrap:wrap;margin:0;}
  body.crm-compact .orders-dashboard-search .input-group-text {display:none;}
  body.crm-compact .orders-dashboard-period {margin-top:6px;}

  /* Remove generated field labels from mobile order cards. */
  body.crm-compact .customer-orders-table.order-table-adaptive tbody td[data-mobile-label]::before {display:none!important;}
}

@media (max-width:767.98px) {
  body.crm-compact .customer-orders-card {padding:7px;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody {gap:6px;}
  body.crm-compact .customer-orders-table.order-table-adaptive tbody tr {
    position:relative;
    row-gap:0!important;
    column-gap:8px!important;
    padding:7px 8px!important;
    border:1px solid #e3e9f1;
    border-radius:7px;
  }
  body.crm-compact .customer-orders-table.order-table-adaptive tbody td {padding:2px 0!important;line-height:1.25;}
  body.crm-compact .customer-orders-table.order-table-adaptive td.orders-col-actions {gap:4px!important;}

  /* Customer dashboard: exactly three visual rows. */
  body.crm-compact .customer-orders-table[data-customer-orders-table] tbody tr {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(92px,auto)!important;
    grid-template-rows:auto auto auto!important;
    align-items:center;
    min-height:0;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-name {
    grid-column:1;grid-row:1!important;padding:1px 28px 1px 0!important;
    font-size:14px!important;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-date {
    grid-column:2;grid-row:1!important;text-align:right!important;font-size:11px!important;color:#617087;white-space:nowrap;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-service {
    grid-column:1;grid-row:2!important;display:block!important;min-width:0;font-size:12px!important;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .customer-orders-service-title {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .customer-orders-direction {display:none!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-mobile-service-prefix {display:inline;font-weight:700;color:#315578;margin-right:5px;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-status {
    grid-column:2;grid-row:2!important;display:flex!important;justify-content:flex-end;min-width:0;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-status .status-badge {
    max-width:42vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;padding:3px 5px;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-amount {
    grid-column:1;grid-row:3!important;font-size:12px!important;font-weight:700!important;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-payment {
    grid-column:2;grid-row:3!important;text-align:right!important;font-size:11px!important;white-space:nowrap;padding-right:0!important;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-number {display:none!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-unread {top:5px!important;right:auto!important;left:calc(100% - 116px);z-index:2;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-actions {
    position:absolute!important;right:5px;bottom:4px;display:flex!important;width:auto!important;border:0!important;padding:0!important;margin:0!important;z-index:3;
  }
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-actions:empty {display:none!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-actions:not(:empty) ~ .orders-col-payment {padding-right:68px!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-actions .btn {min-height:28px!important;padding:3px 6px!important;font-size:10px!important;}

  /* Staff cards stay dense, without generated labels or an Open button. */
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) tbody tr {padding:7px 8px!important;}
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-name {font-size:14px;font-weight:700;}
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions {padding-top:5px!important;margin-top:2px!important;}
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions .btn {min-height:34px!important;padding:4px 7px!important;}
}

@media (max-width:360px) {
  body.crm-compact .main-content {padding-left:6px!important;padding-right:6px!important;}
  body.crm-compact .customer-orders-card {padding:6px;}
  body.crm-compact .orders-dashboard-tabs .btn {font-size:11px;padding-left:6px;padding-right:6px;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] tbody tr {grid-template-columns:minmax(0,1fr) minmax(82px,auto)!important;padding-left:7px!important;padding-right:7px!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-name {font-size:13px!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-status .status-badge {max-width:39vw;}
}
@media (max-width:767.98px) {
  body.crm-compact .customer-orders-table[data-customer-orders-table] .orders-col-actions:not(:has(form,button,a)) {display:none!important;}
  body.crm-compact .customer-orders-table[data-customer-orders-table] tr:has(.orders-col-actions form) .orders-col-payment {padding-right:68px!important;}
}
body.crm-compact .order-table-adaptive .orders-col-actions {min-width:120px;width:auto;}

/* CRM UI 1.3.1: mobile executor selector lives between Save and Delete. */
.mobile-executor-action-select {display:none;}
@media (max-width:767.98px) {
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-executor {display:none!important;}
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions {
    display:grid!important;
    grid-template-columns:auto minmax(112px,1fr) auto;
    align-items:center!important;
    gap:5px!important;
    width:100%!important;
    text-align:left!important;
  }
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions .mobile-executor-action-select {
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    min-height:34px!important;
    font-size:11px!important;
    padding:4px 24px 4px 6px!important;
  }
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions > form {margin:0!important;}
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions .btn {margin:0!important;}
}
@media (max-width:360px) {
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions {
    grid-template-columns:auto minmax(92px,1fr) auto;
    gap:4px!important;
  }
  body.crm-compact .role-orders-table:not([data-customer-orders-table]) .orders-col-actions .mobile-executor-action-select {font-size:10px!important;}
}

/* CRM 1.4.0: use the same box and text alignment for links and native buttons. */
body.crm-compact :is(a,button,input).btn {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  text-align:center;vertical-align:middle;box-sizing:border-box;
  font-family:inherit;line-height:1.3;
}
body.crm-compact :is(a,button).btn>svg {flex:0 0 auto;vertical-align:middle;}
body.crm-compact .crm-account-actions .btn {align-self:center;margin-top:0;margin-bottom:0;}
body.crm-compact .chat-attachment .btn {align-self:center;}
body.crm-compact :is(.mobile-app-notify,.mobile-app-logout) {text-decoration:none;line-height:1;}
body.crm-compact .chat-hub-order-link {color:var(--crm-blue);text-decoration:underline;text-underline-offset:3px;min-width:0;}
body.crm-compact .chat-hub-order-link:not([href]) {text-decoration:none;color:var(--crm-muted);cursor:default;}
body.crm-compact .chat-hub-order-link[href]:hover {color:#163451;}
@media(max-width:900px) {
 body.crm-compact .mobile-bottom-tabs {min-width:0;max-width:100%;gap:2px;}
 body.crm-compact .mobile-bottom-tabs .mobile-tab {position:relative;min-width:0;max-width:100%;}
 body.crm-compact .mobile-bottom-tabs .mobile-tab-label {max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
}
