body {
  min-height: 100vh;
}

:root {
  --panel-border: #d7dee7;
  --panel-bg: linear-gradient(135deg, #f7f9fc 0%, #eef4fb 100%);
  --panel-accent: #0d6efd;
}

.table td,
.table th {
  white-space: nowrap;
}

.deals-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.8rem;
}

.deals-table th,
.deals-table td {
  padding: 0.35rem 0.4rem;
  overflow-wrap: anywhere;
}

.deals-table th:nth-child(1),
.deals-table td:nth-child(1) {
  width: 20%;
}

.deals-table th:nth-child(2),
.deals-table td:nth-child(2) {
  width: 10%;
}

.deals-table th:nth-child(3),
.deals-table td:nth-child(3) {
  width: 10%;
}

.deals-table th:nth-child(4),
.deals-table td:nth-child(4) {
  width: 8%;
}

.deals-table th:nth-child(5),
.deals-table td:nth-child(5),
.deals-table th:nth-child(6),
.deals-table td:nth-child(6),
.deals-table th:nth-child(7),
.deals-table td:nth-child(7) {
  width: 10%;
}

.deals-table th:nth-child(8),
.deals-table td:nth-child(8),
.deals-table th:nth-child(9),
.deals-table td:nth-child(9) {
  width: 11%;
}

.deal-name-link {
  cursor: pointer;
}

.deal-expired td {
  color: #7a1f1f;
}

.filters-panel {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.filters-summary {
  cursor: pointer;
  list-style: none;
}

.filters-summary::-webkit-details-marker {
  display: none;
}

.filters-count {
  border: 1px solid #cad5e4;
  color: #3b4b65;
  font-weight: 600;
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(140px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.filter-block {
  background: #ffffffbf;
  border: 1px solid #dbe5f1;
  border-radius: 0.65rem;
  padding: 0.6rem 0.65rem;
}

.filter-block .form-label {
  margin-bottom: 0.35rem;
  color: #334761;
}

.filter-block .form-control,
.filter-block .form-select {
  border-color: #cdd9e8;
}

.filter-block .form-control:focus,
.filter-block .form-select:focus {
  border-color: var(--panel-accent);
  box-shadow: 0 0 0 0.15rem rgb(13 110 253 / 18%);
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

@media (max-width: 1400px) {
  .filters-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .filter-block-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.cluster-chart-wrap {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.cluster-chart {
  min-height: 290px;
  min-width: 640px;
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  padding: 0.75rem 0.25rem 0.4rem;
  border-bottom: 1px solid #dbe3ee;
}

.cluster-col {
  flex: 1 1 120px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.cluster-bar-box {
  width: 100%;
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.cluster-bar {
  width: 82%;
  min-height: 6px;
  border-radius: 0.45rem 0.45rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cluster-bar-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.cluster-bar-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #24344b;
  margin-bottom: 0.25rem;
  text-align: center;
}

.cluster-x-label {
  font-size: 0.75rem;
  color: #324864;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-color-1 { background: #2563eb; }
.cluster-color-2 { background: #38bdf8; }
.cluster-color-3 { background: #22c55e; }
.cluster-color-4 { background: #facc15; }
.cluster-color-5 { background: #84cc16; }

.legend-dot {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.alerts-table {
  width: 100%;
  table-layout: auto;
}

.alerts-table .deal-col {
  width: 28%;
}

.alerts-table .deal-col-content {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.tracker-hero {
  background: linear-gradient(120deg, #ffffff 0%, #f4f7fb 100%);
  border: 1px solid #d9e2ef;
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
}

.tracker-disclaimer {
  color: #4c5f77;
  max-width: 900px;
}

.tracker-kpi-card {
  border: 1px solid #dce5f1;
  border-radius: 0.9rem;
  box-shadow: 0 4px 14px rgb(21 39 77 / 5%);
}

.tracker-kpi-label {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: #60748d;
  text-transform: uppercase;
}

.tracker-kpi-sub {
  color: #8a97a8;
  font-size: 0.76rem;
}

.tracker-kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2e44;
}

.tracker-panel {
  border: 1px solid #dce5f1;
  border-radius: 0.9rem;
  box-shadow: 0 8px 20px rgb(22 40 70 / 6%);
}

.tracker-summary-left {
  border-right: 1px solid #dbe4f0;
}

.tracker-summary-title {
  color: #6d7f95;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.tracker-event-table td,
.tracker-event-table th,
.tracker-change-table td,
.tracker-change-table th {
  white-space: normal;
}

.tracker-info-block {
  border: 1px solid #e3e8f0;
  border-radius: 0.75rem;
  background: #fafcff;
  padding: 0.65rem 0.8rem;
}

.tracker-badge-cross-sell {
  background: #0b3d91;
  color: #fff;
}

.tracker-main-controls {
  flex-wrap: nowrap;
}

.home-card {
  box-shadow: 0 6px 18px rgb(22 40 70 / 8%);
}

.home-card-title {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
}

.home-card-blue {
  background: #e9f0fb;
  border-color: #9fb9df !important;
}

.home-card-green {
  background: #e8f4ec;
  border-color: #9fceb1 !important;
}

.home-card-yellow {
  background: #f7f1df;
  border-color: #d8c483 !important;
}

.home-card-orange {
  background: #fff1e7;
  border-color: #e4b88e !important;
}

.tracker-select-sm {
  width: 170px;
}

@media (max-width: 1200px) {
  .tracker-main-controls {
    flex-wrap: wrap;
  }
}

.dq-checked-row {
  background-color: #f1f3f5;
  color: #6c757d;
}

.alerts-table .dq-col-last-update {
  width: 190px;
  white-space: nowrap;
}

.alerts-table .dq-col-deal {
  min-width: 260px;
}

.alerts-table .dq-col-info-missing {
  min-width: 220px;
}

.alerts-table .dq-col-linked {
  min-width: 220px;
}

.alerts-table .dq-col-short {
  min-width: 110px;
}

.alerts-table .dq-col-date {
  min-width: 120px;
  white-space: nowrap;
}

.alerts-table .dq-col-arr {
  min-width: 90px;
  white-space: nowrap;
}

.alerts-table .dq-col-comment {
  min-width: 280px;
}

.alerts-table .dq-col-done {
  width: 84px;
  text-align: center;
}

.alerts-table .dq-col-cancel {
  width: 44px;
  text-align: center;
}

.alerts-table td:last-child,
.alerts-table th:last-child {
  position: sticky;
  right: 0;
  background: #fff;
}

.dq-checked-row td:last-child {
  background: #f1f3f5;
}

.onboarding-shell {
  max-width: 1280px;
}

.onboarding-hero {
  background: linear-gradient(135deg, #fffdf6 0%, #f3f7ff 100%);
  border: 1px solid #d9e2ef;
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 0.4rem 1.2rem rgb(15 23 42 / 5%);
}

.onboarding-card {
  border: 1px solid #dce5f1;
  border-radius: 0.95rem;
  box-shadow: 0 0.35rem 1rem rgb(15 23 42 / 4%);
}

.onboarding-card-soft {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.onboarding-table th,
.onboarding-table td {
  vertical-align: middle;
}

.onboarding-code {
  font-size: 0.8rem;
  border: 1px solid #dde5f0;
  border-radius: 0.4rem;
  background: #f8fafc;
  padding: 0.1rem 0.35rem;
}

.onboarding-guide details {
  border: 1px solid #dce5f1;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.85rem 1rem;
}

.onboarding-guide details + details {
  margin-top: 0.85rem;
}

.onboarding-guide summary {
  cursor: pointer;
  font-weight: 700;
}

.onboarding-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.onboarding-chip-green {
  background: #d1e7dd;
  color: #0f5132;
}

.onboarding-chip-amber {
  background: #fff3cd;
  color: #664d03;
}

.onboarding-chip-red {
  background: #f8d7da;
  color: #842029;
}
