:root {
  --bg:        #e2e2e2;
  --light:     #ffffff;
  --dark:      #c1c1c1;
  --text:      #111111;
  --muted:     #777777;
  --neu-out:   5px 5px 10px var(--dark), -5px -5px 10px var(--light);
  --neu-in:    inset 3px 3px 6px var(--dark), inset -3px -3px 6px var(--light);
  --neu-sm:    3px 3px 7px var(--dark), -3px -3px 7px var(--light);
  --neu-lg:    7px 7px 14px var(--dark), -7px -7px 14px var(--light);
  --radius:    16px;
  --sidebar-w: 220px;
}

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

html, body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: 'Poppins', sans-serif; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: 'Poppins', sans-serif; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dark); border-radius: 3px; }

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 3px 0 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  position: fixed; top: 0; left: 0;
  z-index: 50;
  transition: transform .3s;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px; padding: 0 4px;
}
.logo-circle-sm {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); box-shadow: var(--neu-sm);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand { font-weight: 800; font-size: 15px; letter-spacing: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; }
.nav-section-label {
  font-size: 9px; font-weight: 600; letter-spacing: .12em;
  color: #aaa; text-transform: uppercase;
  padding: 16px 8px 6px; margin-bottom: 2px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 500; color: var(--text);
  margin-bottom: 2px; transition: all .15s;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: rgba(0,0,0,.04); }
.nav-link.active {
  background: var(--text); color: var(--bg);
  box-shadow: 2px 2px 6px var(--dark), -2px -2px 6px var(--light);
}
.nav-link.active svg { stroke: var(--bg); }

.sidebar-profile {
  display: flex; align-items: center; gap: 8px;
  padding-top: 16px; border-top: 1px solid #d0d0d0; margin-top: 12px;
}
.profile-avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  box-shadow: var(--neu-in);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--blue); font-size: 12px; flex-shrink: 0;
}
.profile-info { flex: 1; overflow: hidden; }
.profile-name-sm { font-size: 10px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-course-sm { font-size: 8px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { color: var(--muted); display: flex; }
.logout-btn svg { width: 16px; }
.logout-btn:hover { color: var(--red); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
  max-width: calc(1200px + var(--sidebar-w));
}

.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg);
  box-shadow: 0 -3px 10px rgba(0,0,0,.08);
  padding: 10px 20px 16px;
  z-index: 40;
  justify-content: space-around; align-items: center;
}
.mob-nav-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg); box-shadow: var(--neu-out);
  display: flex; align-items: center; justify-content: center;
  position: relative; color: var(--text); transition: box-shadow .15s;
}
.mob-nav-btn:active, .mob-nav-btn.active { box-shadow: var(--neu-in); }
.mob-nav-btn svg { width: 20px; }
.mob-nav-fab {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--text); box-shadow: var(--neu-lg);
  display: flex; align-items: center; justify-content: center;
}
.mob-nav-fab svg { width: 28px; stroke: var(--bg); }
.mob-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--blue); color: #fff;
  font-size: 6px; font-weight: 700;
  padding: 2px 3px; border-radius: 3px; letter-spacing: .3px;
}

.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  padding: 14px 18px;
  align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.mobile-header .logo-circle-sm { width: 44px; height: 44px; }
.mobile-header .logo-circle-sm img { width: 28px; }

.menu-open-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); box-shadow: var(--neu-out);
  display: flex; align-items: center; justify-content: center;
}
.menu-open-btn:active { box-shadow: var(--neu-in); }

.menu-overlay {
  position: fixed; inset: 0;
  background: rgba(226,226,226,.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.menu-overlay.active { opacity: 1; pointer-events: all; }

.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 72%; max-width: 280px;
  background: var(--bg);
  z-index: 101;
  box-shadow: 15px 0 30px rgba(0,0,0,.12);
  transform: translateX(-110%);
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
  display: flex; flex-direction: column;
  padding: 28px 22px 22px;
  overflow-y: auto;
}
.side-menu.active { transform: translateX(0); }

.menu-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.menu-header-left { display: flex; align-items: center; gap: 10px; }
.menu-header-left span { font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.menu-close-btn { color: var(--text); display: flex; }

.menu-content { flex: 1; overflow-y: auto; }
.menu-group { margin-bottom: 16px; }
.group-title {
  font-size: 9px; color: #999; text-transform: uppercase;
  letter-spacing: .1em; border-bottom: 1px solid #d3d3d3;
  padding-bottom: 4px; margin-bottom: 6px; font-weight: 600;
}
.menu-item {
  display: block; font-size: 13px; color: var(--text);
  padding: 9px 10px; border-radius: 8px; font-weight: 500;
  transition: background .15s;
}
.menu-item:hover { background: rgba(0,0,0,.04); }
.menu-item:active { box-shadow: var(--neu-in); }

.menu-profile {
  display: flex; align-items: center; gap: 10px;
  padding-top: 16px; border-top: 1px solid #d3d3d3; margin-top: 12px;
}
.profile-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: var(--neu-in);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--blue); font-size: 16px; flex-shrink: 0;
}
.profile-details { display: flex; flex-direction: column; }
.profile-name { font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.3; }
.profile-course { font-size: 8px; color: var(--muted); line-height: 1.3; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title-area h1 { font-size: 26px; font-weight: 700; }
.page-title-area p  { font-size: 13px; color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; }

.btn {
  padding: 10px 20px; border-radius: 50px;
  font-size: 13px; font-weight: 600;
  background: var(--bg); box-shadow: var(--neu-sm);
  display: inline-flex; align-items: center; gap: 6px;
  transition: box-shadow .15s, transform .1s;
  color: var(--text);
}
.btn:active { box-shadow: var(--neu-in); transform: scale(0.99); }
.btn.btn-primary { background: var(--text); color: var(--bg); }
.btn svg { width: 15px; height: 15px; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-bottom-nav { display: flex; }
  .mobile-header { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 16px 16px 88px;
  }
  .app-layout { display: block; }
  .page-title-area h1 { font-size: 20px; }
  .modal { padding: 20px; }
}

@media (max-width: 480px) {
  .main-content { padding: 14px 14px 88px; }
}