/* Главная страница — современный стиль */

.site-home {
  --home-radius: 12px;
  --home-border: 1px solid rgba(0, 0, 0, 0.08);
  --home-bg: #fff;
  --home-muted: rgba(0, 0, 0, 0.55);
  --home-text: rgba(0, 0, 0, 0.82);
  --home-accent: #1976d2;
  --home-accent-hover: rgba(25, 118, 210, 0.08);
}

/* Панель фильтров */
.site-home-filters {
  background: var(--home-bg);
  border: var(--home-border);
  border-radius: var(--home-radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.site-home-filters .row {
  margin-bottom: 4px;
}

.site-home-filters .row:last-of-type {
  margin-bottom: 0;
}

.site-home-filters .form-group {
  margin-bottom: 0;
}

.site-home-filters .control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--home-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: block;
}

.site-home-filters .btn,
.site-home-filters button[type="submit"] {
  border-radius: 10px;
  font-weight: 600;
  padding: 8px 18px;
  background: var(--home-accent);
  border: none;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.site-home-filters .btn:hover,
.site-home-filters button[type="submit"]:hover {
  background: #1565c0;
  color: #fff;
}

.site-home-filters .btn:active,
.site-home-filters button[type="submit"]:active {
  transform: scale(0.98);
}

.site-home-filters-note {
  font-size: 12px;
  color: var(--home-muted);
  margin-top: 10px;
}

/* Карточки на главной */
.site-home .card {
  background: var(--home-bg);
  border: var(--home-border);
  border-radius: var(--home-radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: none;
}

.site-home .card-body {
  padding: 18px 20px;
}

.site-home .card h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--home-text);
}

.site-home .card .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--home-muted);
  margin-bottom: 6px;
}

/* План по менеджерам (главная) */
.site-home-plan-employee .card-header {
  background: linear-gradient(180deg, rgba(25, 118, 210, 0.10), rgba(25, 118, 210, 0.00));
  border-bottom: var(--home-border);
  padding: 14px 20px;
}
.site-home-plan-employee__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--home-text);
  margin: 0;
}
.site-home-plan-employee__hint {
  margin-top: 4px;
}
.site-home-plan-employee__top {
  margin-bottom: 16px;
}
.site-home-plan-employee__status {
  margin-bottom: 16px;
}

/* Финансовая аналитика — чекбокс и ссылка */
.site-home #user-salary-bonuses-all {
  margin-right: 8px;
}

.site-home .card label {
  font-size: 13px;
  color: var(--home-text);
  cursor: pointer;
}

.site-home .card p[onclick] {
  font-size: 13px;
  color: var(--home-accent);
  cursor: pointer;
  margin: 12px 0 0 0;
}

.site-home .card p[onclick]:hover {
  text-decoration: underline;
}

/* Блок лидов — чипы и сетка */
.site-home-leads__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.site-home-leads__desc {
  margin: 0 0 14px 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--home-muted);
}

.site-home-leads__desc b {
  color: var(--home-text);
  font-weight: 700;
}

.site-home-leads__chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.site-home-leads__chip--waiting {
  background: rgba(25, 118, 210, 0.1);
  border: 1px solid rgba(25, 118, 210, 0.25);
  color: #1565c0;
}

.site-home-leads__chip--overdue {
  background: rgba(211, 47, 47, 0.08);
  border: 1px solid rgba(211, 47, 47, 0.25);
  color: #c62828;
}

a.site-home-leads__chip {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

a.site-home-leads__chip:hover {
  opacity: 0.9;
  filter: brightness(0.97);
}

.site-home-leads__chip-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.site-home-leads__chip-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
  opacity: 0.9;
}

.site-home-leads__grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-home-leads__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.site-home-leads__row:last-child {
  border-bottom: none;
}

.site-home-leads__row .site-home-leads__k {
  color: var(--home-muted);
}

.site-home-leads__row .site-home-leads__v {
  color: var(--home-text);
  font-weight: 500;
}

.site-home-leads__row--highlight .site-home-leads__k,
.site-home-leads__row--highlight .site-home-leads__v {
  font-weight: 700;
  color: var(--home-text);
}

.site-home-leads__empty {
  margin: 0;
  font-size: 13px;
  color: var(--home-muted);
}

/* Блок напоминаний — чипы и итог */
.site-home-reminders__desc {
  margin: 0 0 16px 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--home-muted);
}

.site-home-reminders__chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .site-home-reminders__chips {
    grid-template-columns: 1fr;
  }
}

.site-home-reminders__chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.site-home-reminders__chip--wait {
  background: rgba(255, 152, 0, 0.08);
  border-color: rgba(255, 152, 0, 0.25);
  color: #e65100;
}

.site-home-reminders__chip--active {
  background: rgba(25, 118, 210, 0.1);
  border-color: rgba(25, 118, 210, 0.25);
  color: #1565c0;
}

.site-home-reminders__chip--check {
  background: rgba(56, 142, 60, 0.08);
  border-color: rgba(56, 142, 60, 0.25);
  color: #2e7d32;
}

a.site-home-reminders__chip {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

a.site-home-reminders__chip:hover {
  opacity: 0.9;
  filter: brightness(0.97);
}

a.site-home-reminders__total {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

a.site-home-reminders__total:hover {
  opacity: 0.85;
}

.site-home-reminders__chip-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.site-home-reminders__chip-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  color: inherit;
}

.site-home-reminders__chip-hint {
  font-size: 10px;
  color: var(--home-muted);
  margin-top: 2px;
  max-width: 120px;
}

.site-home-reminders__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
}

.site-home-reminders__total-label {
  font-weight: 700;
  color: var(--home-text);
}

.site-home-reminders__total-value {
  font-weight: 700;
  color: var(--home-text);
}

.site-home-reminders__empty {
  margin: 0;
  font-size: 13px;
  color: var(--home-muted);
}

/* Модалка «Финансы» на главной */
.site-home-finances-section__title {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--home-text);
}

.site-home-finances-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--home-text);
}

.site-home-finances-content hr {
  margin: 10px 0;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.site-home-finances-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 480px) {
  .site-home-finances-kpi {
    grid-template-columns: 1fr;
  }
}

.site-home-finances-kpi--single {
  grid-template-columns: 1fr;
}

.site-home-finances-kpi__item {
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  padding: 10px 12px;
  text-align: left;
}

.site-home-finances-kpi__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--home-muted);
  margin-bottom: 6px;
}

.site-home-finances-kpi__value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--home-text);
}

.site-home-finances-kpi__item--danger {
  background: rgba(211, 47, 47, 0.07);
  border-color: rgba(211, 47, 47, 0.22);
}

.site-home-finances-kpi__item--danger .site-home-finances-kpi__value {
  color: #c62828;
}

.site-home-finances-kpi__item--ok {
  background: rgba(56, 142, 60, 0.07);
  border-color: rgba(56, 142, 60, 0.22);
}

.site-home-finances-kpi__item--ok .site-home-finances-kpi__value {
  color: #2e7d32;
}

.site-home-finances-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--home-muted);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Таблица лидов (legacy, если где-то ещё используется) */
.site-home .table-an {
  width: 100%;
  border-collapse: collapse;
  border: none;
  font-size: 13px;
}

.site-home .table-an td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--home-text);
}

.site-home .table-an tr:last-child td {
  border-bottom: none;
}

.site-home .table-an tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.site-home .table-an td:first-child {
  color: var(--home-muted);
  width: 55%;
}

/* Напоминания — список */
.site-home .list-group-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 0;
  font-size: 13px;
  color: var(--home-text);
  background: transparent !important;
}

.site-home .list-group-item:last-child {
  border-bottom: none;
  font-weight: 700;
  padding-top: 14px;
}

.site-home .list-group-item .fas,
.site-home .list-group-item .material-icons {
  opacity: 0.8;
  margin-right: 8px;
}

.site-home .text-muted {
  color: var(--home-muted) !important;
  font-size: 13px;
}

/* Таблица заказов по статусам */
.site-home .table-bordered {
  border: var(--home-border);
  border-radius: var(--home-radius);
  overflow: hidden;
  font-size: 13px;
}

.site-home .table-bordered thead th {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 10px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--home-muted);
}

.site-home .table-bordered tbody td {
  padding: 10px;
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--home-text);
}

.site-home .table-bordered tbody tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.site-home .table-bordered tbody tr.bg-warning td {
  background: rgba(255, 193, 7, 0.12);
}

/* Таблица заказов: disabled + итог */
.site-home .table-bordered tbody tr.site-home-orders__row--disabled td {
  background: rgba(0, 0, 0, 0.015);
  color: rgba(0, 0, 0, 0.45);
}

.site-home .table-bordered tbody tr.site-home-orders__row--disabled:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.site-home .table-bordered tbody tr.site-home-orders__row--total td {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 700;
}

/* Блок итогов по задолженностям */
.site-home .well {
  background: rgba(0, 0, 0, 0.02);
  border: var(--home-border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 16px;
  margin-bottom: 0;
}

.site-home .well p {
  margin: 0 0 8px 0;
  font-size: 13px;
}

.site-home .well ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.site-home .well li {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--home-text);
}

.site-home .well small {
  font-size: 12px;
  color: var(--home-muted);
}

/* Сводка по заказам (абзацы над таблицей) */
.site-home .card-body > p {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--home-text);
}

.site-home .card-body > hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 16px 0;
}

/* Сетка контента: левая колонка + правая */
.site-home-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 992px) {
  .site-home-main {
    grid-template-columns: 380px minmax(0, 1fr);
  }
}

@media (max-width: 991px) {
  .site-home-main {
    grid-template-columns: 1fr;
  }
}

.site-home-main__left {
  min-width: 0;
}

.site-home-main__right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Правая часть: две колонки карточек на больших экранах */
.site-home-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 991px) {
  .site-home-cards {
    grid-template-columns: 1fr;
  }
}

.site-home-cards .card {
  margin-bottom: 0;
}

/* Одна карточка на всю ширину (заказы) */
.site-home-cards-full .card {
  margin-bottom: 0;
}

/* Таблица должников: ссылки на контрагента (модалка) и на заказы */
.site-home-debtors .btn-ajax-counterparty {
  color: #6d28d9;
  text-decoration: none;
  border-bottom: 1px dashed #6d28d9;
}
.site-home-debtors .btn-ajax-counterparty:hover {
  opacity: 0.85;
}
.site-home-debtors #site-home-debtors-table a[href*="/order/index"] {
  color: var(--home-accent, #1976d2);
  text-decoration: none;
}
.site-home-debtors #site-home-debtors-table a[href*="/order/index"]:hover {
  text-decoration: underline;
}
