/* /opt/skynet-portal/app/static/css/reports.css */
/* v0.3.2 — сортировка колонок: клик по th, стрелка направления */
/* 30.07.2026: новый раздел (зеркало devbill /reports + федерация) */

/* ===== Обёртка ===== */
.rep-wrap { width: 100%; padding-bottom: var(--sp-10); }

/* ===== HERO ===== */
.rep-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-4);
  align-items: start;
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, #22d3ee 9%, transparent) 0%, transparent 55%),
    var(--surface-gradient, var(--bg-surface));
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.rep-hero-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(34, 211, 238, 0.25);
}
.rep-hero-icon svg { width: 22px; height: 22px; }
.rep-hero-body { min-width: 0; }
.rep-hero-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--text-primary); }
.rep-hero-sub { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.rep-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.rep-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: rgba(255, 255, 255, 0.03);
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs); color: var(--text-secondary);
}
.rep-chip b { color: var(--text-primary); font-weight: var(--fw-bold); }
.rep-warn {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  color: var(--color-warning, #f59e0b);
}

/* Фильтры — панель на всю ширину над таблицей (как страница Տարիֆներ) */
.rep-filterbar {
  display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.rep-fgap { flex: 1; }
.rep-ffield { display: flex; flex-direction: column; gap: var(--sp-1); }
.rep-flabel {
  font-size: 0.62rem; font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wider);
  color: var(--text-muted);
}
.rep-select {
  height: 38px; min-width: 130px; padding: 0 var(--sp-3);
  background: var(--bg-surface-2);
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.rep-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.rep-apply {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-4);
  background: var(--gradient-accent, var(--accent));
  color: #fff; border: none; border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: var(--fw-bold); cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.rep-apply:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--accent-glow); }
.rep-apply svg { width: 15px; height: 15px; }

/* ===== Вкладки ===== */
.rep-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.rep-tab {
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.rep-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.rep-tab.is-active {
  color: #06202a;
  background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.30);
}
.rep-pane { display: none; }
.rep-pane.is-active { display: block; }
.rep-empty {
  padding: var(--sp-8);
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: var(--border-thin) dashed var(--border-default);
  border-radius: var(--radius-xl);
}

/* ===== Матрица — портальный вид (эталон: страница Տարիֆներ):
   скруглённая карточка, горизонтальные разделители, UPPERCASE-шапка ===== */
.rep-scroll {
  overflow: auto;
  max-height: calc(100vh - 310px);
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}
.rep-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-sm); }
.rep-table th, .rep-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border-thin) solid var(--border-subtle);
  text-align: center;
  white-space: nowrap;
  color: var(--text-secondary);
}
.rep-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 0.62rem; font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wider);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}
.rep-table thead th:hover { color: var(--text-primary); }
.rep-table thead th::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.rep-table thead th[data-sort="desc"]::after {
  border-top: 5px solid var(--accent);
  opacity: 1;
}
.rep-table thead th[data-sort="asc"]::after {
  border-bottom: 5px solid var(--accent);
  opacity: 1;
}
.rep-table thead th[data-sort] { color: var(--text-primary); }
.rep-table td b { color: var(--text-primary); font-weight: var(--fw-semibold); }
.rep-table .z { color: var(--text-muted); opacity: 0.5; }
.rep-sticky {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg-surface);
  text-align: left !important;
  min-width: 230px;
  color: var(--text-primary) !important;
  font-weight: var(--fw-semibold);
}
.rep-table thead .rep-sticky { z-index: 4; background: var(--bg-surface-2); }
.rep-job { display: inline-flex; align-items: center; gap: var(--sp-2); }
.rep-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--jc, var(--accent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--jc, var(--accent)) 60%, transparent);
  flex-shrink: 0;
}
tr.is-inactive .rep-sticky { opacity: 0.55; }
.rep-sys { color: var(--color-info, #3b82f6) !important; }
.rep-tot { color: var(--color-success, #10b981) !important; }
.rep-table tbody tr { transition: background var(--transition-fast); }
.rep-table tbody tr:hover td { background: var(--bg-hover); }
.rep-table tbody tr:hover .rep-sticky { background: color-mix(in srgb, var(--bg-hover) 60%, var(--bg-surface)); }
.rep-table tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: var(--fw-bold);
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
}
.rep-table tfoot .rep-sticky { z-index: 4; background: var(--bg-surface-2); }

/* Полоска-сводка над складскими таблицами + приглушённые штуки в итогах */
.rep-substrip { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.rep-table .dim { color: var(--text-muted); font-weight: var(--fw-medium); font-size: var(--fs-xs); }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .rep-hero { grid-template-columns: auto 1fr; }
  .rep-filters { grid-column: 1 / -1; }
  .rep-sticky { min-width: 150px; }
  .rep-scroll { max-height: none; }
}