/* ============================================================
   Plant Green Inertia LMS — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --green-900: #0d2318;
  --green-800: #133621;
  --green-700: #1a5c30;
  --green-600: #1e7a3c;
  --green-500: #22a24e;
  --green-400: #38c96b;
  --green-300: #6ddc97;
  --green-200: #a8efc3;
  --green-100: #d4f7e4;
  --green-50:  #edfaf3;

  --bg:        #f5f9f6;
  --bg-card:   #ffffff;
  --bg-sidebar:#0d2318;
  --text-dark: #0d2318;
  --text-mid:  #3d6b50;
  --text-muted:#7aaa8d;
  --border:    #d4e8dc;
  --shadow-sm: 0 1px 4px rgba(13,35,24,0.07);
  --shadow-md: 0 4px 16px rgba(13,35,24,0.10);
  --shadow-lg: 0 8px 32px rgba(13,35,24,0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --sidebar-w: 240px;
  --header-h: 64px;

  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --urgent:   #ef4444;
  --warning:  #f59e0b;
  --info:     #3b82f6;
  --success:  #22c55e;
}

[data-theme="dark"] {
  --bg:        #0a1a12;
  --bg-card:   #12261a;
  --bg-sidebar:#060f09;
  --text-dark: #e8f5ee;
  --text-mid:  #9ecfb0;
  --text-muted:#4d7a60;
  --border:    #1e3d2a;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: var(--green-500);
  background-color: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-text .brand { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.3px; color: #fff; }
.sidebar-logo-text .sub { font-size: 10px; color: rgba(255,255,255,0.45); letter-spacing: 1px; text-transform: uppercase; }


.sidebar-logo-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}


/* User profile in sidebar */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  margin: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.10); }
.sidebar-avatar {
  width: 36px; height: 36px;
  background: var(--green-500);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: #fff; flex-shrink: 0;
}
.sidebar-user-info .name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-info .role { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 1px; }

/* XP bar */
.sidebar-xp {
  padding: 0 20px 4px;
}
.xp-label { display: flex; justify-content: space-between; font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 5px; }
.xp-track {
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden;
}
.xp-fill {
  height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-300));
  border-radius: 99px; transition: width 0.8s ease;
}

/* Search */
.sidebar-search {
  margin: 12px 14px;
  position: relative;
}
.sidebar-search input {
  width: 100%; padding: 9px 12px 9px 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: #fff; font-size: 12px; outline: none;
  transition: background 0.2s;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,0.3); }
.sidebar-search input:focus { background: rgba(255,255,255,0.12); }
.sidebar-search .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.3); font-size: 13px;
}

/* Nav sections */
.nav-section { padding: 8px 0; }
.nav-section-title {
  padding: 6px 20px 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
}
.nav-item {
  display: flex; align-items: center;
  padding: 10px 20px; gap: 11px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.65);
  border-radius: 0; cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: #fff;
  background: rgba(34,162,78,0.25);
  border-left: 3px solid var(--green-400);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--urgent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px;
  min-width: 18px; text-align: center;
}
.nav-badge.green { background: var(--green-500); }

/* Sidebar bottom */
.sidebar-bottom {
  margin-top: auto;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.storage-info { padding: 8px 20px; }
.storage-label { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 5px; }
.storage-bar { height: 3px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.storage-fill { height: 100%; background: var(--green-400); border-radius: 99px; width: 38%; }
.storage-text { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 3px; }

/* ── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { flex: 1; }
.topbar-title h1 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-dark); }
.topbar-title p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.streak-badge {
  display: flex; align-items: center; gap: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-mid);
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.icon-btn:hover { background: var(--green-50); border-color: var(--green-300); }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; background: var(--urgent);
  border-radius: 50%; border: 2px solid var(--bg-card);
}

/* ── Filter Tabs ───────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 5px; background: #fff;
  border-radius: 14px; border: 1.5px solid #e5e7eb;
  width: fit-content; box-shadow: 0 2px 6px rgba(0,0,0,.07);
  margin-bottom: 24px;
}
.filter-tabs .tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 10px; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; background: transparent; color: #888;
  transition: all .2s cubic-bezier(.34,1.4,.64,1);
}
.filter-tabs .tab:hover { background: #f3f4f6; color: #444; transform: translateY(-1px); }
.filter-tabs .tab.active { color: #fff; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.filter-tabs .tab .badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 11px; font-weight: 700; padding: 0 5px;
}
/* Active badge always white */
.filter-tabs .tab.active .badge { background: rgba(255,255,255,.28) !important; color: #fff !important; }

/* Green — Courses */
.tabs-courses .tab.active { background: linear-gradient(135deg,#2d7a3a,#4caf50); }
.tabs-courses .tab:not(.active) .badge { background: #e8f5e9; color: #2d7a3a; }

/* Amber — Assignments */
.tabs-assignments .tab.active { background: linear-gradient(135deg,#b45309,#f59e0b); }
.tabs-assignments .tab:not(.active) .badge { background: #fef3c7; color: #b45309; }

/* Purple — Quiz */
.tabs-quiz .tab.active { background: linear-gradient(135deg,#6d28d9,#8b5cf6); }
.tabs-quiz .tab:not(.active) .badge { background: #ede9fe; color: #6d28d9; }

/* Blue — Leaderboard */
.tabs-leaderboard .tab.active { background: linear-gradient(135deg,#1d4ed8,#3b82f6); }
.tabs-leaderboard .tab:not(.active) .badge { background: #dbeafe; color: #1d4ed8; }

/* Teal — Notifications */
.tabs-notifications .tab.active { background: linear-gradient(135deg,#0f766e,#14b8a6); }
.tabs-notifications .tab:not(.active) .badge { background: #ccfbf1; color: #0f766e; }
.tabs-notifications .tab:not(.active) .badge-success { background: #dcfce7; color: #16a34a; }
.tabs-notifications .tab:not(.active) .badge-warning { background: #fef9c3; color: #ca8a04; }
.tabs-notifications .tab:not(.active) .badge-info    { background: #dbeafe; color: #1d4ed8; }

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-dark); border-radius: 2px;
  transition: all 0.3s;
}

/* ── Page Content ───────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px;
}
.stat-badge.green { background: var(--green-100); color: var(--green-700); }
.stat-badge.blue { background: #dbeafe; color: #1d4ed8; }
.stat-badge.orange { background: #fff7ed; color: #c2410c; }
.stat-icon { font-size: 24px; margin-bottom: 12px; }
.stat-value {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--text-dark); line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Section Headers ────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.view-all {
  font-size: 13px; color: var(--green-600); font-weight: 600;
  cursor: pointer; transition: color 0.2s;
}
.view-all:hover { color: var(--green-500); }

/* ── Course Cards ───────────────────────────────────────── */
.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.course-card:hover { box-shadow: var(--shadow-md); border-color: var(--green-200); }
.course-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.course-info { flex: 1; min-width: 0; }
.course-title { font-weight: 700; font-size: 15px; color: var(--text-dark); }
.course-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.course-progress { margin-top: 10px; }
.progress-bar {
  height: 6px; background: var(--green-100);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500), var(--green-400));
  border-radius: 99px; transition: width 0.8s ease;
}
.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }
.course-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: var(--green-700);
  color: #fff;
}
.btn-primary:hover { background: var(--green-600); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--green-300);
  color: var(--green-700);
}
.btn-outline:hover { background: var(--green-50); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-danger { background: #fee2e2; color: var(--urgent); }
.btn-danger:hover { background: var(--urgent); color: #fff; }

/* ── Mode Tags ──────────────────────────────────────────── */
.mode-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}
.mode-live { background: #fee2e2; color: var(--urgent); }
.mode-new { background: #dcfce7; color: var(--green-700); }
.mode-self { background: #f0fdf4; color: var(--text-mid); border: 1px solid var(--green-200); }

/* ── Dashboard Right Panel ──────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Streak calendar */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 14px;
}
.streak-day {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--green-100);
  cursor: default;
  transition: transform 0.15s;
}
.streak-day.active { background: var(--green-500); }
.streak-day.missed { background: #fee2e2; }
.streak-day.today { outline: 2px solid var(--green-500); }
.streak-day:hover { transform: scale(1.15); }
.streak-stats { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.streak-stats span strong { color: var(--text-dark); }

/* Tasks list */
.task-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.task-item:hover { border-color: var(--green-300); }
.task-checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.task-checkbox.done { background: var(--green-500); border-color: var(--green-500); color: #fff; font-size: 10px; }
.task-info { flex: 1; }
.task-title { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.task-due { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.task-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}
.task-badge.urgent { background: #fee2e2; color: var(--urgent); }
.task-badge.quiz { background: #e0e7ff; color: #4338ca; }
.task-badge.done { background: var(--green-100); color: var(--green-700); }
.task-badge.live { background: #fef9c3; color: #854d0e; }

/* Achievements grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.achievement-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.2s;
}
.achievement-item:hover { background: var(--green-50); border-color: var(--green-200); }
.achievement-item.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-icon { font-size: 28px; }
.achievement-name { font-size: 10px; font-weight: 600; color: var(--text-mid); line-height: 1.2; }

/* ── Leaderboard ────────────────────────────────────────── */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.leaderboard-table td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr.current-user { background: var(--green-50); }
.rank-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.rank-1 { background: #fef08a; color: #713f12; }
.rank-2 { background: #e5e7eb; color: #374151; }
.rank-3 { background: #fed7aa; color: #7c2d12; }
.rank-other { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); font-size: 11px; }

/* ── Notifications dropdown ─────────────────────────────── */
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 14px;
}
.notif-item {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--green-50); }
.notif-item-title { font-size: 13px; font-weight: 600; }
.notif-item-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 7px; }
.form-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-dark);
  background: var(--bg); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(34,162,78,0.12);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237aaa8d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close { font-size: 20px; cursor: pointer; color: var(--text-muted); background: none; border: none; }

/* ── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: var(--shadow-lg); max-width: 320px;
  display: flex; gap: 10px; align-items: flex-start;
  animation: slideUp 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--urgent); }
.toast.info { border-left: 3px solid var(--info); }
.toast-icon { font-size: 18px; }
.toast-text { flex: 1; font-size: 13px; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { color: var(--text-muted); }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Overlay for sidebar mobile ─────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Skeleton Loader ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Utility ────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-value { font-size: 24px; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .streak-badge { display: none; }
  .course-card { flex-wrap: wrap; }
  .course-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
  .achievements-grid { grid-template-columns: repeat(4, 1fr); }
  .notif-dropdown { width: 290px; right: -40px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .achievements-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

/* ── Skeleton loader ──────────────────────────────────────────────────────── */
.skeleton-wrap { padding: 2rem; }
.skeleton {
  background: linear-gradient(90deg, #e8f0e4 25%, #f2f7f0 50%, #e8f0e4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  margin-bottom: 1rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton--photo { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 1.5rem; }
.skeleton--line  { height: 20px; }

/* ── Form messages ────────────────────────────────────────────────────────── */
.form-msg { font-size: .8rem; font-weight: 600; min-height: 1.2em; margin-top: .5rem; }
.form-msg--ok    { color: #3d7a35; }
.form-msg--error { color: #c0392b; }
.form-msg--info  { color: #1a5c8a; }

/* ── Photo status ─────────────────────────────────────────────────────────── */
.photo-status { font-size: .72rem; font-weight: 600; min-height: 1em; margin-top: .25rem; }
.photo-status.ok    { color: #3d7a35; }
.photo-status.error { color: #c0392b; }
.photo-status.info  { color: #1a5c8a; }

/* ── Password grid (3 fields) ─────────────────────────────────────────────── */
.password-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem 1.5rem;
}
@media (max-width: 800px) {
  .password-grid { grid-template-columns: 1fr; }
}

/* Professional polish: hide icon placeholders left empty */
.empty-icon:empty,.toast-icon:empty,.nav-icon:empty,.cert-icon:empty,.vp-icon:empty,.result-emoji:empty,.assign-type-icon:empty,.notif-icon:empty,.input-icon:empty{display:none}
.nav-icon svg,.snav-icon svg,.icon-btn svg,.search-icon svg{display:block;margin:auto}
.nav-icon,.snav-icon{display:inline-flex;align-items:center;justify-content:center}
