/* MyBillingApp — Ultra-premium dashboard (brand orange + navy preserved) */

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.content:has(.dash) {
  padding: 24px 28px 40px;
  background: var(--background, #f7f8fb);
  --dash-bg: var(--background, #f7f8fb);
}

.dash {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
  container-type: inline-size;
  container-name: dash;
}

.dash-enter {
  animation: dashEnter var(--motion-slow, 280ms) var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}
.dash-enter:nth-of-type(2) { animation-delay: 40ms; }
.dash-enter:nth-of-type(3) { animation-delay: 70ms; }
.dash-enter:nth-of-type(4) { animation-delay: 100ms; }
.dash-enter:nth-of-type(5) { animation-delay: 130ms; }

@keyframes dashEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-enter { animation: none; }
}

/* Hero */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 4px 2px 2px;
}

.dash-hero-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-greeting {
  margin: 4px 0 0;
  font-size: var(--type-h1, clamp(22px, 2vw, 28px));
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.dash-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 42ch;
}

.dash-hero-aside {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 12px);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.dash-date-range .icon { width: 16px; height: 16px; color: var(--muted); }

/* QR Ordering Center CTA — navigates to existing /whatsapp only */
.dash-qr-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  min-width: min(280px, 100%);
  border-radius: 16px;
  background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(18, 140, 126, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.dash-qr-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(18, 140, 126, 0.36);
  filter: brightness(1.03);
  color: #fff;
}
.dash-qr-cta:active { transform: translateY(0); }
.dash-qr-cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex: none;
}
.dash-qr-cta-icon svg { width: 22px; height: 22px; }
.dash-qr-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dash-qr-cta-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dash-qr-cta-copy span {
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-qr-cta-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex: none;
}
.dash-qr-cta-arrow svg { width: 14px; height: 14px; }

@media (max-width: 720px) {
  .dash-qr-cta { min-width: 100%; }
  .dash-hero-aside { width: 100%; }
  .dash-date-range { flex: 1; justify-content: center; }
}

/* Category dashboards: keep CTA prominent in header action rows */
.rst-header-actions,
.gym-header-actions,
.pharm-header-actions,
.inf-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.rst-header-actions .dash-qr-cta,
.gym-header-actions .dash-qr-cta,
.pharm-header-actions .dash-qr-cta,
.inf-header-actions .dash-qr-cta {
  order: -1;
  flex: 1 1 260px;
  max-width: 340px;
}
@media (max-width: 900px) {
  .rst-header-actions .dash-qr-cta,
  .gym-header-actions .dash-qr-cta,
  .pharm-header-actions .dash-qr-cta,
  .inf-header-actions .dash-qr-cta {
    max-width: none;
    width: 100%;
  }
}

/* Cards */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-card, 0 1px 2px rgba(11, 15, 25, 0.04), 0 8px 24px rgba(11, 15, 25, 0.04));
  padding: 18px 20px;
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
  container-name: dash-card;
  transition: box-shadow var(--motion-base, 180ms) var(--ease-out, ease), border-color var(--motion-base, 180ms) ease;
}

.dash-card:hover {
  border-color: var(--line-strong);
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.dash-card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
}

.dash-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  transition: opacity var(--motion-fast, 120ms) ease;
}
.dash-link:hover { opacity: 0.8; text-decoration: underline; }

.dash-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}

/* Empty */
.dash-empty-hero {
  text-align: center;
  padding: 40px 24px;
}

.dash-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 107, 0, 0.12);
}
.dash-empty-icon svg { width: 26px; height: 26px; }
.dash-empty-hero h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.02em; }
.dash-empty-hero p { margin: 0 auto; color: var(--muted); max-width: 420px; }
.dash-empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.dash-empty-inline {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 14px;
}
.dash-empty-inline .help { margin: 6px 0 14px; }

/* KPI */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dash-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 16px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-card, 0 1px 2px rgba(11, 15, 25, 0.04));
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--motion-base, 180ms) var(--ease-out, ease), transform var(--motion-base, 180ms) var(--ease-out, ease), border-color var(--motion-base, 180ms) ease;
}

.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.dash-kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.dash-kpi-icon svg { width: 17px; height: 17px; }

.dash-kpi--orange .dash-kpi-icon { background: #FFF1E6; color: #FF6B00; }
.dash-kpi--amber .dash-kpi-icon { background: #FFF7ED; color: #C2410C; }
.dash-kpi--navy .dash-kpi-icon { background: #EEF2F8; color: #0B0F19; }
.dash-kpi--slate .dash-kpi-icon { background: #F1F5F9; color: #475569; }
.dash-kpi--green .dash-kpi-icon { background: #ECFDF5; color: #059669; }
.dash-kpi--blue .dash-kpi-icon { background: #EFF6FF; color: #2563EB; }
.dash-kpi--red .dash-kpi-icon { background: #FEF2F2; color: #DC2626; }

.dash-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.dash-kpi-value {
  font-size: var(--type-kpi, clamp(22px, 2vw, 28px));
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-top: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.dash-kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: 4px;
}
.dash-kpi-trend { font-weight: 700; }
.dash-kpi-trend.up { color: var(--success); }
.dash-kpi-trend.down { color: var(--danger); }
.dash-kpi-hint { color: var(--muted); }

.dash-kpi-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  width: 100%;
  pointer-events: none;
  opacity: 0.9;
}

/* Quick actions */
.dash-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-actions-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dash-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  transition: background var(--motion-fast, 120ms) ease, border-color var(--motion-fast, 120ms) ease, transform var(--motion-fast, 120ms) ease, color var(--motion-fast, 120ms) ease;
}
.dash-action:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--text);
}
.dash-action:active { transform: translateY(1px); }
.dash-action.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 0, 0.22);
}
.dash-action.is-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.dash-action-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.dash-action-icon svg { width: 16px; height: 16px; }

/* Grids */
.dash-analytics-row,
.dash-bottom-row,
.dash-tertiary-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.dash-span-7 { grid-column: span 7; min-width: 0; max-width: 100%; }
.dash-span-6 { grid-column: span 6; min-width: 0; max-width: 100%; }
.dash-span-5 { grid-column: span 5; min-width: 0; max-width: 100%; }
.dash-span-3 { grid-column: span 3; min-width: 0; max-width: 100%; }

.dash-chart-wrap {
  position: relative;
  height: 260px;
  min-width: 0;
  max-width: 100%;
}
.dash-chart-wrap canvas { width: 100% !important; height: 100% !important; }

.dash-status-card { min-width: 0; max-width: 100%; }
.dash-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.dash-donut-canvas {
  position: relative;
  width: min(132px, 100%);
  aspect-ratio: 1;
  flex: none;
}
.dash-donut-canvas canvas { width: 100% !important; height: 100% !important; display: block; }
.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dash-donut-center strong {
  font-size: clamp(16px, 4.5cqi, 22px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dash-donut-center span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.dash-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 10px;
}
.dash-legend li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) minmax(3em, max-content) minmax(1.75em, max-content);
  align-items: center;
  column-gap: 10px;
  font-size: 12px;
  min-width: 0;
}
.dash-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.dash-legend-label {
  color: var(--text-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-legend-pct,
.dash-legend-count { text-align: right; }
.dash-legend-pct { color: var(--muted); font-weight: 600; }
.dash-legend-count { font-weight: 700; }

/* Wallet / membership */
.dash-side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-wallet-card {
  background:
    linear-gradient(165deg, rgba(255, 107, 0, 0.08) 0%, transparent 42%),
    var(--surface);
}
.dash-wallet-value {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.dash-wallet-meta {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}
.dash-wallet-hint {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.dash-membership-card .dash-plan-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary-ink);
}
.dash-plan-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.dash-plan-meta strong {
  color: var(--text);
  font-size: 13px;
}
.dash-plan-perk {
  margin: 10px 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}

/* Cash flow */
.dash-cashflow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.dash-cashflow-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dash-cashflow-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.dash-cashflow-icon svg { width: 18px; height: 18px; }
.dash-cashflow-item--in .dash-cashflow-icon { background: #ECFDF5; color: #059669; }
.dash-cashflow-item--out .dash-cashflow-icon { background: #FEF2F2; color: #DC2626; }
.dash-cashflow-item--net .dash-cashflow-icon { background: #FFF1E6; color: #FF6B00; }
.dash-cashflow-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-cashflow-amt {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
}
.dash-cashflow-item--net .dash-cashflow-amt {
  font-size: 17px;
  color: var(--primary);
}

/* Table */
.dash-table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
.dash-mobile-list { display: none; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.dash-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.dash-table th.num,
.dash-table td.num { text-align: right; }
.dash-table th.actions,
.dash-table td.actions { width: 48px; text-align: center; }
.dash-table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.dash-table-row { cursor: pointer; transition: background var(--motion-fast, 120ms) ease; }
.dash-table-row:hover { background: var(--surface-hover); }
.dash-table-row:last-child td { border-bottom: 0; }
.dash-table-link { font-weight: 700; color: var(--text); }
.dash-table-link:hover { color: var(--primary); }

.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dash-badge-paid { background: #D1FAE5; color: #065F46; }
.dash-badge-partial,
.dash-badge-unpaid { background: #FFF1E6; color: #C2410C; }
.dash-badge-overdue { background: #FEE2E2; color: #991B1B; }
.dash-badge-issued { background: #EEF2F8; color: #0B0F19; }

.dash-row-menu { position: relative; }
.dash-row-menu summary {
  list-style: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.dash-row-menu summary::-webkit-details-marker { display: none; }
.dash-row-menu summary:hover { background: var(--surface-muted); }
.dash-row-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 10;
  display: grid;
  animation: dashEnter var(--motion-base, 180ms) var(--ease-out, ease);
}
.dash-row-menu-panel a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.dash-row-menu-panel a:hover { background: var(--primary-soft); color: var(--primary); }

.dash-mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.dash-mobile-row:last-child { border-bottom: 0; }
.dash-mobile-row strong { display: block; font-size: 13px; }
.dash-mobile-row span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-mobile-row-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* Payments */
.dash-tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.dash-tx-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.dash-tx-item:last-child { border-bottom: 0; }
.dash-tx-body strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-tx-body span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.dash-tx-end {
  text-align: right;
}
.dash-tx-end strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.dash-tx-end time {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Customers */
.dash-customer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.dash-customer-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.dash-customer-item:last-child { border-bottom: 0; }
.dash-customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}
.dash-customer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-customer-meta strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-customer-meta span {
  font-size: 11px;
  color: var(--muted);
}
.dash-customer-amt {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}
.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.dash-add-firm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@container dash (max-width: 1100px) {
  .dash-span-7,
  .dash-span-6,
  .dash-span-5 { grid-column: span 12; }
  .dash-span-3 { grid-column: span 6; }
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container dash (max-width: 640px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
  .dash-span-3 { grid-column: span 12; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-date-range { width: 100%; justify-content: center; }
}

@container dash-card (max-width: 420px) {
  .dash-cashflow-item { grid-template-columns: 36px minmax(0, 1fr); }
  .dash-cashflow-amt { grid-column: 2; justify-self: start; }
  .dash-customer-item { grid-template-columns: 40px minmax(0, 1fr); }
  .dash-customer-amt { grid-column: 2; justify-self: start; }
}

@container dash-card (min-width: 480px) {
  .dash-donut-wrap {
    flex-direction: row;
    align-items: center;
  }
  .dash-legend {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 1200px) {
  .dash-span-7,
  .dash-span-6,
  .dash-span-5 { grid-column: span 12; }
  .dash-span-3 { grid-column: span 6; }
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .content:has(.dash) { padding: 16px 14px 110px; }
  .dash { gap: 16px; }
  .dash-kpi-grid { grid-template-columns: 1fr; }
  .dash-span-3,
  .dash-span-5,
  .dash-span-6,
  .dash-span-7 { grid-column: span 12; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-date-range { width: 100%; justify-content: center; }
  .dash-actions-row { display: grid; grid-template-columns: 1fr 1fr; }
  .dash-action.is-primary { grid-column: 1 / -1; justify-content: center; }
  .dash-table-wrap { display: none; }
  .dash-mobile-list { display: grid; }
}

@media (max-width: 360px) {
  .dash-actions-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-kpi:hover { transform: none; }
}

html[data-theme="dark"] .content:has(.dash) {
  --dash-bg: #0B0F19;
  background:
    radial-gradient(900px 320px at 0% -10%, rgba(255, 107, 0, 0.08), transparent 55%),
    radial-gradient(700px 280px at 100% 0%, rgba(37, 99, 235, 0.05), transparent 50%),
    #0B0F19;
}

html[data-theme="dark"] .dash-kpi,
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .dash-date-range,
html[data-theme="dark"] .dash-action:not(.is-primary) {
  background: #151C2E;
  border-color: #273049;
}

html[data-theme="dark"] .dash-kpi--orange .dash-kpi-icon { background: rgba(255, 107, 0, 0.15); }
html[data-theme="dark"] .dash-kpi--amber .dash-kpi-icon { background: rgba(194, 65, 12, 0.18); color: #FDBA74; }
html[data-theme="dark"] .dash-kpi--navy .dash-kpi-icon { background: rgba(248, 250, 252, 0.08); color: #E2E8F0; }
html[data-theme="dark"] .dash-kpi--slate .dash-kpi-icon { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; }

html[data-theme="dark"] .dash-wallet-card {
  background: linear-gradient(165deg, rgba(255, 107, 0, 0.14) 0%, #151C2E 48%);
}
html[data-theme="dark"] .dash-membership-card .dash-plan-name { color: #FDBA74; }
html[data-theme="dark"] .dash-table-row:hover,
html[data-theme="dark"] .dash-action:not(.is-primary):hover {
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .dash-badge-paid { background: rgba(5, 150, 105, 0.2); color: #6EE7B7; }
html[data-theme="dark"] .dash-badge-partial,
html[data-theme="dark"] .dash-badge-unpaid { background: rgba(255, 107, 0, 0.15); color: #FDBA74; }
html[data-theme="dark"] .dash-badge-overdue { background: rgba(220, 38, 38, 0.2); color: #FCA5A5; }
html[data-theme="dark"] .dash-chip {
  background: #1B2438;
  border-color: #273049;
}
html[data-theme="dark"] .bottom-nav {
  background: rgba(11, 15, 25, 0.92);
}

/* Breathing feature cards. Shared by every business dashboard. */
.mba-feature-wrap {
  min-width: 0;
  /* Room for the float and the gold shadow, which stay inside this padding. */
  padding: 12px 8px 16px;
}

.mba-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mba-feature-card {
  --fc: var(--icon-orange, #ff6b00);
  --card-shadow: 0 8px 14px rgba(184, 140, 60, 0.16), 0 2px 4px rgba(120, 80, 20, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 168px;
  padding: 26px 16px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, #fffdf8 0%, #fff6e8 52%, #fffaf3 100%);
  border: 1px solid rgba(212, 175, 95, 0.38);
  border-radius: 26px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  animation: mbaCardBreathe 4.2s ease-in-out infinite;
  animation-delay: var(--mba-breathe, 0s);
}

.mba-feature-streak {
  position: absolute;
  top: -30%;
  inset-inline-end: 8%;
  width: 42%;
  height: 150%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.72) 42%, rgba(242, 201, 120, 0.28) 58%, transparent);
  transform: rotate(24deg);
  pointer-events: none;
}

.mba-feature-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.72) 50%, transparent 64%);
  transform: translateX(-130%);
  pointer-events: none;
  transition: transform 700ms ease;
}

.mba-feature-card.is-locked {
  animation: none;
  box-shadow: var(--card-shadow);
  padding-top: 46px;
}

.mba-feature-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.mba-feature-card:focus-visible .mba-feature-sheen,
.mba-feature-card:hover .mba-feature-sheen {
  transform: translateX(130%);
}

@media (hover: hover) and (pointer: fine) {
  .mba-feature-card:hover {
    animation: none;
    transform: translateY(-8px);
    border-color: rgba(212, 175, 95, 0.7);
    box-shadow: 0 12px 14px rgba(184, 140, 60, 0.28), 0 4px 8px rgba(120, 80, 20, 0.1);
  }

  .mba-feature-card:active {
    transform: translateY(-2px);
  }
}

.mba-feature-card .icon-box {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--fc) 62%, #fff), var(--fc));
  box-shadow: 0 8px 16px color-mix(in srgb, var(--fc) 36%, transparent);
}

.mba-feature-card .icon-box svg {
  width: 26px;
  height: 26px;
}

.mba-feature-card.tone-orange { --fc: #ff6b00; }
.mba-feature-card.tone-pink { --fc: #ec4899; }
.mba-feature-card.tone-blue { --fc: #2563eb; }
.mba-feature-card.tone-cyan { --fc: #0d9488; }
.mba-feature-card.tone-purple { --fc: #7c3aed; }
.mba-feature-card.tone-indigo { --fc: #4f46e5; }
.mba-feature-card.tone-green { --fc: #16a34a; }
.mba-feature-card.tone-amber { --fc: #d97706; }

.mba-feature-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.mba-feature-title,
.mba-feature-desc {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mba-feature-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
  color: #1a140c;
}

.mba-feature-desc {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #8a8175;
}

.mba-feature-action {
  margin-top: 4px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fc) 78%, #000);
  background: color-mix(in srgb, var(--fc) 14%, #fff);
}

.mba-card-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  inset-inline-end: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 24px);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #1a140c;
  background: linear-gradient(90deg, #facc15, #e8b65a);
  box-shadow: 0 4px 10px rgba(184, 140, 60, 0.28);
}

.dash-welcome-line {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.dash-welcome-line strong {
  color: var(--text);
  font-weight: 800;
}

@keyframes mbaCardBreathe {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 8px 14px rgba(184, 140, 60, 0.16), 0 2px 4px rgba(120, 80, 20, 0.06);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 10px 14px rgba(184, 140, 60, 0.24), 0 4px 6px rgba(120, 80, 20, 0.08);
  }
}

@container dash (max-width: 860px) {
  .mba-feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container dash (max-width: 680px) {
  .mba-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container dash (max-width: 340px) {
  .mba-feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mba-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 359px) {
  .mba-feature-grid { grid-template-columns: 1fr; }
  .mba-feature-card { min-height: 0; padding: 22px 12px 16px; }
  .mba-feature-card.is-locked { padding-top: 44px; }
}

[dir="rtl"] .mba-feature-card {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .mba-feature-card,
  .mba-feature-card:hover,
  .mba-feature-card:active {
    animation: none !important;
    transform: none;
    transition: none;
  }
  .mba-feature-sheen {
    display: none;
  }
}

html[data-theme="dark"] .mba-feature-card {
  --card-shadow: 0 8px 14px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(242, 201, 120, 0.08);
  background: linear-gradient(165deg, #2c261c 0%, #1c1914 100%);
  border-color: rgba(232, 182, 90, 0.32);
}

html[data-theme="dark"] .mba-feature-title { color: #f5f0e8; }
html[data-theme="dark"] .mba-feature-desc { color: #b7aea2; }
html[data-theme="dark"] .mba-feature-streak {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08) 46%, rgba(242, 201, 120, 0.12) 60%, transparent);
}

html[data-theme="dark"] .mba-feature-action {
  color: color-mix(in srgb, var(--fc) 70%, #fff);
  background: color-mix(in srgb, var(--fc) 22%, transparent);
}

/* Sidebar polish */
.sidebar .nav a {
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
.sidebar .nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}
.sidebar .nav a.active {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 #ffd400;
}
