/* ===== Страница ===== */
.back {
  background: var(--gray);
}
.page_area{ background:var(--gray); padding:28px 24px 32px; }
@media (min-width:1040px){ .page_area{ padding:48px 120px; } }

.dept_title{
  margin:0 0 18px; color:var(--primary);
  font:600 28px/1.15 Inter, Arial, sans-serif; letter-spacing:.04em;
}
.dept_subtitle{
  margin:24px 0 12px; color: var(--secondary);
  font:700 22px/1.2 Inter, Arial, sans-serif;
}
.dept_text{
  margin:6px 0 10px; color: var(--secondary); font:600 16.5px/1.55 Inter, Arial, sans-serif;
}

/* ===== Линки в стиле header (тел/почта внутри карточек руководства) ===== */
.c_link{
  position:relative; display:inline-block; padding-bottom:3px;
  color:var(--primary); text-decoration:none; transition:color .2s ease;
}
.c_link::after{
  content:""; position:absolute; left:0; bottom:0; height:2px; width:0;
  background:var(--primary); transition:width .22s ease;
}
.c_link:hover::after, .c_link:focus-visible::after{ width:100%; }
.c_link:focus-visible{ outline:none; color:var(--primary); }

/* ===== Центровка единственной карточки руководства (если person_cards.css уже есть — это дополнительно не помешает) */
.page_area .cards_grid.single-card{ justify-content:center; }
.page_area .cards_grid.single-card .person_card{ max-width:420px; width:100%; }

/* ===== Панель инструментов документов ===== */
.docs_tools{
  display:grid; grid-template-columns:1fr; gap:12px;
  margin:8px 0 16px; align-items:end; position:relative; z-index:2;
}
.filters{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{
  padding:8px 12px; border-radius:999px; border:2px solid #e1e8ff;
  background:#f6f9ff; color:var(--primary); font:700 13px/1 Inter, Arial; cursor:pointer;
  transition:background .18s, border-color .18s, color .18s, transform .06s;
}
.chip:hover{ background:var(--white); border-color:var(--primary); }
.chip.is-active{ background:var(--primary); border-color:var(--primary); color:var(--white); }

.search_sort{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.search input{
  height:40px; padding:0 12px 0 14px; border:1px solid rgba(84,84,84,.25); border-radius:8px;
  background:var(--white); color:#2b2b2b; font:600 14px/1 Inter, Arial; width:260px; max-width:100%;
  transition:border-color .2s, box-shadow .2s;
}
.search input:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(76,120,232,.14); }

.select{ position:relative; }
.select select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  height:40px; padding:0 38px 0 12px; min-width:190px;
  border:1px solid rgba(84,84,84,.25); border-radius:8px; background:var(--white);
  color:#2b2b2b; font:700 14px/1 Inter, Arial;
  background-image:url("../media/images/svg/chevron-down.svg");
  background-repeat:no-repeat; background-position:right 12px center; background-size:16px 16px;
  transition:border-color .2s, box-shadow .2s;
}
.select select:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(76,120,232,.14); }

/* кастомный select */
.select.is-enhanced select{ position:absolute; inset:0; width:100%; height:100%; opacity:0; pointer-events:none; }
.fancy-select__btn{
  position:relative; height:40px; min-width:190px; width:auto; padding:0 38px 0 12px;
  border:1px solid rgba(84,84,84,.25); border-radius:8px; background:var(--white); color:#2b2b2b;
  font:700 14px/1 Inter, Arial; display:flex; align-items:center; gap:8px; cursor:pointer;
  transition:border-color .2s, box-shadow .2s, color .2s, background .2s;
}
.fancy-select__btn:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(76,120,232,.14); }
.fancy-select__btn::after{
  content:""; position:absolute; right:12px; width:16px; height:16px;
  background:url("../media/images/svg/arrow_down_black.svg") no-repeat center/16px 16px;
}
.select.is-open .fancy-select__btn{ border-color:var(--primary); box-shadow:0 6px 18px rgba(76,120,232,.18); }
.select.is-open .fancy-select__btn::after{ background-image:url("../media/images/svg/arrow_up_primary.svg"); }
.fancy-select__menu{
  position:absolute; left:0; top:calc(100% + 6px); z-index:1001; min-width:100%;
  background:var(--white); border:1px solid rgba(84,84,84,.22); border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  padding:6px;  list-style:none; max-height:240px; overflow:auto;
  opacity:0; transform:translateY(-4px); pointer-events:none; transition:opacity .16s ease, transform .16s ease;
}
.select.is-open .fancy-select__menu{ opacity:1; transform:translateY(0); pointer-events:auto; }
.fancy-select__option{
  border-radius:8px; padding:10px 12px; font:700 14px/1 Inter, Arial; color:#2b2b2b;
  display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none;
}
.fancy-select__option:hover{ background:#f4f7ff; }
.fancy-select__option[aria-selected="true"]{ background:var(--primary); color:var(--white); }
.fancy-select__option[aria-selected="true"]::after{ content:""; width:10px; height:10px; border-radius:999px; background:var(--white); }

/* Теги у карточки */
.doc_tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.doc_tag{
  padding:5px 9px; border-radius:999px; background:#f1f4ff; color:var(--primary);
  font:800 12px/1 Inter, Arial; border:1px solid #dfe6ff;
}

/* ===== Карточки документов: белые по умолчанию, при ховере — синие (как раньше) ===== */
.document_card{
  background:var(--white);
}
.document_card:hover{
  background:#6288EA;
}
.document_card:hover .document_date,
.document_card:hover .document_name,
.document_card:hover .document_download,
.document_card:hover .document_download span,
.document_card:hover .text_blue{ color:var(--white); }
.document_card:hover .document_icon,
.document_card:hover .document_download_icon{ filter:grayscale(1) brightness(0) invert(1); }
.document_card:hover .document_download:hover{
  background:rgba(255,255,255,.16); box-shadow:0 0 0 2px rgba(255,255,255,.08) inset;
}
.document_card:hover .document_download:hover::after{ opacity:.6; }

/* Якорь */
.anchor-target{ scroll-margin-top:84px; }
@media (max-width:900px){ .anchor-target{ scroll-margin-top:72px; } }
@media (max-width:560px){ .anchor-target{ scroll-margin-top:64px; } }

/* Сетка документов — как на «Документы» */
.docs_grid--page{
  display:grid;
  grid-template-columns:repeat(3, 519px);
  gap:20px;
  justify-content:space-between;
}
@media (max-width:1611px){
  .docs_grid--page{ grid-template-columns:repeat(2, 519px); }
}
@media (max-width:1036px){
  .docs_grid--page{ grid-template-columns:1fr; justify-content:stretch; }
  .docs_grid--page .document_card{ width:100%; }
}

/* Мобильные уплотнения */
@media (max-width:560px){
  .dept_title{ font-size:26px; }
  .dept_subtitle{ font-size:20px; }
  .dept_text{ font-size:15px; }
  .search_sort{ width:100%; }
  .search input{ width:100%; }
  .fancy-select__btn, .select select{ min-width:0; width:100%; }
}
