/* ═══════════════════════════════════════════
   Cards — TailAdmin‑style
   ═══════════════════════════════════════════ */

/* ---------- Stats Grid ---------- */
/* Mobile: flex wrap xuống dòng */
.stats-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background-color var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(var(--color-primary-rgb), 0.12);
}

.stat-card.highlighted {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.stat-card.highlighted .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

.stat-card.highlighted .stat-value {
  color: #fff;
}

/* Icon trên mobile hiện phía trên chữ */
.stat-card .stat-icon {
  display: flex;
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.stat-card .stat-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-bottom: 0px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}

/* Ẩn số lượng hoàn toàn trên các card thống kê này nếu user yêu cầu */
.stat-card .stat-value {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-top: 4px;
}

/* Desktop: grid 3 cột, icon hiện lại */
@media (min-width: 768px) {
  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    overflow-x: visible;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .stat-card {
    min-width: unset;
    flex: unset;
    overflow: visible;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
  }

  .stat-card .stat-icon {
    display: flex;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-sm);
    font-size: 1.5rem;
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
  }

  .stat-card.highlighted .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  .stat-card .stat-label {
    font-size: var(--font-size-xs);
    letter-spacing: 0.025em;
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    word-break: normal;
  }

  .stat-card .stat-value {
    font-size: var(--font-size-xl);
  }

  .stat-card .stat-value.hide-mobile {
    display: block;
    /* Hiện lại trên desktop */
  }
}

/* ---------- Revenue Section ---------- */
.revenue-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  min-width: 0;
  overflow: hidden;
}

/* Date row trên mobile: wrap xuống dòng */
@media (max-width: 479px) {
  .revenue-section [style*="display:flex"][style*="gap:8px"] {
    flex-wrap: wrap;
  }

  .revenue-section [style*="display:flex"][style*="gap:8px"]>div {
    min-width: 120px;
  }
}

.revenue-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.revenue-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.revenue-value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

/* Date row bên trong revenue-section */
.revenue-date-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.revenue-date-row .date-input {
  flex: 1;
  min-width: 120px;
}

.revenue-arrow {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* Date input */
.date-input {
  font-family: var(--font-family);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: background-color var(--transition-normal), border-color var(--transition-fast), color var(--transition-normal);
}

.date-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.section-header .section-line {
  width: 4px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 2px;
}

.section-header .section-title {
  flex: 1;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--color-text);
}

.section-header .section-badge {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}