/* Дополнение к собранному app.css: обзор, статистика, фильтры. */

.crm-body-auth {
  background: #eef2f7;
}

.crm-dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.crm-dash-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.crm-dash-head p {
  margin: 0.3rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.crm-dash-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.crm-pulse {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.crm-pulse__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.crm-pulse__value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.15rem 0;
}

.crm-pulse .crm-delta,
.crm-pulse .text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.crm-pulse .crm-delta--up {
  color: #86efac !important;
}

.crm-pulse .crm-delta--down {
  color: #fecaca !important;
}

button.crm-metric-card {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  background: #fff;
}

button.crm-metric-card.is-active {
  box-shadow: 0 0 0 2px #2563eb, 0 8px 24px rgba(37, 99, 235, 0.12);
}

.crm-delta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.crm-delta--up {
  color: #15803d;
}

.crm-delta--down {
  color: #b91c1c;
}

.crm-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 1rem 1.1rem 1.1rem;
}

.crm-chart-card__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.85rem;
}

.crm-chart-card__canvas {
  position: relative;
  height: 240px;
}

.crm-chart-card__canvas--short {
  height: 220px;
}

.crm-bar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 9.5rem) 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.crm-bar-row:last-child {
  margin-bottom: 0;
}

.crm-bar-row__label {
  font-size: 0.82rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-bar-row__track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.crm-bar-row__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  min-width: 2px;
}

.crm-bar-row__fill--teal {
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.crm-bar-row__fill--amber {
  background: linear-gradient(90deg, #b45309, #fbbf24);
}

.crm-bar-row__value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 1.5rem;
  text-align: right;
}

.crm-reply-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.crm-reply-list a:last-child {
  border-bottom: none;
}

.crm-reply-list a:hover {
  color: #1d4ed8;
}

.crm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: -0.35rem 0 0.9rem;
}

.crm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.crm-filter-chip span {
  color: #64748b;
  font-weight: 700;
}

.crm-filter-chip:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.crm-filter-chip.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.crm-filter-chip.is-active span {
  color: rgba(255, 255, 255, 0.85);
}

.crm-filter-empty {
  text-align: center;
  color: #64748b;
  padding: 0.75rem 0 0.25rem;
}

tr.crm-filtered-out {
  display: none;
}

.crm-desk {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
}

.crm-desk__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 0.65rem;
}

.crm-desk__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.crm-desk__form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.crm-desk__debt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #9a3412;
  margin: 0;
}

tr.crm-row-overdue td:first-child {
  box-shadow: inset 3px 0 0 #dc3545;
}

.order-show-page {
  max-width: 1280px;
}

.crm-order-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.crm-order-hero__device {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.25;
}

.crm-order-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: 28rem;
}

.crm-spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.4rem;
}

.crm-spec__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.crm-spec__value {
  color: #0f172a;
  font-weight: 600;
  line-height: 1.35;
}

.crm-spec__wide {
  grid-column: 1 / -1;
}

.crm-desk__steps .btn {
  min-width: 7.2rem;
}

@media (max-width: 767.98px) {
  .crm-pulse {
    grid-template-columns: 1fr;
  }
  .crm-spec {
    grid-template-columns: 1fr;
  }
  .crm-order-hero {
    flex-direction: column;
  }
  .crm-order-hero__actions {
    justify-content: flex-start;
    max-width: none;
  }

  .crm-bar-row {
    grid-template-columns: 1fr auto;
  }

  .crm-bar-row__track {
    grid-column: 1 / -1;
    order: 3;
  }

  .crm-chart-card__canvas,
  .crm-chart-card__canvas--short {
    height: 200px;
  }
}
