@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

  :root {
    --sidebar-bg: #0F172A;
    --accent: #0EA5E9;
    --accent-strong: #0284C7;
    --accent-light: #E0F2FE;
    --bg: #F7F9FB;
    --bg-muted: #ECF4FF;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text-primary: #0F172A;
    --text-secondary: #6B7280;
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #FFFFFF;
    --radius: 14px;
    --shadow: 0 14px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.06);
    --sidebar-w: 240px;
    --header-h: 64px;
    --font: 'Space Grotesk', 'SF Pro Display', 'Segoe UI', system-ui, -apple-system, sans-serif;
  }

body {
  font-family: var(--font);
  background: radial-gradient(circle at 20% 20%, rgba(14,165,233,0.12), transparent 28%),
              radial-gradient(circle at 80% 0%, rgba(8,47,73,0.08), transparent 24%),
              var(--bg);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

  /* ── SIDEBAR ── */
  #sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    transition: transform .25s ease;
    z-index: 200;
  }

  .sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  .sidebar-logo span {
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -.3px;
  }
  .sidebar-logo span em {
    color: var(--accent);
    font-style: normal;
  }

  nav { padding: 12px 10px; flex: 1; }

  nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .18s, color .18s;
    margin-bottom: 2px;
    cursor: pointer;
  }
  nav a svg { flex-shrink: 0; opacity: .7; transition: opacity .18s; }
  nav a:hover { background: rgba(255,255,255,.07); color: #CBD5E1; }
  nav a.active {
    background: var(--accent);
    color: var(--sidebar-text-active);
  }
  nav a.active svg { opacity: 1; }

  .sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .avatar {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
  }
  .sidebar-footer-info p { font-size: .8rem; color: #E2E8F0; font-weight: 600; }
  .sidebar-footer-info span { font-size: .72rem; color: var(--sidebar-text); }

  #logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
  }

  /* ── MAIN WRAPPER ── */
  #main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
  }

  /* ── HEADER ── */
  header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 100;
    position: sticky;
    top: 0;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  #hamburger {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
  }
  #hamburger:hover { 
    background: #F1F5F9; 
    color: var(--text-primary);
  }

  #page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
  }

  .header-search {
    position: relative;
    display: flex;
    align-items: center;
  }

  .header-search svg {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
  }

  .header-search input {
    height: 38px;
    width: 240px;
    padding: 0 16px 0 36px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #F8FAFC;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
  }

  .header-search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    width: 280px;
  }

  .header-icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
  }

  .header-icon-btn:hover {
    background: #F1F5F9;
    color: var(--text-primary);
  }

  .header-profile {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
  }

  .header-profile:hover {
    transform: translateY(-2px);
  }

  .header-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ── CONTENT ── */
  #content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 36px;
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.5), transparent 280px);
  }

  .section { display: none; }
  .section.active { display: block; }

  .section-head {
    margin-bottom: 20px;
  }
  .section-head h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  .section-head p {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 3px;
  }

  /* ── CARDS GRID ── */
  .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
  }
  .card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.09); transform: translateY(-2px); }

  .card-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: .3px;
  }
  .badge-blue { background: var(--accent-light); color: var(--accent); }
  .badge-green { background: #F0FDF4; color: #16A34A; }
  .badge-orange { background: #FFF7ED; color: #EA580C; }
  .badge-purple { background: #FAF5FF; color: #7C3AED; }

  .card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
  .card p  { font-size: .82rem; color: var(--text-secondary); line-height: 1.5; }

  .card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .78rem;
    color: var(--text-secondary);
  }
  .card-meta svg { color: var(--accent); }

  /* course card extras */
  .course-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    font-size: 1.2rem;
  }

  /* ── TABLE ── */
  .table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  table { width: 100%; border-collapse: collapse; }
  thead th {
    background: var(--bg);
    padding: 12px 18px;
    text-align: left;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
  }
  tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--bg); }
  tbody td {
    padding: 13px 18px;
    font-size: .875rem;
    color: var(--text-primary);
  }
  tbody td:last-child { color: var(--text-secondary); font-size: .8rem; }

  /* ── OVERLAY ── */
  #overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 150;
  }

  /* ── RESPONSIVE ── */
  body.sidebar-collapsed #sidebar {
    width: 0;
    flex-basis: 0;
    transform: translateX(-100%);
    pointer-events: none;
  }
  body.sidebar-collapsed #sidebar .sidebar-logo,
  body.sidebar-collapsed #sidebar nav,
  body.sidebar-collapsed #sidebar .sidebar-footer {
    opacity: 0;
  }
  body.sidebar-collapsed #content {
    padding-left: 16px;
    padding-right: 16px;
  }

  @media (max-width: 720px) {
    #sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      transform: translateX(-100%);
    }
    #sidebar.open { transform: translateX(0); }
    #hamburger { display: flex; align-items: center; justify-content: center; }
    #overlay.open { display: block; }
    #content { padding: 20px 16px; }
    #search-input { width: 160px; }
    .cards-grid { grid-template-columns: 1fr 1fr; }
  }

@media (max-width: 420px) {
  .cards-grid { grid-template-columns: 1fr; }
  #search-input { width: 130px; }
}

/* hidden by search */
.hidden { display: none !important; }
