/* ── Dokanwala Official Dashboard Home ── */
.dashboard-page {
  min-height: 100%;
}

.dash-page-header {
  margin-bottom: var(--space-lg);
}

/* ── Overview panel ── */
.dash-overview-panel {
  margin-bottom: var(--space-lg);
}

.dash-controls-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-balance-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 2px solid #16a34a;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dash-balance-icon {
  display: flex;
  color: #16a34a;
  flex-shrink: 0;
}

.dash-balance-icon svg {
  width: 22px;
  height: 22px;
}

.dash-balance-text {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.dash-balance-text strong {
  font-family: var(--font-en);
  font-weight: 700;
}

.dash-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 0 14px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background 0.2s ease;
}

.dash-refresh-btn:hover {
  background: var(--color-hover);
}

.dash-refresh-btn.is-spinning .dash-refresh-icon {
  animation: dashSpin 0.7s linear infinite;
}

.dash-refresh-btn svg,
.dash-refresh-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dash-refresh-label {
  white-space: nowrap;
}

@keyframes dashSpin {
  to { transform: rotate(360deg); }
}

/* ── Period tabs ── */
.dash-period-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e8eaed;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dash-period-tabs::-webkit-scrollbar {
  display: none;
}

.dash-period-tab {
  flex: 1 0 auto;
  min-width: 0;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.dash-period-tab.is-active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Metrics grid ── */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.dash-metric-card {
  position: relative;
  padding: 14px 12px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  min-height: 88px;
}

.dash-metric-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.dash-metric-icon svg {
  width: 18px;
  height: 18px;
}

.dash-metric-icon.is-green {
  background: #dcfce7;
  color: #16a34a;
}

.dash-metric-icon.is-blue {
  background: #dbeafe;
  color: #2563eb;
}

.dash-metric-icon.is-orange {
  background: #ffedd5;
  color: #ea580c;
}

.dash-metric-icon.is-red {
  background: #fee2e2;
  color: #dc2626;
}

.dash-metric-label {
  display: block;
  padding-right: 36px;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.35;
  margin-bottom: 6px;
}

.dash-metric-value {
  display: block;
  font-family: var(--font-en);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

/* ── Promotional banner carousel ── */
.dash-banner {
  width: 100%;
  margin-bottom: var(--space-lg);
}

.dash-banner-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 280;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #f3f4f6;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-banner-carousel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
  will-change: transform;
}

.dash-banner-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  position: relative;
  display: block;
  opacity: 1;
  text-decoration: none;
}

.dash-banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (prefers-reduced-motion: reduce) {
  .dash-banner-track {
    transition: none;
  }
}

.dash-banner-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.dash-banner-dot {
  width: 28px;
  height: 5px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #d1d5db;
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}

.dash-banner-dot.is-active {
  width: 36px;
  background: var(--color-brand);
}

.dash-banner-dot:hover {
  background: #9ca3af;
}

.dash-banner-dot.is-active:hover {
  background: var(--color-brand-hover);
}

/* ── Featured & grids ── */
.dash-featured-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dash-featured-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 132px;
  padding: var(--space-lg);
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text-deep);
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 600;
  transition: all 0.2s ease;
}

.dash-featured-card:hover {
  background: #e8eaed;
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.dash-featured-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.dash-section {
  margin-bottom: var(--space-xl);
}

.dash-section-title {
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  padding-left: 10px;
  border-left: 3px solid var(--color-brand);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.dash-grid-wide {
  grid-template-columns: repeat(5, 1fr);
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 118px;
  padding: 18px 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text-deep);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  transition: all 0.2s ease;
}

.dash-tile:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.dash-tile img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

@media (min-width: 769px) {
  body.page-home .dashboard-page {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
  }

  .dash-page-header {
    margin-bottom: var(--space-lg);
  }

  .dash-overview-panel {
    margin-bottom: var(--space-xl);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .dash-controls-row {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-bottom: var(--space-lg);
  }

  .dash-balance-pill {
    flex: 0 0 auto;
    width: 220px;
    min-height: 48px;
    padding: 12px 16px;
  }

  .dash-balance-text {
    font-size: var(--text-md);
  }

  .dash-period-tabs {
    flex: 1;
    margin-bottom: 0;
    overflow-x: visible;
  }

  .dash-period-tab {
    flex: 1;
    padding: 12px 14px;
    font-size: var(--text-md);
  }

  .dash-refresh-btn {
    width: auto;
    min-width: 120px;
    height: 48px;
    padding: 0 18px;
    font-size: var(--text-md);
  }

  .dash-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .dash-metric-card {
    min-height: 100px;
    padding: 18px 16px 14px;
    border-color: #eeeeee;
  }

  .dash-metric-icon {
    width: 40px;
    height: 40px;
    top: 12px;
    right: 12px;
  }

  .dash-metric-icon svg {
    width: 20px;
    height: 20px;
  }

  .dash-metric-label {
    font-size: var(--text-sm);
    padding-right: 44px;
    margin-bottom: 8px;
  }

  .dash-metric-value {
    font-size: var(--text-lg);
  }

  .dash-featured-card {
    min-height: 140px;
    background: #f9fafb;
  }

  .dash-featured-card img {
    width: 64px;
    height: 64px;
  }

  .dash-sections-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
  }

  .dash-sections-split .dash-section {
    margin-bottom: 0;
  }

  .dash-sections-split .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-sections-split .dash-section-title {
    padding-left: 0;
    border-left: none;
  }
}

@media (max-width: 1200px) {
  .dash-grid-wide {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  body:not(.page-home) .dash-featured-row,
  body:not(.page-home) .dash-grid,
  body:not(.page-home) .dash-grid-wide {
    grid-template-columns: repeat(2, 1fr);
  }

  body.page-home .dash-featured-row {
    grid-template-columns: repeat(3, 1fr);
  }

  body.page-home .dash-grid,
  body.page-home .dash-grid-wide {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .dash-controls-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "balance refresh"
      "tabs tabs";
    gap: 10px;
  }

  .dash-balance-pill {
    grid-area: balance;
  }

  .dash-refresh-btn {
    grid-area: refresh;
    width: var(--touch-min);
    padding: 0;
  }

  .dash-refresh-label {
    display: none;
  }

  .dash-period-tabs {
    grid-area: tabs;
  }

  body.page-home .main-wrapper {
    padding: 8px 12px;
  }

  body.page-home .dashboard-page {
    padding: 12px;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .dash-overview-panel {
    margin-bottom: var(--space-md);
  }

  .dash-featured-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: var(--space-lg);
  }

  .dash-featured-card {
    min-height: 100px;
    padding: 12px 8px;
    font-size: var(--text-sm);
    gap: 8px;
  }

  .dash-featured-card img {
    width: 44px;
    height: 44px;
  }

  .dash-grid,
  .dash-grid-wide {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .dash-tile {
    min-height: 90px;
    padding: 12px 6px 10px;
    font-size: 11px;
    gap: 6px;
  }

  .dash-tile img {
    width: 36px;
    height: 36px;
  }

  .dash-section {
    margin-bottom: var(--space-lg);
  }

  .dash-section-title {
    font-size: var(--text-sm);
    margin-bottom: 10px;
  }

  .dash-banner-carousel {
    min-height: 80px;
  }
}
