/* ================================================================
   WLA USER — Premium Design System
   Brand Gradient: #3db6bd → #3cb878 → #61b441 → #3a6429
   ================================================================ */

/* ── Variables ── */
:root {
  --grad:           linear-gradient(135deg, #3db6bd 0%, #3cb878 40%, #61b441 70%, #3a6429 100%);
  --grad-h:         linear-gradient(135deg, #2ea5ac 0%, #2da869 40%, #52a332 70%, #2d5120 100%);
  --grad-r:         linear-gradient(to right, #3db6bd, #3cb878, #61b441, #3a6429);
  --grad-soft:      linear-gradient(135deg, rgba(61,182,189,.08) 0%, rgba(60,184,120,.06) 100%);

  --primary:        #3cb878;
  --primary-d:      #3a6429;
  --primary-t:      #3db6bd;
  --primary-l:      #61b441;
  --primary-glow:   rgba(60,184,120,.20);
  --primary-light:  rgba(60,184,120,.09);

  --success:        #3cb878;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3db6bd;

  --text-head:      #142214;
  --text-body:      #2d4a30;
  --text-muted:     #6a8f6d;
  --text-light:     #9fbfa2;

  --bg-page:        #f0f7f1;
  --bg-white:       #ffffff;
  --bg-subtle:      #f7faf7;

  --border:         #d4e8d6;
  --border-light:   #e8f4e8;

  --sidebar-w:      265px;
  --navbar-h:       66px;

  --radius-xs:      6px;
  --radius-sm:      10px;
  --radius:         14px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  --shadow-xs:      0 1px 4px rgba(20,60,20,.06);
  --shadow-sm:      0 2px 10px rgba(20,60,20,.08);
  --shadow:         0 4px 20px rgba(20,60,20,.10);
  --shadow-md:      0 8px 32px rgba(20,60,20,.12);
  --shadow-lg:      0 16px 56px rgba(20,60,20,.16);

  --transition:     all .2s cubic-bezier(.4,0,.2,1);
  --font:           'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-d); }

img { max-width: 100%; display: block; }

/* ── Layout Shell ── */
.u-wrapper {
  display: flex;
  min-height: 100vh;
}

.u-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}

.u-content {
  flex: 1;
  padding: 28px 30px;
  max-width: 1400px;
  width: 100%;
}

/* ── Sidebar ── */
.u-sidebar {
  width: var(--sidebar-w);
  background: var(--grad);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.u-sidebar::-webkit-scrollbar { width: 4px; }
.u-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

/* Brand */
.u-sidebar-brand {
  padding: 22px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.u-brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.u-brand-icon {
  width: 100px;
  height: 38px;
  flex-shrink: 0;
}

.u-brand-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
}

.u-brand-tagline {
  font-size: 10px;
  color: rgba(255,255,255,.65);
  letter-spacing: .3px;
  margin-top: 1px;
}

.u-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}
.u-sidebar-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Profile Card */
.u-sidebar-profile {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.08);
  margin: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
}

.u-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.3);
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.u-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.u-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.u-profile-id { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 1px; }
.u-profile-desig { font-size: 10.5px; color: rgba(255,255,255,.5); margin-top: 1px; }

/* Nav */
.u-sidebar-nav { padding: 8px 0; flex: 1; }

.u-nav-group { margin-bottom: 6px; }

.u-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.45);
  padding: 10px 22px 4px;
}

.u-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 22px;
  color: rgba(255,255,255,.82);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  transition: var(--transition);
  text-decoration: none;
  margin: 1px 10px;
  border-radius: var(--radius-xs);
}

.u-nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.u-nav-link.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 600;
}

.u-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

.u-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
}
.u-nav-link.active .u-nav-icon, .u-nav-link:hover .u-nav-icon { opacity: 1; }

.u-nav-text { flex: 1; }

.u-nav-badge {
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar Footer */
.u-sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.u-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  text-decoration: none;
}
.u-logout-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.u-sidebar-version {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-align: center;
  margin-top: 8px;
}

.u-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ── Navbar ── */
.u-navbar {
  height: var(--navbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.u-navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.u-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  flex-shrink: 0;
}
.u-hamburger:hover { background: var(--primary-light); }
.u-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-head);
  border-radius: 2px;
  transition: var(--transition);
}

/* Breadcrumb */
.u-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.u-breadcrumb-home { color: var(--text-muted); }
.u-breadcrumb-home:hover { color: var(--primary); }
.u-breadcrumb-sep { color: var(--text-light); flex-shrink: 0; }
.u-breadcrumb-link { color: var(--text-muted); }
.u-breadcrumb-link:hover { color: var(--primary); }
.u-breadcrumb-current { color: var(--text-head); font-weight: 600; }

.u-navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search */
.u-search-wrap { position: relative; }
.u-search-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.u-search-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.u-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1100;
  overflow: hidden;
}
.u-search-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }

.u-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}
.u-search-inner input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-head);
  background: transparent;
  font-family: var(--font);
}
.u-search-results { max-height: 300px; overflow-y: auto; }
.u-search-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border-light); transition: var(--transition); }
.u-search-item:hover { background: var(--primary-light); }
.u-search-item-title { font-size: 13.5px; font-weight: 500; color: var(--text-head); }
.u-search-item-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.u-search-empty { padding: 20px 16px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* Notification Bell */
.u-notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.u-notif-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.u-notif-dot {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-white);
  padding: 0 3px;
}

/* User Menu */
.u-user-menu { position: relative; }
.u-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  transition: var(--transition);
}
.u-user-trigger:hover { border-color: var(--primary); background: var(--primary-light); }

.u-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.u-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.u-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-head);
  white-space: nowrap;
}
.u-user-dept { font-size: 10.5px; color: var(--text-muted); }

.u-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1100;
  overflow: hidden;
}
.u-user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.u-dropdown-header { padding: 14px 16px; }
.u-dropdown-name { font-size: 13.5px; font-weight: 600; color: var(--text-head); }
.u-dropdown-email { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.u-dropdown-divider { height: 1px; background: var(--border-light); }
.u-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-body);
  transition: var(--transition);
  text-decoration: none;
}
.u-dropdown-item:hover { background: var(--primary-light); color: var(--primary-d); }
.u-dropdown-logout { color: var(--danger) !important; }
.u-dropdown-logout:hover { background: #fef2f2 !important; }

/* ── Page Header ── */
.u-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.u-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-head);
  letter-spacing: -.3px;
  line-height: 1.2;
}
.u-page-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.u-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Welcome Banner ── */
.u-welcome-banner {
  background: var(--grad);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.u-welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.u-welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 120px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.u-welcome-text { position: relative; z-index: 1; }
.u-welcome-greeting {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  font-weight: 500;
  margin-bottom: 4px;
}
.u-welcome-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
  line-height: 1.2;
}
.u-welcome-sub {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  margin-top: 8px;
}
.u-welcome-cta {
  position: relative;
  z-index: 1;
}
.u-welcome-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}
.u-welcome-stat-item {
  text-align: center;
}
.u-welcome-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.u-welcome-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 3px;
}

/* ── KPI Cards ── */
.u-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.u-kpi-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.u-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border); }
.u-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-r);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: var(--transition);
}
.u-kpi-card:hover::before { opacity: 1; }

.u-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.u-kpi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.u-kpi-icon.green  { background: rgba(60,184,120,.12); color: #3cb878; }
.u-kpi-icon.teal   { background: rgba(61,182,189,.12); color: #3db6bd; }
.u-kpi-icon.amber  { background: rgba(245,158,11,.12);  color: #f59e0b; }
.u-kpi-icon.red    { background: rgba(239,68,68,.12);   color: #ef4444; }
.u-kpi-icon.purple { background: rgba(139,92,246,.12);  color: #8b5cf6; }

.u-kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-head);
  letter-spacing: -.5px;
  line-height: 1;
}
.u-kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.u-kpi-progress {
  height: 4px;
  background: var(--border-light);
  border-radius: 4px;
  margin-top: 14px;
  overflow: hidden;
}
.u-kpi-progress-fill {
  height: 100%;
  background: var(--grad-r);
  border-radius: 4px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ── Section Header ── */
.u-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.u-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-head);
}
.u-section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Course Cards ── */
.u-course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Force 2-col max (used on dashboard) */
.u-course-grid-2col { grid-template-columns: repeat(2, 1fr) !important; }
@media (max-width: 640px) {
  .u-course-grid-2col { grid-template-columns: 1fr !important; }
}

.u-course-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.u-course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.u-course-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--grad);
}
.u-course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.u-course-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
}
.u-course-thumb-placeholder svg { width: 48px; height: 48px; color: rgba(255,255,255,.5); }

.u-course-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 60%);
}
.u-course-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0;
  transition: var(--transition);
  color: var(--primary-d);
}
.u-course-card:hover .u-course-play-btn { opacity: 1; }

.u-course-status-pill {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.u-course-status-pill.completed   { background: #22c55e; color: #fff; }
.u-course-status-pill.in-progress { background: var(--primary-t); color: #fff; }
.u-course-status-pill.assigned    { background: rgba(255,255,255,.9); color: var(--primary-d); }
.u-course-status-pill.overdue     { background: var(--danger); color: #fff; }

.u-course-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.u-course-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.u-course-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.u-course-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.u-course-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.u-course-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}
.u-course-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.u-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.u-progress-fill {
  height: 100%;
  background: var(--grad-r);
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.u-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 100%;
  background: rgba(255,255,255,.35);
  border-radius: 6px;
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; }
}

/* ── Card / Panel ── */
.u-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.u-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.u-card-title { font-size: 15px; font-weight: 700; color: var(--text-head); }
.u-card-sub   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.u-card-body  { padding: 24px; }

/* ── Buttons ── */
.btn-u {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font);
  line-height: 1;
}
.btn-u-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-u-primary:hover {
  background: var(--grad-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
  color: #fff;
}
.btn-u-outline {
  background: transparent;
  color: var(--primary-d);
  border: 1.5px solid var(--primary);
}
.btn-u-outline:hover { background: var(--primary-light); }
.btn-u-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
}
.btn-u-ghost:hover { background: var(--bg-subtle); color: var(--primary-d); }
.btn-u-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-u-lg { padding: 13px 28px; font-size: 15px; }

/* ── Badges ── */
.u-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .2px;
}
.badge-success   { background: rgba(60,184,120,.12);  color: #16853d; }
.badge-info      { background: rgba(61,182,189,.12);  color: #0e7490; }
.badge-warning   { background: rgba(245,158,11,.12);  color: #92400e; }
.badge-danger    { background: rgba(239,68,68,.12);   color: #b91c1c; }
.badge-secondary { background: rgba(100,116,139,.10); color: #475569; }
.badge-primary   { background: rgba(60,184,120,.12);  color: var(--primary-d); }

/* ── Progress Ring (SVG) ── */
.u-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.u-ring-svg { transform: rotate(-90deg); }
.u-ring-track { fill: none; stroke: var(--border); }
.u-ring-fill  { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
.u-ring-text  {
  position: absolute;
  text-align: center;
}
.u-ring-pct { font-size: 16px; font-weight: 800; color: var(--text-head); line-height: 1; }
.u-ring-sublabel { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Toast Notifications ── */
.u-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.u-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  animation: toastIn .35s cubic-bezier(.4,0,.2,1);
  max-width: 360px;
  min-width: 280px;
}
.u-toast.removing { animation: toastOut .3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); } to { opacity:0; transform: translateX(30px); } }

.u-toast-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.u-toast.success .u-toast-icon { background: rgba(60,184,120,.12); color: #3cb878; }
.u-toast.error   .u-toast-icon { background: rgba(239,68,68,.12);  color: #ef4444; }
.u-toast.info    .u-toast-icon { background: rgba(61,182,189,.12); color: #3db6bd; }
.u-toast.warning .u-toast-icon { background: rgba(245,158,11,.12); color: #f59e0b; }

.u-toast-body { flex: 1; min-width: 0; }
.u-toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-head); }
.u-toast-msg   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.u-toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; flex-shrink: 0;
  transition: var(--transition);
}
.u-toast-close:hover { color: var(--text-head); }

/* ── Table ── */
.u-table { width: 100%; border-collapse: collapse; }
.u-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.u-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.u-table tbody tr:last-child td { border-bottom: none; }
.u-table tbody tr:hover td { background: var(--bg-subtle); }

/* ── Forms ── */
.u-form-group { margin-bottom: 20px; }
.u-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-head);
  margin-bottom: 6px;
}
.u-label .req { color: var(--danger); margin-left: 2px; }
.u-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-head);
  background: var(--bg-white);
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}
.u-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.u-input::placeholder { color: var(--text-light); }

/* ── Empty State ── */
.u-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.u-empty-icon {
  width: 80px; height: 80px;
  background: var(--grad-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
}
.u-empty-title { font-size: 16px; font-weight: 700; color: var(--text-head); margin-bottom: 8px; }
.u-empty-sub { font-size: 13.5px; color: var(--text-muted); max-width: 320px; line-height: 1.6; }

/* ── Alert / Info box ── */
.u-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1.5px solid;
}
.u-alert.info    { background: rgba(61,182,189,.07);  border-color: rgba(61,182,189,.25); color: #0e7490; }
.u-alert.success { background: rgba(60,184,120,.07);  border-color: rgba(60,184,120,.25); color: #16853d; }
.u-alert.warning { background: rgba(245,158,11,.07);  border-color: rgba(245,158,11,.25); color: #92400e; }
.u-alert.danger  { background: rgba(239,68,68,.07);   border-color: rgba(239,68,68,.25);  color: #b91c1c; }

/* ── Tabs ── */
.u-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.u-tab {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  font-family: var(--font);
}
.u-tab:hover { color: var(--primary-d); }
.u-tab.active {
  color: var(--primary-d);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

/* ── Video Player Shell ── */
.u-player-page {
  background: #0d1117;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.u-player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.u-player-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.u-player-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  min-height: 0;
}
.u-player-main {
  display: flex;
  flex-direction: column;
  background: #0d1117;
}
.u-player-video-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 16/9;
  width: 100%;
  max-height: 75vh;
  overflow: hidden;
  user-select: none;
}
.u-player-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.u-player-sidebar {
  background: #161b22;
  border-left: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Security overlay */
.u-security-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,17,23,.96);
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  gap: 16px;
}
.u-security-overlay.show { display: flex; }
.u-security-icon { font-size: 56px; }
.u-security-title { font-size: 22px; font-weight: 700; }
.u-security-msg { font-size: 14px; color: rgba(255,255,255,.65); max-width: 380px; line-height: 1.6; }

/* ── Certificate Card ── */
.u-cert-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.u-cert-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.u-cert-banner {
  height: 6px;
  background: var(--grad-r);
}
.u-cert-body { padding: 24px; }
.u-cert-course { font-size: 16px; font-weight: 700; color: var(--text-head); margin-bottom: 6px; }
.u-cert-date   { font-size: 12.5px; color: var(--text-muted); }
.u-cert-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ── Notification items ── */
.u-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}
.u-notif-item:hover { background: var(--bg-subtle); }
.u-notif-item.unread { background: rgba(60,184,120,.04); border-left: 3px solid var(--primary); padding-left: 21px; }
.u-notif-dot-badge {
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.u-notif-content { flex: 1; min-width: 0; }
.u-notif-subject { font-size: 14px; font-weight: 600; color: var(--text-head); }
.u-notif-msg     { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-notif-time    { font-size: 11px; color: var(--text-light); margin-top: 5px; }

/* ── Filter Row ── */
.u-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.u-filter-select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-body);
  background-color: var(--bg-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a8f6d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  appearance: none;
  cursor: pointer;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}
.u-filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* ── Loading Spinner ── */
.u-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard Main Grid (left content + right sidebar) ── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  margin-bottom: 28px;
}

/* ── Course Detail Grid (left info + right syllabus) ── */
.course-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

/* ── Certificate Details Info Grid ── */
.cert-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Certificate Card Grid ── */
.u-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Profile Page Layout ── */
.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.u-col-full { grid-column: span 2; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Full breakpoint coverage
   1200 → Laptop  |  900 → Tablet  |  640 → Mobile  |  380 → XS
══════════════════════════════════════════════════════════════ */

/* ── 1200px — Large tablet / small laptop ── */
@media (max-width: 1200px) {
  .u-kpi-grid         { grid-template-columns: repeat(2, 1fr); }
  .u-course-grid      { grid-template-columns: repeat(2, 1fr); }
  .u-content          { padding: 24px 22px; }
  .dash-main-grid     { grid-template-columns: 1fr 280px; }
  .course-detail-grid { grid-template-columns: 1fr 300px; }
}

/* ── 900px — Tablet / sidebar collapses ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .profile-layout     { grid-template-columns: 1fr; }
  .u-cert-grid        { grid-template-columns: repeat(2, 1fr); }
  .dash-main-grid     { grid-template-columns: 1fr; }
  .course-detail-grid { grid-template-columns: 1fr; }
  .cert-detail-grid   { grid-template-columns: repeat(2, 1fr); }

  /* Sidebar — slides in from left as drawer */
  .u-sidebar {
    transform: translateX(-265px);
    width: 265px;
    box-shadow: none;
    z-index: 1100;
  }
  .u-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .u-sidebar-overlay.show { display: block; }
  .u-sidebar-close { display: flex; }
  .u-hamburger    { display: flex; }
  .u-main         { margin-left: 0; }
  .u-content      { padding: 20px 18px; }

  /* Navbar */
  .u-navbar       { padding: 0 18px; gap: 10px; }
  .u-user-info    { display: none; }

  /* Search panel — constrain width on tablet */
  .u-search-panel { width: 280px; right: 0; }

  /* Player — stack video + sidebar vertically */
  .u-player-body    { grid-template-columns: 1fr; }
  .u-player-sidebar { display: none; }

  /* Course grid → 2 col on tablet */
  .u-course-grid { grid-template-columns: repeat(2, 1fr); }

  /* KPI grid — keep 2×2 */
  .u-kpi-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables — allow horizontal scroll */
  .u-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  /* Welcome banner */
  .u-welcome-banner { padding: 26px 24px; }
}

/* ── 768px — Mobile / small tablet ── */
@media (max-width: 768px) {
  .u-content { padding: 16px 14px; }

  /* Navbar tighter */
  .u-navbar { padding: 0 14px; height: 58px; gap: 8px; }
  .u-navbar-left { gap: 10px; }

  /* Breadcrumb — hide on small screens to save space */
  .u-breadcrumb-link,
  .u-breadcrumb-sep:not(:last-of-type) { display: none; }

  /* Search panel — full width below navbar */
  .u-search-panel {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    border-left: none;
    border-right: none;
    z-index: 1200;
  }

  /* User dropdown — full-width from right edge */
  .u-user-dropdown {
    width: 200px;
    right: 0;
  }

  /* Page header — stack title + actions */
  .u-page-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
  }
  .u-page-actions { flex-wrap: wrap; gap: 8px; }
  .u-page-title   { font-size: 20px; }

  /* KPI grid — keep 2 col but reduce padding */
  .u-kpi-grid { gap: 12px; }
  .u-kpi-card { padding: 16px 18px; }
  .u-kpi-val  { font-size: 24px; }

  /* Welcome banner — stack vertically */
  .u-welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
    gap: 16px;
  }
  .u-welcome-title { font-size: 22px; }
  .u-welcome-stats { gap: 20px; flex-wrap: wrap; }
  .u-welcome-cta   { width: 100%; }
  .u-welcome-cta .btn-u { width: 100%; justify-content: center; }

  /* Course grid → single column */
  .u-course-grid    { grid-template-columns: 1fr; }
  .u-cert-grid      { grid-template-columns: 1fr; }
  .cert-detail-grid { grid-template-columns: 1fr 1fr; }

  /* Cards */
  .u-card-body   { padding: 18px; }
  .u-card-header { padding: 14px 18px; }

  /* Tabs — scrollable horizontally */
  .u-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .u-tabs::-webkit-scrollbar { display: none; }
  .u-tab { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

  /* Filter row — wrap on mobile, expand inputs full-width */
  .u-filter-row { gap: 8px; }
  .u-filter-row .u-input { max-width: 100% !important; flex: 1; min-width: 140px; }
  .u-filter-row .u-filter-select { flex: 1; min-width: 120px; }
  .u-filter-select { font-size: 12.5px; padding: 7px 28px 7px 10px; }

  /* Certificate cards */
  .u-cert-actions { flex-wrap: wrap; }
  .u-cert-actions .btn-u { flex: 1; min-width: 120px; justify-content: center; }

  /* Toast — anchor bottom, full width on mobile */
  .u-toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
  .u-toast { min-width: 0; max-width: 100%; }

  /* Player topbar */
  .u-player-topbar { padding: 12px 16px; }
  .u-player-title  { font-size: 13.5px; }

  /* Section header */
  .u-section-header { flex-wrap: wrap; gap: 10px; }
  .u-section-header .btn-u { font-size: 12.5px; padding: 7px 14px; }

  /* Profile page layout */
  .profile-form-grid { grid-template-columns: 1fr; }
  .u-col-full { grid-column: span 1; }

  /* Profile info grid (legacy) */
  .profile-grid,
  .form-grid-2col { grid-template-columns: 1fr !important; }
}

/* ── 640px — Phone ── */
@media (max-width: 640px) {
  html { font-size: 14px; }
  .u-content { padding: 14px 12px; }

  /* Navbar */
  .u-navbar { padding: 0 12px; height: 56px; }

  /* KPI → single column on very small phones */
  .u-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .u-kpi-card  { padding: 14px 16px; }
  .u-kpi-icon  { width: 38px; height: 38px; }
  .u-kpi-val   { font-size: 22px; }
  .u-kpi-label { font-size: 11.5px; }

  /* Welcome banner — compact */
  .u-welcome-banner  { padding: 18px 16px; border-radius: var(--radius); }
  .u-welcome-greeting { font-size: 12px; }
  .u-welcome-title   { font-size: 19px; }
  .u-welcome-sub     { font-size: 12.5px; }
  .u-welcome-stats   { gap: 16px; margin-top: 12px; }
  .u-welcome-stat-val { font-size: 20px; }

  /* Course card body */
  .u-course-body { padding: 14px 16px; }
  .u-course-title { font-size: 14px; }
  .u-course-footer { padding: 10px 16px 14px; }

  /* Page title */
  .u-page-title { font-size: 18px; }
  .u-page-sub   { font-size: 12.5px; }

  /* Buttons */
  .btn-u-lg { padding: 11px 20px; font-size: 14px; }
  .btn-u    { padding: 9px 16px; font-size: 13px; }

  /* Alert */
  .u-alert { padding: 12px 14px; font-size: 13px; }

  /* User dropdown — wider to fit text */
  .u-user-dropdown { width: 190px; }

  /* Notification item */
  .u-notif-item { padding: 14px 16px; gap: 10px; }

  /* Empty state */
  .u-empty { padding: 40px 16px; }
  .u-empty-icon { width: 64px; height: 64px; }
  .u-empty-title { font-size: 15px; }

  /* Tables — add scroll container hint */
  .u-table th { font-size: 10.5px; padding: 10px 12px; }
  .u-table td { font-size: 12.5px; padding: 11px 12px; }

  /* Tabs */
  .u-tab { padding: 9px 12px; font-size: 12.5px; }

  /* Card */
  .u-card-body { padding: 14px; }

  /* Progress ring — scale down */
  .u-ring-pct { font-size: 14px; }

  /* Player */
  .u-player-topbar { padding: 10px 14px; }
  .u-player-topbar .btn-u { padding: 7px 12px; font-size: 12px; }
}

/* ── 480px — Small phones ── */
@media (max-width: 480px) {
  .cert-detail-grid { grid-template-columns: 1fr; }
}

/* ── 380px — Extra-small phones (SE, Galaxy A) ── */
@media (max-width: 380px) {
  .u-content { padding: 12px 10px; }

  /* KPI → true single column on tiny phones */
  .u-kpi-grid { grid-template-columns: 1fr; gap: 10px; }
  .u-kpi-card { padding: 14px; display: flex; align-items: center; gap: 14px; }
  .u-kpi-top  { margin-bottom: 0; flex: 1; }
  .u-kpi-progress { display: none; } /* hide on tiny screens */

  /* Navbar — hide search icon to save space, keep bell + avatar */
  .u-search-wrap { display: none; }

  /* Welcome banner */
  .u-welcome-stats { flex-wrap: wrap; gap: 12px; }
  .u-welcome-stat-item { min-width: 70px; }

  .u-page-title { font-size: 17px; }

  /* Buttons — smaller */
  .btn-u { padding: 8px 14px; font-size: 12.5px; }
  .btn-u-sm { padding: 6px 12px; font-size: 12px; }

  /* User trigger — avatar only */
  .u-user-trigger svg:last-child { display: none; }
}
