.crm-shell{min-height:100vh}
.crm-sidebar{width:76px;position:fixed;inset:0 auto 0 0;background:#20252b;color:#c7d0d9;z-index:20}
.crm-brand{height:66px;display:grid;place-items:center;background:#181c20;color:#fff;font-size:18px;font-weight:700}
.crm-brand small{display:block;color:#87919c;font-size:10px;letter-spacing:.12em;text-transform:uppercase}
.brand-short{display:block;letter-spacing:-.04em}.brand-full{display:none}
.crm-nav{padding:12px 8px}
.crm-nav a{height:46px;display:flex;align-items:center;justify-content:center;color:#c7d0d9;border-radius:5px;text-decoration:none;margin-bottom:6px}
.crm-nav a i{font-size:18px}.crm-nav a.active{background:#694f93;color:#fff}.nav-label{display:none}
.crm-main{margin-left:76px;min-height:100vh}
.crm-topbar{height:66px;background:#fff;border-bottom:1px solid #e3e6e8;display:flex;align-items:center;justify-content:space-between;padding:0 26px;position:sticky;top:0;z-index:10}
.crm-content{padding:20px 22px}
.orders-card{overflow:hidden}.crm-status-tabs{display:flex;align-items:stretch;overflow-x:auto;background:#f8f9fa;border-bottom:1px solid #dfe3e8;scrollbar-width:thin}
.status-tab{--tab-color:#667085;position:relative;flex:1 0 112px;display:flex;align-items:center;gap:6px;min-width:0;padding:8px 9px 7px;color:#344054;text-decoration:none!important;border-top:3px solid transparent;border-right:1px solid #e4e7ec;white-space:nowrap}
.status-tab:last-child{border-right:0}.status-tab:hover{background:#fff;color:#101828}.status-tab.active{background:#fff;border-top-color:var(--tab-color);color:#101828}
.status-tab .metric-dot{width:8px;height:8px;border-radius:50%;flex:0 0 8px;background:var(--tab-color)}.status-tab strong{font-size:15px;line-height:1}.status-tab span:last-child{font-size:9px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis}
.metric-orders{--tab-color:#694f93}.metric-geo1{--tab-color:#1d4ed8}.metric-passthrough{--tab-color:#0891b2}.metric-observe{--tab-color:#0b5ea8}.metric-allowed{--tab-color:#067647}.metric-duplicate{--tab-color:#b7791f}.metric-blocked{--tab-color:#b42318}.metric-invalid{--tab-color:#667085}.metric-would-send{--tab-color:#5b3f8c}
.filter-panel{position:sticky;top:82px;max-height:calc(100vh - 98px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.filter-panel .card-header{position:sticky;top:0;background:#fff;z-index:2}.filter-actions{position:sticky;bottom:-1px;background:#fff;padding:10px 0 2px;z-index:2}
.table td{vertical-align:middle}.orders-table{min-width:980px}
.status-row-blocked{background:#fff0f0}.status-row-invalid{background:#f2f4f7}.status-row-duplicate{background:#fff8e7}.status-row-observe_only{background:#eef7ff}.status-row-waiting_fp{background:#fff8e7}.status-row-processing{background:#eef4ff}.status-row-would_send{background:#f5f0ff}
.sale-row-1{background:#eaf8f0}.sale-row-2{background:#f2f4f7}.sale-row-3{background:#fff0f0}.sale-row-4{background:#fdecec}
.crm-badge{font-size:11px;padding:.42em .68em;color:#fff;letter-spacing:.01em}.crm-badge-allowed,.crm-badge-sale{background:#067647}.crm-badge-passthrough{background:#0e7490}.crm-badge-duplicate,.crm-badge-waiting{background:#744210}.crm-badge-blocked,.crm-badge-rejected{background:#b42318}.crm-badge-invalid,.crm-badge-trash{background:#475467}.crm-badge-observe{background:#0b5ea8}.crm-badge-would-send{background:#5b3f8c}.crm-badge-processing{background:#1d4ed8}.crm-badge-failed,.crm-badge-spam{background:#7f1d1d}.crm-badge-stored,.crm-badge-neutral{background:#344054}
.phone{font-variant-numeric:tabular-nums;white-space:nowrap}.fingerprint{max-width:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sub1-value{display:block;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:#344054}
.crm-pagination{display:flex;gap:4px;flex-wrap:wrap}.crm-pagination a,.crm-pagination span{padding:7px 11px;border:1px solid #ddd;border-radius:3px;background:#fff}.crm-pagination .active{background:#694f93;color:#fff;border-color:#694f93}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}.json-box{background:#1d2024;color:#c9d1d9;border-radius:4px;padding:16px;white-space:pre-wrap;word-break:break-word;max-height:480px;overflow:auto}
.login-bg{min-height:100vh;background:linear-gradient(135deg,#20252b,#4b3f62);display:grid;place-items:center;padding:20px}.login-card{width:100%;max-width:420px;border:0;box-shadow:0 20px 60px rgba(0,0,0,.3)}
@media(max-width:1199px){.filter-panel{position:static;max-height:none;overflow:visible}.filter-panel .card-header,.filter-actions{position:static}}
@media(max-width:991px){.crm-sidebar{position:static;width:auto}.crm-main{margin-left:0}.crm-brand{height:auto;display:block;padding:12px 20px}.brand-short{display:none}.brand-full{display:block}.crm-nav{display:flex;padding:8px}.crm-nav a{height:auto;justify-content:flex-start;margin:0 4px 0 0;padding:10px 13px}.crm-nav a i{font-size:14px;margin-right:8px}.nav-label{display:inline}.crm-topbar{position:static}.crm-content{padding:14px}}
@media(max-width:575px){.status-tab{flex-basis:126px}.crm-topbar{padding:0 14px}}

/* Dashboard layout refresh 2026-08-24 */
.crm-topbar{height:74px;padding:0 24px}
.crm-topbar-title>strong{display:block;font-size:18px;line-height:1.2;color:#101828}
.crm-topbar-actions{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.crm-pp-disabled{font-size:10px;padding:.25em .48em}
.crm-dashboard-content{padding-top:14px}
.dashboard-grid{display:grid;grid-template-columns:minmax(270px,310px) minmax(0,1fr);gap:14px;align-items:start}
.dashboard-filters,.dashboard-orders{min-width:0}
.filter-panel{top:88px}
.filter-panel .card-body{padding:14px 14px 12px}
.filter-panel .form-group{margin-bottom:13px}
.filter-panel label{font-size:12px;font-weight:600;margin-bottom:5px;color:#344054}
.filter-panel .form-control{font-size:12px;height:36px;padding:.4rem .65rem}
.filter-panel select.form-control{padding-right:1.6rem}
.filter-default-hint{padding-top:10px;color:#667085;font-size:10px;line-height:1.45}

/* Keep the original compact tab bar; only typography/count presentation changes. */
.crm-status-tabs{background:#f8f9fa}
.status-tab{flex:1 0 132px;justify-content:flex-start;gap:7px;padding:10px 9px 9px}
.status-tab .metric-dot{width:7px;height:7px;flex-basis:7px}
.status-tab .status-tab-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;line-height:1.15;font-weight:600;text-transform:uppercase;color:inherit}
.status-tab .status-tab-label strong{font-size:10.5px;line-height:inherit;font-weight:700}

/* Sorting lives in table headers instead of the filter column. */
.orders-table thead th{padding:0;vertical-align:middle;white-space:nowrap}
.table-sort-link{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:.58rem .48rem;color:#4b5563!important;text-decoration:none!important;font-weight:600}
.table-sort-link:hover{background:#e9ecef;color:#111827!important}
.table-sort-link.active{color:#4f3a78!important}
.table-sort-link i{font-size:11px;color:#98a2b3}
.table-sort-link.active i{color:#694f93}

@media(max-width:1399px){.dashboard-grid{grid-template-columns:minmax(250px,285px) minmax(0,1fr)}.status-tab{flex-basis:126px}.status-tab .status-tab-label,.status-tab .status-tab-label strong{font-size:10px}}
@media(max-width:1199px){.dashboard-grid{grid-template-columns:1fr}.dashboard-filters{order:1}.dashboard-orders{order:2}.filter-panel{position:static;max-height:none;overflow:visible}.filter-panel .card-header,.filter-actions{position:static}}

/* Right-side filters modal */
.crm-dashboard-content{padding-top:14px}
.dashboard-orders{min-width:0;width:100%}
.crm-orders-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.crm-orders-toolbar-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.crm-filter-open{white-space:nowrap}

.crm-filter-modal{position:fixed;inset:0;z-index:1050;visibility:hidden;pointer-events:none}
.crm-filter-modal.is-open{visibility:visible;pointer-events:auto}
.crm-filter-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.46);opacity:0;transition:opacity .2s ease}
.crm-filter-modal.is-open .crm-filter-backdrop{opacity:1}
.crm-filter-dialog{position:absolute;top:0;right:0;width:min(470px,92vw);height:100%;background:#fff;box-shadow:-12px 0 38px rgba(16,24,40,.18);transform:translateX(100%);transition:transform .22s ease;display:flex;flex-direction:column;outline:0}
.crm-filter-modal.is-open .crm-filter-dialog{transform:translateX(0)}
.crm-filter-modal-header{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 20px 15px;border-bottom:1px solid #e4e7ec;background:#fff}
.crm-filter-modal-header h2{font-size:16px;line-height:1.3;margin:0 0 2px;font-weight:600;color:#101828}
.crm-filter-close{border:0;background:transparent;width:34px;height:34px;border-radius:4px;color:#667085;display:grid;place-items:center;cursor:pointer;font-size:18px}
.crm-filter-close:hover{background:#f2f4f7;color:#101828}
.crm-filter-modal-body{flex:1 1 auto;overflow-y:auto;padding:18px 20px 20px;overscroll-behavior:contain}
.crm-filter-modal-body .admin-filter-form{max-width:none}
.crm-filter-modal-body .form-group{margin-bottom:14px}
.crm-filter-modal-body label{font-size:12px;font-weight:600;margin-bottom:5px;color:#344054}
.crm-filter-modal-body .form-control{font-size:12px;height:36px;padding:.4rem .65rem}
.crm-filter-modal-body textarea.form-control{height:auto}
.crm-filter-modal-body .filter-actions{position:sticky;bottom:-20px;background:#fff;border-top:1px solid #eef0f2;margin:18px -20px -20px;padding:14px 20px 16px;z-index:2}
.crm-filter-modal-body .filter-default-hint{padding-top:10px;color:#667085;font-size:10px;line-height:1.45}
body.crm-modal-open{overflow:hidden}

/* Left filter column is no longer used after moving filters to the modal. */
.dashboard-grid{display:block}
.dashboard-filters{display:none}

@media(max-width:767px){
  .crm-filter-dialog{width:100vw;max-width:none}
  .crm-filter-modal-header{padding:15px 16px 13px}
  .crm-filter-modal-body{padding:15px 16px 18px}
  .crm-filter-modal-body .filter-actions{bottom:-18px;margin:16px -16px -18px;padding:12px 16px 14px}
  .crm-orders-toolbar{align-items:flex-start}
  .crm-orders-toolbar-actions{width:100%;justify-content:flex-start}
}
.crm-selection-summary{font-size:12px;line-height:1.45;color:#344054}
.crm-selection-summary strong{font-weight:600;color:#101828}
.crm-selection-summary .text-muted{margin-left:4px;font-size:11px}
@media(max-width:767px){.crm-selection-summary{width:100%}.crm-selection-summary .text-muted{display:block;margin:2px 0 0}}

/* Quick filter presets */
.crm-quick-filters{margin:-2px 0 18px;padding:12px;border:1px solid #e4e7ec;border-radius:5px;background:#f8fafc}
.crm-quick-filter-group+.crm-quick-filter-group{margin-top:12px;padding-top:12px;border-top:1px solid #e4e7ec}
.crm-quick-filter-label{margin-bottom:7px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:#667085}
.crm-quick-filter-buttons{display:flex;flex-wrap:wrap;gap:6px}
.crm-quick-filter-buttons .btn{margin:0;font-size:11px;line-height:1.2;padding:.4rem .55rem;border-radius:4px}
.crm-quick-filter-buttons .btn.is-active{box-shadow:0 0 0 2px rgba(105,79,147,.14);font-weight:700}
.crm-quick-clear{padding-left:.25rem!important;padding-right:.25rem!important;text-decoration:none!important}
@media(max-width:575px){.crm-quick-filter-buttons .btn{font-size:10.5px;padding:.42rem .5rem}}


/* Current filter legend below selection summary */
.crm-filter-legend{display:flex;align-items:center;flex-wrap:wrap;gap:5px 6px;margin-top:5px;font-size:10.5px;line-height:1.3}
.crm-filter-legend-title{font-weight:600;color:#667085;margin-right:1px}
.crm-filter-legend-item{display:inline-flex;align-items:center;min-height:21px;padding:2px 7px;border:1px solid #dfe3e8;border-radius:10px;background:#f8f9fa;color:#344054;white-space:nowrap}
.crm-filter-legend-empty{color:#98a2b3}
@media(max-width:767px){.crm-filter-legend{margin-top:7px}.crm-filter-legend-item{white-space:normal}}

/* Desktop readability pass 2026-08-24 */
@media(min-width:992px){
  .crm-topbar-title>strong{font-size:20px}
  .crm-topbar-title .text-muted{font-size:11.5px}
  .crm-selection-summary{font-size:13px;line-height:1.5}
  .crm-selection-summary .text-muted{font-size:12px}
  .crm-filter-legend{font-size:11.5px;gap:6px 7px}
  .crm-filter-legend-item{min-height:23px;padding:3px 8px}

  .orders-table{font-size:13px}
  .orders-table td{font-size:13px;line-height:1.3}
  .orders-table td .text-muted,.orders-table td small{font-size:11.5px;line-height:1.3}
  .table-sort-link{font-size:13px;padding:.62rem .5rem}
  .table-sort-link i{font-size:11.5px}
  .phone{font-size:14px}
  .sub1-value{font-size:12px}
  .crm-badge{font-size:11.5px;padding:.4em .65em}

  .crm-orders-toolbar-actions{font-size:12px}
  .crm-pagination a,.crm-pagination span{font-size:12.5px}

  .crm-filter-modal-header h2{font-size:18px}
  .crm-filter-modal-header .text-muted{font-size:11.5px}
  .crm-filter-modal-body label{font-size:13px}
  .crm-filter-modal-body .form-control{font-size:13px;height:38px}
  .crm-filter-modal-body .filter-default-hint{font-size:11px}
  .crm-quick-filter-label{font-size:11.5px}
  .crm-quick-filter-buttons .btn{font-size:12px;padding:.43rem .6rem}
}

/* Sticky working context: keep current selection and filters visible while scrolling. */
@media(min-width:992px){
  .crm-topbar{position:static;top:auto}
  .orders-card{overflow:visible}
  .crm-orders-toolbar{
    position:sticky;
    top:0;
    z-index:18;
    background:#fff;
    border-top-left-radius:inherit;
    border-top-right-radius:inherit;
    box-shadow:0 2px 8px rgba(16,24,40,.08);
  }
}

/* Диагностика */
.crm-health-banner{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border:1px solid #dfe3e8;border-left-width:5px;border-radius:.3rem;background:#fff;margin-bottom:1rem}
.crm-health-banner-main{display:flex;align-items:center;gap:.9rem}
.crm-health-verdict{font-size:1.05rem;font-weight:600;line-height:1.2}
.crm-health-sub{color:#6c757d;font-size:.8rem;margin-top:.15rem;max-width:70ch}
.crm-health-dot{width:.85rem;height:.85rem;border-radius:50%;flex:0 0 auto;background:#adb5bd}
.crm-health-ok{border-left-color:#1dc9b7}
.crm-health-ok .crm-health-dot{background:#1dc9b7}
.crm-health-warn{border-left-color:#ffc241}
.crm-health-warn .crm-health-dot{background:#ffc241}
.crm-health-danger{border-left-color:#fd3995}
.crm-health-danger .crm-health-dot{background:#fd3995}
.crm-health-unknown{border-left-color:#adb5bd}
.crm-health-card{margin-bottom:1rem}
.crm-health-card .card-header{display:flex;align-items:baseline}
.crm-health-jobs td{vertical-align:middle}
.crm-health-row-warn{background:#fff9e6}
.crm-health-row-danger{background:#fff1f6}
.crm-health-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.6rem}
.crm-health-tile{border:1px solid #e3e6ea;border-radius:.3rem;padding:.7rem .85rem;background:#fbfcfd}
.crm-health-tile-value{font-size:1.45rem;font-weight:600;line-height:1.1}
.crm-health-tile-label{color:#6c757d;font-size:.78rem;margin-top:.2rem}
.crm-health-tile-note{color:#8a9199;font-size:.72rem;margin-top:.35rem}
.crm-health-tile.is-ok{border-color:#b8ebe4}
.crm-health-tile.is-danger{border-color:#fbb;background:#fff1f6}
.crm-health-tile.is-danger .crm-health-tile-value{color:#c2185b}
.crm-health-tile-wide{grid-column:span 2}
@media (max-width:640px){.crm-health-banner{flex-direction:column;align-items:flex-start}.crm-health-tile-wide{grid-column:span 1}}
