/* ═══════════════════════════════════════════════════
   EduConnect — Student Portal CSS
   Matches Figma design
═══════════════════════════════════════════════════ */

@import url('/css/logout-button.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #16a34a;
  --green-light:  #dcfce7;
  --green-dark:   #166534;
  --green-border: #86efac;
  --emerald:      #10b981;
  --amber:        #f59e0b;
  --amber-light:  #fffbeb;
  --amber-border: #fde68a;
  --orange:       #ea580c;
  --red:          #ef4444;
  --ink:          #0f172a;
  --muted:        #475569;
  --border:       #e5e7eb;
  --bg:           #f8fafc;
  --white:        #ffffff;
  --sidebar-w:    248px;
  --right-w:      300px;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Page Loader ──────────────────────────────── */
.sp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 14px;
  color: var(--muted);
  gap: 10px;
  background: var(--bg);
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ── Layout ───────────────────────────────────── */
.sp-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────── */
.sp-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.22s ease, min-width 0.22s ease, padding 0.22s ease;
}

.sp-sidebar.collapsed {
  width: 62px;
  min-width: 62px;
  padding: 20px 10px;
}

.sp-sidebar.collapsed .sidebar-logo-text,
.sp-sidebar.collapsed .sp-role-badge span,
.sp-sidebar.collapsed .sp-nav-label,
.sp-sidebar.collapsed .sp-bottom-chip span,
.sp-sidebar.collapsed .sp-user-info,
.sp-sidebar.collapsed .sp-logout-label { display: none; }

.sp-sidebar.collapsed .sp-user    { justify-content: center; }
.sp-sidebar.collapsed .sp-role-badge { justify-content: center; padding: 7px; }

/* Logo row */
.sp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sp-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.01em;
  flex: 1;
}

.sp-collapse-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Role badge */
.sp-role-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--green-border);
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: padding 0.22s;
}

/* Nav */
.sp-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sp-nav-item:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

.sp-nav-item.active {
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
  border-left-color: var(--green);
}

.sp-nav-item i { font-size: 17px; flex-shrink: 0; }

/* Bottom */
.sp-bottom {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-bottom-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 8px;
}

.sp-bottom-chip-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

.sp-bottom-chip span {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
}

.sp-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
}

.sp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 12px;
}

.sp-user-info { flex: 1; min-width: 0; }

.sp-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-user-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Logout styles → logout-button.css */

/* ── Content Area ─────────────────────────────── */
.sp-content {
  flex: 1;
  display: flex;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

.sp-main {
  flex: 1;
  padding: 28px 24px;
  min-width: 0;
  overflow-y: auto;
}

/* ── Right Panel ──────────────────────────────── */
.sp-right {
  width: var(--right-w);
  min-width: var(--right-w);
  padding: 28px 20px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Hero Card ────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-radius: 16px;
  padding: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.hero-welcome {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 4px;
}

.hero-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.15;
}

.hero-info {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 24px;
}

.hero-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255,255,255,0.85);
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat {}

.hero-stat-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}

.hero-stat-label {
  font-size: 12px;
  opacity: 0.75;
}

/* ── Section ──────────────────────────────────── */
.sp-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.sp-section:last-child { margin-bottom: 0; }

.sp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sp-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.sp-view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.sp-view-all:hover { color: var(--green-dark); text-decoration: underline; }

/* ── Event List Items ─────────────────────────── */
.event-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--white);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.event-list-item:last-child { margin-bottom: 0; }
.event-list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); border-color: #d1d5db; text-decoration: none; color: inherit; }

.event-list-body { flex: 1; min-width: 0; }

.event-list-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-list-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.event-list-meta span { display: flex; align-items: center; gap: 4px; }

.event-list-arrow {
  color: var(--muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Mandatory Pill ───────────────────────────── */
.mandatory-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ── Recent Activity ──────────────────────────── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--green);
  flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }
.activity-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.activity-date { font-size: 12px; color: var(--muted); margin-top: 1px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  flex-shrink: 0;
}

.sp-pill-green   { color: #166534; background: #dcfce7; border-color: #86efac; }
.sp-pill-gray    { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; }
.sp-pill-red     { color: #b91c1c; background: #fee2e2; border-color: #fca5a5; }
.sp-pill-amber   { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.sp-pill-blue    { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.sp-pill-violet  { color: #6d28d9; background: #ede9fe; border-color: #c4b5fd; }

/* ── Right Panel Cards ────────────────────────── */
.rp-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.rp-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.rp-card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Goal card */
.goal-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--green);
  margin-bottom: 10px;
}

.goal-progress-wrap {
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}

.goal-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.goal-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.goal-message {
  font-size: 13px;
  color: var(--green);
}

.goal-message strong { font-weight: 700; }

/* Action needed card */
.action-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.action-warning i { font-size: 18px; color: var(--amber); }

.action-warning-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.action-slip-card {
  background: var(--amber-light);
  border: 1px solid var(--amber-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.action-slip-type { font-size: 13px; font-weight: 600; color: var(--orange); margin-bottom: 2px; }
.action-slip-event { font-size: 13px; color: var(--orange); margin-bottom: 1px; }
.action-slip-due { font-size: 12px; color: var(--orange); }

.btn-upload {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.btn-upload:hover { background: #c2410c; }

/* Quick actions */
.quick-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.quick-action-item:last-child { margin-bottom: 0; }
.quick-action-item:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.07); border-color: #d1d5db; text-decoration: none; color: var(--ink); }

.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Full-page views (Events, Attendance, Profile) */
.sp-page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.sp-page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── Events View ─────────────────────────────── */
.events-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #14532d 45%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.events-hero::after {
  content: '';
  position: absolute;
  inset: auto -45px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.events-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.events-hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.events-hero-subtitle {
  max-width: 60ch;
  color: rgba(255,255,255,0.84);
  line-height: 1.6;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.events-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.events-metric {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(10px);
}

.events-metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.events-metric-label {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 600;
}

.events-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.events-panel,
.event-detail-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.events-panel { padding: 20px; }

.events-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.events-panel-title,
.event-detail-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.events-panel-sub,
.event-detail-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.events-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.events-grid {
  display: grid;
  gap: 12px;
}

.event-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.03), 0 10px 28px rgba(15,23,42,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.event-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #16a34a, #0f766e);
}

.event-card--qr::before { background: linear-gradient(180deg, #8b5cf6, #6366f1); }
.event-card--photo::before { background: linear-gradient(180deg, #f59e0b, #ea580c); }
.event-card--hybrid::before { background: linear-gradient(180deg, #0ea5e9, #14b8a6); }

.event-card:hover,
.event-card.is-selected {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.event-card-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 18px 18px 18px 22px;
}

.event-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.event-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.event-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
  max-width: 68ch;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.event-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.event-meta-chip i { font-size: 13px; color: var(--green-dark); }

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-card-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.event-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--white);
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 8px 18px rgba(22,163,74,0.18);
}

.event-action:hover { text-decoration: none; color: var(--white); }

.event-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-flag--mandatory { color: #b91c1c; background: #fee2e2; border: 1px solid #fca5a5; }
.event-flag--published { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.event-flag--upcoming { color: #1d4ed8; background: #dbeafe; border: 1px solid #93c5fd; }

.event-detail-panel {
  padding: 20px;
  position: sticky;
  top: 18px;
  align-self: start;
}

.event-detail-empty {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
}

.event-detail-banner {
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #16a34a 0%, #0f766e 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.event-detail-banner::after {
  content: '';
  position: absolute;
  right: -12px;
  top: -12px;
  width: 84px;
  height: 84px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.event-detail-meta {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.event-detail-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.event-detail-row:last-child { border-bottom: none; }

.event-detail-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-detail-row-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2px;
}

.event-detail-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

.event-detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.event-detail-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-detail-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.event-detail-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 10px 20px rgba(22,163,74,0.18);
}

.event-detail-btn--secondary {
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.events-compact-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* Attendance table */
.sp-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.sp-table { width: 100%; border-collapse: collapse; }

.sp-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.sp-table tbody td {
  font-size: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.sp-table tbody tr:last-child td { border-bottom: none; }
.sp-table tbody tr:hover td { background: #fafafa; }

/* Profile card */
.profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 16px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--green-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 12px;
}

.profile-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.profile-role { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.profile-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-field { }
.profile-field-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.profile-field-value { font-size: 14px; font-weight: 500; color: var(--ink); }

/* ── Skeleton ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 14px;
  margin-bottom: 6px;
}

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

/* ── Utility ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state i { font-size: 30px; color: #d1d5db; display: block; margin-bottom: 8px; }

.error-msg {
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Dashboard (Flutter-style) ───────────────── */

.dash-header {
  margin-bottom: 16px;
}

.dash-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text);
}

.dash-welcome {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

/* Attendance rate card (green gradient) */
.dash-att-card {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 16px;
  padding: 18px;
  color: #fff;
  box-shadow: 0 10px 20px rgba(34,197,94,.25);
  margin-bottom: 18px;
}

.dash-att-label {
  font-size: 14px;
  opacity: 0.9;
}

.dash-att-rate {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 8px;
}

.dash-att-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.dash-att-divider {
  height: 1px;
  background: rgba(255,255,255,.2);
  margin: 14px 0;
}

.dash-att-metrics {
  display: flex;
  justify-content: space-between;
}

.dash-att-metric {
  text-align: center;
}

.dash-att-metric-val {
  font-size: 20px;
  font-weight: 700;
}

.dash-att-metric-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Sections */
.dash-section {
  margin-bottom: 20px;
}

.dash-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.dash-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.dash-view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  text-decoration: none;
}

.dash-view-all:hover { text-decoration: underline; }

/* Action needed cards */
.dash-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}

.dash-action-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.dash-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dash-action-body { flex: 1; min-width: 0; }

.dash-action-title {
  font-weight: 700;
  font-size: 14px;
}

.dash-action-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.dash-action-arrow {
  color: var(--muted);
  flex-shrink: 0;
}

/* Announcement cards */
.dash-ann-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.dash-ann-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(59,130,246,.12);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dash-ann-body { flex: 1; min-width: 0; }

.dash-ann-title {
  font-weight: 700;
  font-size: 14px;
}

.dash-ann-content {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Event cards */
.dash-event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.dash-event-name {
  font-size: 15px;
  font-weight: 700;
}

.dash-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.dash-event-meta i { margin-right: 4px; }

/* Quick actions grid */
.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dash-quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s;
}

.dash-quick-tile:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.dash-quick-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.dash-quick-label {
  font-weight: 700;
  font-size: 13px;
}

/* Goal card */
.dash-goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.dash-goal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-goal-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16,185,129,.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.dash-goal-title {
  font-weight: 700;
  font-size: 14px;
}

.dash-goal-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 12px;
}

.dash-goal-bar-track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.dash-goal-bar-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.dash-goal-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* Check-in page */
.checkin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.checkin-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(34,197,94,.3);
}

.checkin-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.checkin-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkin-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
}

.checkin-input:focus {
  border-color: var(--green-dark);
}

.checkin-btn {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.checkin-msg {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkin-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.checkin-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.checkin-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* My QR page */
.qr-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.qr-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  max-width: 340px;
  width: 100%;
}

.qr-code-box {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.qr-code-box img,
.qr-code-box canvas {
  border-radius: 8px;
}

.qr-card-name {
  font-size: 16px;
  font-weight: 700;
}

.qr-card-sid {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.qr-card-dept {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.qr-card-hint {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Mobile Shell (matches Flutter MobileShell) ── */

.mobile-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

.mobile-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 100px;
  -webkit-overflow-scrolling: touch;
}

.mobile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-size: 14px;
  color: var(--muted);
  gap: 10px;
}

/* Bottom nav bar */
.bn-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.bn-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 64px;
  padding: 6px 0;
  text-decoration: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s;
  cursor: pointer;
}

.bn-tab i {
  font-size: 22px;
  line-height: 1;
}

.bn-tab.active {
  color: var(--green);
  font-weight: 700;
}

.bn-tab:hover {
  color: var(--green);
}

/* FAB slot spacer in bottom nav */
.bn-fab-slot {
  width: 56px;
  flex-shrink: 0;
}

/* Scan FAB (floating action button) */
.bn-fab {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 16px rgba(22,163,74,.4);
  z-index: 101;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  cursor: pointer;
}

.bn-fab:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(22,163,74,.5);
}

.bn-fab.active {
  background: var(--green-dark);
}

/* Mobile logout positioning handled in logout-button.css */

/* Clickable event cards */
.event-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
}

.event-clickable:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.event-list-arrow {
  color: var(--muted);
  font-size: 16px;
  flex-shrink: 0;
  align-self: center;
  margin-left: 8px;
}

.event-list-item {
  display: flex;
  align-items: center;
}

/* Event Detail Modal */
.evt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.evt-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.evt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 12px;
}

.evt-modal-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.evt-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
  transition: background 0.15s;
}

.evt-modal-close:hover {
  background: #e2e8f0;
}

.evt-modal-body {
  padding: 20px 24px;
}

.evt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.evt-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
  letter-spacing: 0.3px;
}

.evt-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
}

.evt-info-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--ink);
}

.evt-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.evt-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.evt-info-text {
  flex: 1;
  min-width: 0;
}

.evt-info-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}

.evt-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.evt-modal-footer {
  padding: 0 24px 24px;
}

/* ── Slip wallet, emergency portal, participation KPIs ── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.kpi-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.slip-wallet-grid {
  display: grid;
  gap: 12px;
}

.slip-wallet-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.slip-wallet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.slip-wallet-meta {
  font-size: 13px;
  color: var(--muted);
}

.slip-wallet-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink);
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
}

.emergency-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
}

.emergency-profile {
  text-align: center;
  margin-bottom: 8px;
}

.empty-card {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.empty-card i {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.evt-checkin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.sp-apk-download {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
}

.sp-apk-download:hover {
  color: #ffffff;
  opacity: 0.92;
  transform: translateY(-1px);
}

.sp-apk-download i.bi-android2 {
  color: #34d399;
  font-size: 1rem;
}

.sp-mobile-ios {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.sp-mobile-ios:hover {
  color: #111827;
  background: #f9fafb;
  transform: translateY(-1px);
}

.sp-mobile-ios i {
  font-size: 1rem;
}

.portal-download-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #bbf7d0;
  color: #15803d;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}

.portal-download-link:hover {
  color: #15803d;
  background: #dcfce7;
  transform: translateY(-1px);
}

.sp-download-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.sp-download-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.sp-download-platforms .sp-mobile-download {
  margin-bottom: 0;
  justify-content: center;
  padding: 0.55rem 0.45rem;
  font-size: 0.75rem;
  gap: 0.35rem;
}

.sp-download-platforms .sp-mobile-download span {
  white-space: nowrap;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
  .sp-right { display: none; }
  .events-shell { grid-template-columns: 1fr; }
  .event-detail-panel { position: static; }
}

@media (max-width: 768px) {
  .sp-sidebar { position: fixed; z-index: 100; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sp-sidebar.mobile-open { transform: translateX(0); }
  .sp-main { padding: 16px; }
  .events-metrics { grid-template-columns: 1fr; }
  .event-card-inner { grid-template-columns: 1fr; }
  .event-card-footer { flex-direction: column; align-items: flex-start; }
}
