/* =============================================================
   kz-documents-docs.css  v2.0.0
   ============================================================= */

.kvh-docs-wrap {
    --kvhd-primary  : #002B32;
    --kvhd-accent   : #00A4BD;
    --kvhd-text     : #002B32;
    --kvhd-muted    : #6B7280;
    --kvhd-border   : #E8EDF4;
    --kvhd-bg       : #F4F7FC;
    --kvhd-white    : #FFFFFF;
    --kvhd-hover-bg : #EEF9FB;
    --kvhd-r        : 10px;
    color: var(--kvhd-text);
}

/* ════════════════════════════════════════════════════════════════
   ФИЛЬТРЫ
════════════════════════════════════════════════════════════════ */
.kvh-docs-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

/* ── Поиск ── */
.kvh-docs-filter-search {
    position: relative;
    flex: 1 1 260px;
}

.kvh-docs-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--kvhd-muted);
    pointer-events: none;
    z-index: 1;
}

.kvh-docs-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 16px 0 42px;
    font-size: 14px;
    color: var(--kvhd-text);
    background: var(--kvhd-white);
    border: 2px solid var(--kvhd-border);
    border-radius: var(--kvhd-r);
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.kvh-docs-search-input::placeholder { color: #B0BAC8; }

.kvh-docs-search-input:focus {
    border-color: var(--kvhd-accent);
    box-shadow: 0 0 0 3px rgba(0, 164, 189, 0.12);
}

/* ── Филиал select2 ── */
.kvh-docs-filter-filial {
    flex: 1 1 260px;
    min-width: 200px;
}

.kvh-docs-filter-filial .select2-container {
    display: block !important;
    width: 100% !important;
}

.kvh-docs-filter-filial .select2-container--default .select2-selection--single {
    display: flex !important;
    align-items: center !important;
    height: 44px !important;
    padding: 0 36px 0 14px !important;
    border: 2px solid var(--kvhd-border) !important;
    border-radius: var(--kvhd-r) !important;
    background: var(--kvhd-white) !important;
    outline: none !important;
    transition: border-color 0.22s ease, box-shadow 0.22s ease !important;
    box-shadow: none !important;
}

.kvh-docs-filter-filial .select2-container--default.select2-container--open  .select2-selection--single,
.kvh-docs-filter-filial .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--kvhd-accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 164, 189, 0.12) !important;
}

.kvh-docs-filter-filial .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 14px !important;
    color: var(--kvhd-text) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kvh-docs-filter-filial .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #B0BAC8 !important;
}

.kvh-docs-filter-filial .select2-container--default .select2-selection--single .select2-selection__arrow {
    width: 36px !important;
    height: 100% !important;
    top: 0 !important;
    right: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ── Кнопка «Сбросить» ── */
.kvh-docs-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px;
    background: var(--kvhd-white);
    color: var(--kvhd-muted);
    border: 2px solid var(--kvhd-border);
    border-radius: var(--kvhd-r);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.kvh-docs-reset svg { width: 14px; height: 14px; flex-shrink: 0; }

.kvh-docs-reset:hover {
    border-color: var(--kvhd-primary);
    color: var(--kvhd-primary);
    background: var(--kvhd-hover-bg);
}

/* ════════════════════════════════════════════════════════════════
   СПИСОК ДОКУМЕНТОВ
════════════════════════════════════════════════════════════════ */
.kvh-docs-list {
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s ease;
}

.kvh-docs-list--loading {
    opacity: 0.45;
    pointer-events: none;
}

/* ── Один документ ── */
.kvh-corp-docs-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--kvhd-border);
    transition: background 0.18s;
}

.kvh-corp-docs-item:first-child {
    border-top: 1px solid var(--kvhd-border);
}

.kvh-corp-docs-item:hover {
    background: var(--kvhd-hover-bg);
}

/* Иконка типа файла */
.kvh-corp-docs-type-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.kvh-corp-docs-type-icon.pdf {
    background: #FDE8E8;
    color: #C0392B;
}

.kvh-corp-docs-type-icon.docx,
.kvh-corp-docs-type-icon.doc {
    background: #E3EEFF;
    color: #1D4EBB;
}

/* Название */
.kvh-corp-docs-title {
    flex: 1;
    font-size: 15px;
    color: var(--kvhd-text);
    line-height: 1.4;
}

/* Кнопка скачивания */
.kvh-corp-docs-download {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00A4BD;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.18s, transform 0.15s;
    padding: 0;
    min-width: 0;
    line-height: 1;
    box-sizing: border-box;
    border: none;
}

.kvh-corp-docs-download:hover {
    background: #002B32;
    transform: scale(1.08);
}

.kvh-corp-docs-download svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    display: block;
}

/* Пустой список */
.kvh-docs-empty {
    padding: 40px 0;
    text-align: center;
    font-size: 15px;
    color: var(--kvhd-muted);
}

/* ════════════════════════════════════════════════════════════════
   КНОПКА «ЗАГРУЗИТЬ ЕЩЁ»
════════════════════════════════════════════════════════════════ */
.kvh-docs-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.kvh-docs-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 36px;
    background: var(--kvhd-white);
    color: #00A4BD;
    border: 2px solid #00A4BD;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
}

.kvh-docs-loadmore:hover {
    background: #002B32;
    color: var(--kvhd-white);
    border-color: #002B32;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 43, 50, 0.22);
}

.kvh-docs-loadmore:active { transform: translateY(0); }

.kvh-docs-loadmore--loading {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .kvh-docs-filters { flex-direction: column; align-items: stretch; gap: 10px; }
    .kvh-docs-filter-filial { min-width: 0; }
    .kvh-docs-reset { width: 100%; justify-content: center; }
    .kvh-corp-docs-item { padding: 12px 10px; gap: 10px; }
    .kvh-corp-docs-title { font-size: 13px; }
}
