/* SWS Mode — классический рабочий кабинет, Bootstrap 5 */
:root {
  --sws-radius: 0.375rem;
  --sws-border: #dee2e6;
  --sws-sidebar-width: 17.75rem;
  --sws-nav-accent: #0d6efd;
  --sws-nav-active-bg: rgba(13, 110, 253, 0.14);
  --sws-nav-active-bar: 3px;
}

html {
  font-size: 100%;
}

body {
  font-family:
    "Segoe UI",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background-color: #f1f3f5;
  color: #212529;
}

/* ——— layout: фиксированный сайдбар + область с верхней шапкой ——— */
html.logged-in,
html.logged-in body {
  height: 100%;
}

.sws-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
  width: var(--sws-sidebar-width);
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fafbfc;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sws-shell {
  margin-left: 0;
  background-color: #f1f3f5;
}

@media (min-width: 768px) {
  .sws-shell {
    margin-left: var(--sws-sidebar-width);
  }
}

.sws-topbar {
  background: #fff;
  border-bottom: 1px solid var(--sws-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  z-index: 1020;
}

.sws-topbar-title {
  line-height: 1.3;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.sws-sidebar-brand {
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.sws-sidebar-footer {
  border-top: none;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.06);
  background: #fafbfc;
}

.sws-sidebar-nav {
  gap: 0;
}

.sws-nav-group {
  border-radius: 0;
  margin-bottom: 0.35rem;
}

summary.sws-nav-category {
  list-style: none;
}

.sws-nav-group > summary.sws-nav-category {
  cursor: pointer;
  user-select: none;
  padding: 1rem 0.75rem 0.4rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #868e96;
}

.sws-nav-group:first-of-type > summary.sws-nav-category {
  padding-top: 0.25rem;
}

.sws-nav-group > summary.sws-nav-category::-webkit-details-marker {
  display: none;
}

.sws-nav-group[open] > summary.sws-nav-category {
  color: #6c757d;
}

.sws-nav-panel {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.375rem 1rem 0.25rem;
}

.sws-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: var(--sws-radius);
  color: #343a40;
  text-decoration: none;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.sws-sidebar-link i.bi {
  flex-shrink: 0;
  width: 1.125rem;
  text-align: center;
  font-size: 1rem;
  opacity: 0.88;
}

.sws-sidebar-link--l2 {
  padding: 0.58rem 0.65rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.sws-sidebar-link--l3 {
  padding: 0.38rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6c757d;
}

.sws-sidebar-link--l3:hover {
  color: #495057;
}

.sws-nav-nest {
  margin: 0 0 0.35rem 0.35rem;
  padding: 0.15rem 0 0.15rem 0.65rem;
  border-left: 2px solid rgba(0, 0, 0, 0.07);
}

.sws-nav-nest--stack {
  margin-left: 0.25rem;
  padding-left: 0.75rem;
  border-radius: var(--sws-radius);
  background: rgba(0, 0, 0, 0.02);
  border-left: 2px solid rgba(13, 110, 253, 0.12);
}

.sws-sidebar-link:hover:not(.active) {
  background: rgba(0, 0, 0, 0.045);
  color: var(--sws-nav-accent);
}

.sws-sidebar-link.active {
  background: var(--sws-nav-active-bg);
  color: var(--sws-nav-accent);
  font-weight: 700;
  box-shadow: inset var(--sws-nav-active-bar) 0 0 var(--sws-nav-accent);
}

.sws-sidebar-link--l3.active {
  background: rgba(13, 110, 253, 0.11);
  color: #0a58ca;
}

.sws-offcanvas .sws-sidebar-link.active {
  background: var(--sws-nav-active-bg);
  font-weight: 700;
  color: var(--sws-nav-accent);
  box-shadow: inset var(--sws-nav-active-bar) 0 0 var(--sws-nav-accent);
}

/* Dashboard KPI */
.sws-page-title {
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #212529;
}

.sws-page-lead {
  font-size: 0.8125rem;
  color: #868e96;
  line-height: 1.45;
  max-width: 52rem;
}

.sws-dashboard-signals {
  border-radius: var(--sws-radius);
  border: 1px solid rgba(13, 110, 253, 0.18);
  background: linear-gradient(180deg, #f6f9ff 0%, #fff 55%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sws-dashboard-signals .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(13, 110, 253, 0.1);
}

.sws-kpi-card {
  border-radius: var(--sws-radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.sws-kpi-card .sws-kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: #868e96;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.sws-kpi-card .sws-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #212529;
}

.sws-kpi-card .sws-kpi-value-sm {
  font-size: 1.35rem;
}

.sws-kpi-card--neutral {
  background: #fff;
}

.sws-kpi-card--info {
  background: linear-gradient(145deg, #f8faff 0%, #fff 100%);
  border-left: 3px solid #0d6efd !important;
}

.sws-kpi-card--success {
  background: linear-gradient(145deg, #f5fcf8 0%, #eefaf3 100%);
  border-left: 3px solid #198754 !important;
}

.sws-kpi-card--success .sws-kpi-value {
  color: #146c43;
}

.sws-kpi-card--danger {
  background: linear-gradient(145deg, #fff8f8 0%, #fdecef 100%);
  border-left: 3px solid #dc3545 !important;
}

.sws-kpi-card--danger .sws-kpi-value {
  color: #b02a37;
}

.sws-kpi-card--warning {
  background: linear-gradient(145deg, #fffdf5 0%, #fff8e6 100%);
  border-left: 3px solid #ffc107 !important;
}

.sws-kpi-card--warning .sws-kpi-value {
  color: #997404;
}

.sws-main {
  min-height: 0;
}

.sws-navbar {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.sws-page-header {
  background: #fff;
  border-bottom: 1px solid var(--sws-border);
}

/* Карточки: лёгкая рамка, почти без тени */
.card.sws-card {
  border: 1px solid var(--sws-border);
  border-radius: var(--sws-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.table.sws-table thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.table.sws-table td {
  vertical-align: middle;
}

.form-label.required::after {
  content: " *";
  color: #dc3545;
}

.btn-lg-timer {
  min-width: 8rem;
  min-height: 3rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.app-page-shell {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.sws-collapsible-section > summary {
  cursor: pointer;
  list-style: none;
  background: #f8f9fa;
}

.sws-collapsible-section > summary::-webkit-details-marker {
  display: none;
}

.nav-tabs.sws-tabs {
  gap: 0.25rem;
}

.nav-tabs.sws-tabs .nav-link {
  border-radius: var(--sws-radius);
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  color: #495057;
}

.nav-tabs.sws-tabs .nav-link:hover {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.nav-tabs.sws-tabs .nav-link.active {
  background: var(--sws-nav-active-bg);
  border-color: rgba(13, 110, 253, 0.22);
  color: #0d6efd;
  font-weight: 600;
}

/* Печать / упрощённый отчёт */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .sws-shell {
    margin-left: 0 !important;
  }
}
