/* === Light Corporate Theme (Blue Header) — Modern UI Refresh === */
:root{
  --bg:#f4f8fc;
  --card:#ffffff;
  --text:#000000;
  --muted:#5f6b7a;
  --line:#d9e2ef;
  --accent:#1e88e5;      /* blue */
  --accent-soft:#e3f2fd;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm:0 2px 10px rgba(15, 23, 42, 0.06);
}

*{ box-sizing:border-box; }

html, body{
  background: var(--bg);
  color: var(--text);
}

body{
  margin:0;
  font-size:16.5px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height:1.45;
}

/* Links */
a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Layout */
.container{ max-width:1200px; margin:0 auto; padding: 18px 18px; }

/* Header */
.topbar{
  position: sticky;
  top:0;
  z-index: 20;
  background: linear-gradient(90deg, #1e88e5 0%, #2f9bff 100%);
  color:#ffffff;
  border-bottom:1px solid rgba(255,255,255,0.18);
  backdrop-filter:saturate(1.2);
}
.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 18px;
}
.brand a{
  font-weight: 800;
  letter-spacing: 0.2px;
  color:#ffffff;
}
.topbar .muted{ color:#eaf4ff; }
.nav{
  display:flex;
  align-items:center;
  gap: 12px;
}
.nav a{
  color:#ffffff;
  padding: 8px 10px;
  border-radius: 10px;
}
.nav a:hover{
  background: rgba(255,255,255,0.14);
  text-decoration:none;
}

/* Typography */
h1{ font-size: 20px; margin: 14px 0 12px; letter-spacing:-0.2px; }
h2{ font-size: 20px; margin: 12px 0 10px; }
h3{ font-size: 17.5px; margin: 10px 0 8px; }
.muted{ color: var(--muted); }

/* Cards */
.card{
  background: var(--card);
  border: 1px solid rgba(217,226,239,0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin: 14px 0;
}
.card:hover{
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
}

/* Rows / grids */
.row{
  display:flex;
  gap: 12px;
  align-items:center;
}
.row.space{ justify-content: space-between; }
.actions{ margin-top: 12px; justify-content:flex-end; }
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
@media (max-width: 860px){
  .grid2{ grid-template-columns: 1fr; }
  .nav{ flex-wrap: wrap; justify-content:flex-end; }
}

/* Forms */
label{
  display:block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 6px;
}
input, select, textarea{
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: #000000;
  transition: border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}
textarea{ min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: rgba(30,136,229,0.9);
  box-shadow: 0 0 0 4px rgba(30,136,229,0.16);
}
input:active, select:active, textarea:active{
  transform: translateY(0.5px);
}

/* Buttons */
button, .btn{
  font-family: inherit;
  font-size: inherit;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color:#fff;
  font-weight: 550;
  cursor:pointer;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 5px 5px rgba(30,136,229,0.22);
}

button:hover, .btn:hover{
  transform: translateY(-1px);
  text-decoration:none;
  box-shadow: 0 10px 12px rgba(30,136,229,0.28);
}
button:active, .btn:active{ transform: translateY(0px); }
.btn.secondary{
  background:#ffffff;
  color:#000000;
  border-color: var(--line);
  box-shadow: 0 6px 10px rgba(15,23,42,0.08);
}
.btn.secondary:hover{
  background:#f5f9ff;
  box-shadow: 0 10px 22px rgba(15,23,42,0.10);
}

/* Tables */
.table-wrap{ overflow:auto; border-radius: var(--radius); }
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
thead th{
  text-align:left;
  font-size:12px;
  letter-spacing:0.2px;
  text-transform: none;
  background: #f0f6ff;
  color:#000;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(217,226,239,0.7);
}
tbody tr:hover td{
  background: rgba(227,242,253,0.35);
}
tbody tr:last-child td{ border-bottom: none; }

/* Badges */
.badge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0d47a1;
  border: 1px solid rgba(30,136,229,0.18);
  font-size: 12px;
  font-weight: 650;
}

/* Lists */
.list{ margin:0; padding-left: 18px; }
.list li{ margin: 6px 0; }

/* Flash */
.flash{
  background:#ffffff;
  border:1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  color: var(--muted);
}

/* Footer */
.footer{
  padding: 18px 18px 28px;
  color: var(--muted);
}

/* Small tweaks */
hr{ border:0; border-top:1px solid var(--line); margin: 12px 0; }

/* ===== Report / Tables ===== */
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.page-head .actions{ display:flex; gap:10px; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  margin: 14px 0;
}

.kpi{
  font-size: 34px;
  font-weight: 800;
  margin-top: 6px;
}

.table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  text-align:left;
}
.table th{
  font-size:13px;
  color: var(--muted);
  font-weight:700;
}
.table tr:hover td{
  background: rgba(30,136,229,0.04);
}

@media (max-width: 900px){
  .grid2{ grid-template-columns: 1fr; }
}
/* ===== Выполненные работы: отдельный блок, сетка как в PDF ===== */
.work-done-box {
  width: 300mm;           /* “полоса текста” как в PDF */
  max-width: 100%;
  padding: 14px 16px;
  margin-top: 8px;

  border: 2px solid #4fa3d1;   /* под цвет шапки */
  border-radius: 12px;
  background: #f5faff;
}

/* Автобалансированный список работ */
.checkbox-list.checkbox-grid {
  column-count: 3;
  column-gap: 10mm;
}

/* Строка чекбокса */
.checkbox-row {
  display: grid;
  grid-template-columns: 1fr 20px; /* фиксированная колонка под чекбокс */
  align-items: center;

  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;

  break-inside: avoid;
  page-break-inside: avoid;
}

/* Текст */
.checkbox-text {
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
}

/* Сам чекбокс */
.checkbox-row input[type="checkbox"] {
  margin: 0;
  justify-self: end;
  transform: scale(1.1);
  accent-color: #4fa3d1;
}

/* Disabled чуть приглушаем */
.checkbox-row input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint-text {
  margin-top: 10px;
  font-size: 12.5px;
  color: #6c7a89;
}

.app-title {
  text-align: center;
  margin-bottom: 12px;
}

.app-title-main {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff; /* тёмный, читаемый */
}

.app-title-sub {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  margin-top: 4px;
}

/* Sortable table headers */
th .th-link{
  color: inherit;
  text-decoration: none;
}
th .th-link:hover{
  text-decoration: underline;
}
/* контейнер всё так же в колонках */
.checkbox-list.checkbox-grid.grouped{
  column-count: 3;
  column-gap: 10mm;
}

/* группа целиком не рвётся между колонками */
.work-group{
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
}

.work-group-title{
  font-weight: 700;
  margin: 0 0 6px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15,23,42,0.06);
}
/* === Combo styled like native <select> in this project === */
.combo{
  position: relative;
  width: 100%;
  display: flex;
}

/* Само поле (как select) */
.combo > input{
  width: 100%;
  height: 44px;                 /* подгони под высоту select (если у тебя другой размер — поменяй тут) */
  padding: 0 44px 0 14px;       /* справа место под стрелку */
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}

/* Кнопка-стрелка: визуально прячем как отдельную кнопку,
   оставляем только "стрелку", чтобы выглядело как select */
.combo-btn{
  position: absolute;
  right: 0;
  top: 0;
  height: 44px;
  width: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
}

/* Рисуем стрелку как у select */
.combo-btn::before{
  content: "▾";
  display: block;
  font-size: 16px;
  line-height: 44px;
  text-align: center;
  color: inherit;
  opacity: .75;
}

.combo > input:focus{
  box-shadow: 0 0 0 3px rgba(0,0,0,.06); /* если у тебя есть свой focus-ring — замени */
}

/* Dropdown контейнер (как меню select) */
.combo-dropdown{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  max-height: 260px;
  overflow: auto;
  z-index: 50;
}

/* Список пунктов */
.combo-list{
  list-style: none;
  margin: 0;
  padding: 6px;
}

/* Пункт (как option в select меню) */
.combo-item{
  padding: 8px 12px;     /* чуть плотнее, как у select */
  border-radius: 10px;
  cursor: pointer;
  user-select: none;

  font-size: 13px;       /* ← КЛЮЧЕВО */
  line-height: 1.3;
}


/* Hover / active */
.combo-item:hover,
.combo-item[aria-selected="true"]{
  background: var(--accent-soft);
}
/* === Static arrow inside combo input === */
.combo{
  position: relative;
}

.combo::after{
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted, #6b7280);
  border-bottom: 2px solid var(--text-muted, #6b7280);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

/* место под стрелку */
.combo > input{
  padding: 0 32px 0 14px;
}
/* Скрываем select после "combo-enhance" */
select.combo-select.combo-select-enhanced{
  display: none;
}
/* === Combo dropdown: always visible above cards/grids === */
.combo{
  position: relative;
}

/* когда раскрыто — поднимаем слой */
.combo.combo-open{
  z-index: 2000;
}

.combo-dropdown{
  z-index: 2001;
}

/* На страницах с карточками/сетками dropdown часто режется overflow-ом */
.card,
.grid2{
  overflow: visible;
}
/* --- Combo: всегда поверх и без обрезания --- */
.combo{ position: relative; }

.combo-dropdown{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 3000;
}

/* Поднимаем весь combo, когда открыт */
.combo.combo-open{ z-index: 2999; }

/* В сложных сетках dropdown часто режется overflow-ом */
.grid2, .card, .table-wrap{ overflow: visible; }

/* Скрыть исходный select (важно, чтобы не мешал клику) */
select.combo-select{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}
/* === FIX: combo dropdown visibility (same as earlier ticket fix) === */

/* Карточки и сетки не должны резать dropdown */
.card,
.grid2{
  overflow: visible;
}

/* combo всегда локальный stacking context */
.combo{
  position: relative;
}

/* при открытии — поверх всего */
.combo.combo-open{
  z-index: 3000;
}

.combo-dropdown{
  z-index: 3001;
}
.date-range {
  max-width: 320px;
}

.date-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.date-row input {
  width: 140px;
}

.date-sep {
  color: #6b7280;
  font-weight: 500;
}