@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cabinet+Grotesk:wght@400;500;700;800;900&display=swap');

/* ═══════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════ */
:root {
  --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cabinet Grotesk', 'Plus Jakarta Sans', sans-serif;
  --purple-dark:  #1a0440;
  --purple-mid:   #7904c2;
  --purple-main:  #8b14d4;
  --purple-card:  #6a0dad;
  --purple-deep:  #4a0080;
  --white:        #ffffff;
  --bg:           #f9f9f9;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */
.page {
  padding: 10px;
  font-family: var(--font-body);
  min-height: 100vh;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* ── Faint purple gradient on the page background ── */
.page {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(139, 20, 212, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(74, 0, 128, 0.06), transparent 60%),
    #faf8ff;
}

/* ── White panel behind the KPI cards ── */
.cardPanel {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow:
    0 2px 16px rgba(74, 0, 128, 0.08),
    0 12px 40px -16px rgba(74, 0, 128, 0.14);
  border: 1px solid rgba(74, 0, 128, 0.06);
}
.cardPanel .kpiGrid {
  margin-bottom: 0;
}
.container {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  min-height: calc(100vh - 56px);
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.header {
  margin-bottom: 28px;
  animation: fadeInUp 0.4s ease both;
}

.greeting {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--purple-dark);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.greetingAccent { color: var(--purple-mid); }

.greetingSub {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #888;
  font-weight: 400;
  letter-spacing: 0;
}

/* ═══════════════════════════════════════════
   KPI GRID
═══════════════════════════════════════════ */
.kpiGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════
   KPI CARD
═══════════════════════════════════════════ */
.kpiCard {
  border-radius: 14px;
  padding: 24px 20px;
  background: linear-gradient(135deg, #8b14d4 0%, #6a0dad 50%, #4a0080 100%);
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeInUp 0.4s ease both;
  border: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-body);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 4px 12px rgba(74, 0, 128, 0.25),
    0 12px 28px rgba(74, 0, 128, 0.15);
}

.kpiCard::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.kpiCard::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  pointer-events: none;
}

.kpiCard:hover {
  transform: translateY(-5px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 8px 20px rgba(74, 0, 128, 0.35),
    0 20px 48px rgba(74, 0, 128, 0.2);
}

/* ── Circular icon ── */
.kpiIcon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.1);
  transition: background 0.2s var(--ease);
  position: relative;
  z-index: 1;
}

.kpiCard:hover .kpiIcon {
  background: rgba(255,255,255,0.22);
}

/* ── Text ── */
.kpiBody {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.kpiValue {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.5px;
}

.kpiLabel {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Stagger animations ── */
.kpiCard:nth-child(1)  { animation-delay: 0.05s; }
.kpiCard:nth-child(2)  { animation-delay: 0.10s; }
.kpiCard:nth-child(3)  { animation-delay: 0.15s; }
.kpiCard:nth-child(4)  { animation-delay: 0.20s; }
.kpiCard:nth-child(5)  { animation-delay: 0.25s; }
.kpiCard:nth-child(6)  { animation-delay: 0.30s; }
.kpiCard:nth-child(7)  { animation-delay: 0.35s; }
.kpiCard:nth-child(8)  { animation-delay: 0.40s; }
.kpiCard:nth-child(9)  { animation-delay: 0.45s; }
.kpiCard:nth-child(10) { animation-delay: 0.50s; }
.kpiCard:nth-child(11) { animation-delay: 0.55s; }
.kpiCard:nth-child(12) { animation-delay: 0.60s; }

/* ═══════════════════════════════════════════
   BOTTOM PANELS
═══════════════════════════════════════════ */
.bottomRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: linear-gradient(135deg, #8b14d4 0%, #4a0080 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 22px;
  animation: fadeInUp 0.4s ease 0.6s both;
  font-family: var(--font-body);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 4px 12px rgba(74, 0, 128, 0.25),
    0 12px 28px rgba(74, 0, 128, 0.15);
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panelTitle {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.1px;
}

.panelBadge {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* ═══════════════════════════════════════════
   ACTIVITY LIST
═══════════════════════════════════════════ */
.activityList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activityItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  transition: background 0.2s var(--ease);
  font-family: var(--font-body);
}

.activityItem:hover { background: rgba(255,255,255,0.12); }

.activityDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activityContent { flex: 1; min-width: 0; }

.activityText {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activityTime {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

.activityStatus {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

/* ═══════════════════════════════════════════
   BAR CHART
═══════════════════════════════════════════ */
.chartBars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
}

.chartBar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: rgba(255,255,255,0.25);
  transition: background 0.2s var(--ease);
  animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: bottom;
  cursor: pointer;
}

.chartBar:hover { background: rgba(255,255,255,0.45); }
.chartBar.active { background: rgba(255,255,255,0.7); }

@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.chartLabels {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.chartLabel {
  flex: 1;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — COMPLETE MEDIA QUERIES
═══════════════════════════════════════════ */

/* ── Large Desktop (≥ 1440px) ── */
@media (min-width: 1440px) {
  .container        { padding: 36px; }
  .kpiGrid          { grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
  .kpiCard          { padding: 28px 24px; gap: 20px; }
  .kpiIcon          { width: 70px; height: 70px; }
  .kpiValue         { font-size: 2.2rem; }
  .kpiLabel         { font-size: 0.875rem; }
  .greeting         { font-size: 1.9rem; }
  .bottomRow        { gap: 20px; }
  .panel            { padding: 26px; }
  .panelTitle       { font-size: 1.05rem; }
  .chartBars        { height: 130px; }
}

/* ── Standard Desktop (1200px – 1439px) ── */
@media (min-width: 1200px) and (max-width: 1439px) {
  .kpiGrid   { grid-template-columns: repeat(4, 1fr); }
  .kpiValue  { font-size: 1.85rem; }
}

/* ── Small Desktop / Large Tablet (1025px – 1199px) ── */
@media (max-width: 1200px) {
  .kpiGrid { grid-template-columns: repeat(3, 1fr); }
  .kpiCard { padding: 20px 16px; gap: 14px; }
  .kpiIcon  { width: 56px; height: 56px; }
  .kpiValue { font-size: 1.7rem; }
}

/* ── Tablet Landscape (769px – 1024px) ── */
@media (max-width: 1024px) {
  .container  { padding: 20px; border-radius: 16px; }
  .kpiGrid    { grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
  .kpiCard    { padding: 18px 14px; gap: 13px; border-radius: 12px; }
  .kpiIcon    { width: 52px; height: 52px; }
  .kpiValue   { font-size: 1.55rem; }
  .kpiLabel   { font-size: 0.78rem; }
  .greeting   { font-size: 1.4rem; }
  .greetingSub{ font-size: 0.8rem; }
  .bottomRow  { gap: 12px; }
  .panel      { padding: 18px; }
  .chartBars  { height: 90px; }
  .panelTitle { font-size: 0.9rem; }
  .header     { margin-bottom: 20px; }
}

/* ── Tablet Portrait (577px – 768px) ── */
@media (max-width: 900px) {
  .kpiGrid   { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bottomRow { grid-template-columns: 1fr; }
  .panel     { animation-delay: 0s; }
}

@media (max-width: 768px) {
  .page       { padding: 8px; }
  .container  { padding: 16px; border-radius: 14px; min-height: calc(100vh - 40px); }
  .header     { margin-bottom: 18px; }
  .greeting   { font-size: 1.25rem; letter-spacing: -0.2px; }
  .greetingSub{ font-size: 0.78rem; }

  .kpiGrid    { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .kpiCard    { padding: 16px 13px; gap: 12px; border-radius: 12px; }
  .kpiIcon    { width: 46px; height: 46px; }
  .kpiValue   { font-size: 1.45rem; letter-spacing: -0.3px; }
  .kpiLabel   { font-size: 0.75rem; }

  .kpiCard:hover { transform: translateY(-2px); }

  .bottomRow  { grid-template-columns: 1fr; gap: 12px; }
  .panel      { padding: 16px; border-radius: 12px; }
  .panelTitle { font-size: 0.88rem; }
  .panelHeader{ margin-bottom: 14px; }
  .chartBars  { height: 80px; gap: 6px; }
  .chartLabel { font-size: 0.6rem; }

  .activityItem  { padding: 8px 10px; gap: 10px; }
  .activityText  { font-size: 0.78rem; }
  .activityTime  { font-size: 0.66rem; }
  .activityStatus{ font-size: 0.65rem; padding: 2px 6px; }
}

/* ── Mobile Large (481px – 576px) ── */
@media (max-width: 576px) {
  .container { padding: 14px; border-radius: 12px; }
  .kpiGrid   { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpiCard   { padding: 14px 12px; gap: 10px; }
  .kpiIcon   { width: 42px; height: 42px; }
  .kpiValue  { font-size: 1.35rem; }
  .kpiLabel  { font-size: 0.72rem; white-space: normal; }
  .panel     { padding: 14px; }
}

/* ── Mobile Small (≤ 480px) ── */
@media (max-width: 480px) {
  .page      { padding: 6px; }
  .container { padding: 12px; border-radius: 12px; }
  .header    { margin-bottom: 14px; }
  .greeting  { font-size: 1.15rem; }

  .kpiGrid   { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
  .kpiCard   { padding: 13px 11px; gap: 9px; border-radius: 10px; }
  .kpiIcon   { width: 38px; height: 38px; }
  .kpiValue  { font-size: 1.25rem; }
  .kpiLabel  { font-size: 0.7rem; white-space: normal; line-height: 1.2; }

  .bottomRow { gap: 10px; }
  .panel     { padding: 13px; border-radius: 10px; }
  .chartBars { height: 70px; gap: 5px; }
  .chartBar  { border-radius: 4px 4px 0 0; }
  .chartLabel{ font-size: 0.58rem; }

  .activityItem  { padding: 7px 9px; border-radius: 8px; }
  .activityText  { font-size: 0.76rem; }
  .activityDot   { width: 6px; height: 6px; }
}

/* ── Very Small (≤ 380px) ── */
@media (max-width: 380px) {
  .container { padding: 10px; }
  .kpiGrid   { grid-template-columns: 1fr 1fr; gap: 7px; }
  .kpiCard   { padding: 12px 10px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .kpiIcon   { width: 34px; height: 34px; }
  .kpiValue  { font-size: 1.15rem; }
  .kpiLabel  { font-size: 0.68rem; white-space: normal; }
  .greeting  { font-size: 1.05rem; }
  .greetingSub { font-size: 0.74rem; }
}

/* ── Full single column (≤ 600px can opt for this too) ── */
@media (max-width: 600px) {
  /* Keep 2-col grid for cards — feels better than 1-col on mobile */
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .kpiCard,
  .panel,
  .header         { animation: none !important; }
  .chartBar       { animation: none !important; }
  .kpiCard:hover  { transform: none !important; }
}

/* ── Print ── */
@media print {
  .page       { background: white; padding: 0; }
  .container  { box-shadow: none; border: none; padding: 16px; border-radius: 0; }
  .kpiCard    { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .panel      { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpiGrid    { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .bottomRow  { grid-template-columns: 1fr 1fr; }
}
/* ════════════════════════════════════════════════════════════════════
   KPI CARD — PREMIUM POLISH
   Paste this block at the very END of your dashboard.module.css.
   It refines the existing .kpiCard / .kpiIcon / .kpiValue rules
   (later rules win, so nothing above is removed).
   ════════════════════════════════════════════════════════════════════ */

.kpiCard {
  border-radius: 16px;
  /* richer, deeper royal-purple gradient with a diagonal light */
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,0.10) 0%, transparent 42%),
    linear-gradient(135deg, #9b1de9 0%, #6a0dad 48%, #2c0560 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 6px 16px rgba(74, 0, 128, 0.28),
    0 16px 40px -12px rgba(74, 0, 128, 0.45);
  overflow: hidden;
}

/* glassy sheen that sweeps across on hover */
.kpiCard::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 90%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255,255,255,0.14) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.kpiCard:hover::before {
  left: 130%;
}

.kpiCard:hover {
  transform: translateY(-6px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    0 10px 22px rgba(74, 0, 128, 0.38),
    0 26px 56px -14px rgba(74, 0, 128, 0.55);
}

/* icon as a glass tile with an inner highlight + soft glow */
.kpiIcon {
  border-radius: 14px;
  background: rgba(255,255,255,0.16) !important;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 4px 12px rgba(0,0,0,0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease),
              box-shadow 0.2s var(--ease);
}

.kpiCard:hover .kpiIcon {
  background: rgba(255,255,255,0.26) !important;
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    0 0 18px rgba(196,181,253,0.35);
}

/* slightly crisper number + label hierarchy */
.kpiValue {
  letter-spacing: -0.6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.kpiLabel {
  color: rgba(255,255,255,0.82);
  font-weight: 500;
  letter-spacing: 0.1px;
}