/*.ag-theme-balham .ag-cell-value {*/
/*    padding: 0 !important;*/
/*    margin: 0 !important;*/
/*    !*line-height: 20px !important;*!*/
/*    height: 100% !important;*/
/*}*/


.ag-theme-quartz .ag-body-viewport { min-height: 0 !important; }

.compact-container {
    width: 96%;
    margin: 0 auto 30px auto;
    padding: 10px 0 0 0; /* Учитываем navbar сверху */
    /*min-height: calc(100vh - 100px); /* Учитываем футер 10px + navbar */
}

.compact-controls {
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #555;
}

.search-box {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
}

.search-box input {
    font-size: 12px;
    padding: 2px 6px;
    height: 26px;
}

.page-size-select {
    width: 70px;
}

.page-size-select select {
    font-size: 12px;
    padding: 2px 4px;
    height: 26px;
}

.stats-info {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.pagination-buttons {
    display: flex;
    gap: 2px;
}

.pagination-buttons .btn {
    font-size: 11px;
    padding: 1px 4px;
    height: 24px;
}

/* Компактная форма */
.form-compact .form-control {
    font-size: 12px;
    padding: 4px 6px;
    height: 30px;
}

.form-compact .btn {
    font-size: 12px;
    padding: 4px 8px;
    height: 30px;
}

/* autoHeight — грид подстраивается под контент */
#myGrid.ag-theme-balham,
#myGrid.ag-theme-quartz {
    width: 100%;
}

/**/
/**/
/**/
.ag-theme-balham,
.ag-theme-quartz {
    --ag-header-background-color: rgba(55, 56, 58, 0.59) !important;
    --ag-border-radius: 0px !important;
    --ag-wrapper-border-radius: 0px !important;
    --ag-header-height: 30px;
    --ag-row-height: 26px !important;
    --ag-font-size: 12px;
    height: 100%;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden;
}
.ag-root-wrapper { border-radius: 4px !important; }

/* позиционирование внутри ячейки */
.ag-theme-balham .ag-cell,
.ag-theme-quartz .ag-cell {
    padding: 1px 2px 2px 1px !important;
    font-weight: 630 !important;
    display: flex !important;
    align-items: center !important;
}

.ag-theme-balham .ag-cell-value,
.ag-theme-quartz .ag-cell-value {
    width: 100%;
    display: flex;
    align-items: center;
}

/* горизонтальное центрирование содержимого ячейки и заголовка */
.ag-theme-balham .center-cell .ag-cell-value,
.ag-theme-quartz .center-cell .ag-cell-value { justify-content: center; }

.ag-theme-balham .ag-header-cell.center-col .ag-header-cell-label,
.ag-theme-quartz .ag-header-cell.center-col .ag-header-cell-label { justify-content: center; }

.ag-theme-balham .ag-header-cell,
.ag-theme-quartz .ag-header-cell {
    padding: 0 0;
    color: rgba(246, 194, 10, 0.82) !important;
    border: 1px solid #000000 !important;
    background: #1b1b1c;
}

.ag-theme-balham .ag-header-cell-text,
.ag-theme-quartz .ag-header-cell-text {
    font-weight: 650;
    text-align: center !important;
    text-align: center !important;
    width: 100%;
}

/*убрать*/
.ag-theme-balham .ag-header-cell-resize.ag-column-resize::after,
.ag-theme-quartz .ag-header-cell-resize.ag-column-resize::after {
    background-color: transparent !important;
    opacity: 0 !important;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
}

.ag-theme-balham .ag-overlay,
.ag-theme-quartz .ag-overlay {
    display: none !important;
}

/* убираем попап */
.ag-theme-balham .ag-popup,
.ag-theme-quartz .ag-popup {
    max-height: 0 !important;
    overflow-y: auto !important;
}



.ag-theme-quartz .ag-cell input,
.ag-theme-quartz .ag-cell [contenteditable] { font-size: 14px !important; line-height: 1 !important; }
.ag-cell input::placeholder,
.ag-cell textarea::placeholder {
    font-style: italic !important;
    opacity: 0.7;
}

[contenteditable][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #dc3545;
    font-style: italic;
    opacity: 0.7;
    pointer-events: none;
}


.ag-theme-balham .ag-row,
.ag-theme-quartz .ag-row {
    border-bottom: none;
    background-color: #c7c5c5;
    box-shadow: inset 0 -1px 0 #151515;
}

/* Вертикальные линии между колонками */
.ag-theme-balham .ag-cell,
.ag-theme-quartz .ag-cell {
    border-right: 1px solid #464545 !important; /* Цвет и толщина */
}

/* Граница слева у первой колонки */
.ag-theme-balham .ag-cell:first-child,
.ag-theme-quartz .ag-cell:first-child {
    border-left: 1px solid #464545 !important;
}

/* Граница у последней колонки */
.ag-theme-balham .ag-cell:last-child,
.ag-theme-quartz .ag-cell:last-child {
    border-right: 1px solid #464545 !important;
}


.ag-theme-balham .ag-cell input:focus-visible,
.ag-theme-balham .ag-cell textarea:focus-visible,
.ag-theme-balham .ag-cell [contenteditable]:focus-visible,
.ag-theme-quartz .ag-cell input:focus-visible,
.ag-theme-quartz .ag-cell textarea:focus-visible,
.ag-theme-quartz .ag-cell [contenteditable]:focus-visible {
    border: 2px solid #000 !important;
}

.ag-theme-balham .ag-row-selected,
.ag-theme-quartz .ag-row-selected {
    background-color: rgba(75, 178, 8, 0.64) !important;
    /*box-shadow: 0 2px 0 0 #0c0c0c,*/
    /*0 2px 0 0 #0c0c0c;*/
}

/*.modified-row {*/
/*    background-color: rgba(236, 215, 5, 0.42) !important;*/
/*}*/

/**************/
/*   АЛЕРТЫ   */
/**************/

#successMessage,
#errorMessage {
    position: relative;
    padding-right: 40px !important;
    min-width: 300px;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
}

.ag-theme-balham .ag-cell-wrapper,
.ag-theme-quartz .ag-cell-wrapper {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ag-theme-balham .ag-header-select-all .ag-input-field-label,
.ag-theme-quartz .ag-header-select-all .ag-input-field-label {
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Агрессивное центрирование ВСЕГО */
/*.ag-theme-balham .ag-header-cell.ag-column-first,*/
/*.ag-theme-balham .ag-cell.ag-column-first {*/
/*    display: flex !important;*/
/*    align-items: center !important;*/
/*    justify-content: center !important;*/
/*    padding: 0 !important;*/
/*    margin: 0 !important;*/
/*}*/

/*Центрирование ВСЕХ внутренних элементов*/
/*.ag-theme-balham .ag-header-cell.ag-column-first > *,*/
/*.ag-theme-balham .ag-cell.ag-column-first > * {*/
/*    display: flex !important;*/
/*    align-items: center !important;*/
/*    justify-content: center !important;*/
/*    width: 100% !important;*/
/*    height: 100% !important;*/
/*    margin: 0 !important;*/
/*    padding: 0 !important;*/
/*}*/


/* ⭐ Скрываем мешающие элементы */
.ag-theme-balham .ag-cell.ag-column-first .ag-cell-value,
.ag-theme-balham .ag-header-cell.ag-column-first .ag-header-cell-comp-wrapper,
.ag-theme-quartz .ag-cell.ag-column-first .ag-cell-value,
.ag-theme-quartz .ag-header-cell.ag-column-first .ag-header-cell-comp-wrapper {
    display: none !important;
}

/* ⭐ Смещаем чекбоксы в данных и заголовке */
.ag-theme-balham .ag-selection-checkbox,
.ag-theme-balham .ag-header-select-all,
.ag-theme-quartz .ag-selection-checkbox,
.ag-theme-quartz .ag-header-select-all {
    margin: 0 auto !important;
}


/*....................*/
/*....................*/
/*....................*/
.ag-theme-balham .ag-tooltip,
.ag-theme-quartz .ag-tooltip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    color: white !important;
    font-size: 12px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    max-width: 250px !important;
    white-space: pre-line !important;
    animation: tooltipFadeIn 0.2s ease-out !important;
    z-index: 10000 !important;
}

/*размер чекбокс колонки*/
/*.ag-theme-balham .ag-header-cell[col-id="ag-Grid-SelectionColumn"] {*/
/*    width: 30px !important;*/
/*    min-width: 30px !important;*/
/*    max-width: 30px !important;*/
/*    !*    flex: 0 0 30px !important;*!*/
/*}*/

/*.ag-theme-balham .ag-column-first {*/
/*    min-width: 30px !important;*/
/*    max-width: 30px !important;*/
/*    flex: auto;*/
/*}*/




