/* ========================================================================
   04_admin_components.css — ЕДИНЫЕ КОМПАКТНЫЕ СТИЛИ КОМПОНЕНТОВ ОТиДО
   ======================================================================== */

/* 1. ОБЩИЕ БЛОКИ, ФОРМЫ И ПОЛЯ (Для всех вкладок) */
.otido-admin-wrap .admin-panel-box,
.otido-admin-wrap .db-navigator-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    margin-bottom: 25px;
}

.otido-admin-wrap .mat-form-flex {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.otido-admin-wrap .mat-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

/* Расширенная группа наименования материала */
.otido-admin-wrap .mat-group-name {
    flex: 2 1 360px;
    min-width: 300px;
}

/* Группа пояснения (admin_note) */
.otido-admin-wrap .mat-group-note {
    flex: 2 1 400px;
    min-width: 300px;
}

/* Группа действий с компактной кнопкой */
.otido-admin-wrap .mat-form-row-actions {
    margin-top: 5px;
}

.otido-admin-wrap .mat-group-actions {
    align-self: flex-start;
}

.otido-admin-wrap .mat-label { 
    display: block; 
    margin-bottom: 6px; 
    font-size: 12px; 
    font-weight: 600; 
    color: #475569; 
}

.otido-admin-wrap .mat-label-bold { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 12px; 
    font-weight: 700; 
    color: #475569; 
}

.otido-admin-wrap .price-display {
    min-width: 145px;
    line-height: 1.25;
    white-space: nowrap;
}

.otido-admin-wrap .price-display__perm {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.otido-admin-wrap .price-display__amount {
    color: #172554;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1px;
}

.otido-admin-wrap .price-display__city {
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
}

.otido-admin-wrap .price-display__moscow {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

.otido-admin-wrap .unit-display {
    color: #2563eb;
    font-weight: 600;
}

.otido-admin-wrap .component-table-zebra__table th,
.otido-admin-wrap .component-table-zebra__table td {
    border-bottom: 1px solid #cbd5e1;
    line-height: 1.35;
}

.otido-admin-wrap .component-table-zebra__table th {
    padding: 9px 10px;
    white-space: normal;
    vertical-align: middle;
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: inset 0 -2px 0 #cbd5e1;
}

.otido-admin-wrap .component-table-zebra__table td {
    padding: 9px 10px;
    vertical-align: top;
    font-weight: 400 !important;
}

/* Пояснение админа под наименованием материала (стиль как у подписи региона) */
.otido-admin-wrap .mat-admin-note,
.otido-admin-wrap .mat-note-subtext {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
    margin-top: 3px;
    line-height: 1.3;
}

.otido-admin-wrap .mat-input,
.otido-admin-wrap .mat-select { 
    width: 100%; 
    padding: 8px 12px; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    font-size: 14px; 
    box-sizing: border-box; 
    height: 38px; 
    background: #fff;
}

/* 2. СИСТЕМНЫЕ КНОПКИ С МАТОВЫМ ЭФФЕКТОМ */
.otido-admin-wrap .btn-action-add {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.otido-admin-wrap .btn-action-add:hover { background: #1e40af !important; }

.otido-admin-wrap .btn-action-cancel {
    background: #64748b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.otido-admin-wrap .btn-action-cancel:hover { background: #475569 !important; }

/* 3. СПЕЦИФИЧЕСКИЕ МЕЛКИЕ УЗЛЫ (Скроллбоксы, бейджи, карточки таблиц) */
.otido-admin-wrap .mat-checkbox-scroll { 
    max-height: 165px; 
    overflow-y: auto;
    scroll-behavior: smooth;
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    padding: 8px; 
    background: #ffffff; 
}

.otido-admin-wrap .mat-badge-counter { 
    margin-bottom: 15px; 
    font-size: 14px; 
    color: #334155; 
    font-weight: 600; 
    background: #edf2f7; 
    padding: 10px 15px; 
    border-radius: 4px; 
    display: inline-block; 
}
.otido-admin-wrap .mat-badge-num { color: #1d4ed8; font-size: 16px; font-weight: 800; }

/* Скролл-контейнер таблицы материалов — 10 строк на экране */
.otido-admin-wrap .excel-table-scroll-container {
    max-height: 580px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.otido-admin-wrap .db-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.otido-admin-wrap .db-sys-name {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
}
.otido-admin-wrap .db-ru-name { font-size: 13px; font-weight: 600; color: #64748b; }

.otido-admin-wrap .db-notify-alert {
    background: #e0f2fe; 
    color: #0369a1; 
    padding: 10px 12px; 
    border-radius: 4px; 
    border: 1px solid #bae6fd; 
    margin-bottom: 20px; 
    font-size: 13px; 
    font-weight: 600;
}

/* 4. ПАГИНАЦИЯ (СТРАНИЦЫ ПУЛЬТА) */
.otido-admin-wrap .admin-pagination-line {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-top: 20px; padding-top: 15px; border-top: 1px dashed #cbd5e1;
}
.otido-admin-wrap .pagination-nav-btn {
    padding: 6px 12px; background: #f1f5f9; color: #475569;
    border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.otido-admin-wrap .pagination-nav-btn:hover { background: #e2e8f0; color: #1e293b; }
.otido-admin-wrap .pagination-nav-btn.active-page { background: #1d4ed8; color: #ffffff; border-color: #1d4ed8; cursor: default; }
/* ========================================================================
   ФИНАЛЬНЫЕ ЧИСТЫЕ СТИЛИ СУПЕРАДМИНСКОГО ПУЛЬТА БД (БЕЗ ЗАПРЕЩЕНКИ В PHP)
   ======================================================================== */

.otido-admin-wrap .db-active-row {
    background: #eff6ff !important;
}

.otido-admin-wrap .db-active-text {
    color: #1d4ed8 !important;
}

.otido-admin-wrap .db-editor-container {
    background: #ffffff; 
    padding: 20px; 
    border-radius: 6px; 
    border: 2px solid #1d4ed8; 
    margin-top: 25px;
}

.otido-admin-wrap .db-editor-title {
    margin-top: 0; 
    margin-bottom: 0; 
    color: #1d4ed8; 
    font-size: 15px; 
    font-weight: 700;
}

.otido-admin-wrap .db-editor-title span {
    font-family: monospace; 
    color: #0f172a;
}

.otido-admin-wrap .db-text-blue {
    font-weight: 700; 
    color: #1d4ed8 !important;
}

.otido-admin-wrap .db-action-btn-line {
    display: flex; 
    justify-content: flex-end;
    margin-top: 15px;
}


/* Умные всплывающие подсказки для длинных текстов рекомендаций ОТиДО */
.otido-admin-wrap .recommendation-cell {
    position: relative;
    cursor: help;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Добавляет троеточие в конце длинного текста */
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.otido-admin-wrap .recommendation-cell:hover::after {
    content: attr(data-full-text); /* Подтягивает полный текст из атрибута */
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b; /* Благородный тёмный матовый фон подсказки */
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    width: 280px;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Маленький аккуратный стрелочный указатель под окном подсказки */
.otido-admin-wrap .recommendation-cell:hover::before {
    content: "";
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    z-index: 100;
}
/* Единый стиль управления No-Code записями внутри синего окна */
.otido-admin-wrap .db-add-form-box {
    background: #f8fafc;
    border: 1px dashed #1d4ed8;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.otido-admin-wrap .db-table-badge-id {
    font-weight: 700;
    color: #64748b;
    font-size: 13px;
}

.otido-admin-wrap .db-table-text-main {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.otido-admin-wrap .db-table-text-desc {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    line-height: 1.4;
}


/* Ширина блока кнопок управления No-Code формы ОТиДО */
.otido-admin-wrap .db-form-btn-group {
    width: 220px;
}

/* Автоматическое растягивание инпутов внутри строки добавления */
.otido-admin-wrap .db-form-field-group {
    flex: 1; 
    min-width: 200px;
}
/* ========================================================================
   ДОПОЛНЕНИЕ ДЛЯ ВЕРХНЕГО ПУЛЬТА БД (ВЫЧИЩЕНО ИЗ ИНЛАН-СТИЛЕЙ PHP)
   ======================================================================== */
.otido-admin-wrap .db-top-create-form {
    margin-bottom: 25px; 
    border-bottom: 1px dashed #cbd5e1; 
    padding-bottom: 20px;
}

.otido-admin-wrap .db-top-search-wrapper {
    margin-bottom: 15px; 
    width: 100%;
}

.otido-admin-wrap .db-top-search-input {
    font-weight: 600; 
    background: #fff;
}

.otido-admin-wrap .db-top-scroll-box {
    max-height: 280px; 
    overflow-y: auto; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    margin-bottom: 25px;
}

.otido-admin-wrap .db-top-main-table {
    width: 100%; 
    border-collapse: collapse; 
    background: #fff;
}

.otido-admin-wrap .db-top-th-sticky {
    border-bottom: 2px solid #cbd5e1; 
    background: #f8fafc; 
    position: sticky; 
    top: 0; 
    z-index: 10;
}

.otido-admin-wrap .db-top-th-left {
    padding: 10px; 
    text-align: left;
}

.otido-admin-wrap .db-top-th-actions {
    text-align: right; 
    padding-right: 25px; 
    width: 150px;
}

.otido-admin-wrap .db-top-tr-border {
    border-bottom: 1px solid #cbd5e1;
}

.otido-admin-wrap .db-top-td-sys {
    padding: 12px 10px; 
    font-family: 'Courier New', Courier, monospace; 
    font-weight: 700; 
    font-size: 15px;
}

.otido-admin-wrap .db-top-td-ru {
    padding: 12px 10px; 
    color: #475569; 
    font-size: 13px; 
    font-weight: 500;
}

.otido-admin-wrap .db-top-td-actions {
    text-align: right; 
    padding-right: 25px; 
    white-space: nowrap; 
    padding: 12px 10px;
}

.otido-admin-wrap .db-top-btn-show {
    text-decoration: none; 
    display: inline-block; 
    line-height: 22px; 
    text-align: center;
}
/* ========================================================================
   ОФИЦИАЛЬНОЕ РАСШИРЕНИЕ ДЛЯ CRUD-ТАБЛИЦЫ ПУЛЬТА БД (ВНЕДРЕНО В МОНОЛИТ)
   ======================================================================== */
.otido-admin-wrap .db-editor-container {
    background: #ffffff; 
    padding: 20px; 
    border-radius: 6px; 
    border: 1px solid #cbd5e1; 
    margin-top: 25px;
}

.otido-admin-wrap .db-editor-title {
    margin-top: 0; 
    margin-bottom: 0; 
    color: #334155; 
    font-size: 14px; 
    font-weight: 600;
}

.otido-admin-wrap .db-editor-title span {
    font-family: monospace; 
    color: #0f172a;
}

.otido-admin-wrap .db-add-form-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Стилизация и облегчение шрифтов ячеек таблицы */
.otido-admin-wrap .db-table-badge-id {
    font-weight: 500;
    color: #64748b;
    font-size: 12px;
}

.otido-admin-wrap .db-table-text-main {
    font-size: 13px;
    font-weight: 400 !important;
    color: #1e293b;
}

.otido-admin-wrap .db-table-text-desc {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    line-height: 1.4;
}

/* Ограничители ширины и растягивание No-Code полей */
.otido-admin-wrap .db-form-btn-group {
    width: 220px;
}

.otido-admin-wrap .db-form-field-group {
    flex: 1; 
    min-width: 200px;
}

/* Выравнивание шапки и содержимого */
.otido-admin-wrap .th-badge-id { 
    width: 60px; 
}

.otido-admin-wrap .th-actions-right,
.otido-admin-wrap .td-actions-cell { 
    text-align: right; 
    padding-right: 25px; 
    white-space: nowrap;
}

.otido-admin-wrap .th-actions-right {
    width: 150px;
}

.otido-admin-wrap .td-empty-table { 
    text-align: center; 
    padding: 20px; 
    color: #64748b; 
}
