* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0 !important;
  min-height: 100%;
  background: #eef1f8;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: linear-gradient(90deg, #f59e0b, #fb923c);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  z-index: 1100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.topbar-left,
.topbar-right,
.topbar-admin {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
  min-width: 0;
}

.topbar-title {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.topbar-toggler,
.topbar .toggler {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}

.topbar-toggler:hover,
.topbar .toggler:hover {
  background: rgba(255, 255, 255, 0.18);
}

.topbar-admin-wrapper {
  position: relative;
}

.topbar-admin {
  gap: 8px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.topbar-admin:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar-admin-caret {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.topbar-admin-wrapper.open .topbar-admin-caret {
  transform: rotate(180deg);
}

.admin-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  z-index: 1200;
}

.topbar-admin-wrapper.open .admin-dropdown {
  display: flex;
  flex-direction: column;
}

.admin-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f2937;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.admin-dropdown-item:hover {
  color: #fff;
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.sidebar {
  position: fixed !important;
  top: 68px !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  z-index: 1000;
  overflow: hidden;
  background: #1d4ed8 !important;
  border-right: 0 !important;
  padding: 0 !important;
  transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar.open {
  width: 280px !important;
  overflow-y: auto;
  padding: 24px 0 20px !important;
}


.sidebar-header {
  display: flex;
  justify-content: center;
  padding: 0 0 24px !important;
  border: 0 !important;
}

.header-logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.55))
    drop-shadow(-1px -1px 1px rgba(255, 255, 255, 0.65));
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 14px;
}

.primary-nav,
.secondary-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.secondary-nav {
  margin-top: 20px;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-item {
  list-style: none;
}

.sidebar .nav-link {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  color: #e0e7ff !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
}

.sidebar .nav-link .nav-icon {
  color: inherit;
  font-size: 22px;
  flex: 0 0 auto;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff !important;
  background: linear-gradient(135deg, #fbbf24, #f97316) !important;
}

.main-content {
  margin-left: 0 !important;
  margin-top: 68px !important;
  width: auto !important;
  min-height: calc(100vh - 68px);
  padding: 32px !important;
  overflow-x: hidden;
  transition: margin-left 0.2s ease, width 0.2s ease;
}

.sidebar.open ~ .main-content {
  margin-left: 280px !important;
  width: auto !important;
}

.student-container,
.content-box {
  max-width: 100%;
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar-title {
    font-size: 15px;
  }

  .sidebar,
  .sidebar.open {
    width: 0 !important;
    overflow: hidden;
    padding: 0 !important;
  }

  .sidebar.open {
    width: 280px !important;
    overflow-y: auto;
    padding: 24px 0 20px !important;
  }

  .main-content,
  .sidebar.open ~ .main-content {
    margin-left: 0 !important;
    width: auto !important;
    padding: 22px !important;
  }
}

@media (max-width: 560px) {
  .topbar-admin-name,
  .topbar-title {
    display: none;
  }

  .sidebar {
    width: 0 !important;
    overflow: hidden;
    padding: 0 !important;
  }

  .sidebar.open {
    width: 280px !important;
    max-width: 88vw;
    overflow-y: auto;
    padding: 24px 0 20px !important;
  }

  .main-content,
  .sidebar.open ~ .main-content {
    margin-left: 0 !important;
    width: auto !important;
    padding: 16px !important;
  }
}
