/* style.css - PROLOGSCAPOSKA Premium Theme */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");

:root {
  --bg-color: #eef4fb;
  --surface-color: #f8fbff;
  --text-main: #24314a;
  --text-muted: #56667c;
  --border-color: #d9e4f1;
  --primary: #5b91f9;
  --primary-light: #eaf2ff;

  /* Stats Colors */
  --attendance: #0ea5e9;
  --attendance-bg: #f0f9ff;
  --quiz: #8b5cf6;
  --quiz-bg: #f5f3ff;
  --kontribusi: #eab308;
  --kontribusi-bg: #fefce8;
  --reward: #ec4899;
  --reward-bg: #fdf2f8;

  /* Widgets */
  --books-bg: #fff1f2;
  --books-color: #f43f5e;
  --videos-bg: #ecfdf5;
  --videos-color: #10b981;
  --papers-bg: #f5f3ff;
  --papers-color: #8b5cf6;

  --today-bg: #fefce8;
  --today-icon: #eab308;
  --tomorrow-bg: #eff6ff;
  --tomorrow-icon: #3b82f6;

  --shadow-soft:
    0 10px 35px -5px rgba(0, 0, 0, 0.03), 0 8px 20px -6px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 20px 40px -15px rgba(15, 23, 42, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  color-scheme: light;
}

/* =========================================
   LOGIN SCREEN (PROLOGSCAPOSKA STYLE)
   ========================================= */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
}

.login-body::before {
  content: "";
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.15) 0%,
    transparent 70%
  );
  top: -200px;
  left: -200px;
  pointer-events: none;
}

.login-body::after {
  content: "";
  position: absolute;
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.12) 0%,
    transparent 70%
  );
  bottom: -150px;
  right: -150px;
  pointer-events: none;
}

.login-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 3.2rem 2.5rem;
  border-radius: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.login-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.1rem;
}

.login-logo-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(234, 179, 8, 0.35)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo-img:hover {
  transform: scale(1.06);
}

.prologs-logo h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
  margin-bottom: 0.4rem;
}

.login-title {
  font-size: clamp(1.15rem, 3vw, 1.3rem);
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.3px;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  color: rgba(148, 163, 184, 0.88);
  font-size: clamp(0.84rem, 2vw, 0.9rem);
  line-height: 1.45;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.88rem 1.1rem;
  border-radius: 14px;
  color: var(--text-main);
  font-size: 16px; /* Prevents auto zoom in mobile browser */
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01) inset;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
  color: #94a3b8;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper .form-control {
  padding-right: 48px;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 3;
}

.btn-toggle-password:hover {
  color: #2563eb;
}

.btn-toggle-password:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-inputs select,
.date-inputs input {
  flex: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
}

.date-inputs input[type="number"] {
  background-image: none;
  padding-right: 1.1rem;
}

.date-separator {
  color: #cbd5e1;
  font-weight: 500;
}

.login-footer {
  margin-top: 1.8rem;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 0.95rem 1.2rem;
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -5px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-submit:active {
  transform: translateY(1px);
}

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.85rem 1rem;
  margin-bottom: 1.4rem;
  border-radius: 12px;
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

/* Responsive adjustments for Login Screen */
@media (max-width: 640px) {
  .login-body {
    padding: 16px 12px;
  }

  .login-container {
    padding: 2.2rem 1.4rem;
    border-radius: 22px;
    max-width: 100%;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  }

  .login-header {
    margin-bottom: 1.8rem;
  }

  .prologs-logo h1 {
    font-size: 2.15rem;
    letter-spacing: -1px;
    margin-bottom: 0.3rem;
  }

  .login-title {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
  }

  .login-subtitle {
    font-size: 0.84rem;
  }

  .form-group {
    margin-bottom: 1.2rem;
  }

  .form-group label {
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
  }

  .form-control {
    font-size: 16px;
    padding: 0.82rem 1rem;
    border-radius: 12px;
  }

  .btn-submit {
    padding: 0.88rem 1rem;
    font-size: 0.94rem;
    border-radius: 12px;
  }

  .login-footer {
    margin-top: 1.5rem;
  }
}

@media (max-width: 380px) {
  .login-body {
    padding: 12px 8px;
  }

  .login-container {
    padding: 1.75rem 1.05rem;
    border-radius: 18px;
  }

  .prologs-logo h1 {
    font-size: 1.85rem;
  }

  .login-title {
    font-size: 1.05rem;
  }

  .login-subtitle {
    font-size: 0.8rem;
  }

  .form-group {
    margin-bottom: 1.1rem;
  }

  .form-group label {
    font-size: 0.78rem;
  }

  .form-control {
    padding: 0.75rem 0.85rem;
  }

  .btn-submit {
    padding: 0.8rem 0.85rem;
    font-size: 0.9rem;
  }
}

/* =========================================
   DASHBOARD SCREEN
   ========================================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
  width: 90px;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 0;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.01);
}

.sidebar-brand-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.4rem;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand-logo:hover {
  transform: scale(1.1);
}

.sidebar-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

.dash-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.dash-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.dash-brand-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.nav-item {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.2rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.15);
}

.nav-item i {
  font-size: 24px;
}

/* Main Content area */
.main-content {
  flex: 1;
  margin-left: 90px;
  padding: 2.5rem 3.5rem;
  background-color: var(--bg-color);
  overflow-x: hidden;
}

/* Header bar */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.back-btn-container {
  display: flex;
  align-items: center;
}

.btn-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #dbe2f1;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  transition: all 0.2s ease;
}

.btn-back:hover {
  transform: translateX(-3px);
  background: rgba(71, 85, 105, 0.84);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-soft);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.action-icon:hover {
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.profile-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.btn-logout {
  background: #3b82f6;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #2563eb;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

/* Dashboard Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 330px 1fr 340px;
  gap: 1.8rem;
  align-items: start;
}

/* Welcome Banner (Spans Col 1 & Col 2) */
.welcome-section {
  grid-column: 1 / 3;
  grid-row: 1;
  background: var(--surface-color);
  border-radius: 24px;
  padding: 2.5rem 3rem 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.welcome-text {
  max-width: 60%;
}

.welcome-text h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  color: #0f172a;
  letter-spacing: -0.8px;
}

.welcome-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 480px;
}

/* Welcome illustration replaced with profile photo */
.welcome-illustration {
  display: none;
}

.welcome-profile-photo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  max-width: 220px;
}

.profile-banner-photo {
  width: 140px;
  height: 170px;
  object-fit: cover;
  object-position: center top;
  border-radius: 24px;
  border: 4px solid #ffffff;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.14),
    0 0 0 4px rgba(59, 130, 246, 0.15);
  transition: transform 0.3s ease;
}

.profile-banner-photo:hover {
  transform: scale(1.03);
}

.profile-banner-name,
.profile-banner-class {
  width: 100%;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-banner-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  padding: 0.35rem 0.9rem;
}

.profile-banner-class {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.35rem 0.9rem;
}

/* Dark mode overrides for profile photo card */
body.dark-mode .profile-banner-name {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .profile-banner-class {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Column Wrappers */
.grid-col-left {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.grid-col-center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.grid-col-right {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  align-self: stretch;
}

/* Stats Cards (Left Col) */
.stats-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--surface-color);
  padding: 1.2rem;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat-icon.attendance {
  background: var(--attendance-bg);
  color: var(--attendance);
}
.stat-icon.tugas {
  background: var(--quiz-bg);
  color: var(--quiz);
}
.stat-icon.quiz {
  background: var(--quiz-bg);
  color: var(--quiz);
}
.stat-icon.kontribusi {
  background: var(--kontribusi-bg);
  color: var(--kontribusi);
}
.stat-icon.reward {
  background: var(--reward-bg);
  color: var(--reward);
}

.stat-icon i {
  font-size: 22px;
}

/* Clickable stat cards */
.stat-card.clickable {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.stat-card.clickable:hover {
  transform: translateY(-4px);
  transition: transform 160ms ease;
}

.stat-card.clickable .stat-info p {
  margin: 0;
}

.stat-icon.reward img.reward-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.1rem;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* Widgets General */
.widget-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
}

.widget-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.widget-title-bar h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.widget-title-bar .view-all {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.widget-title-bar .view-all:hover {
  color: var(--primary);
}

/* Jadwal Pertemuan Widget (Left Col) */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.schedule-item.today {
  background-color: var(--today-bg);
}
.schedule-item.tomorrow {
  background-color: var(--tomorrow-bg);
}

.schedule-bell {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.02);
}

.schedule-item.today .schedule-bell {
  color: var(--today-icon);
}
.schedule-item.tomorrow .schedule-bell {
  color: var(--tomorrow-icon);
}

.schedule-bell i {
  font-size: 18px;
}

.schedule-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.schedule-details p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* Tugas Widget (Center Col) */
.tugas-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.tugas-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.2rem 0.5rem;
  border-radius: 18px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.01);
  transition: all 0.2s;
}

.tugas-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
}

.tugas-btn.books {
  background-color: var(--books-bg);
  color: var(--books-color);
}
.tugas-btn.videos {
  background-color: var(--videos-bg);
  color: var(--videos-color);
}
.tugas-btn.papers {
  background-color: var(--papers-bg);
  color: var(--papers-color);
}

.tugas-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.tugas-icon i {
  font-size: 20px;
}

.tugas-btn span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

/* Quiz Line Chart Widget (Center Col) */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header select {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 220px;
  margin-top: 1rem;
}

/* Attendance Doughnut Chart Widget (Right Col) */
.attendance-doughnut-card {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.attendance-canvas-container {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 1.25rem auto;
}

.attendance-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.attendance-center-text span {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  display: block;
  line-height: 1;
}

.leaderboard-card {
  border: none;
  padding: 2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
}

.leaderboard-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.leaderboard-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #eff6ff;
  color: #2563eb;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.leaderboard-title-bar h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.leaderboard-subtitle {
  font-size: 0.88rem;
  color: #475569;
  margin-top: 0.2rem;
}

.leaderboard-explainer {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.65rem;
  max-width: 420px;
}

.leaderboard-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8rem;
}

.leaderboard-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.8rem;
}

.leaderboard-page-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.leaderboard-page-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
  color: #0f172a;
}

.leaderboard-page-header p {
  color: #475569;
  margin: 0;
  line-height: 1.6;
}

.btn-back-primary {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.btn-back-primary:hover {
  transform: translateX(-2px);
}

.page-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.page-link:hover {
  text-decoration: underline;
}

.leaderboard-page-card {
  padding: 2rem;
}

.leaderboard-two-column {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.8rem;
}

.star-overview-card,
.leaderboard-table-card {
  min-height: 500px;
}

.star-card-main {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #ffffff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.star-card-main h1 {
  font-size: 2.5rem;
}

.star-source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #334155;
}

.leaderboard-table {
  display: grid;
  gap: 0.9rem;
}

.leaderboard-table-header,
.leaderboard-table-row {
  display: grid;
  grid-template-columns: 70px 1.7fr 90px 110px;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.leaderboard-table-header {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.leaderboard-table-row {
  background: #f8fbff;
  border-radius: 18px;
}

.leaderboard-table-row.top-row {
  background: #dbeafe;
}

.leaderboard-name-cell img {
  width: 42px;
  height: 42px;
  border-radius: 16px;
}

.status-pill {
  justify-self: end;
}

.leaderboard-two-column {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.8rem;
}

.star-overview-card,
.leaderboard-table-card {
  min-height: 480px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.35rem;
}

.card-title-row h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.star-card-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border-radius: 24px;
  padding: 1rem 1.2rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: 1.45rem;
}

.star-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fef3c7 0%, #fef08a 100%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 6px 16px rgba(251, 191, 36, 0.18);
  text-align: center;
}

.star-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.star-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.star-card-label {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 600;
}

.star-card-main h1 {
  font-size: 3.35rem;
  margin: 0;
  color: #0f172a;
}

.star-card-subtitle {
  font-size: 0.85rem;
  color: #64748b;
}

.star-source-list {
  display: grid;
  gap: 0.85rem;
}

.star-history-dropdown {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--surface-color);
  overflow: hidden;
}

.star-history-dropdown > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.star-history-dropdown > summary::-webkit-details-marker {
  display: none;
}

.star-history-dropdown > summary i {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.star-history-dropdown[open] > summary {
  border-bottom: 1px solid var(--border-color);
}

.star-history-dropdown[open] > summary i {
  transform: rotate(180deg);
}

.star-history-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
}

.star-history-dropdown .star-source-list {
  padding: 0.7rem;
  max-height: 360px;
  overflow-y: auto;
}

.star-source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  font-weight: 600;
  color: #0f172a;
}

.leaderboard-table {
  display: grid;
  gap: 0.95rem;
}

.leaderboard-table-header,
.leaderboard-table-row {
  display: grid;
  grid-template-columns: 50px 1.5fr 90px 100px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.leaderboard-table-row {
  background: #e2e8f0;
  border-radius: 18px;
}

.leaderboard-table-row.top-row {
  background: #dbeafe;
}

.leaderboard-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-name-cell img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 72px;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.active {
  background: #e0f2fe;
  color: #0c4a6e;
}

.leaderboard-item:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.25);
}

.leaderboard-top {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.leaderboard-rank {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.leaderboard-user img {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.leaderboard-name {
  display: block;
  font-weight: 700;
  color: #0f172a;
}

.leaderboard-role {
  display: block;
  font-size: 0.8rem;
  color: #475569;
}

.leaderboard-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  text-align: right;
}

.leaderboard-score span {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.leaderboard-score small {
  color: #64748b;
}

.leaderboard-summary-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 24px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.leaderboard-summary-avatar {
  position: relative;
  width: 72px;
  height: 72px;
}

.leaderboard-summary-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.leaderboard-crown {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.leaderboard-summary-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.leaderboard-summary-info h4 {
  font-size: 1rem;
  margin: 0;
}

.leaderboard-summary-rank {
  font-size: 0.75rem;
  color: #2563eb;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.leaderboard-summary-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
}

.leaderboard-summary-score span {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
}

.leaderboard-summary-score small {
  color: #64748b;
}

.leaderboard-list {
  display: grid;
  gap: 0.85rem;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 40px auto 84px;
  align-items: center;
  gap: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 0.95rem 1rem;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.25);
}

.leaderboard-top {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.leaderboard-rank {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.leaderboard-user img {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.leaderboard-item {
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.leaderboard-item:hover {
  transform: translateY(-3px);
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.35);
}

.leaderboard-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.leaderboard-role {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.leaderboard-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.15rem;
}

.leaderboard-score span {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.leaderboard-score small {
  font-size: 0.75rem;
  color: #475569;
}

.attendance-filters {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.attendance-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.attendance-filter-item label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.attendance-filters select {
  width: 100%;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  border: 1px solid var(--border-color);
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.logout-confirm-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
}

.logout-confirm-dialog:not([open]) {
  display: none;
}

.logout-confirm-dialog[open] {
  display: grid;
}

.logout-confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.logout-confirm-content {
  display: grid;
  justify-items: center;
  width: min(380px, calc(100vw - 32px));
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: var(--surface-color);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  text-align: center;
}

.logout-confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  place-items: center;
  border-radius: 16px;
  background: #fff1f2;
  color: #e11d48;
  font-size: 24px;
}

.logout-confirm-content h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 800;
}

.logout-confirm-content p {
  margin: 0.45rem 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.logout-confirm-actions {
  display: flex;
  width: 100%;
  gap: 0.65rem;
}

.logout-confirm-actions button {
  flex: 1 1 0;
  min-height: 42px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.logout-confirm-cancel {
  background: var(--bg-color);
  color: var(--text-main);
}

.logout-confirm-submit {
  border-color: #e11d48 !important;
  background: #e11d48;
  color: #ffffff;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 750;
  color: #0f172a;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

/* Responsive Scaling */
@media (max-width: 1380px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-col-right {
    grid-column: 1 / 3;
  }
  .welcome-section {
    grid-column: 1 / 3;
  }
  .welcome-section {
    padding-right: 3rem;
  }
}

@media (max-width: 1200px) {
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 2rem;
  }
  .welcome-text {
    max-width: 100%;
  }
  .welcome-profile-photo {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-top: 1.8rem;
    pointer-events: none;
  }
}

@media (max-width: 992px) {
  .main-content {
    padding: 2rem;
  }
  .welcome-illustration {
    display: none;
  }
  .welcome-section {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 0.8rem 0;
    position: fixed;
    bottom: 0;
    top: auto;
    border-right: none;
    border-top: 1px solid var(--border-color);
  }
  .nav-item {
    margin-bottom: 0;
  }
  .main-content {
    margin-left: 0;
    margin-bottom: 70px;
    padding: 1.5rem;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .grid-col-right {
    grid-column: 1 / 2;
  }
  .welcome-section {
    grid-column: 1 / 2;
  }
  .dash-header {
    margin-bottom: 1.5rem;
  }
}
/* =========================================
   ATTENDANCE HISTORY
   ========================================= */
.attendance-legend {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.present {
  background: #0ea5e9;
}
.legend-dot.absent {
  background: #1e3a8a;
}

.attendance-history {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.2rem;
}

.history-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}

.history-item:hover {
  background: #f0f9ff;
}

.history-item.empty-state {
  justify-content: center;
  min-height: 100px;
}

.history-item.empty-state .history-info {
  text-align: center;
}

.history-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.history-day {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.history-month {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-subject {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.1rem;
}

.history-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.history-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.history-status.hadir {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.history-status.absen {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* =========================================
   DARK MODE
   ========================================= */
body.dark-mode {
  background-color: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .sidebar {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .nav-item {
  color: #94a3b8;
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

body.dark-mode .main-content {
  background-color: #0f172a;
}

body.dark-mode .dash-header {
  background: transparent;
}

body.dark-mode .btn-back,
body.dark-mode .action-icon {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .action-icon:hover {
  color: #818cf8;
}

body.dark-mode .profile-pic {
  border-color: #334155;
}

body.dark-mode .welcome-section {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .welcome-text h2 {
  color: #f1f5f9;
}

body.dark-mode .welcome-text p {
  color: #94a3b8;
}

body.dark-mode .stat-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .stat-info h3 {
  color: #f1f5f9;
}

body.dark-mode .stat-info p {
  color: #64748b;
}

body.dark-mode .widget-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .widget-title-bar h3 {
  color: #f1f5f9;
}

body.dark-mode .tugas-btn {
  filter: brightness(0.85) saturate(0.9);
}

body.dark-mode .tugas-btn span {
  color: #e2e8f0;
}

body.dark-mode .schedule-item.today {
  background: rgba(234, 179, 8, 0.1);
}

body.dark-mode .schedule-item.tomorrow {
  background: rgba(59, 130, 246, 0.1);
}

body.dark-mode .schedule-bell {
  background: #334155;
}

body.dark-mode .schedule-details h4 {
  color: #f1f5f9;
}

body.dark-mode .history-item {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .history-item:hover {
  background: #1a2744;
}

body.dark-mode .history-date {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .history-day {
  color: #f1f5f9;
}

body.dark-mode .history-subject {
  color: #e2e8f0;
}

body.dark-mode .attendance-filters select,
body.dark-mode .chart-header select {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .attendance-history {
  border-color: #334155;
}

body.dark-mode .history-status.hadir {
  background: rgba(5, 150, 105, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.2);
}

body.dark-mode .history-status.absen {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.2);
}

body.dark-mode .modal-content {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .modal-header h3 {
  color: #f1f5f9;
}

body.dark-mode .btn-close-modal {
  color: #64748b;
}

/* =========================================
   TUGAS (ASSIGNMENTS) FEATURE STYLES
   ========================================= */
.tugas-view-container {
  animation: fadeIn 0.4s ease-out;
  min-height: calc(100vh - 160px);
  position: relative;
  padding-bottom: 80px; /* Space for bottom navigation */
}

.header-page-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-main);
  margin-left: 0.75rem;
  line-height: 1.05;
}

.topic-list-header h2 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

/* Loading state */
.loading-spinner-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 300px;
  width: 100%;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

/* 1. Topic List (Home) View */
.topic-list-header {
  margin-bottom: 2rem;
}

.topic-list-header h2 {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* 1. Topic List (Home) View - Stacked Vertical List */
.topic-list-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: fadeIn 0.4s ease-out;
}

.topic-card-row-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.topic-card-main-card {
  flex: 1;
  min-height: 140px;
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 18px 40px -10px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  background-blend-mode: soft-light;
}

.topic-card-main-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.12),
    transparent 45%
  );
  pointer-events: none;
}

.topic-card-main-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 55px -16px rgba(15, 23, 42, 0.23);
}

.topic-card-icon-area {
  display: flex;
  justify-content: center;
  align-items: center;
}

.topic-card-file-mock {
  width: 58px;
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #334155;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.06),
    inset 0 -4px 0 rgba(0, 0, 0, 0.02);
  font-size: 22px;
}

.topic-card-file-mock::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.12) 50%), #cbd5e1;
  border-bottom-left-radius: 5px;
  border-top-right-radius: 10px;
}

.topic-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.topic-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.topic-card-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
}

.topic-card-progress {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.topic-card-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transition: width 0.4s ease;
}

.topic-card-deadline-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-card-deadline-badge span {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

.topic-card-deadline-badge strong {
  font-size: 0.86rem;
  font-weight: 800;
}

.topic-status-indicator-circle {
  width: 54px;
  height: 54px;
}

.topic-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.3px;
}

.topic-card-deadline-badge {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topic-card-deadline-badge span {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.topic-card-deadline-badge strong {
  font-size: 0.85rem;
  font-weight: 800;
}

.topic-card-menu {
  opacity: 0.7;
  cursor: pointer;
  padding: 0.4rem;
  font-size: 20px;
  transition: opacity 0.2s;
}

.topic-card-menu:hover {
  opacity: 1;
}

.topic-status-indicator-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-color);
  border: 2px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-size: 16px;
}

.topic-status-indicator-circle.checked {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.3);
}

.topic-status-indicator-circle:hover {
  transform: scale(1.08);
}

/* 2. Topic Detail & Forum View */
.topic-detail-header-card {
  border-radius: 24px;
  padding: 2rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 1.8rem;
  box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.15);
  margin-bottom: 1.5rem;
}

.topic-detail-header-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}

.topic-detail-header-info p {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

.new-announcement-bar {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.btn-new-announcement {
  width: 100%;
  max-width: 500px;
  background: var(--text-muted);
  color: #ffffff;
  border: none;
  padding: 0.85rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}

.btn-new-announcement:hover {
  transform: translateY(-2px);
  background: var(--text-main);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.scrollable-area {
  max-height: calc(100vh - 380px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Scrollbar styling */
.scrollable-area::-webkit-scrollbar {
  width: 6px;
}
.scrollable-area::-webkit-scrollbar-track {
  background: transparent;
}
.scrollable-area::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2);
  border-radius: 10px;
}
.scrollable-area::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.4);
}

/* Post Cards (Feed/Stream) */
.post-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Specific themes */
.post-card.assignment-theme {
  border-left: 4px solid var(--primary);
}

.post-card.announcement-theme {
  border-left: 4px solid var(--text-muted);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.post-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.post-author-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-menu {
  margin-left: auto;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
}

.post-body {
  cursor: pointer;
  margin-bottom: 1.2rem;
}

.post-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.post-text {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
}

.attachment-preview-mini {
  margin-top: 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.post-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  cursor: pointer;
}

.comment-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}

.comment-trigger-btn:hover {
  color: var(--primary);
}

/* Bottom Navigation Bar for Topic Details */
.topic-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.bottom-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem 1.5rem;
  border-radius: 16px;
  transition: all 0.2s;
}

.bottom-nav-item i {
  font-size: 20px;
}

.bottom-nav-item span {
  font-size: 0.72rem;
  font-weight: 700;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Assignments List tab */
.assignments-list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assignment-row-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.assignment-row-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--primary);
}

.assignment-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.assignment-row-details {
  flex: 1;
}

.assignment-row-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.assignment-row-details span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.assignment-row-status {
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.assignment-row-status.submitted {
  background: #ecfdf5;
  color: #10b981;
}

.assignment-row-status.pending {
  background: #fef2f2;
  color: #ef4444;
}

/* 3. Comment Thread View Styles */
.comment-thread-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}

.comment-reference-post {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.ref-post-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.ref-post-header img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.ref-post-header h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.ref-post-header span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.comment-reference-post p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.comments-scroll-pane {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.empty-comments {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

.comment-item-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  position: relative;
}

.comment-item-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.comment-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.comment-author-meta {
  display: flex;
  flex-direction: column;
}

.comment-author-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.comment-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.comment-item-body {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.comment-item-actions {
  display: flex;
  align-items: center;
}

.btn-reply-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.btn-reply-link:hover {
  color: var(--primary);
}

.btn-delete-comment {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-delete-comment:hover {
  opacity: 1;
}

.reply-alert-banner {
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--primary);
  animation: slideUp 0.2s ease-out;
}

.btn-cancel-reply {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
}

.comment-input-area-form {
  margin-top: auto;
}

.comment-input-box-wrapper {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.comment-textbox {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 0.4rem 0;
}

.comment-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.comment-send-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.comment-send-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* 4. Task Detail View Styles */
.task-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.task-detail-main {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.task-detail-header-info {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.task-deadline-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 0.6rem;
}

.task-title-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.task-meta-bar {
  display: flex;
  align-items: center;
}

.task-points-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
}

.task-instructions-body {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.section-subtitle {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.attachment-file-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  border-radius: 16px;
  padding: 1.1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.attachment-file-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.attachment-file-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.attachment-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.attachment-name-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.attachment-size-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.attachment-download-icon {
  font-size: 20px;
  color: var(--text-muted);
}

/* Submission card */
.task-submission-sidebar {
  position: sticky;
  top: 20px;
}

.submission-card-widget {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
}

.submission-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.submission-card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.submission-status-label {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.submission-status-label.submitted {
  background: #ecfdf5;
  color: #10b981;
}

.submission-status-label.pending {
  background: #fef2f2;
  color: #ef4444;
}

.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 1.2rem;
}

.upload-dropzone:hover,
.upload-dropzone.has-file {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.8rem auto;
  font-size: 20px;
  transition: all 0.2s;
}

.upload-dropzone:hover .upload-icon-circle,
.upload-dropzone.has-file .upload-icon-circle {
  background: var(--primary);
  color: #ffffff;
}

.upload-title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.upload-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-action-submit {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.95rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
  transition: all 0.2s;
}

.btn-action-submit:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-action-submit:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.submitted-file-preview-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.2rem;
  transition: all 0.2s;
}

.submitted-file-preview-card:hover {
  border-color: var(--primary);
}

.submitted-file-preview-card .file-icon {
  font-size: 24px;
  color: #ef4444;
  flex-shrink: 0;
}

.submitted-file-preview-card .file-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.btn-action-unsubmit-flat {
  width: 100%;
  background: var(--surface-color);
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 0.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-unsubmit-flat:hover {
  background: #f8fafc;
  color: #334155;
  border-color: #94a3b8;
}

/* Animations & Utilities */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =========================================
   DARK MODE OVERRIDES FOR TUGAS MODULE
   ========================================= */
body.dark-mode .spinner {
  border-color: #334155;
  border-top-color: var(--primary);
}

body.dark-mode .topic-status-indicator-circle {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .topic-status-indicator-circle.checked {
  background: #10b981;
  border-color: #10b981;
}

body.dark-mode .topic-card-file-mock {
  background: #334155;
  color: #cbd5e1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .topic-card-file-mock::before {
  background:
    linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.3) 50%), #475569;
}

body.dark-mode .btn-new-announcement {
  background: #334155;
  color: #f1f5f9;
}

body.dark-mode .btn-new-announcement:hover {
  background: #475569;
}

body.dark-mode .post-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .post-author-info h4,
body.dark-mode .post-title,
body.dark-mode .post-text {
  color: #f1f5f9;
}

body.dark-mode .attachment-preview-mini {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .post-footer {
  border-color: #334155;
}

body.dark-mode .assignment-row-item {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .assignment-row-item:hover {
  border-color: var(--primary);
}

body.dark-mode .assignment-row-details h4 {
  color: #f1f5f9;
}

body.dark-mode .assignment-row-status.submitted {
  background: rgba(16, 185, 129, 0.15);
}

body.dark-mode .assignment-row-status.pending {
  background: rgba(239, 68, 68, 0.15);
}

body.dark-mode .topic-bottom-nav {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .bottom-nav-item:hover,
body.dark-mode .bottom-nav-item.active {
  background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .comment-reference-post {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .ref-post-header h4 {
  color: #f1f5f9;
}

body.dark-mode .comment-item-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .comment-author-name {
  color: #f1f5f9;
}

body.dark-mode .comment-item-body p {
  color: #e2e8f0;
}

body.dark-mode .reply-alert-banner {
  background: rgba(59, 130, 246, 0.15);
  border-color: #334155;
  border-left-color: var(--primary);
}

body.dark-mode .comment-input-box-wrapper {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .comment-textbox {
  color: #f1f5f9;
}

body.dark-mode .task-detail-main,
body.dark-mode .submission-card-widget {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .task-title-text,
body.dark-mode .task-instructions-body {
  color: #f1f5f9;
}

body.dark-mode .task-detail-header-info,
body.dark-mode .attachment-file-card {
  border-color: #334155;
}

body.dark-mode .attachment-file-card {
  background: #0f172a;
}

body.dark-mode .attachment-name-label {
  color: #f1f5f9;
}

body.dark-mode .submission-card-header h3 {
  color: #f1f5f9;
}

body.dark-mode .submission-status-label.submitted {
  background: rgba(16, 185, 129, 0.15);
}

body.dark-mode .submission-status-label.pending {
  background: rgba(239, 68, 68, 0.15);
}

body.dark-mode .upload-dropzone {
  border-color: #334155;
}

body.dark-mode .upload-dropzone:hover,
body.dark-mode .upload-dropzone.has-file {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--primary);
}

body.dark-mode .upload-icon-circle {
  background: #334155;
  color: #cbd5e1;
}

body.dark-mode .upload-title {
  color: #f1f5f9;
}

body.dark-mode .submitted-file-preview-card {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .submitted-file-preview-card .file-name {
  color: #f1f5f9;
}

body.dark-mode .btn-action-unsubmit-flat {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .btn-action-unsubmit-flat:hover {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #475569;
}

body.dark-mode .user-header-profile {
  background: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-mode .user-header-profile span {
  color: #f1f5f9 !important;
}

body.dark-mode .user-header-profile div {
  background: #334155 !important;
}

/* Responsive details for bottom navigation view */
@media (max-width: 991px) {
  .task-detail-grid {
    grid-template-columns: 1fr;
  }
  .task-submission-sidebar {
    position: static;
  }
}

/* =========================================
   GLOBAL MODAL OVERLAY & MODAL CONTENT
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--surface-color);
  border-radius: 28px;
  padding: 2rem;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 30px 80px -10px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border-color);
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fecaca;
}

/* =========================================
   ABSEN / KEHADIRAN MODULE
   ========================================= */

/* Absen main container */
.absen-view-container {
  max-width: 960px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

/* ---- 1. Link Absen Card ---- */
.link-absen-widget {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem 2.2rem;
  box-shadow: var(--shadow-soft);
}

.link-absen-header {
  margin-bottom: 1.2rem;
}

.link-absen-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
}

.link-absen-body {
  display: flex;
  justify-content: center;
}

.link-box-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  transition: all 0.25s;
  width: 100%;
  max-width: 580px;
}

.link-box-container:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.link-box-container.copied {
  border-color: #10b981;
  background: #ecfdf5;
}

.absen-url {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
  user-select: none;
}

.icon-copy {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

.link-box-container:hover .icon-copy {
  color: var(--primary);
}

/* ---- 2. Section Badge Title ---- */
.section-badge-title {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.45rem 1.1rem;
  border-radius: 10px;
  letter-spacing: 0.2px;
}

/* ---- 3. Attendance Main Widget ---- */
.absen-main-widget {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.absen-stats-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.absen-dropdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.absen-dropdown-wrapper h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.student-select-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.student-select-box:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---- 4. Attendance Stats Badges ---- */
.attendance-summary-pills {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.stat-percentage-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.stat-percentage-circle.present {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.summary-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  font-size: 0.75rem;
}

.summary-pill .pill-label {
  font-weight: 600;
  opacity: 0.85;
}

.summary-pill .pill-count {
  font-size: 1.1rem;
  font-weight: 800;
}

.summary-pill.present {
  background: #dcfce7;
  color: #16a34a;
}

.summary-pill.permit {
  background: #dbeafe;
  color: #2563eb;
}

.summary-pill.sick {
  background: #fef9c3;
  color: #ca8a04;
}

.summary-pill.absent {
  background: #fee2e2;
  color: #dc2626;
}

/* ---- 5. Attendance History Table ---- */
.absen-table-container {
  overflow-x: auto;
}

.absen-history-table {
  width: 100%;
  border-collapse: collapse;
}

.absen-history-table thead th {
  background: var(--bg-color);
  padding: 0.9rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.absen-history-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.absen-history-table tbody tr:last-child {
  border-bottom: none;
}

.absen-history-table tbody tr:hover {
  background: var(--primary-light);
}

.absen-history-table td {
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  vertical-align: middle;
}

/* Proof image view button */
.btn-view-proof {
  width: 65px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.btn-view-proof:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 6px 14px -4px rgba(59, 130, 246, 0.35);
}

/* Add attendance (+) button */
.btn-add-proof {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1.5px dashed #6ee7b7;
  color: #10b981;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-add-proof:hover {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  border-style: solid;
  transform: scale(1.08);
  box-shadow: 0 6px 14px -4px rgba(16, 185, 129, 0.35);
}

/* ---- 6. Upload Proof Form (Modal) ---- */
.absen-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}

.absen-upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.absen-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text-main);
  transition: border-color 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ---- 7. Absen Detail View (Modal) ---- */
.absen-detail-table-box {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.absen-detail-table-widget {
  width: 100%;
  border-collapse: collapse;
}

.absen-detail-table-widget tr {
  border-bottom: 1px solid var(--border-color);
}

.absen-detail-table-widget tr:last-child {
  border-bottom: none;
}

.absen-detail-table-widget .cell-label {
  width: 35%;
  padding: 0.85rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-color);
}

.absen-detail-table-widget .cell-value {
  padding: 0.85rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ---- 8. Status Badge (in detail modal) ---- */
.badge-status-detail {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-status-detail.present {
  background: #dcfce7;
  color: #16a34a;
}

.badge-status-detail.permit {
  background: #dbeafe;
  color: #2563eb;
}

.badge-status-detail.sick {
  background: #fef9c3;
  color: #ca8a04;
}

.badge-status-detail.absent {
  background: #fee2e2;
  color: #dc2626;
}

/* ---- 9. Photo Proof Frame ---- */
.absen-detail-photo-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.photo-proof-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-proof-frame img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

/* ---- 10. Header action icons ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: all 0.2s;
}

.action-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* =========================================
   DARK MODE: ABSEN MODULE + MODALS
   ========================================= */
body.dark-mode .modal-content {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .modal-header {
  border-color: #334155;
}

body.dark-mode .modal-header h3 {
  color: #f1f5f9;
}

body.dark-mode .btn-close-modal {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .link-absen-widget,
body.dark-mode .absen-main-widget {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .link-absen-header h3 {
  color: #f1f5f9;
}

body.dark-mode .link-box-container {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .link-box-container:hover {
  background: rgba(59, 130, 246, 0.1);
}

body.dark-mode .absen-stats-header {
  border-color: #334155;
}

body.dark-mode .absen-dropdown-wrapper h4 {
  color: #f1f5f9;
}

body.dark-mode .student-select-box {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .absen-history-table thead th {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .absen-history-table tbody tr {
  border-color: #334155;
}

body.dark-mode .absen-history-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

body.dark-mode .absen-history-table td {
  color: #94a3b8;
}

body.dark-mode .btn-view-proof {
  background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .btn-add-proof {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .absen-upload-box {
  border-color: #334155;
}

body.dark-mode .absen-upload-box:hover {
  background: rgba(59, 130, 246, 0.1);
}

body.dark-mode .form-control {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .absen-detail-table-box {
  border-color: #334155;
}

body.dark-mode .absen-detail-table-widget tr {
  border-color: #334155;
}

body.dark-mode .absen-detail-table-widget .cell-label {
  background: #0f172a;
  color: #94a3b8;
}

body.dark-mode .absen-detail-table-widget .cell-value {
  color: #f1f5f9;
}

body.dark-mode .photo-proof-frame {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .action-icon {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .photo-section-title {
  color: #f1f5f9;
}

/* =========================================
   MENTOR ATTENDANCE & ACC BADGES STYLING
   ========================================= */
.absen-tab-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.absen-tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.absen-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.absen-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.tab-badge-count {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.badge-acc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-acc.approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-acc.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-acc.rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.btn-action-acc {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-action-acc:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-action-reject {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-action-reject:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-acc-all {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-acc-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

body.dark-mode .badge-acc.approved {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .badge-acc.pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

body.dark-mode .badge-acc.rejected {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    margin-bottom: 0;
    padding: 1rem 0.8rem calc(5.25rem + env(safe-area-inset-bottom));
  }

  .sidebar-brand-logo {
    display: none !important;
  }

  .sidebar {
    z-index: 1000;
    gap: 0;
    justify-content: space-evenly;
    padding: 0.45rem 0.25rem calc(0.45rem + env(safe-area-inset-bottom));
    overflow-x: auto;
  }

  .sidebar .nav-item {
    flex: 0 1 44px;
    width: 44px;
    min-width: 40px;
    height: 44px;
    margin: 0 !important;
    border-radius: 12px;
  }

  .dash-header {
    align-items: stretch;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.25rem;
  }

  .back-btn-container {
    min-width: 0;
    width: 100%;
  }

  .header-page-title {
    min-width: 0;
    font-size: 1.45rem;
    overflow-wrap: anywhere;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .header-actions .user-header-profile {
    min-width: 0;
    max-width: calc(100% - 96px);
    overflow: hidden;
  }

  .header-profile-name {
    display: none;
  }

  body.dashboard-home .dash-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
  }

  body.dashboard-home .back-btn-container {
    flex: 0 0 auto;
    width: auto;
  }

  body.dashboard-home .header-actions {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.3rem;
  }

  body.dashboard-home .header-actions .action-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  body.dashboard-home .header-actions .profile-pic {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
  }

  body.dashboard-home .header-actions .btn-logout {
    flex: 0 0 auto;
    margin-left: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  body.tasks-home .dash-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
  }

  body.tasks-home .back-btn-container {
    flex: 0 0 auto;
    width: auto;
    gap: 0.35rem;
  }

  body.tasks-home .back-btn-container .btn-back {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  body.tasks-home .header-page-title {
    margin-left: 0.2rem;
    font-size: 1rem;
    white-space: nowrap;
  }

  body.tasks-home .header-actions {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  body.tasks-home .header-actions .action-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 32px;
  }

  body.tasks-home .header-actions .user-header-profile {
    flex: 0 1 38px;
    min-width: 30px;
    max-width: 38px;
    padding: 0.2rem !important;
    justify-content: center;
  }

  body.tasks-home .header-actions .user-header-profile img {
    width: 24px !important;
    height: 24px !important;
  }

  body.tasks-home .header-actions .user-header-profile > div,
  body.tasks-home .header-actions .user-header-profile span {
    display: none;
  }

  body.tasks-home .header-actions .btn-logout {
    flex: 0 0 auto;
    margin-left: 0;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.68rem !important;
    white-space: nowrap;
  }

  .welcome-section {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.9rem;
  }

  .welcome-text {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .welcome-text h2 {
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
    line-height: 1.3;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .welcome-text p {
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .welcome-profile-photo {
    flex: 0 0 88px;
    width: 88px;
    max-width: 88px;
    margin: 0;
    gap: 0.3rem;
    pointer-events: auto;
  }

  .profile-banner-photo {
    width: 80px;
    height: 96px;
    border-width: 3px;
    border-radius: 15px;
  }

  .profile-banner-name,
  .profile-banner-class {
    padding: 0.25rem 0.3rem;
    border-radius: 10px;
    white-space: nowrap;
    font-size: 0.58rem;
  }

  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    gap: 0.9rem;
  }

  .dash-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100%;
    min-width: 0;
  }

  .grid-col-left,
  .grid-col-center,
  .grid-col-right {
    min-width: 0;
  }

  .stats-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .absen-tab-nav {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .absen-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .absen-main-widget {
    max-width: 100%;
    overflow-x: auto;
  }

  .absen-main-widget table,
  .absen-history-table {
    min-width: 640px;
  }

  .topic-list-container {
    width: 100%;
    gap: 1rem;
  }

  .topic-card-row-wrapper {
    position: relative;
    display: block;
    width: 100%;
  }

  .topic-card-main-card {
    width: 100%;
    min-width: 0;
    min-height: 150px;
    padding: 1rem;
    gap: 0.85rem;
    border-radius: 18px;
  }

  .topic-card-icon-area {
    flex: 0 0 48px;
  }

  .topic-card-file-mock {
    width: 48px;
    height: 58px;
    border-radius: 14px;
  }

  .topic-card-details {
    min-width: 0;
    gap: 0.6rem;
    padding-right: 0.4rem;
  }

  .topic-card-title {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .topic-card-meta {
    gap: 0.35rem;
  }

  .topic-card-pill {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    overflow-wrap: anywhere;
  }

  .topic-card-progress {
    height: 7px;
  }

  .topic-status-indicator-circle {
    position: absolute;
    z-index: 4;
    right: 0.55rem;
    bottom: 0.55rem;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.94);
  }

  .task-filter-panel {
    padding: 0.75rem !important;
  }

  .task-filter-panel > div:first-child {
    flex-wrap: wrap;
    gap: 0.55rem !important;
  }

  .task-filter-panel > div:first-child > h3 {
    flex: 1 0 100%;
  }

  .task-filter-panel > div:first-child > div {
    width: 100%;
    min-width: 0;
  }

  .task-filter-panel select {
    flex: 1 1 0;
    min-width: 0 !important;
  }

  #adminAddTaskTypeBtn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.tasks-home .tugas-view-container {
    padding-bottom: 1rem;
  }

  .modal-content {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    margin: auto;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 0.8rem 0.65rem calc(5rem + env(safe-area-inset-bottom));
  }

  .sidebar .nav-item {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .header-actions .action-icon {
    width: 40px;
    height: 40px;
  }

  .header-actions .btn-logout {
    margin-left: auto;
  }

  body.dashboard-home .header-actions .action-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  body.dashboard-home .header-actions .profile-pic {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }

  .welcome-section {
    padding: 0.75rem;
    gap: 0.45rem;
  }

  .welcome-text h2 {
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }

  .welcome-text p {
    font-size: 0.72rem;
  }

  .welcome-profile-photo {
    flex-basis: 76px;
    width: 76px;
    max-width: 76px;
  }

  .profile-banner-photo {
    width: 70px;
    height: 84px;
  }

  .absen-main-widget table,
  .absen-history-table {
    min-width: 600px;
  }

  .topic-card-row-wrapper {
    align-items: initial;
  }

  body.tasks-home .header-page-title {
    font-size: 0.9rem;
  }

  body.tasks-home .header-actions .action-icon {
    flex-basis: 28px;
    width: 28px;
    height: 30px;
  }

  body.tasks-home .header-actions .user-header-profile {
    flex-basis: 30px;
    max-width: 30px;
  }

  body.tasks-home .header-actions .btn-logout {
    padding: 0.35rem 0.4rem !important;
    font-size: 0.62rem !important;
  }

  .topic-card-main-card {
    min-height: 138px;
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .topic-card-icon-area {
    flex-basis: 42px;
  }

  .topic-card-file-mock {
    width: 42px;
    height: 52px;
  }

  .topic-card-title {
    font-size: 0.92rem;
  }

  .topic-card-pill {
    padding: 0.3rem 0.45rem;
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  body.leaderboard-page .leaderboard-page-grid,
  body.leaderboard-page .leaderboard-two-column {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    gap: 0.9rem;
  }

  body.leaderboard-page .leaderboard-two-column > *,
  body.leaderboard-page .leaderboard-page-grid > * {
    width: 100%;
    min-width: 0;
  }

  body.leaderboard-page .star-overview-card,
  body.leaderboard-page .leaderboard-table-card {
    min-height: 0;
    padding: 1.1rem;
  }

  body.leaderboard-page .star-card-main {
    gap: 0.75rem;
    padding: 0.9rem;
  }

  body.leaderboard-page .star-card-main h1 {
    font-size: 2rem;
  }

  body.leaderboard-page .leaderboard-table-header {
    display: none;
  }

  body.leaderboard-page .leaderboard-table-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  body.leaderboard-page .leaderboard-name-cell {
    min-width: 0;
    gap: 0.5rem;
  }

  body.leaderboard-page .leaderboard-name-cell > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.leaderboard-page .leaderboard-name-cell img {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  body.leaderboard-page .leaderboard-table-row > .status-pill {
    display: none;
  }

  body.attendance-page .dash-header,
  body.leaderboard-page .dash-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
  }

  body.attendance-page .back-btn-container,
  body.leaderboard-page .back-btn-container {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    gap: 0.25rem;
  }

  body.attendance-page .back-btn-container .btn-back,
  body.leaderboard-page .back-btn-container .btn-back {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  body.attendance-page .header-page-title,
  body.leaderboard-page .header-page-title {
    min-width: 0;
    max-width: 118px;
    margin-left: 0.2rem;
    font-size: 0.88rem !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.attendance-page .header-actions,
  body.leaderboard-page .header-actions {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  body.attendance-page .header-actions .action-icon,
  body.leaderboard-page .header-actions .action-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 32px;
  }

  body.attendance-page .header-actions .user-header-profile {
    flex: 0 1 32px;
    min-width: 28px;
    max-width: 32px;
    padding: 0.2rem !important;
    justify-content: center;
  }

  body.attendance-page .header-actions .user-header-profile > div,
  body.attendance-page .header-actions .user-header-profile span,
  body.leaderboard-page .header-actions .header-profile-name {
    display: none;
  }

  body.attendance-page .header-actions .user-header-profile img,
  body.leaderboard-page .header-actions .profile-pic {
    flex: 0 0 24px;
    width: 24px !important;
    height: 24px !important;
  }

  body.attendance-page .header-actions .btn-logout,
  body.leaderboard-page .header-actions .btn-logout {
    flex: 0 0 auto;
    margin-left: 0;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.66rem !important;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  body.attendance-page .header-page-title,
  body.leaderboard-page .header-page-title {
    max-width: 86px;
    font-size: 0.78rem !important;
  }

  body.attendance-page .header-actions .action-icon,
  body.leaderboard-page .header-actions .action-icon {
    flex-basis: 27px;
    width: 27px;
    height: 29px;
  }

  body.attendance-page .header-actions .btn-logout,
  body.leaderboard-page .header-actions .btn-logout {
    padding: 0.35rem 0.38rem !important;
    font-size: 0.6rem !important;
  }
}
