body {
  background: #f0f2f5;
  font-size: 14px;
}

.card {
  border-radius: 12px;
}

/* KPI */
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Таблица */
#mainTable thead th {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  padding: 10px 12px;
}

#mainTable tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

#mainTable tbody tr:last-child td {
  border-bottom: none;
}

#mainTable tbody tr:hover td {
  background: #f8f9ff;
}

/* Просрочка бейджи */
.badge-overdue-yes {
  display: inline-block;
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-overdue-no {
  display: inline-block;
  background: #dcfce7;
  color: #16a34a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Обрезка длинного текста */
.deal-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Числа в таблице */
.num-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Чарты */
.card-body canvas {
  max-height: 200px;
}

/* ── MultiSelect ── */
.ms-wrap { position: relative; display: inline-block; }
.ms-btn  { min-width: 140px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; text-align: left; }
.ms-panel { display: none; position: absolute; top: calc(100% + 2px); left: 0;
  background: #fff; border: 1px solid #dee2e6; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 1060;
  min-width: 200px; max-height: 300px; flex-direction: column; }
.ms-panel.open { display: flex; }
.ms-header { display: flex; align-items: center; gap: 6px; padding: 6px 10px 5px; border-bottom: 1px solid #dee2e6; flex-shrink: 0; }
.ms-header input { flex: 1; font-size: .82rem; padding: 3px 7px; border: 1px solid #ced4da; border-radius: .25rem; outline: none; min-width: 0; }
.ms-select-all { font-size: .78rem; color: #0d6efd; cursor: pointer; white-space: nowrap; flex-shrink: 0; user-select: none; }
.ms-select-all:hover { text-decoration: underline; }
.ms-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.ms-item { display: flex; align-items: center; gap: 6px; padding: 5px 14px; cursor: pointer; }
.ms-item:hover { background: #f0f4ff; }
.ms-item input[type=checkbox] { display: none; }
.ms-item label { cursor: pointer; margin: 0; font-size: .78rem; user-select: none; flex: 1; }
.ms-item.hidden { display: none; }
.ms-action { opacity: 0; font-size: .8rem; cursor: pointer; white-space: nowrap; padding: 1px 6px;
  pointer-events: none; border: 1px solid transparent; border-radius: 3px; color: #0d6efd;
  transition: background .1s, border-color .1s; }
.ms-item:hover .ms-action { opacity: 1; pointer-events: auto; }
.ms-action:hover { background: #e7edff; border-color: #0d6efd; }
.ms-check { color: #000; font-size: 15px; opacity: 0; flex-shrink: 0; width: 16px; text-align: center; line-height: 1; }
.ms-item input[type=checkbox]:checked ~ .ms-check { opacity: 1; }
