/* View Tabs — глобальная панель над всем layout */
.view-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    padding: 0 12px;
    flex-shrink: 0;
    height: 36px;
    z-index: 10;
}

/* Period select in tabs */
.view-tabs .report-period-select {
    flex: 0 0 auto;
    width: auto;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.view-tabs .report-period-select:focus {
    border-color: #1565c0;
}

.view-tabs-divider {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 4px;
}

.view-tabs #validateAllBtn {
    margin-left: auto;
}

.view-tabs .validate-all-btn {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
}

.view-tabs .validate-all-btn:hover {
    background: #e3f2fd;
    border-color: #1565c0;
    color: #1565c0;
}

.view-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.view-tab:hover {
    color: #333;
}

.view-tab.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
}

/* View Containers */
.view-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0; /* важно для flex overflow */
}

#crmViewContainer {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #e2e6ea;
}

#crmGrid {
    flex: 1;
    min-height: 0;
    display: flex;
    background: #e2e6ea;
}

#tableViewContainer {
    overflow: auto;
}

/* Sentinel для lazy loading */
.lazy-sentinel {
    height: 1px;
    width: 100%;
}

/* Sidebar в режиме CRM/Table — сворачивается */
body[data-current-view="crm"] .left-sidebar.sidebar-views-mode,
body[data-current-view="table"] .left-sidebar.sidebar-views-mode {
    width: 0;
    min-width: 0;
    border: none;
    overflow: hidden;
    padding: 0;
}

/* Правый sidebar — скрыт в CRM/Table */
body[data-current-view="crm"] .right-sidebar,
body[data-current-view="table"] .right-sidebar {
    width: 0;
    min-width: 0;
    border: none;
    overflow: hidden;
    padding: 0;
}
