/* =====================================================
   SahiHisab — Dashboard Redesign: "The Photographer's Ledger"

   Aesthetic: Warm industrial precision. Premium cash register
   meets studio light meter. Bold numbers, warm shadows,
   staggered reveals. Sunlight readable. No glassmorphism.

   Mobile-first 375px. Sidebar-collapse aware.
   body .class specificity — no !important.
   ===================================================== */


/* ─────────────────────────────────────────────────────
   LOAD ANIMATION — Shutter cascade
   Cards stagger in like frames advancing on film.
   ───────────────────────────────────────────────────── */

/* ── Entrance: sections cascade in ── */
@keyframes dashSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Entrance: individual items pop in ── */
@keyframes dashPopIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(10px); }
  60%  { transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Entrance: slide from left ── */
@keyframes dashSlideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Revenue bars grow in ── */
@keyframes dashBarGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Continuous: soft breathing glow on hero cards ── */
@keyframes dashBreathe {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
  50%      { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
}

/* ── Continuous: today's calendar dot pulse ── */
@keyframes dashTodayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
}

/* ── Continuous: dues card attention pulse ── */
@keyframes dashDuesPulse {
  0%, 100% { border-color: var(--danger, #ef4444); }
  50%      { border-color: rgba(239, 68, 68, 0.3); }
}

/* ── Continuous: subtle icon float on quick actions ── */
@keyframes dashIconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* ── Continuous: shimmer sweep across stat values ── */
@keyframes dashShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── Section entrance stagger ── */
body .dash-filter-bar       { animation: dashSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
body .aaj-ka-summary        { animation: dashSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both; }
body .quick-actions          { animation: dashSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both; }
body .jaldi-section          { animation: dashSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both; }
body .stats-grid             { animation: dashSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both; }
body .dash-grid              { animation: dashSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }

/* ── Individual items pop in with stagger ── */
body .aaj-summary-item:nth-child(1) { animation: dashPopIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }
body .aaj-summary-item:nth-child(2) { animation: dashPopIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both; }
body .aaj-summary-item:nth-child(3) { animation: dashPopIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both; }

body .stat-card:nth-child(1) { animation: dashPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both; }
body .stat-card:nth-child(2) { animation: dashPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both; }
body .stat-card:nth-child(3) { animation: dashPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.40s both; }
body .stat-card:nth-child(4) { animation: dashPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.46s both; }
body .stat-card:nth-child(5) { animation: dashPopIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.52s both; }

/* ── Jaldi pills slide in from left one by one ── */
body .jaldi-pill:nth-child(1) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
body .jaldi-pill:nth-child(2) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both; }
body .jaldi-pill:nth-child(3) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both; }
body .jaldi-pill:nth-child(4) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both; }
body .jaldi-pill:nth-child(5) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.44s both; }
body .jaldi-pill:nth-child(6) { animation: dashSlideRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.50s both; }

/* ── Booking rows slide in staggered ── */
body .dash-grid .client-row:nth-child(1) { animation: dashSlideRight 0.4s ease 0.35s both; }
body .dash-grid .client-row:nth-child(2) { animation: dashSlideRight 0.4s ease 0.42s both; }
body .dash-grid .client-row:nth-child(3) { animation: dashSlideRight 0.4s ease 0.49s both; }
body .dash-grid .client-row:nth-child(4) { animation: dashSlideRight 0.4s ease 0.56s both; }

/* ── Activity rows stagger ── */
body .activity-row:nth-child(1) { animation: dashSlideRight 0.4s ease 0.4s both; }
body .activity-row:nth-child(2) { animation: dashSlideRight 0.4s ease 0.47s both; }
body .activity-row:nth-child(3) { animation: dashSlideRight 0.4s ease 0.54s both; }


/* ─────────────────────────────────────────────────────
   0. DATE FILTER BAR
   Scrollable pill row — frosted strip feel.
   ───────────────────────────────────────────────────── */

body .dash-filter-bar {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

body .dash-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}

body .dash-filter-pills::-webkit-scrollbar {
  display: none;
}

body .dash-filter-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border, #e2e8f0);
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  flex-shrink: 0;
}

body .dash-filter-pill .material-symbols-rounded {
  font-size: 0.95rem;
}

body .dash-filter-pill:hover {
  border-color: var(--primary, #0ea5e9);
  color: var(--primary, #0ea5e9);
  background: rgba(14, 165, 233, 0.04);
}

body .dash-filter-pill.active {
  background: var(--primary, #0ea5e9);
  color: #fff;
  border-color: var(--primary, #0ea5e9);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
  transform: scale(1.05);
}

/* Mobile: show only Aaj, Mahina, Custom + currently active pill */
@media (max-width: 768px) {
  body .dash-filter-pill[data-period="all"]:not(.active),
  body .dash-filter-pill[data-period="week"]:not(.active),
  body .dash-filter-pill[data-period="quarter"]:not(.active),
  body .dash-filter-pill[data-period="year"]:not(.active) {
    display: none;
  }
}

body .dash-filter-pill:active {
  transform: scale(0.92);
}

body .dash-filter-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gray-50, #f8fafc);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}

body .dash-date-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--card, #fff);
  color: var(--text-primary, #1e293b);
  min-height: 40px;
}

body .dash-date-input:focus {
  border-color: var(--primary, #0ea5e9);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}


/* ─────────────────────────────────────────────────────
   1. AAJ KA SUMMARY — THE HERO SCOREBOARD
   These are THE numbers. Big, bold, unmissable.
   Warm gradient accents. Each card is a "meter reading".
   ───────────────────────────────────────────────────── */

body .aaj-ka-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

body .aaj-summary-item {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
  overflow: visible;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
  border-left: none;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(14,165,233,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* Warm gradient strip at top of each hero card */
body .aaj-summary-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

body .aaj-summary-item[data-aaj="bookings"]::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

body .aaj-summary-item[data-aaj="collection"]::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

body .aaj-summary-item[data-aaj="expenses"]::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Breathing glow — cards feel alive, like a heartbeat */
body .aaj-summary-item {
  animation: dashBreathe 4s ease-in-out infinite;
}
body .aaj-summary-item:nth-child(2) { animation-delay: 1.3s; }
body .aaj-summary-item:nth-child(3) { animation-delay: 2.6s; }

body .aaj-summary-item:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 2px 4px rgba(14,165,233,0.08), 0 6px 12px rgba(14,165,233,0.10), 0 1px 0 rgba(255,255,255,0.6) inset;
}

body .aaj-summary-item:active {
  transform: scale(0.97);
}

/* Icon circle */
body .aaj-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body .aaj-summary-icon .material-symbols-rounded {
  font-size: 1.1rem;
}

/* THE BIG NUMBER — full amounts, auto-shrink for long numbers */
body .aaj-summary-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(0.72rem, 2.8vw, 1rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

/* Collection card — same size, no extra emphasis */
body .aaj-summary-item[data-aaj="collection"] .aaj-summary-value {
  font-size: clamp(0.72rem, 2.8vw, 1rem);
}

body .aaj-summary-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Breakdown sub-text */
body .aaj-summary-item[data-aaj="collection"] > div > div[style*="font-size:0.6rem"] {
  font-size: 0.65rem;
  line-height: 1.3;
  margin-top: 3px;
  font-weight: 500;
  opacity: 0.8;
}


/* ─────────────────────────────────────────────────────
   2. QUICK ACTIONS — Precision Tool Grid
   Like a photographer's tool belt. 3x2 grid.
   Each button is a "tool" — tap to deploy.
   ───────────────────────────────────────────────────── */

body .quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  margin-top: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  padding-right: 0;
  scrollbar-width: none;
  position: static;
  -webkit-overflow-scrolling: touch;
}

body .quick-actions::before,
body .quick-actions::after {
  display: none;
}

@keyframes qaGlowSpin {
  from { --qa-glow-angle: 0deg; }
  to   { --qa-glow-angle: 360deg; }
}

@property --qa-glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

body .quick-actions::-webkit-scrollbar { display: none; }

body .quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  white-space: normal;
  width: 86px;
  min-width: 86px;
  text-align: center;
  line-height: 1.25;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(14,165,233,0.06), 0 1px 2px rgba(0,0,0,0.04);
  cursor: pointer;
  position: relative;
  z-index: 0;
  overflow: hidden;
  flex-shrink: 0;
}

/* Spinning glow border */
body .quick-action-btn::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  z-index: -2;
  border-radius: 11.5px;
  background: conic-gradient(
    from var(--qa-glow-angle, 0deg),
    transparent 0%,
    transparent 20%,
    #3b82f6 30%,
    #10b981 42%,
    #f59e0b 54%,
    #ec4899 66%,
    #0ea5e9 78%,
    transparent 88%,
    transparent 100%
  );
  animation: qaGlowSpin 3s linear infinite;
  opacity: 0.45;
}

/* Inner fill to mask gradient, showing only the glowing border */
body .quick-action-btn::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 9px;
  background: var(--card, #fff);
}

body .quick-action-btn:hover::before {
  opacity: 0.85;
}

body .quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(14,165,233,0.08), 0 6px 12px rgba(14,165,233,0.10);
}

body .quick-action-btn:active {
  transform: scale(0.95);
}

body .quick-action-btn .material-symbols-rounded {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

body .qa-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}


/* ─────────────────────────────────────────────────────
   3. JALDI ORDER — Speed Strip
   Horizontal scroll, pill-shaped. "Grab and go" feel.
   ───────────────────────────────────────────────────── */

body .jaldi-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(14,165,233,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

body .jaldi-section h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

body .jaldi-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body .jaldi-pills::-webkit-scrollbar {
  display: none;
}

body .jaldi-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--background, #F4F8FB);
  cursor: pointer;
  flex-shrink: 0;
  text-align: center;
  transition: all 0.2s ease;
}

body .jaldi-pill:hover {
  border-color: var(--primary, #0ea5e9);
  color: var(--primary, #0ea5e9);
}

body .jaldi-pill:active {
  transform: scale(0.95);
}

body .jaldi-pill .material-symbols-rounded {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

body .jaldi-pill span:last-child {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  line-height: 1.2;
  white-space: nowrap;
}


/* ─────────────────────────────────────────────────────
   4. STATS GRID — The Metrics Wall
   Each stat is a "gauge". Color accent + big number.
   Left border gradient for visual coding.
   ───────────────────────────────────────────────────── */

body .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

body .stat-card {
  background: var(--card, #fff);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(14,165,233,0.06), 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
  position: relative;
  min-width: 0;
  overflow: visible;
}

/* Thicker gradient left border via pseudo */
body .stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

/* Remove the old decorative ::after */
body .stat-card::after {
  display: none;
}

/* Color-code each card's left accent based on inline border-left */
body .stat-card[style*="border-left:3px solid var(--primary)"]::before {
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
}
body .stat-card[style*="border-left:3px solid var(--warning)"]::before {
  background: linear-gradient(180deg, #f59e0b, #fbbf24);
}
body .stat-card[style*="border-left:3px solid var(--success)"]::before {
  background: linear-gradient(180deg, #10b981, #34d399);
}
body .stat-card[style*="border-left:3px solid var(--danger)"]::before {
  background: linear-gradient(180deg, #ef4444, #f87171);
}

/* Hide the inline border-left since we use pseudo */
body .stat-card[style*="border-left:3px solid"] {
  border-left: 1.5px solid var(--border, #e2e8f0);
  padding-left: 18px;
}

body .stat-card:hover {
  box-shadow: 0 2px 4px rgba(14,165,233,0.08), 0 6px 12px rgba(14,165,233,0.10);
  transform: translateY(-3px) scale(1.02);
}

body .stat-card:active {
  transform: scale(0.97);
}

/* Dues stat card — pulsing border to grab attention */
body .stat-card[data-stat="dues"] {
  animation: dashDuesPulse 2s ease-in-out infinite;
}

body .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* Icon bounces on card hover */
body .stat-card:hover .stat-icon {
  transform: scale(1.1);
}

body .stat-icon .material-symbols-rounded {
  font-size: 1.2rem;
}

body .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(0.72rem, 2.5vw, 0.95rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}

body .stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  color: var(--text-secondary, #64748b);
  font-weight: 600;
  line-height: 1.2;
}

body .stat-card > div:last-child {
  min-width: 0;
  flex: 1;
}


/* ─────────────────────────────────────────────────────
   5. REVENUE TREND — Animated bars
   ───────────────────────────────────────────────────── */

body #dashRevenueTrend {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body #dashRevenueTrend .analytics-bar-fill {
  transform-origin: left;
  animation: dashBarGrow 0.8s ease 0.3s both;
}


/* ─────────────────────────────────────────────────────
   6. PAYMENT DUES ALERT
   ───────────────────────────────────────────────────── */

body #dashPaymentDues {
  margin-bottom: 16px;
}


/* ─────────────────────────────────────────────────────
   7. DASH GRID — Content panels
   Upcoming bookings, calendar, activity.
   ───────────────────────────────────────────────────── */

body .dash-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body .dash-grid .card {
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body .dash-grid .card-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

body .dash-grid .card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

/* Booking rows */
body .dash-grid .client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  min-height: 58px;
  transition: background 0.12s;
}

body .dash-grid .client-row:last-child {
  border-bottom: none;
}

body .dash-grid .client-row:hover {
  background: var(--gray-50, #f8fafc);
  padding-left: 22px;
}

body .dash-grid .client-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

/* Avatar scales up on row hover */
body .dash-grid .client-row:hover .client-avatar {
  transform: scale(1.08);
}

body .dash-grid .client-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

body .dash-grid .client-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

body .dash-grid .client-phone {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  color: var(--text-secondary, #64748b);
}

/* Due amount — bold and color-coded */
body .dash-grid .client-balance {
  flex-shrink: 0;
  text-align: right;
  margin-left: auto;
}

body .dash-grid .client-balance .amount {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

body .dash-grid .client-balance .amount.due {
  color: var(--danger, #ef4444);
}

body .dash-grid .client-balance .amount.clear {
  color: var(--success, #10b981);
}

body .dash-grid .client-balance .balance-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}


/* ─────────────────────────────────────────────────────
   8. ACTIVITY ROWS
   ───────────────────────────────────────────────────── */

body .activity-row {
  padding: 12px 18px;
  gap: 10px;
}

body .activity-row .stat-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
}

body .activity-row .stat-icon .material-symbols-rounded {
  font-size: 1rem;
}

body .activity-row .client-info {
  flex: 1;
  min-width: 0;
}

body .activity-row .client-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

body .activity-row .client-phone {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
}

body .activity-row .activity-time {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

body .activity-row .activity-time .material-symbols-rounded {
  font-size: 0.8rem;
}


/* ─────────────────────────────────────────────────────
   9. EMPTY STATE
   ───────────────────────────────────────────────────── */

body .dash-grid .empty-state {
  padding: 40px 20px;
  text-align: center;
}

body .dash-grid .empty-state p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary, #64748b);
}

body .dash-grid .empty-state-cta {
  margin-top: 12px;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 0.88rem;
  border-radius: 10px;
}


/* ─────────────────────────────────────────────────────
   10. MINI CALENDAR
   Solid, compact, high-contrast date grid.
   ───────────────────────────────────────────────────── */

body .calendar-legend-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

body .mini-calendar-card {
  background: var(--card, #fff);
  backdrop-filter: none;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body .mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
}

body .mini-cal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

body .mini-cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  color: var(--text-primary, #1e293b);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

body .mini-cal-nav:active {
  background: var(--primary, #0ea5e9);
  border-color: var(--primary, #0ea5e9);
  color: #fff;
  transform: scale(0.92);
}

body .mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  width: 100%;
}

body .mini-cal-dayname {
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  padding: 4px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body .mini-cal-day,
body .mini-cal-empty {
  aspect-ratio: 1 / 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

body .mini-cal-day {
  cursor: pointer;
  transition: background 0.12s ease;
}

body .mini-cal-day:active {
  background: rgba(14, 165, 233, 0.08);
}

/* Today — solid accent circle with living pulse */
body .mini-cal-day.today {
  background: var(--primary, #0ea5e9);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  animation: dashTodayPulse 2.5s ease-in-out infinite;
}

body .mini-cal-day.has-events {
  font-weight: 700;
}

body .mini-cal-daynum {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 600;
}

/* Event dots */
body .mini-cal-dots {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 3px;
}

body .mini-cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────
   11. COLOR LEGEND — Proper pill badges
   Not tiny dots. Actual readable, tappable badges.
   This is the FIX for the broken legend.
   ───────────────────────────────────────────────────── */

body .color-legend-card {
  background: var(--card, #fff);
  backdrop-filter: none;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body .color-legend-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary, #1e293b);
}

body .legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  min-height: 28px;
}

body .legend-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}


/* ─────────────────────────────────────────────────────
   RESPONSIVE — Wider phones (400px+)
   ───────────────────────────────────────────────────── */

@media (min-width: 400px) {
  body .aaj-summary-value {
    font-size: 1.5rem;
  }

  body .aaj-summary-item[data-aaj="collection"] .aaj-summary-value {
    font-size: 1.7rem;
  }

  body .aaj-summary-label {
    font-size: 0.75rem;
  }

  body .stat-value {
    font-size: 1.35rem;
  }

  body .quick-action-btn {
    font-size: 0.75rem;
    padding: 18px 8px;
    min-height: 80px;
  }
}


/* ─────────────────────────────────────────────────────
   RESPONSIVE — Tablet+ (769px)
   Two-column dash grid, horizontal layouts.
   ───────────────────────────────────────────────────── */

@media (min-width: 769px) {
  /* Summary — row with larger cards */
  body .aaj-ka-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  body .aaj-summary-item {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 22px 20px;
    gap: 16px;
    border-radius: 18px;
  }

  /* Colored left border on desktop hero cards */
  body .aaj-summary-item::before {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 4px;
    height: auto;
    border-radius: 18px 0 0 18px;
  }

  body .aaj-summary-value {
    font-size: 1.7rem;
  }

  body .aaj-summary-item[data-aaj="collection"] .aaj-summary-value {
    font-size: 1.9rem;
  }

  body .aaj-summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  body .aaj-summary-icon .material-symbols-rounded {
    font-size: 1.5rem;
  }

  body .aaj-summary-label {
    font-size: 0.8rem;
  }

  /* Quick Actions — single row */
  body .quick-actions {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  body .quick-action-btn {
    padding: 20px 10px;
    min-height: 88px;
    font-size: 0.8rem;
    border-radius: 16px;
  }

  body .quick-action-btn .material-symbols-rounded {
    font-size: 1.6rem;
  }

  /* Stats — auto-fit grid */
  body .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
  }

  body .stat-card {
    padding: 20px 18px;
    border-radius: 16px;
  }

  body .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  body .stat-value {
    font-size: 1.5rem;
  }

  body .stat-label {
    font-size: 0.78rem;
  }

  /* Dash Grid — two columns */
  body .dash-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: start;
  }

  /* Calendar+legend — row */
  body .calendar-legend-wrap {
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 0;
  }

  body .mini-calendar-card {
    padding: 20px 18px;
    flex: 1;
  }

  body .mini-cal-title {
    font-size: 1.05rem;
  }

  body .mini-cal-daynum {
    font-size: 0.85rem;
  }

  body .mini-cal-nav {
    width: 40px;
    height: 40px;
  }

  body .mini-cal-nav:hover {
    background: var(--primary, #0ea5e9);
    color: #fff;
    border-color: var(--primary, #0ea5e9);
  }

  /* Legend — vertical on desktop */
  body .legend-list {
    flex-direction: column;
    gap: 6px;
  }

  body .legend-item {
    width: fit-content;
  }

  /* Jaldi pills bigger */
  body .jaldi-pill {
    padding: 16px 20px;
    min-width: 88px;
  }

  /* Filter bar wider */
  body .dash-filter-bar {
    padding: 12px 18px;
  }
}


/* ─────────────────────────────────────────────────────
   RESPONSIVE — Large desktop (1200px+)
   Max comfort, big numbers, spacious layout.
   ───────────────────────────────────────────────────── */

@media (min-width: 1200px) {
  body .aaj-summary-value {
    font-size: 1.9rem;
  }

  body .aaj-summary-item[data-aaj="collection"] .aaj-summary-value {
    font-size: 2.1rem;
  }

  body .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  body .stat-value {
    font-size: 1.7rem;
  }

  body .stat-card {
    padding: 22px 20px;
  }

  body .dash-grid {
    gap: 24px;
  }
}


/* ─────────────────────────────────────────────────────
   SIDEBAR COLLAPSE AWARENESS
   When sidebar collapses on medium screens (1024-1279px),
   the main content area expands. Dashboard should
   re-flow gracefully.
   ───────────────────────────────────────────────────── */

@media (min-width: 1024px) and (max-width: 1279px) {
  /* When sidebar is icon-only (~60px), stats get more room */
  body .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  body .aaj-ka-summary {
    gap: 14px;
  }

  body .quick-actions {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
}

/* Sidebar expanded on large screens — content has less width */
@media (min-width: 1280px) {
  body .stats-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }

  body .aaj-ka-summary {
    gap: 18px;
  }

  body .dash-grid {
    grid-template-columns: 1.3fr 1fr;
  }
}


/* ─────────────────────────────────────────────────────
   DARK MODE
   Maintain high contrast. Warm card surfaces.
   ───────────────────────────────────────────────────── */

body.dark-mode .aaj-summary-item {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .stat-card {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .quick-action-btn {
  background: var(--card);
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

body.dark-mode .jaldi-pill {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

body.dark-mode .mini-calendar-card {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .color-legend-card {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .mini-cal-nav {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .legend-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

body.dark-mode .dash-filter-bar {
  background: var(--card);
  border-color: var(--border);
}

body.dark-mode .dash-filter-pill {
  border-color: var(--border);
}

body.dark-mode .dash-filter-pill.active {
  background: var(--primary, #0ea5e9);
  border-color: var(--primary, #0ea5e9);
  color: #fff;
}

body.dark-mode .dash-grid .client-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .mini-cal-day.today {
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}


/* ─────────────────────────────────────────────────────
   ACCESSIBILITY — Focus states
   High-contrast outlines for keyboard navigation.
   ───────────────────────────────────────────────────── */

body .stat-card:focus-visible,
body .aaj-summary-item:focus-visible,
body .quick-action-btn:focus-visible,
body .jaldi-pill:focus-visible,
body .dash-filter-pill:focus-visible,
body .mini-cal-nav:focus-visible {
  outline: 2px solid var(--primary, #0ea5e9);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}


/* ─────────────────────────────────────────────────────
   REDUCED MOTION
   Respect user preferences. Kill animations.
   ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  /* Kill all entrance animations */
  body .dash-filter-bar,
  body .aaj-ka-summary,
  body .quick-actions,
  body .jaldi-section,
  body .stats-grid,
  body .dash-grid,
  body .aaj-summary-item,
  body .stat-card,
  body .jaldi-pill,
  body .dash-grid .client-row,
  body .activity-row {
    animation: none;
  }

  /* Kill all continuous animations */
  body .aaj-summary-item { animation: none; }
  body .mini-cal-day.today { animation: none; }
  body .stat-card[data-stat="dues"] { animation: none; }
  body .quick-action-btn .material-symbols-rounded { animation: none; }

  body #dashRevenueTrend .analytics-bar-fill {
    animation: none;
  }

  /* Kill all transitions */
  body .aaj-summary-item,
  body .stat-card,
  body .quick-action-btn,
  body .jaldi-pill,
  body .mini-cal-nav,
  body .dash-grid .client-row,
  body .dash-grid .client-avatar,
  body .stat-icon,
  body .dash-filter-pill {
    transition: none;
  }

  /* Kill glow border */
  body .quick-action-btn::before {
    animation: none;
    opacity: 0;
  }
}


/* ─────────────────────────────────────────────────────
   MOBILE 375px FIXES
   Ensure dashboard elements don't cramp on small screens.
   This block loads last → wins cascade conflicts.
   ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  /* Aaj Ka Summary: 2 columns on small phones (not 3) */
  body .aaj-ka-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  body .aaj-summary-value {
    font-size: 1.15rem;
  }

  body .aaj-summary-item[data-aaj="collection"] .aaj-summary-value {
    font-size: 1.3rem;
  }

  body .aaj-summary-item {
    padding: 14px 12px;
    border-radius: 14px;
  }

  /* Quick actions: keep 3-col grid but tighten spacing */
  body .quick-actions {
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 16px;
  }

  body .quick-action-btn {
    padding: 12px 4px;
    min-height: 68px;
    font-size: 0.68rem;
    border-radius: 12px;
  }

  body .quick-action-btn .material-symbols-rounded {
    font-size: 1.2rem;
  }

  /* Stats grid: 2 columns */
  body .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Filter pills: smaller on mobile */
  body .dash-filter-pill {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  body .dash-filter-bar {
    padding: 8px 10px;
    margin-bottom: 12px;
  }

  /* Dash grid: full width on mobile */
  body .dash-grid {
    margin-left: -8px;
    margin-right: -8px;
  }
  body .dash-grid .card {
    border-radius: 12px;
  }
}

/* Dash grid wider on mobile (up to 768px) */
@media (max-width: 768px) {
  body .dash-grid {
    margin-left: -4px;
    margin-right: -4px;
    gap: 10px;
  }
}
