.sales-page {
  min-height: 100%;
  padding: clamp(14px, 2vw, 26px);
  background: #eef5ff;
}

.sd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.sd-heading {
  min-width: 240px;
  max-width: 720px;
}

.sd-title {
  margin: 0;
  color: #132144;
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.2;
}

.sd-subtitle {
  margin-top: 8px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
}

.sd-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.sd-actions .btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}

.sd-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(99, 102, 241, .16);
  border-radius: 16px;
  background: #fff;
  color: #334155;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.sd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.sd-kpi-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .04);
}

.sd-kpi-accent {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #fff;
}

.sd-kpi-label {
  margin-bottom: 10px;
  color: #64748b;
  font-size: .92rem;
}

.sd-kpi-accent .sd-kpi-label,
.sd-kpi-accent .sd-kpi-foot {
  color: rgba(255, 255, 255, .82);
}

.sd-kpi-value {
  color: #0f172a;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sd-kpi-accent .sd-kpi-value {
  color: #fff;
}

.sd-kpi-foot {
  margin-top: 10px;
  color: #64748b;
  font-size: .88rem;
}

.sd-quick-panel,
.sd-panel {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.sd-quick-panel {
  margin-bottom: 20px;
}

.sd-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  padding: 18px 20px 20px;
}

.sd-quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 62px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: #f8fbff;
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sd-quick-link:hover {
  background: #eef4ff;
  border-color: rgba(96, 165, 250, .3);
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(99, 102, 241, .08);
}

.sd-quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 14px;
  background: rgba(37, 99, 235, .12);
  color: #2563eb;
  font-size: 1.2rem;
}

.sd-quick-link span {
  min-width: 0;
  font-size: .95rem;
  line-height: 1.35;
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.sd-panel-span-12 { grid-column: span 12; }
.sd-panel-span-8 { grid-column: span 8; }
.sd-panel-span-7 { grid-column: span 7; }
.sd-panel-span-6 { grid-column: span 6; }
.sd-panel-span-5 { grid-column: span 5; }
.sd-panel-span-4 { grid-column: span 4; }

.sd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.sd-panel-title {
  color: #0f172a;
  font-weight: 900;
  line-height: 1.35;
}

.sd-panel-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: .9rem;
  line-height: 1.5;
}

.sd-panel-body {
  padding: 18px 20px 22px;
}

.sd-chart-body {
  height: 320px;
  min-height: 280px;
}

.sd-chart-body-sm {
  height: 300px;
}

.sd-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.sd-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sd-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: #f8fbff;
}

.sd-alert-main {
  min-width: 0;
}

.sd-alert-title {
  color: #0f172a;
  font-weight: 800;
}

.sd-alert-message {
  margin-top: 6px;
  color: #475569;
  font-size: .95rem;
  line-height: 1.55;
}

.sd-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.sd-alert-badge.info { background: #dbeafe; color: #1d4ed8; }
.sd-alert-badge.warning { background: #fef3c7; color: #b45309; }
.sd-alert-badge.secondary { background: #e2e8f0; color: #475569; }

.sales-page .table {
  min-width: 520px;
}

.sales-page .table thead th {
  color: #475569;
  font-weight: 800;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  white-space: nowrap;
}

.sales-page .table tbody td {
  border-color: rgba(148, 163, 184, .12);
  vertical-align: middle;
}

html[dir="rtl"] .sales-page {
  text-align: right;
}

@media (max-width: 1280px) {
  .sd-header {
    flex-direction: column;
  }

  .sd-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .sd-panel-span-8,
  .sd-panel-span-7,
  .sd-panel-span-6,
  .sd-panel-span-5,
  .sd-panel-span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 700px) {
  .sales-page {
    padding: 12px;
  }

  .sd-header {
    gap: 14px;
    margin-bottom: 16px;
  }

  .sd-title {
    font-size: 1.65rem;
  }

  .sd-subtitle {
    font-size: .95rem;
  }

  .sd-actions {
    width: 100%;
    align-items: stretch;
  }

  .sd-actions .btn,
  .sd-date-pill {
    width: 100%;
  }

  .sd-kpis,
  .sd-grid {
    gap: 12px;
  }

  .sd-kpi-card,
  .sd-panel-head,
  .sd-panel-body {
    padding: 14px;
  }

  .sd-kpi-value {
    font-size: 1.55rem;
  }

  .sd-quick-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sd-chart-body,
  .sd-chart-body-sm {
    height: 260px;
    min-height: 240px;
  }

  .sd-alert {
    flex-direction: column;
  }
}
