/**
 * HomeUni — Dashboard & Role-specific Styles
 * Tile grids for staff dashboards, role-specific layouts
 */

/* ============================================================
   STAFF TILE GRID (shared by PM, HR, COO, IT Admin dashboards)
   ============================================================ */
.hu-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--hu-space-6);
  margin-bottom: var(--hu-space-8);
}

.hu-tile {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-8) var(--hu-space-6);
  cursor: pointer;
  text-align: center;
  transition: all 250ms ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hu-space-3);
  position: relative;
  overflow: hidden;
}
.hu-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hu-gold-pale);
  opacity: 0;
  transition: opacity var(--hu-transition-fast);
}
.hu-tile:hover {
  transform: translateY(-4px);
  border-color: var(--hu-gold);
  box-shadow: var(--hu-shadow-gold);
}
.hu-tile:hover::before { opacity: 1; }
.hu-tile:active { transform: translateY(-2px); }

.hu-tile__icon {
  font-size: 2.5rem;
  color: var(--hu-gold);
  position: relative;
  z-index: 1;
  line-height: 1;
}

.hu-tile__label {
  font-size: var(--hu-text-sm);
  font-weight: var(--hu-font-semibold);
  color: var(--hu-text-primary);
  position: relative;
  z-index: 1;
  line-height: var(--hu-leading-tight);
}

.hu-tile__count {
  font-size: var(--hu-text-xs);
  color: var(--hu-text-secondary);
  position: relative;
  z-index: 1;
}

.hu-tile__badge {
  position: absolute;
  top: var(--hu-space-3);
  right: var(--hu-space-3);
  background: var(--hu-error);
  color: white;
  font-size: 10px;
  font-weight: var(--hu-font-bold);
  padding: 2px 5px;
  border-radius: var(--hu-radius-full);
  min-width: 18px;
  text-align: center;
  z-index: 2;
}

/* Tile color variants */
.hu-tile--gold   { border-color: rgba(21,101,192,0.3); }
.hu-tile--blue   { --tile-color: var(--hu-info); }
.hu-tile--green  { --tile-color: var(--hu-success); }
.hu-tile--purple { --tile-color: #A855F7; }
.hu-tile--red    { --tile-color: var(--hu-error); }

.hu-tile--gold .hu-tile__icon   { color: var(--hu-gold); }
.hu-tile--blue .hu-tile__icon   { color: var(--hu-info); }
.hu-tile--green .hu-tile__icon  { color: var(--hu-success); }
.hu-tile--purple .hu-tile__icon { color: #A855F7; }
.hu-tile--red .hu-tile__icon    { color: var(--hu-error); }

/* ============================================================
   STUDENT DASHBOARD
   ============================================================ */
.hu-dashboard-hero {
  background: var(--hu-gradient-hero);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-2xl);
  padding: var(--hu-space-10) var(--hu-space-10);
  margin-bottom: var(--hu-space-8);
  position: relative;
  overflow: hidden;
}
.hu-dashboard-hero::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: var(--hu-gold-glow);
  pointer-events: none;
}
.hu-dashboard-hero::before {
  content: '';
  position: absolute;
  bottom: -40px; left: 200px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(21,101,192,0.08);
  pointer-events: none;
}

.hu-dashboard-hero__greeting {
  font-size: var(--hu-text-sm);
  color: var(--hu-gold);
  font-weight: var(--hu-font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--hu-space-2);
  position: relative;
}

.hu-dashboard-hero__name {
  font-size: var(--hu-text-4xl);
  font-weight: var(--hu-font-bold);
  color: var(--hu-text-primary);
  margin-bottom: var(--hu-space-2);
  position: relative;
}

.hu-dashboard-hero__subtitle {
  color: var(--hu-text-secondary);
  font-size: var(--hu-text-base);
  position: relative;
}

.hu-dashboard-hero__wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--hu-space-2);
  background: var(--hu-gold-pale);
  border: 1px solid rgba(21,101,192,0.3);
  border-radius: var(--hu-radius-full);
  padding: var(--hu-space-2) var(--hu-space-4);
  font-size: var(--hu-text-sm);
  font-weight: var(--hu-font-semibold);
  color: var(--hu-gold);
  margin-top: var(--hu-space-5);
  cursor: pointer;
  transition: all var(--hu-transition-fast);
  position: relative;
}
.hu-dashboard-hero__wallet-pill:hover { background: rgba(21,101,192,0.2); }

/* Continue Learning Rail */
.hu-continue-rail {
  margin-bottom: var(--hu-space-8);
}

.hu-continue-card {
  display: flex;
  align-items: center;
  gap: var(--hu-space-5);
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-5);
  cursor: pointer;
  transition: all var(--hu-transition-fast);
  text-decoration: none;
  color: inherit;
}
.hu-continue-card:hover { border-color: var(--hu-gold); box-shadow: var(--hu-shadow-gold); }

.hu-continue-card__thumb {
  width: 80px; height: 60px;
  border-radius: var(--hu-radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hu-gradient-hero);
  display: flex; align-items: center; justify-content: center;
  color: var(--hu-gold-dim);
  font-size: 1.5rem;
}

.hu-continue-card__info { flex: 1; min-width: 0; }
.hu-continue-card__programme { font-size: var(--hu-text-xs); color: var(--hu-text-muted); margin-bottom: 4px; }
.hu-continue-card__lesson { font-size: var(--hu-text-sm); font-weight: var(--hu-font-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: var(--hu-space-2); }
.hu-continue-card__progress { width: 100%; }

.hu-continue-card__action {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: var(--hu-gold-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--hu-gold);
  font-size: 1.1rem;
  transition: all var(--hu-transition-fast);
}
.hu-continue-card:hover .hu-continue-card__action { background: var(--hu-gold); color: var(--hu-text-inverse); }

/* ============================================================
   COO / IT ADMIN — REPORT CHARTS AREA
   ============================================================ */
.hu-chart-card {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-6);
}

.hu-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--hu-space-5);
}

.hu-chart-title {
  font-weight: var(--hu-font-semibold);
  font-size: var(--hu-text-base);
}

.hu-chart-container {
  position: relative;
  height: 280px;
}

.hu-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hu-space-4);
  margin-top: var(--hu-space-4);
}

.hu-chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--hu-space-2);
  font-size: var(--hu-text-xs);
  color: var(--hu-text-secondary);
}

.hu-chart-legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   PROGRAMME MANAGER — CONTENT CREATION
   ============================================================ */
.hu-module-builder {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  overflow: hidden;
}

.hu-module-row {
  border-bottom: 1px solid var(--hu-border);
  transition: background var(--hu-transition-fast);
}
.hu-module-row:last-child { border-bottom: none; }
.hu-module-row:hover { background: var(--hu-bg-overlay); }

.hu-module-row__header {
  padding: var(--hu-space-4) var(--hu-space-5);
  display: flex;
  align-items: center;
  gap: var(--hu-space-4);
  cursor: pointer;
}

.hu-module-row__drag { color: var(--hu-text-muted); cursor: grab; }
.hu-module-row__title { flex: 1; font-weight: var(--hu-font-medium); font-size: var(--hu-text-sm); }
.hu-module-row__count { font-size: var(--hu-text-xs); color: var(--hu-text-muted); }

.hu-lesson-row {
  padding: var(--hu-space-3) var(--hu-space-5) var(--hu-space-3) var(--hu-space-12);
  display: flex;
  align-items: center;
  gap: var(--hu-space-3);
  border-top: 1px solid var(--hu-border-subtle);
  font-size: var(--hu-text-sm);
  color: var(--hu-text-secondary);
  transition: background var(--hu-transition-fast);
}
.hu-lesson-row:hover { background: rgba(255,255,255,0.02); }
.hu-lesson-row__type-icon { color: var(--hu-gold-dim); font-size: 1rem; flex-shrink: 0; }
.hu-lesson-row__title { flex: 1; color: var(--hu-text-primary); }
.hu-lesson-row__duration { font-size: var(--hu-text-xs); color: var(--hu-text-muted); }

/* ============================================================
   GRADING QUEUE
   ============================================================ */
.hu-grade-card {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-5);
  margin-bottom: var(--hu-space-4);
}
.hu-grade-card__header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--hu-space-3); }
.hu-grade-card__student { display: flex; align-items: center; gap: var(--hu-space-3); }
.hu-grade-card__assignment { font-size: var(--hu-text-sm); color: var(--hu-text-secondary); margin-bottom: var(--hu-space-3); }
.hu-grade-card__submission { background: var(--hu-bg-surface); border-radius: var(--hu-radius-md); padding: var(--hu-space-3); font-size: var(--hu-text-sm); color: var(--hu-text-secondary); margin-bottom: var(--hu-space-4); }
.hu-grade-input { display: flex; align-items: center; gap: var(--hu-space-3); }
.hu-grade-input__score { width: 80px; }

/* ============================================================
   SYSTEM HEALTH (IT Admin)
   ============================================================ */
.hu-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--hu-space-4);
  margin-bottom: var(--hu-space-6);
}

.hu-health-item {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-5);
}
.hu-health-item__label { font-size: var(--hu-text-xs); color: var(--hu-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--hu-space-2); }
.hu-health-item__value { font-size: var(--hu-text-xl); font-weight: var(--hu-font-bold); color: var(--hu-text-primary); }
.hu-health-item__status { font-size: var(--hu-text-xs); margin-top: var(--hu-space-1); }

/* ============================================================
   APPROVAL QUEUE CARDS
   ============================================================ */
.hu-approval-card {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--hu-space-5);
  margin-bottom: var(--hu-space-4);
  transition: all var(--hu-transition-fast);
}
.hu-approval-card:hover { border-color: rgba(21,101,192,0.3); }
.hu-approval-card__info { flex: 1; }
.hu-approval-card__name { font-weight: var(--hu-font-semibold); margin-bottom: var(--hu-space-1); }
.hu-approval-card__meta { font-size: var(--hu-text-sm); color: var(--hu-text-secondary); margin-bottom: var(--hu-space-3); }
.hu-approval-card__actions { display: flex; gap: var(--hu-space-2); }

/* ============================================================
   CALENDAR/SCHEDULE (Live Sessions)
   ============================================================ */
.hu-session-card {
  background: var(--hu-bg-elevated);
  border: 1px solid var(--hu-border);
  border-left: 4px solid var(--hu-gold);
  border-radius: var(--hu-radius-xl);
  padding: var(--hu-space-4) var(--hu-space-5);
  margin-bottom: var(--hu-space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--hu-space-4);
  transition: all var(--hu-transition-fast);
}
.hu-session-card:hover { box-shadow: var(--hu-shadow-md); }
.hu-session-card.live { border-left-color: var(--hu-success); }
.hu-session-card.cancelled { border-left-color: var(--hu-error); opacity: 0.6; }
.hu-session-card__time { flex-shrink: 0; text-align: center; min-width: 60px; }
.hu-session-card__time .date { font-size: var(--hu-text-2xl); font-weight: var(--hu-font-bold); color: var(--hu-text-primary); line-height: 1; }
.hu-session-card__time .month { font-size: var(--hu-text-xs); color: var(--hu-text-muted); text-transform: uppercase; }
.hu-session-card__info { flex: 1; }
.hu-session-card__title { font-weight: var(--hu-font-semibold); margin-bottom: 2px; }
.hu-session-card__facilitator { font-size: var(--hu-text-sm); color: var(--hu-text-secondary); margin-bottom: var(--hu-space-2); }
.hu-session-card__details { font-size: var(--hu-text-xs); color: var(--hu-text-muted); display: flex; gap: var(--hu-space-4); }

/* ============================================================
   LIVE BADGE
   ============================================================ */
.hu-live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--hu-space-2);
  background: var(--hu-error-bg);
  border: 1px solid var(--hu-error-border);
  color: var(--hu-error);
  font-size: var(--hu-text-xs);
  font-weight: var(--hu-font-bold);
  padding: 2px 8px;
  border-radius: var(--hu-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hu-live-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--hu-error);
  border-radius: 50%;
  animation: hu-pulse 1.5s ease infinite;
}

/* ============================================================
   RESPONSIVE — DASHBOARD
   ============================================================ */
@media (max-width: 1024px) {
  .hu-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--hu-space-4);
  }
  .hu-tile { padding: var(--hu-space-6) var(--hu-space-4); }
}

@media (max-width: 768px) {
  .hu-tile-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hu-space-3);
  }
  .hu-tile { padding: var(--hu-space-5) var(--hu-space-3); }
  .hu-tile__icon { font-size: 1.75rem; }
  .hu-dashboard-hero { padding: var(--hu-space-6); }
  .hu-dashboard-hero__name { font-size: var(--hu-text-3xl); }
  .hu-chat-layout { grid-template-columns: 1fr; }
  .hu-chat-rooms { display: none; }
  .hu-chat-rooms.show { display: flex; position: fixed; inset: 0; z-index: var(--hu-z-overlay); background: var(--hu-bg-surface); }
  .hu-lesson-layout { grid-template-columns: 1fr; }
  .hu-lesson-sidebar { display: none; }
  .hu-lesson-sidebar.show { display: block; position: fixed; inset: 0; z-index: var(--hu-z-overlay); border-radius: 0; }
}

@media (max-width: 480px) {
  .hu-tile-grid { grid-template-columns: repeat(2, 1fr); }
  .hu-chart-container { height: 200px; }
}
