/* ============================================
   Aurexa Academy — Premium Dashboard v2.0
   Charts, Badges, Fees, ID Card, Teacher Grid
   ============================================ */

/* ── Notice Ticker ── */
.notice-ticker {
  background: linear-gradient(90deg, var(--primary-dark), var(--bg-dark));
  padding: 10px 0; overflow: hidden;
  position: relative; z-index: calc(var(--z-navbar) - 1);
}
.notice-ticker-inner {
  display: flex; animation: ticker 30s linear infinite; white-space: nowrap;
}
.notice-ticker-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 40px;
  color: rgba(255,255,255,0.85); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  white-space: nowrap; flex-shrink: 0;
}
.notice-ticker-item .ticker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.notice-ticker-item.urgent { color: var(--accent-light); }
.notice-ticker-item.urgent .ticker-dot { background: var(--error); animation: pulse 1.5s infinite; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.notice-ticker:hover .notice-ticker-inner { animation-play-state: paused; }

/* ── Notice Board Grid (Home) ── */
.notice-board-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-lg);
}
.notice-board-card {
  background: var(--bg-elevated); border-radius: var(--radius-xl);
  padding: var(--space-xl); box-shadow: var(--shadow-card);
  border-left: 4px solid var(--brand); transition: all var(--transition-base);
  position: relative; overflow: hidden; border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand);
}
.notice-board-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.notice-board-card.urgent { border-left-color: var(--error); }
.notice-board-card.admission { border-left-color: var(--success); }
.notice-board-card.result { border-left-color: var(--accent); }
.notice-board-card.fee { border-left-color: #8B5CF6; }
.notice-board-card .notice-type-badge { position: absolute; top: 12px; right: 12px; font-size: var(--fs-xs); padding: 2px 10px; }
.notice-board-card h4 { font-size: var(--fs-base); margin-bottom: var(--space-sm); padding-right: 80px; }
.notice-board-card p { font-size: var(--fs-sm); margin-bottom: var(--space-md); color: var(--text-secondary); line-height: var(--lh-relaxed); }
.notice-board-card .notice-date { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ── Dashboard Page ── */
.dashboard-page {
  padding-top: calc(var(--navbar-height) + var(--space-2xl));
  padding-bottom: var(--space-3xl);
  background: var(--bg-secondary);
  background-image: var(--gradient-mesh);
  min-height: 100vh;
}

/* ── Welcome Banner ── */
.dash-welcome {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--gradient-hero); border-radius: var(--radius-2xl);
  padding: var(--space-2xl) var(--space-3xl); margin-bottom: var(--space-2xl);
  color: var(--text-light); position: relative; overflow: hidden;
}
.dash-welcome::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(var(--brand-rgb), 0.1);
}
.dash-welcome::after {
  content: ''; position: absolute; bottom: -30%; left: 20%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.08);
}
.dash-welcome-text { position: relative; z-index: 1; }
.dash-welcome-badge {
  display: inline-block; padding: 4px 14px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1); font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-md); color: var(--accent-light);
}
.dash-welcome h1 { color: var(--text-light) !important; font-size: var(--fs-2xl); margin-bottom: var(--space-xs); }
.dash-welcome p { color: rgba(255,255,255,0.6) !important; }
.dash-welcome-actions { display: flex; gap: var(--space-sm); position: relative; z-index: 1; }
.dash-welcome .btn-outline { border-color: rgba(255,255,255,0.2); color: white; }
.dash-welcome .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }
.dash-welcome .btn-ghost { color: rgba(255,255,255,0.8); }
.dash-welcome .btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }

/* ── Stat Cards ── */
.dash-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg); margin-bottom: var(--space-2xl);
}
.dash-stat-card {
  padding: var(--space-xl); border-radius: var(--radius-xl);
  background: var(--bg-elevated); box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  border: 1px solid var(--border-subtle);
}
.dash-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.dash-stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
.dash-stat-icon-wrap {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.dash-stat-icon-wrap.blue { background: rgba(var(--brand-rgb),0.1); color: var(--brand); }
.dash-stat-icon-wrap.green { background: rgba(var(--success-rgb),0.1); color: var(--success); }
.dash-stat-icon-wrap.orange { background: rgba(var(--accent-rgb),0.1); color: var(--accent); }
.dash-stat-icon-wrap.purple { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.dash-stat-trend {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  padding: 2px 8px; border-radius: var(--radius-full);
}
.dash-stat-trend.up { background: rgba(var(--success-rgb),0.1); color: var(--success); }
.dash-stat-trend.down { background: rgba(var(--error-rgb),0.1); color: var(--error); }
.dash-stat-trend.neutral { background: rgba(var(--accent-rgb),0.1); color: var(--accent); }
.dash-stat-value {
  font-family: var(--font-heading); font-weight: var(--fw-bold);
  font-size: var(--fs-2xl); color: var(--text-primary); line-height: 1.2;
}
.dash-stat-label {
  font-size: var(--fs-xs); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: var(--ls-wider); margin-top: 2px;
}
/* Legacy stat card support */
.dash-stat-icon { font-size: 32px; }
.dash-stat-card.blue { border-left: 3px solid var(--brand); }
.dash-stat-card.green { border-left: 3px solid var(--success); }
.dash-stat-card.orange { border-left: 3px solid var(--accent); }
.dash-stat-card.purple { border-left: 3px solid #8B5CF6; }

/* ── Dashboard Grids ── */
.dash-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--space-xl); }
.dash-grid-3 { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: var(--space-xl); }

/* ── Dashboard Cards ── */
.dash-card {
  background: var(--bg-elevated); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card); overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.dash-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}
.dash-card-header h3 { font-size: var(--fs-md); }
.dash-card-body { padding: var(--space-lg) var(--space-xl); }
.dash-card-tabs { display: flex; gap: 4px; }
.dash-tab {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent; border: 1px solid transparent;
}
.dash-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.dash-tab.active { background: var(--brand); color: white; border-color: var(--brand); }

/* ── Tables ── */
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  padding: 10px 12px; text-align: left;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--ls-wider);
  border-bottom: 2px solid var(--border-light); background: var(--bg-secondary);
}
.dash-table td { padding: 12px; font-size: var(--fs-sm); border-bottom: 1px solid var(--border-light); }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--bg-secondary); }

.student-cell { display: flex; align-items: center; gap: var(--space-sm); }
.student-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--gradient-brand); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: var(--fw-bold); flex-shrink: 0;
}

.progress-bar-wrap {
  width: 80px; height: 6px; background: var(--bg-tertiary);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar { height: 100%; border-radius: var(--radius-full); transition: width 1s ease; }

.dash-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) 0; margin-top: var(--space-md);
  border-top: 2px solid var(--border-light);
  font-weight: var(--fw-semibold); color: var(--text-primary);
}

.empty-state {
  text-align: center; padding: var(--space-3xl);
  color: var(--text-muted); font-style: italic;
}

/* ── Dashboard Notices ── */
.dash-notice {
  display: flex; gap: var(--space-md); padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}
.dash-notice:last-child { border-bottom: none; }
.dash-notice.urgent {
  background: rgba(var(--error-rgb),0.03);
  margin: 0 calc(-1 * var(--space-xl)); padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
}
.dash-notice-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dash-notice-dot.red { background: var(--error); }
.dash-notice-dot.blue { background: var(--brand); }
.dash-notice-title { font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-primary); margin-bottom: 2px; }
.dash-notice-content { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }
.dash-notice-date { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

/* ── Schedule Card ── */
.dash-schedule-card {
  display: flex; align-items: center; gap: var(--space-lg);
  padding: var(--space-lg); background: var(--bg-secondary);
  border-radius: var(--radius-lg); margin-bottom: var(--space-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}
.dash-schedule-card:hover { box-shadow: var(--shadow-sm); }
.dash-schedule-card:last-child { margin-bottom: 0; }
.dash-schedule-icon { font-size: 40px; }
.dash-schedule-info h4 { font-size: var(--fs-base); margin-bottom: 2px; }
.dash-schedule-info p { font-size: var(--fs-sm); margin-bottom: var(--space-sm); }
.dash-schedule-meta { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.dash-schedule-meta span { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ── Badges ── */
.badges-grid { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.badge-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--badge-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 20%, transparent);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--text-primary); transition: all var(--transition-fast);
}
.badge-item:hover { transform: scale(1.05); }
.badge-icon { font-size: 14px; }

/* ── Fee Tracker ── */
.fee-overview {
  display: flex; gap: var(--space-xl); margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg); border-bottom: 1px solid var(--border-light);
}
.fee-stat { display: flex; flex-direction: column; gap: 2px; }
.fee-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--ls-wider); }
.fee-value { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-primary); }
.fee-months { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.fee-month {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  border: 1px solid var(--border-light); min-width: 56px;
}
.fee-month.paid { background: rgba(var(--success-rgb),0.08); border-color: rgba(var(--success-rgb),0.2); }
.fee-month.paid .fee-month-icon { color: var(--success); }
.fee-month.pending { background: rgba(var(--accent-rgb),0.08); border-color: rgba(var(--accent-rgb),0.2); }
.fee-month.pending .fee-month-icon { color: var(--accent); }
.fee-month.upcoming { background: var(--bg-tertiary); color: var(--text-muted); }

/* ── Chart Progress Bars ── */
.chart-progress-item { margin-bottom: var(--space-md); }
.chart-progress-item:last-child { margin-bottom: 0; }
.chart-progress-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.chart-progress-label { font-size: var(--fs-xs); color: var(--text-secondary); }
.chart-progress-value { font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.chart-progress-track { height: 6px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.chart-progress-fill {
  height: 100%; border-radius: var(--radius-full);
  animation: progressGrow 1s ease forwards;
  transform-origin: left;
}
@keyframes progressGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Teacher Dashboard ── */
.teacher-classes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); }
.teacher-class-card {
  display: flex; align-items: flex-start; gap: var(--space-lg);
  padding: var(--space-lg); background: var(--bg-secondary);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}
.teacher-class-card:hover { box-shadow: var(--shadow-sm); border-color: rgba(var(--brand-rgb), 0.2); }
.teacher-class-icon { font-size: 36px; flex-shrink: 0; }
.teacher-class-info h4 { font-size: var(--fs-base); margin-bottom: 2px; }
.teacher-class-info p { font-size: var(--fs-sm); margin-bottom: var(--space-sm); color: var(--text-secondary); }
.teacher-class-meta { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.teacher-class-meta span {
  font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 3px;
  padding: 2px 8px; background: var(--bg-tertiary); border-radius: var(--radius-full);
}

/* ── Student ID Card ── */
.id-card {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  border-radius: var(--radius-xl); overflow: hidden; color: white;
}
.id-card-header {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0F172A;
}
.id-card-logo { font-size: 32px; }
.id-card-school { font-family: var(--font-heading); font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.id-card-subtitle { font-size: var(--fs-xs); opacity: 0.7; }
.id-card-body {
  padding: var(--space-xl);
  display: flex; align-items: center; gap: var(--space-xl);
}
.id-card-avatar {
  width: 72px; height: 72px; border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xl); font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.id-card-name {
  font-family: var(--font-heading); font-size: var(--fs-lg);
  font-weight: var(--fw-bold); margin-bottom: var(--space-sm);
}
.id-card-row {
  display: flex; gap: var(--space-sm); font-size: var(--fs-sm);
  margin-bottom: 4px;
}
.id-card-row span { color: rgba(255,255,255,0.5); min-width: 60px; }
.id-card-row strong { color: rgba(255,255,255,0.9); }
.id-card-footer {
  padding: var(--space-md) var(--space-xl);
  background: rgba(255,255,255,0.05); text-align: center;
  font-size: var(--fs-xs); color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-grid-3 > div:first-child { grid-column: span 1; }
}
@media (max-width: 900px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-welcome {
    flex-direction: column; gap: var(--space-md);
    text-align: center; padding: var(--space-xl);
  }
  .notice-board-grid { grid-template-columns: 1fr; }
  .teacher-classes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-stat-card { padding: var(--space-md); }
  .dash-table { font-size: var(--fs-xs); }
  .dash-table th, .dash-table td { padding: 8px 6px; }
  .id-card-body { flex-direction: column; text-align: center; }
  .fee-months { justify-content: center; }
}
