:root {
  --bg-sand: #fbf9f5;
  --bg-card: #ffffff;
  --bg-sidebar: #f7f3ec;
  --bg-subtle: #f2eee6;
  
  --primary-forest: #2d5a43;
  --primary-sage: #52796f;
  --primary-moss: #84a98c;
  --accent-olive: #354f52;
  
  --warm-tan: #ede7de;
  --warm-border: #e6dfd3;
  
  --text-dark: #111827;
  --text-body: #475569;
  --text-muted: #6b7280;

  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --success-bg: #dcfce7;
  --success-text: #166534;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 4px 20px rgba(45, 90, 67, 0.05);
  --shadow-hover: 0 8px 24px rgba(45, 90, 67, 0.10);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-sand);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
}

/* ==========================================================================
   Authentication Screens (Login / Register Centering)
   ========================================================================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--bg-sand);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(45, 90, 67, 0.06);
}

.auth-brand {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-forest);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-btn-submit {
 width: 100%;
  margin-top: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-forest);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Application Layout & Sidebar Navigation
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.mobile-topbar {
  display: none;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--warm-border);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.hamburger-btn:hover {
  background-color: var(--warm-tan);
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--primary-forest);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.is-active .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(31, 41, 35, 0.4);
  backdrop-filter: blur(2px);
  z-index: 998;
}

.sidebar-overlay.is-active {
  display: block;
}

.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--warm-border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.mobile-topbar .brand-badge {
  margin-bottom: 0;
}

.brand-dot {
  width: 14px;
  height: 14px;
  background-color: var(--primary-forest);
  border-radius: 50%;
}

.brand-badge h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-forest);
  letter-spacing: -0.5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: var(--warm-tan);
  color: var(--primary-forest);
}

.nav-link.active {
  background-color: var(--primary-forest);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(45, 90, 67, 0.2);
}

.nav-link-signout {
  color: var(--error-text);
  margin-top: auto;
}

.main-content {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
  max-width: 1400px;
}

/* Admin Sidebar Logo */
#sidebarMenu .sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 14px 12px 14px;
}

#sidebarMenu .admin-sidebar-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#sidebarMenu .admin-sidebar-logo {
    width: auto;
    max-width: 132px;
    max-height: 82px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

#sidebarMenu .admin-brand-dot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-mobile-logo {
    height: 30px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    border-radius: 6px;
}

/* ==========================================================================
   Page Headers & Action Bars
   ========================================================================== */

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.page-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.mgmt-header-divider {
  border: none;
  border-top: 1px solid var(--warm-border);
  margin: 18px 0 28px 0;
}

/* ==========================================================================
   Vocabulary Management Grid & Category Cards
   ========================================================================== */

.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.cat-mgmt-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 175px;
  box-shadow: 0 4px 16px rgba(45, 90, 67, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-mgmt-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-forest);
  box-shadow: var(--shadow-hover);
}

.cat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.cat-title-dusun {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
}

.cat-word-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.cat-translations {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.9rem;
  color: var(--text-body);
}

.cat-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.cat-manage-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-forest);
  text-decoration: none;
  display: inline-block;
}

.cat-manage-link:hover {
  text-decoration: underline;
}

.cat-quick-add {
  background: var(--warm-tan);
  color: var(--primary-forest);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cat-quick-add:hover {
  background-color: var(--primary-forest);
  color: #ffffff;
}



/* ==========================================================================
   Admin Vocabulary Management - Aesthetic Modern Academic Styling
   ========================================================================== */

/* Page Header Stats Row */
.admin-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-metric-card {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.admin-metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-forest, #1e3d2f);
  line-height: 1.1;
}

.admin-metric-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #728077);
  margin-top: 2px;
}

/* Category Grid */
.admin-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.admin-vocab-card {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.admin-vocab-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 61, 47, 0.08);
}

.admin-card-canvas {
  max-height: 150px;
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 14px;
  background: #f8f6f0;
  border: 1px solid #eee8dc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 8px; /* Adds a nice breathing room around the full picture */
}

.admin-card-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Ensures the ENTIRE picture is seen inside the frame */
  border-radius: 8px;
}

.admin-vocab-card:hover .admin-card-canvas img {
  transform: scale(1.08);
}

.admin-word-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-forest, #1e3d2f);
  backdrop-filter: blur(4px);
}

/* Card Typography */
.admin-card-dusun-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.admin-translations-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted, #728077);
  font-weight: 600;
  margin-bottom: 16px;
}

.admin-trans-pill {
  background: #fbf9f5;
  border: 1px solid #ded8cb;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.76rem;
  color: var(--text-dark, #121c17);
}

/* Card Bottom Action Bar */
.admin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f2ede4;
  padding-top: 12px;
  margin-top: auto;
}

.btn-admin-manage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary-forest, #1e3d2f);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-admin-manage:hover {
  background: #142a20;
}

.admin-card-icon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-round {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--warm-border, #ded8cb);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #728077);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action-round.edit:hover {
  background: #f4efe6;
  color: var(--primary-forest, #1e3d2f);
  border-color: var(--primary-forest, #1e3d2f);
}

.btn-action-round.delete:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ==========================================================================
   Dashboard Metrics & Content Cards
   ========================================================================== */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--warm-border);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-forest);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--warm-border);
  overflow-x: auto;
  margin-top: 24px;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

th {
  background-color: var(--bg-sidebar);
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid var(--warm-border);
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--warm-border);
  color: var(--text-body);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #fdfdfb;
}

/* ==========================================================================
   Modal Dialog & Backdrop
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(3px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--warm-border);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ==========================================================================
   Forms, Inputs & Buttons
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--warm-border);
  background-color: #ffffff;
  color: var(--text-dark);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary-forest);
  box-shadow: 0 0 0 3px rgba(45, 90, 67, 0.12);
}

.btn-primary {
  background-color: var(--primary-forest);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--accent-olive);
  box-shadow: 0 4px 14px rgba(45, 90, 67, 0.25);
}

.btn-cancel {
  background-color: var(--bg-sand);
  color: var(--primary-forest);
  border: 1px solid var(--warm-border);
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-cancel:hover {
  background-color: var(--warm-tan);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #bbf7d0;
}

.alert-error {
  background-color: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #fecaca;
}

.badge-pill {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  background-color: var(--warm-tan);
  color: var(--primary-forest);
}

.empty-state-text {
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .mobile-topbar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    z-index: 999;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.is-open {
    transform: translateX(290px);
  }

  .main-content {
    padding: 24px 20px;
  }
}

/* ==========================================================================
   Media Queries & Responsive Layout
   ========================================================================== */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  margin-top: 6px;
}

/* Thin Divider */
.mgmt-header-divider {
  border: none;
  border-top: 1px solid #ede8df;
  margin: 18px 0 28px 0;
}

/* Add Word Button */
.btn-add-word {
  background-color: #1c432d;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.btn-add-word:hover {
  background-color: #143221;
}

.vocab-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.vocab-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vocab-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.vocab-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.vocab-card-dusun {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
}

.vocab-card-count {
  font-size: 0.85rem;
  color: #4b5563;
  text-align: right;
  line-height: 1.2;
}

.vocab-card-subtitles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.95rem;
  color: #374151;
}

.vocab-manage-link {
  display: inline-block;
  margin-top: 24px;
  color: #1c432d;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.vocab-manage-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Category Vocabulary Management Table View
   ========================================================================== */

.category-mgmt-container {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(45, 90, 67, 0.03);
}

.vocab-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.vocab-mgmt-table thead tr {
  background-color: #f6f3ed;
}

.vocab-mgmt-table th {
  padding: 12px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #78716c;
  border-bottom: 1px solid #ede8df;
}

.vocab-mgmt-table td {
  padding: 13px 20px;
  border-bottom: 1px solid #f3efe8;
  vertical-align: middle;
  font-size: 0.88rem;
  color: #3f3f46;
}

.vocab-mgmt-table tbody tr:last-child td {
  border-bottom: none;
}

.vocab-mgmt-table tbody tr:hover td {
  background-color: #fcfbf9;
}

.col-dusun-bold {
  font-weight: 700;
  color: #18181b;
  font-size: 0.92rem;
}

.col-category-label {
  color: #71717a;
  font-size: 0.85rem;
}

.media-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #ede7de;
  color: #44403c;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #e2dacd;
  user-select: none;
}

.media-badge svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  opacity: 0.85;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: #52525b;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  background-color: #ede7de;
  color: #1c432d;
}

.action-icon-btn.btn-delete {
  color: #dc2626;
  margin-left: 4px;
}

.action-icon-btn.btn-delete:hover {
  background-color: #fee2e2;
  color: #b91c1c;
}

.action-icon-btn.btn-delete {
  color: #dc2626;
  margin-left: 6px;
}

.action-icon-btn.btn-delete:hover {
  background-color: #fee2e2;
  color: #b91c1c;
}

.vocab-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.card-action-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cat-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.cat-icon-btn.btn-edit {
  color: #52525b;
}

.cat-icon-btn.btn-edit:hover {
  background-color: #ede7de;
  color: #1c432d;
}

.cat-icon-btn.btn-delete {
  color: #dc2626;
}

.cat-icon-btn.btn-delete:hover {
  background-color: #fee2e2;
  color: #991b1b;
}
/* ==========================================================================
   Category Creation Form Styles
   ========================================================================== */

.cat-form-card {
  background: #ffffff;
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  padding: 32px;
  max-width: 640px;
  box-shadow: 0 2px 12px rgba(45, 90, 67, 0.03);
}

.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 600px) {
  .form-grid-two {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ==========================================================================
   Image Preview Modal & Interactive Media Pill States
   ========================================================================== */

.preview-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.preview-modal.active {
  display: flex;
}

.preview-modal-content {
  background: #ffffff;
  padding: 20px;
  border-radius: 18px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--warm-border);
}

.preview-modal-content img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  background-color: #f7f3ec;
}

.preview-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 12px 0 8px 0;
  color: #111827;
}

.preview-modal-actions {
  margin-top: 16px;
}

.media-badge.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.media-badge.playing {
  background-color: var(--primary-forest);
  color: #ffffff;
}

/* Back button in sub-headers */
.btn-header-back {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 12px;
}

/* Empty state row text */
.table-empty-row {
  text-align: center;
  color: #9ca3af;
  padding: 36px 20px;
}

/* ==========================================================================
   Enhanced Professional Admin Sidebar
   ========================================================================== */

.sidebar {
  width: 270px;
  background-color: #faf7f2;
  border-right: 1px solid #ebe5da;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 18px 20px 18px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Brand header */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ede7db;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #1c432d;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1c432d;
  margin: 0;
}

/* Nav sections & grouping */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #9ca3af;
  text-transform: uppercase;
  padding: 14px 12px 6px 12px;
}

.nav-section-label:first-of-type {
  padding-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-link:hover {
  background-color: #eee8de;
  color: #111827;
}

.nav-link.active {
  background-color: #1c432d;
  color: #ffffff;
}

.nav-link.active svg {
  opacity: 1;
  stroke: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #ebe5da;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e7e0d3;
  border-radius: 12px;
}

.user-avatar-initials {
  width: 34px;
  height: 34px;
  background-color: #1c432d;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: capitalize;
}

.nav-link-signout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #b91c1c;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-link-signout svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-link-signout:hover {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   Stories Hub & Grid Cards
   ========================================================================== */

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.story-card {
  background: #ffffff;
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 90, 67, 0.06);
}

.story-card-cover {
  width: 100%;
  height: 160px;
  background-color: #f6f3ed;
  object-fit: cover;
  display: block;
}

.story-card-cover-placeholder {
  width: 100%;
  height: 160px;
  background-color: #ede7de;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c8275;
  font-size: 2rem;
}

.story-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.story-card-title-dusun {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 4px 0;
}

.story-card-title-sub {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 12px;
}

.story-card-excerpt {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.45;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f1ece4;
}

.story-read-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1c432d;
  text-decoration: none;
}

.story-read-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Shell & Mobile
   ========================================================================== */

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fbf9f5;
  border-bottom: 1px solid #ede8df;
  position: sticky;
  top: 0;
  z-index: 900;
  width: 100%;
  box-sizing: border-box;
}

.hamburger-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c432d;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-content {
  flex: 1;
  min-width: 0;
  background-color: #faf8f5;
}

@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex; 
  }

  .app-layout {
    display: flex; 
    flex-direction: column;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: none;
    margin: 0;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%); 
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.active{
      transform: translateX(0); 
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  .main-content {
    width: 100%;
    padding: 20px 16px;
    box-sizing: border-box;
  }
}

.split-page-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 1024px) {
    .split-page-layout {
        grid-template-columns: 1fr;
    }
}
.story-line-card-box {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
.story-line-card-box.collapsed .expanded-content {
    display: none;
}
.story-line-card-box.expanded .collapsed-preview {
    display: none;
}
/* ==========================================================================
   Quiz Manager Styles
   ========================================================================== */

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.quiz-card {
  background: #ffffff;
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(45, 90, 67, 0.05);
}

.quiz-header-badge {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.quiz-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
}

.quiz-points-pill {
  background-color: #f7f3ec;
  color: var(--primary-forest);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #ede8df;
  white-space: nowrap;
}

.quiz-category-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 10px;
}

.quiz-description {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.45;
  margin-bottom: 18px;
  flex-grow: 1;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1ece4;
  padding-top: 14px;
}

.question-item-card {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.question-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.option-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  background-color: #faf7f2;
  border: 1px solid #ede8df;
  color: #374151;
}

.option-bubble.is-correct {
  background-color: #e6f4ea;
  border-color: #b7dfca;
  color: #14532d;
  font-weight: 700;
}

/* --- Gamified Quiz Hub Styles --- */
.quiz-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #121c17;
    margin: 30px 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-section-subtitle {
    font-size: 0.9rem;
    color: #728077;
    margin: 0 0 20px 0;
}

.quiz-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.quiz-item-card {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(18, 28, 23, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.quiz-item-card.locked {
    background: #fbf9f4;
    border-color: #e5dfd3;
    opacity: 0.85;
}

.quiz-item-card:not(.locked):hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(18, 28, 23, 0.09);
    border-color: #1c432d;
}

.quiz-card-thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: #f4efe6;
}

.quiz-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.quiz-badge-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quiz-mini-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1ede4;
    color: #554e42;
}

.quiz-mini-badge.complete {
    background: #e6f4ea;
    color: #166534;
}

.quiz-mini-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.quiz-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 14px 0;
    line-height: 1.35;
}

.quiz-card-action {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1ede4;
}

.quiz-btn-action {
    display: block;
    text-align: center;
    padding: 9px 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.84rem;
    text-decoration: none;
    transition: background 0.2s;
}

.quiz-btn-action.active {
    background: #1c432d;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(28,67,45,0.2);
}

.quiz-btn-action.locked {
    background: #e5dfd3;
    color: #8c8270;
    cursor: not-allowed;
}

/* Aesthetic Compact Quiz Cards */
.quiz-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 16px;
}

.aesthetic-quiz-card {
    background: #ffffff;
    border: 3px solid #d4c5a9; /* Sempadan gaya klasik/tali */
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aesthetic-quiz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(28,67,45,0.08);
}

.aesthetic-quiz-card.locked {
    opacity: 0.75;
    border-style: dashed;
    background: #fbf9f4;
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.quiz-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #121c17;
    margin: 0;
    line-height: 1.3;
}

.quiz-badges-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quiz-pill-badge {
    background: #f4efe6;
    color: #5c5240;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.quiz-thumb-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid #e5dfd3;
}

.aesthetic-start-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #1c432d;
    color: #ffffff;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(28,67,45,0.2);
    margin-top: auto;
    transition: background 0.15s ease;
}

.aesthetic-start-btn:hover {
    background: #143221;
}

.aesthetic-start-btn.locked-btn {
    background: #e5dfd3;
    color: #728077;
    box-shadow: none;
    cursor: not-allowed;
}
/* ==========================================================================
   Student Directory & Minimal Roster Layout
   ========================================================================== */

.student-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 32px;
}

.student-header {
  margin-bottom: 24px;
}

.student-title {
  font-size: 2rem;
  font-weight: 800;
  color: #153222;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.student-subtitle {
  font-size: 0.95rem;
  color: #718096;
  margin: 0;
}

.student-divider {
  border: none;
  border-top: 1px solid #ede8df;
  margin: 20px 0 28px 0;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin-bottom: 28px;
}

.search-pill-input {
  flex: 1;
  padding: 13px 20px;
  background: #ffffff;
  border: 1px solid #e2ddd5;
  border-radius: 999px;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-pill-input:focus {
  border-color: #1b4931;
  box-shadow: 0 0 0 3px rgba(27, 73, 49, 0.08);
}

.btn-search {
  background-color: #1b4931;
  color: #ffffff;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background-color 0.15s ease;
}

.btn-search:hover {
  background-color: #143725;
}

.btn-reset {
  color: #718096;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0 8px;
}

.roster-card {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.roster-table th {
  padding: 16px 24px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c9ba5;
  background-color: #fdfcfb;
  border-bottom: 1px solid #f1ede6;
}

.roster-table td {
  padding: 18px 24px;
  border-bottom: 1px solid #f5f2eb;
  vertical-align: middle;
}

.roster-table tr:last-child td {
  border-bottom: none;
}

.roster-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.roster-row:hover {
  background-color: #faf8f4;
}

.learner-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.learner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e4efe7, #d2e4d7);
  color: #1b4931;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #c3dbc9;
}

.learner-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #153222;
  margin: 0;
}

.learner-email {
  font-size: 0.82rem;
  color: #8c9ba5;
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-badge.active {
  background-color: #eaf6ed;
  color: #166534;
}

.status-badge.suspended {
  background-color: #fef2f2;
  color: #b91c1c;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.btn-view-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #faf8f5;
  border: 1px solid #e5dfd5;
  color: #1b4931;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.roster-row:hover .btn-view-profile {
  background-color: #1b4931;
  color: #ffffff;
  border-color: #1b4931;
}

/* ==========================================================================
   Student profile admin side 
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 998;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.student-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 460px;
  max-width: 92vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.student-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px 28px;
  border-bottom: 1px solid #f1ece4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #153222;
}

.drawer-close-btn {
  background: #faf7f2;
  border: 1px solid #ede8df;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: #ede8df;
  color: #111827;
}

.drawer-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.drawer-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #faf8f5;
  border: 1px solid #ede8df;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.drawer-avatar-lg {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #1b4931;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #153222;
  margin: 0;
}

.drawer-email {
  font-size: 0.85rem;
  color: #718096;
  margin-top: 2px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.drawer-metric {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.drawer-metric-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #153222;
  line-height: 1.2;
}

.drawer-metric-label {
  font-size: 0.75rem;
  color: #8c9ba5;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.drawer-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8c9ba5;
  margin: 0 0 12px 0;
}

.badges-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.badge-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #ede8df;
  transition: all 0.2s ease;
}

.badge-pill.locked {
  opacity: 0.45;
  background: #fdfdfd;
  filter: grayscale(1);
}

.badge-pill.earned {
  border-color: #cde4d4;
  background: #f7faf8;
}

.badge-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.badge-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
}

.badge-status {
  font-size: 0.7rem;
  color: #8c9ba5;
}

.drawer-meta-box {
  background: #faf8f5;
  border: 1px solid #ede8df;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.drawer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.drawer-meta-row:last-child {
  margin-bottom: 0;
}

.drawer-actions {
  border-top: 1px solid #f1ece4;
  padding-top: 20px;
  display: flex;
  gap: 10px;
}

.btn-drawer-status {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid #e2ddd5;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4a5568;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-drawer-status:hover {
  background-color: #faf8f5;
}

.btn-drawer-delete {
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid #fee2e2;
  background: #fff5f5;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-drawer-delete:hover {
  background: #fee2e2;
}

.roster-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5dfd5;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action-icon:hover {
  background: #faf8f5;
  color: #1b4931;
  border-color: #1b4931;
}

.btn-action-icon.btn-delete-row:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Edit button inside drawer */
.btn-drawer-edit {
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid #e2ddd5;
  background: #ffffff;
  color: #153222;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-drawer-edit:hover {
  background: #faf8f5;
  border-color: #153222;
}

.drawer-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-badge-card {
  background: #ffffff;
  border: 1.5px solid #cde4d4;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-badge-card.is-hidden-badge {
  display: none;
}

.drawer-badge-icon-box {
  width: 34px;
  height: 34px;
  background: #f3efe6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.drawer-badge-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.drawer-badge-meta {
  overflow: hidden;
  min-width: 0;
}

.drawer-badge-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-badge-desc {
  font-size: 0.7rem;
  color: #8c9ba5;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-badges-empty {
  color: #8c9ba5;
  font-size: 0.85rem;
  grid-column: span 2;
}

.drawer-all-badges-wrap {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.drawer-all-badges-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1b4931;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawer-all-badges-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
  Badges Admin Management
  ========================================================================== */
.badge-preview-icon img,
.badge-icon img,
.badge-pill img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.badge-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: #f6f3ee;
  border: 1px solid #ede8df;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
  box-sizing: border-box;
}

.badge-pill.locked img {
  filter: grayscale(1) opacity(0.4);
}

/* ==========================================================================
  same size image
  ========================================================================== */
.story-hero-banner {
    position: relative;
    width: 100%;
    height: 360px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 22px;
    background: #eef2ec;
    border: 1px solid #ded8cb;
    box-shadow: 0 10px 24px rgba(18, 28, 23, 0.08);
}

.story-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    display: block;
}

.story-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(18, 28, 23, 0.06) 0%,
        rgba(18, 28, 23, 0.25) 55%,
        rgba(16, 32, 23, 0.78) 100%
    );
    pointer-events: none;
}

.story-hero-caption {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 22px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.story-hero-tag {
    background: #dfb572;
    color: #121c17;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.story-hero-title {
    margin: 0;
    color: #ffffff;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
    .story-hero-banner {
        height: 240px;
        border-radius: 16px;
    }
    .story-hero-caption {
        left: 18px;
        right: 18px;
        bottom: 16px;
    }
    .story-hero-title {
        font-size: 1.65rem;
    }
}

/* ==========================================================================
   Admin Analytics Dashboard
   ========================================================================== */

.dashboard-container {
  max-width: 1200px;
  margin: 0;
  padding: 36px 40px;
}

.dashboard-header {
  margin-bottom: 24px;
}

.dashboard-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #153222;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.95rem;
  color: #718096;
  margin: 0;
}

.dashboard-divider {
  border: none;
  border-top: 1px solid #ede8df;
  margin: 20px 0 28px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c9ba5;
  margin-bottom: 6px;
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #153222;
  line-height: 1;
}

.stat-badge-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f4efe6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.charts-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.chart-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #153222;
  margin: 0;
}

.chart-card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  background: #eaf6ed;
  color: #166534;
  padding: 4px 10px;
  border-radius: 999px;
}

.chart-canvas-box {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Bottom Feed Grid (Recent Students & Recent Activity) */
.feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feed-card {
  background: #ffffff;
  border: 1px solid #ede8df;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.feed-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #153222;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-card-title a {
  font-size: 0.8rem;
  color: #1b4931;
  text-decoration: none;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: #faf8f5;
  border: 1px solid #f1ece4;
}

.feed-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-item-text {
  display: flex;
  flex-direction: column;
}

.feed-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #153222;
}

.feed-item-sub {
  font-size: 0.75rem;
  color: #8c9ba5;
}

.feed-item-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d97706;
}

/* Responsive collapse for screens <= 1024px */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 20px 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid,
  .feed-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
  Notification
   ========================================================================== */

.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

/* Floating Result Menu */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ede8df;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    padding: 6px;
}

/* Each Student Row inside Dropdown */
.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 12px;
}

.autocomplete-item:hover {
    background-color: #f7f5f0;
}

.ac-user-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ac-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e4efe7;
    color: #1b4931;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ac-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #153222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-sub {
    font-size: 0.74rem;
    color: #8c9ba5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-add-btn {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #eaf6ed;
    color: #166534;
    border: 1px solid #c2e2cc;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.autocomplete-item:hover .ac-add-btn {
    background: #166534;
    color: #ffffff;
    border-color: #166534;
}

.ac-add-btn.is-added {
    background: #f1ede6;
    color: #8c9ba5;
    border-color: #e2ddd5;
}

/* Selected Students Chip Container */
.student-tags-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 12px 14px;
    background: #faf8f5;
    border: 1px solid #ede8df;
    border-radius: 14px;
    margin-top: 10px;
}

.student-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #dcd6cc;
    padding: 4px 8px 4px 6px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #153222;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.tag-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1b4931;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-tag-pill button.btn-remove-tag {
    background: #f1ede6;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}

.student-tag-pill button.btn-remove-tag:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Summary Bar */
.tags-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 0 4px;
    font-size: 0.78rem;
    color: #8c9ba5;
    font-weight: 600;
}

.btn-clear-all-tags {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0;
}

.btn-clear-all-tags:hover {
    text-decoration: underline;
}

/* =========================================
   Manage Quiz Compact Builder & Accordion List
   ========================================= */
.quiz-admin-main {
  padding: 30px;
}

.quiz-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 960px;
}

.quiz-page-title {
  margin: 0 0 4px 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #121c17;
}

.quiz-page-subtitle {
  margin: 0;
  color: #666666;
  font-size: 0.88rem;
}

.quiz-divider {
  border: none;
  border-top: 1px solid #ded8cb;
  margin: 0 0 20px 0;
  max-width: 960px;
}

.quiz-btn-primary {
  background: #1c432d;
  color: #ffffff;
  padding: 11px 18px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.quiz-btn-primary:hover {
  background: #143221;
}

.quiz-btn-secondary {
  background: #ffffff;
  color: #1c432d;
  padding: 9px 15px;
  border: 1.5px solid #ded8cb;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quiz-btn-secondary:hover {
  background: #f4f2eb;
  border-color: #1c432d;
}

.quiz-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 600;
  max-width: 960px;
}

.quiz-alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.quiz-alert.success {
  background: #eaf6ed;
  color: #166534;
  border: 1px solid #b7dfc2;
}

.compact-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  max-width: 960px;
}

.compact-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.set-meta-strip {
  max-width: 960px;
  background: #fbf9f4;
  border: 1px solid #ded8cb;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: #374151;
}

.set-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cap-badge {
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: #eaf6ed;
  color: #1c432d;
  border: 1px solid #b7dfc2;
}

.cap-badge.full {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.quiz-form-card {
  max-width: 960px;
  background: #ffffff;
  border: 1px solid #ded8cb;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  margin-bottom: 22px;
}

.style-switcher-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee9de;
}

.style-pill-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1.5px solid #ded8cb;
  background: #fbf9f4;
  color: #374151;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.style-pill-btn:hover {
  border-color: #1c432d;
  color: #1c432d;
}

.style-pill-btn.active {
  background: #1c432d;
  border-color: #1c432d;
  color: #ffffff;
}

.style-guide-box {
  background: #f4f8f5;
  border: 1px solid #cce0d2;
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 0.82rem;
  color: #1c432d;
  margin-bottom: 14px;
}

.quiz-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.quiz-field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-field-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #121c17;
}

.quiz-field-hint {
  font-size: 0.77rem;
  color: #6b7280;
  margin: 0;
}

.quiz-input,
.quiz-select,
.quiz-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #cfd9d2;
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.9rem;
  color: #121c17;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quiz-input:focus,
.quiz-select:focus,
.quiz-textarea:focus {
  border-color: #1c432d;
  box-shadow: 0 0 0 3px rgba(28, 67, 45, 0.1);
}

.quiz-compact-select {
  padding: 8px 12px;
  border: 1.5px solid #ded8cb;
  border-radius: 9px;
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  color: #121c17;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
}

.tf-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.tf-choice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #ded8cb;
  border-radius: 10px;
  background: #fbf9f4;
  font-weight: 800;
  font-size: 0.92rem;
  color: #121c17;
  cursor: pointer;
}

.tf-choice-card input[type="radio"] {
  accent-color: #1c432d;
  transform: scale(1.15);
}

.blank-helper-btn {
  background: #eef5f0;
  color: #1c432d;
  border: 1px solid #b7dfc2;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.blank-helper-btn:hover {
  background: #dceee1;
}

.quiz-media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 12px 14px;
  background: #fbf9f4;
  border: 1px dashed #d4cec0;
  border-radius: 10px;
  margin-bottom: 14px;
}

.quiz-media-preview {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #374151;
  flex-wrap: wrap;
}

.quiz-media-preview img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ded8cb;
}

.quiz-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Accordion Question List */
.quiz-question-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
}

.q-row-card {
  background: #ffffff;
  border: 1px solid #ded8cb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.q-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.q-row-header:hover {
  background: #fbf9f4;
}

.q-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.q-num-badge {
  flex-shrink: 0;
  background: #eaf6ed;
  color: #1c432d;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.q-style-pill {
  flex-shrink: 0;
  background: #f4f1ea;
  color: #5c6861;
  font-weight: 700;
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e2ddd0;
}

.q-media-tag {
  flex-shrink: 0;
  background: #eef6ff;
  color: #1e40af;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}

.q-ans-pill {
  flex-shrink: 0;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.q-prompt-preview {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.45;
  color: #121c17;
  white-space: pre-line;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 220px;
}

.q-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.q-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.q-icon-btn.edit {
  color: #1c432d;
}

.q-icon-btn.edit:hover {
  background: #eaf6ed;
  border-color: #b7dfc2;
}

.q-icon-btn.delete {
  color: #991b1b;
}

.q-icon-btn.delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.q-row-details {
  display: none;
  padding: 14px 16px 16px 16px;
  border-top: 1px solid #eee9de;
  background: #fcfbf8;
}

.q-row-card.is-open .q-row-details {
  display: block;
}

.q-detail-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.q-detail-chip {
  padding: 8px 11px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e0d5;
  font-size: 0.84rem;
  color: #374151;
}

.q-detail-chip.is-correct {
  background: #eaf6ed;
  border-color: #86efac;
  color: #14532d;
  font-weight: 700;
}

.q-detail-media {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.q-detail-media img {
  max-height: 90px;
  border-radius: 8px;
  border: 1px solid #ded8cb;
}

.pager-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.pager-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pager-btn {
  background: #ffffff;
  border: 1px solid #ded8cb;
  color: #1c432d;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.pager-btn.active,
.pager-btn:hover {
  background: #1c432d;
  color: #ffffff;
  border-color: #1c432d;
}

.is-hidden-field {
  display: none;
}

/* =========================================
Quiz Setup Form Card (add_quiz.php)
========================================= */
.quiz-setup-main {
padding: 28px 32px;
}

.quiz-setup-shell {
max-width: 980px;
}

.quiz-setup-card {
background: #ffffff;
border: 1px solid #ece6da;
border-radius: 20px;
padding: 28px 30px;
box-shadow: 0 4px 16px rgba(18, 28, 23, 0.03);
}

.quiz-setup-group {
margin-bottom: 18px;
}

.quiz-setup-row-2 {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 18px;
}

@media (max-width: 720px) {
.quiz-setup-row-2 {
grid-template-columns: 1fr;
}
}

.quiz-setup-label {
display: block;
font-size: 0.86rem;
font-weight: 800;
color: #16221b;
margin-bottom: 8px;
}

.quiz-setup-input,
.quiz-setup-select,
.quiz-setup-textarea {
width: 100%;
padding: 11px 14px;
border: 1.5px solid #e2ddd2;
border-radius: 12px;
background: #ffffff;
font-size: 0.92rem;
color: #16221b;
outline: none;
box-sizing: border-box;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quiz-setup-input:focus,
.quiz-setup-select:focus,
.quiz-setup-textarea:focus {
border-color: #1b4931;
box-shadow: 0 0 0 3px rgba(27, 73, 49, 0.08);
}

.quiz-cap-banner {
background: #eef6f0;
border: 1px solid #cce3d3;
border-radius: 12px;
padding: 13px 16px;
margin-bottom: 18px;
font-size: 0.85rem;
color: #163624;
line-height: 1.45;
}

.quiz-kinds-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
}

@media (max-width: 720px) {
.quiz-kinds-grid {
grid-template-columns: 1fr;
}
}

.quiz-kind-box {
display: flex;
align-items: center;
gap: 12px;
padding: 13px 16px;
border: 1.5px solid #e5dfd3;
border-radius: 12px;
background: #fbfaf7;
font-size: 0.88rem;
font-weight: 700;
color: #16221b;
cursor: pointer;
transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-kind-box:hover {
border-color: #1b4931;
background: #f5f9f6;
}

.quiz-kind-box input[type="checkbox"] {
accent-color: #1b4931;
width: 16px;
height: 16px;
cursor: pointer;
}

.quiz-setup-footer {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 14px;
margin-top: 22px;
}

.quiz-setup-cancel {
color: #4b5563;
font-size: 0.9rem;
font-weight: 700;
text-decoration: underline;
padding: 10px 12px;
}

.quiz-setup-submit {
background: #173d29;
color: #ffffff;
border: none;
border-radius: 12px;
padding: 12px 24px;
font-size: 0.92rem;
font-weight: 800;
cursor: pointer;
transition: background 0.15s ease;
}

.quiz-setup-submit:hover {
background: #102c1d;
}

.quiz-main {
    padding: 30px;
}

.quiz-back-wrap {
    margin-bottom: 14px;
}

.quiz-back-link {
    text-decoration: none;
    font-weight: 700;
    color: #1c432d;
    font-size: 0.9rem;
}

.quiz-page-header {
    margin-bottom: 24px;
}

.quiz-page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #121c17;
    margin: 0;
}

.quiz-section-rule {
    border: none;
    border-top: 1px solid #ded8cb;
    margin-bottom: 24px;
}

.quiz-alert-success {
    background: #ecfdf5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.quiz-folder-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-folder-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #121c17;
    margin: 0;
}

.quiz-create-btn {
    background: #1c432d;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.88rem;
}

.quiz-empty-box {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: #728077;
}

.quiz-empty-text {
    margin: 0 0 14px 0;
}

.quiz-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quiz-set-card {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.quiz-set-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.quiz-set-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #121c17;
    margin: 0;
}

.quiz-set-note {
    font-size: 0.82rem;
    color: #728077;
    background: #fbf9f4;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0 0 14px 0;
    border: 1px solid #e5dfd3;
}

.quiz-set-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #f1ede4;
}

.quiz-manage-btn {
    flex: 1;
    text-align: center;
    background: #1c432d;
    color: #ffffff;
    padding: 9px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

.admin-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #121c17;
    margin: 24px 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 2px solid #e5dfd3;
    padding-bottom: 8px;
}

.admin-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.admin-folder-card {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.admin-folder-card:hover {
    transform: translateY(-3px);
    border-color: #1c432d;
    box-shadow: 0 8px 22px rgba(18, 28, 23, 0.07);
}

.admin-folder-cover {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.admin-folder-placeholder {
    width: 100%;
    height: 110px;
    background: #fbf9f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.admin-folder-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.admin-folder-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-folder-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #121c17;
    margin: 0;
}

.admin-folder-title--spaced {
    margin-bottom: 10px;
}

.admin-folder-meta {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: #728077;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1ede4;
}

.admin-empty-state {
    color: #728077;
    font-size: 0.9rem;
    font-style: italic;
}

.admin-search-empty {
    display: none;
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    color: #728077;
    margin-top: 16px;
}

.tab-menu {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.tab-btn {
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid #ded8cb;
    background: #fbf9f4;
    color: #554e42;
}

.tab-btn.active {
    background: #1c432d;
    color: #ffffff;
    border-color: #1c432d;
}

.academic-search-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 680px;
    width: 100%;
    margin-bottom: 18px;
}

.academic-search-input {
    flex: 1;
    height: 44px;
    padding: 0 18px;
    border: 1.5px solid #cfd9d2;
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.92rem;
    color: #121c17;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.academic-search-input::placeholder {
    color: #78867e;
}

.academic-search-input:focus {
    border-color: #1c432d;
    box-shadow: 0 0 0 3px rgba(28, 67, 45, 0.1);
}

.academic-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.btn-academic-search {
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: #2f4f3c;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-academic-search:hover {
    background: #1c432d;
}

.quota-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e6f4ea;
    color: #166534;
}

.quota-badge.maxed {
    background: #fef3c7;
    color: #92400e;
}

.quota-badge--banner {
    padding: 8px 14px;
    font-size: 0.82rem;
}

.q-cap-pill {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f6f4;
    color: #1c432d;
    border: 1px solid #d5e2da;
    white-space: nowrap;
}

.q-cap-pill.over {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.q-type-hint {
    font-size: 0.8rem;
    color: #4b5563;
    background: #fbf9f4;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0 0 14px 0;
    border: 1px solid #e5dfd3;
    line-height: 1.45;
}

.btn-edit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fbf9f4;
    color: #1c432d;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #ded8cb;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-edit-icon:hover {
    background: #eef5f0;
    border-color: #1c432d;
}

.btn-delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #fecaca;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-delete-icon:hover {
    background: #fee2e2;
    color: #7f1d1d;
}
/* ==========================================================================
student portal
   ========================================================================== */


   /* ==========================================================================
   Student Dashboard Hero Banner (Mascot, Streak & Weekday Tracker)
   ========================================================================== */

.dashboard-hero-banner {
    position: relative;
    border-radius: 24px;
    padding: 24px 32px;
    background: 
        linear-gradient(98deg, rgba(20, 40, 30, 0.85) 0%, rgba(20, 35, 25, 0.65) 50%, rgba(35, 28, 15, 0.75) 100%),
        url('../assets/images/kinabalu.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(26, 46, 35, 0.12);
    overflow: hidden;
    margin-bottom: 26px;
}

.hero-left-content {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex: 1;
    min-width: 0;
}

.hero-mascot-frame {
    width: 105px;
    height: 105px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mascot-floating-img {
    width: 230px;          
    height: auto;
    max-height: 220px;
    object-fit: contain;
    flex-shrink: 0;
    margin-bottom: -24px;       
    margin-top: -10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
    user-select: none;
    pointer-events: none;
}

.hero-text-block {
    display: flex;
    flex-direction: column;
}

.hero-greeting-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.hero-greeting-sub {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.45;
    max-width: 460px;
}

.hero-right-tracker {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.tracker-top-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.streak-pod {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.streak-flame-icon {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(249, 115, 22, 0.45));
}

.streak-count-val {
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    margin-top: 2px;
}

.streak-count-lbl {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.weekday-tracker-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.weekday-header-title {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
}

.weekday-boxes-row {
    display: flex;
    gap: 6px;
}

.weekday-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.weekday-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}

.weekday-check-box {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekday-check-box.active {
    background: #1e3d2f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.weekday-check-box.active svg {
    stroke: #ffffff;
    stroke-width: 3.2;
}

.btn-resume-study {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #173326;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: background 0.15s ease, transform 0.15s ease;
    width: 100%;
}

.btn-resume-study:hover {
    background: #0f231a;
    transform: translateY(-1px);
}

.resume-pill-progress {
    width: 70px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.resume-pill-fill {
    height: 100%;
    background: #eab308;
    border-radius: 999px;
}

@media (max-width: 992px) {
    .dashboard-hero-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
    .hero-right-tracker {
        align-items: flex-start;
        width: 100%;
    }
    .tracker-top-row {
        width: 100%;
        justify-content: space-between;
    }
}

.hero-mascot-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
/* Ensure the student sidebar container allows the motif strip on the right */
#studentSidebar.sidebar-drawer {
    position: relative !important;
    padding-right: 28px !important;
    overflow-x: hidden !important;
}

/* Vertical Motif Border Strip */
#studentSidebar .sidebar-motif-strip {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 20px !important;
    height: 100% !important;
    background-image: url('../images/motif.jpg') !important;
    background-repeat: repeat-y !important;
    background-size: 20px auto !important;
    background-position: center top !important;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15) !important;
    pointer-events: none !important;
    z-index: 100 !important;
}

/* Full custom background image on the student sidebar */
#studentSidebar.sidebar-drawer.student-sidebar-custom-bg,
.student-sidebar-custom-bg {
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(
            180deg,
            rgba(16, 42, 27, 0.52) 0%,
            rgba(16, 42, 27, 0.64) 55%,
            rgba(12, 32, 20, 0.78) 100%
        ),
        url('../images/sidebar.png') !important;
    background-size: cover, cover !important;
    background-position: center, center !important;
    background-repeat: no-repeat, no-repeat !important;
}

/* Crisp white text & icons for all student sidebar items */
#studentSidebar .nav-item,
#studentSidebar .nav-item span,
#studentSidebar .nav-item svg,
#studentSidebar .nav-item a,
#studentSidebar .nav-item div {
    color: rgba(255, 255, 255, 0.95) !important;
    stroke: currentColor !important;
    opacity: 1 !important;
}

#studentSidebar .nav-item {
    background-color: rgba(12, 34, 21, 0.45) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#studentSidebar .nav-item svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    flex-shrink: 0;
}

#studentSidebar .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

#studentSidebar .nav-item.active {
    background-color: rgba(134, 173, 146, 0.65) !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* Close button (X) visibility */
#studentSidebar .btn-sidebar-close,
#studentSidebar .btn-sidebar-close svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
    background-color: rgba(12, 34, 21, 0.55) !important;
    border-radius: 8px;
}

/* Sign Out button contrast */
#studentSidebar .sign-out-link,
#studentSidebar .sign-out-link span,
#studentSidebar .sign-out-link svg {
    color: #fecaca !important;
    stroke: #fecaca !important;
}

#studentSidebar .sign-out-link {
    background-color: rgba(69, 18, 18, 0.55) !important;
}

#studentSidebar .sign-out-link:hover {
    background-color: rgba(153, 27, 27, 0.75) !important;
    color: #ffffff !important;
}

.student-sidebar-custom-bg .sidebar-top-wrapper,
.student-sidebar-custom-bg .sidebar-signout-footer {
    position: relative;
    z-index: 1;
}

.student-sidebar-custom-bg .sidebar-motif-strip {
    z-index: 2;
}

/* Keep links readable over detailed background artwork */
.student-sidebar-custom-bg .nav-item {
    background-color: rgba(15, 38, 25, 0.36);
    backdrop-filter: blur(2px);
}

.student-sidebar-custom-bg .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.16);
}

.student-sidebar-custom-bg .nav-item.active {
    background-color: rgba(134, 173, 146, 0.58);
}

/* Top Logo Header */
.student-logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 14px 16px 14px;
    position: relative;
}

.student-sidebar-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.student-sidebar-logo {
    width: 100%;
    max-width: 175px;
    height: auto;
    max-height: 118px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.mobile-header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.student-logo-header .btn-sidebar-close {
    position: absolute;
    right: 10px;
    top: 12px;
}

/* ==========================================================================
   Interactive Dusun World Map Component
   ========================================================================== */

.dusun-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 980px;
    margin-bottom: 32px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(18, 28, 23, 0.18);
    border: 3px solid #dfb572;
    background: #1e3d2f;
}

/* Aspect-ratio container so coordinates never shift */
.dusun-map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: url('../images/map.png') center/cover no-repeat;
    overflow: hidden;
}

/* Fallback if map image is a jpg */
@supports not (aspect-ratio: 16 / 9) {
    .dusun-map-container {
        padding-top: 56.25%;
        height: 0;
    }
}

/* Top-Left & Bottom-Right Floating Badges */
.map-badge-top-left {
    position: absolute;
    top: 18px;
    left: 20px;
    background: rgba(18, 38, 27, 0.88);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(223, 181, 114, 0.7);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.map-badge-bottom-right {
    position: absolute;
    bottom: 18px;
    right: 20px;
    background: rgba(18, 38, 27, 0.88);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(223, 181, 114, 0.7);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}


/* ==========================================================================
   Clickable Map Pins
   ========================================================================== */

.map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.map-pin:hover {
    transform: translate(-50%, -108%) scale(1.08);
}

/* Circular Pin Icon */
.pin-icon-bubble {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, #244b36 0%, #152d20 100%);
    border: 2.5px solid #f6d892;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    position: relative;
    transition: all 0.2s ease;
}

.map-pin:hover .pin-icon-bubble {
    border-color: #ffffff;
    background: radial-gradient(circle, #2d5e43 0%, #1a3827 100%);
    box-shadow: 0 0 16px rgba(246, 216, 146, 0.7);
}

/* Subtle Pulsing Ring Behind Bubble */
.pin-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #f6d892;
    opacity: 0.8;
    animation: pinPulse 2s infinite ease-out;
}

@keyframes pinPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Dark Green + Gold Border Pill Label */
.pin-label-pill {
    margin-top: 6px;
    background: #173625;
    border: 1.5px solid #d4a359;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.map-pin:hover .pin-label-pill {
    background: #0f2318;
    border-color: #fce8a6;
    color: #fce8a6;
}

/* Pin Small Arrow Tail */
.pin-pointer-tail {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #173625;
    margin-top: -1px;
}

/* Specific Pin Positions (% based on your artwork) */
.pin-vocab {
    top: 42%;
    left: 42%;
}

.pin-stories {
    top: 75%;
    left: 31%;
}

.pin-quiz {
    top: 31%;
    left: 73%;
}

.pin-practice {
    top: 67%;
    left: 81%;
}

/* Mobile & Tablet Scaling */
@media (max-width: 768px) {
    .pin-icon-bubble {
        width: 38px;
        height: 38px;
    }
    .pin-icon-bubble svg {
        width: 16px;
        height: 16px;
    }
    .pin-label-pill {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    .map-badge-top-left,
    .map-badge-bottom-right {
        font-size: 0.72rem;
        padding: 5px 10px;
    }
}

/* ==========================================================================
   Refined Academic Student Portal (University Tier)
   ========================================================================== */

.student-portal {
  --bg-sand: #fbfaf7;
  --bg-card: #ffffff;
  --bg-sidebar: #f5f2eb;
  --bg-subtle: #eeece4;

  --primary-forest: #1e3d2f;
  --primary-forest-hover: #152c22;
  --primary-sage: #4f6d5e;
  --primary-moss: #769382;

  --warm-tan: #e8e3d8;
  --warm-border: #ded8cb;
  --warm-border-light: #ece8df;

  --text-dark: #121c17;
  --text-body: #3c4a42;
  --text-muted: #6b7a71;

  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(30, 61, 47, 0.03);
  --shadow-hover: 0 4px 16px rgba(30, 61, 47, 0.08);
}

/* 1. Refined Executive Hero Banner */
.academic-hero {
  background: #ffffff;
  border: 1px solid var(--warm-border);
  border-left: 4px solid var(--primary-forest);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-subtle);
  flex-wrap: wrap;
  gap: 20px;
}

.hero-tagline {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-sage);
  margin-bottom: 6px;
  display: inline-block;
}

.academic-hero h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.academic-hero p {
  font-size: 0.92rem;
  color: var(--text-body);
  margin: 0 0 18px 0;
  max-width: 580px;
  line-height: 1.5;
}

.btn-academic-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--primary-forest);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-academic-primary:hover {
  background: var(--primary-forest-hover);
}

.streak-pill-subtle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: #fbfaf7;
  border: 1px solid var(--warm-border);
  color: var(--text-dark);
  font-size: 0.88rem;
}

/* 2. Sleek Metrics Grid */
.academic-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .academic-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .academic-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.academic-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-label-row span {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-label-row svg {
  color: var(--primary-sage);
}

.metric-figure {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
}

.metric-figure small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

/* 3. Section Headers & Learning Modules */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-wrap h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -0.01em;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.academic-module-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: all 0.18s ease;
}

.academic-module-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-forest);
  box-shadow: var(--shadow-hover);
}

.module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.module-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-forest);
}

.module-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.academic-module-card p {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.module-footer-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-forest);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   categories
   ========================================================================== */

.category-page-header {
  margin-bottom: 24px;
}

.category-page-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.category-page-header p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* Search & Filter Toolbar */
.academic-search-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 480px;
}

.academic-search-input {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.academic-search-input:focus {
  border-color: var(--primary-forest);
}

.btn-academic-search {
  padding: 9px 16px;
  background: var(--primary-forest);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-academic-reset {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Category Grid & Cards */
.academic-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.academic-category-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.18s ease;
}

.academic-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-forest);
  box-shadow: var(--shadow-hover);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.category-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-forest);
}

.category-term-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-sage);
  background: #fbfaf7;
  border: 1px solid var(--warm-border);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.category-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 6px 0;
}

.category-card-desc {
  font-size: 0.86rem;
  color: var(--text-body);
  line-height: 1.45;
  margin: 0 0 18px 0;
}

.category-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--warm-border-light);
}

.btn-card-primary {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: var(--primary-forest);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-card-primary:hover {
  background: var(--primary-forest-hover);
}

.btn-card-secondary {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--warm-border);
  color: var(--primary-forest);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-card-secondary:hover {
  background: var(--warm-tan);
}

/* ==========================================================================
   vocab
   ========================================================================== */

/* 1. Flush Mountain Banner */
.vocab-hero-strip {
    position: relative;
    border-radius: 22px;
    margin-top: 24px;
    margin-bottom: 24px;
    background:
        linear-gradient(98deg, rgba(16, 32, 23, 0.88) 0%, rgba(18, 30, 22, 0.70) 55%, rgba(28, 22, 12, 0.80) 100%),
        url('../assets/images/Kinabalu.jpg') center/cover no-repeat;
    box-shadow: 0 10px 24px rgba(18, 28, 23, 0.16);
    overflow: hidden;
    color: #ffffff;
}

/* 3. Category Grid & Cards */
.vocab-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.vocab-cat-card {
    background: #ffffff;
    border: 1px solid #e5dfd3;
    border-radius: 20px;
    padding: 14px;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(18, 28, 23, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vocab-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(18, 28, 23, 0.1);
}

.cat-card-media {
    position: relative;
    width: 100%;
    height: 160px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #f4efe6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    box-sizing: border-box;
}

.cat-card-body {
    padding: 14px 4px 4px 4px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cat-title-dusun {
    font-size: 1.25rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.cat-sub-meanings {
    font-size: 0.88rem;
    color: #6d665b;
    margin-bottom: 12px;
    line-height: 1.35;
}

.cat-progress-bar {
    width: 100%;
    height: 5px;
    background: #ebe6dc;
    border-radius: 999px;
    overflow: hidden;
    margin-top: auto;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.cat-progress-fill {
    height: 100%;
    background: #1c432d;
    border-radius: 999px;
}

.cat-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1024px) {
    .vocab-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .vocab-main-layout {
        padding-left: 16px;
        padding-right: 16px;
    }

    .vocab-hero-strip {
        margin-top: 16px;
    }

    .vocab-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .vocab-mascot-img {
        width: 100px;
        max-height: 105px;
        margin-bottom: 0;
    }

    .vocab-page-title {
        font-size: 1.6rem;
    }

    .vocab-search-input {
        width: 100%;
    }

    .vocab-search-form {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .vocab-categories-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ==========================================================================
   Attached Vocab Kinabalu Banner & Categories Grid
   ========================================================================== */

.vocab-main-layout {
    padding-top: 0 !important; /* Lets banner attach flush to the top edge */
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 40px;
}

/* 1. Flush Mountain Banner */
.vocab-hero-strip {
    position: relative;
    border-radius: 22px;
    margin-top: 24px;
    margin-bottom: 24px;
    background: 
        linear-gradient(98deg, rgba(16, 32, 23, 0.88) 0%, rgba(18, 30, 22, 0.70) 55%, rgba(28, 22, 12, 0.80) 100%),
        url('../assets/images/kinabalu.jpg') center/cover no-repeat;
    box-shadow: 0 10px 24px rgba(18, 28, 23, 0.16);
    overflow: hidden;
    color: #ffffff;
}

.vocab-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 34px;
    gap: 20px;
}

.vocab-hero-left {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex: 1;
}

.vocab-mascot-img {
    width: 140px;
    max-height: 145px;
    object-fit: contain;
    margin-bottom: -24px; /* Anchors the mascot torso flush to the bottom */
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.38));
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
}

.vocab-hero-headings {
    padding-bottom: 6px;
}

.vocab-page-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.vocab-page-subtitle {
    font-size: 0.95rem;
    color: #d1dcce;
    margin: 0;
    line-height: 1.45;
    max-width: 620px;
}

/* Right Streak Pod */
.vocab-streak-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(223, 181, 114, 0.4);
    padding: 10px 18px;
    border-radius: 16px;
}

.vocab-streak-flame {
    font-size: 2rem;
    line-height: 1;
}

.vocab-streak-info {
    display: flex;
    flex-direction: column;
}

.vocab-streak-info .streak-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.vocab-streak-info .streak-sub {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #dfb572;
    font-weight: 700;
}

/* 2. Search Bar */
.vocab-controls-shelf {
    margin-bottom: 24px;
}

.vocab-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vocab-search-input {
    width: 320px;
    max-width: 100%;
    background: #ffffff;
    border: 1.5px solid #ded8cb;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    color: #121c17;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vocab-search-input:focus {
    border-color: #1c432d;
    box-shadow: 0 0 0 3px rgba(28, 67, 45, 0.12);
}

.vocab-search-btn {
    background: #1c432d;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.vocab-search-btn:hover {
    background: #153423;
}

.vocab-clear-btn {
    color: #8c8375;
    font-size: 0.9rem;
    text-decoration: underline;
    margin-left: 6px;
}

/* 3. Category Grid & Cards */
.vocab-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
}

.vocab-cat-card {
    background: #ffffff;
    border: 1px solid #e5dfd3;
    border-radius: 20px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(18, 28, 23, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vocab-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(18, 28, 23, 0.1);
}

.cat-card-media {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 14px;
    background: #f4efe6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.cat-image-placeholder {
    font-size: 2.8rem;
    color: #b5ac9d;
}

.cat-terms-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    font-size: 0.75rem;
    font-weight: 700;
    color: #121c17;
    padding: 3px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cat-card-body {
    padding: 14px 4px 4px 4px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cat-title-dusun {
    font-size: 1.3rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.cat-sub-meanings {
    font-size: 0.88rem;
    color: #6d665b;
    margin-bottom: 12px;
}

.meaning-dot {
    margin: 0 4px;
    opacity: 0.6;
}

.cat-progress-bar {
    width: 100%;
    height: 5px;
    background: #ebe6dc;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}

.cat-progress-fill {
    height: 100%;
    background: #1c432d;
    border-radius: 999px;
}

.cat-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.btn-card-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-flashcards {
    background: #1c432d;
    color: #ffffff;
}

.btn-flashcards:hover {
    background: #133020;
}

.btn-practice-link {
    background: #f1ede4;
    color: #121c17;
}

.btn-practice-link:hover {
    background: #e5dfd3;
}

/* Mobile & Tablet Adjustments */
@media (max-width: 900px) {
    .vocab-main-layout {
        padding-left: 16px;
        padding-right: 16px;
    }

    .vocab-hero-strip {
        margin-top: 16px;
    }

    .vocab-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .vocab-mascot-img {
        width: 100px;
        max-height: 105px;
        margin-bottom: 0;
    }

    .vocab-page-title {
        font-size: 1.6rem;
    }

    .vocab-search-input {
        width: 100%;
    }

    .vocab-search-form {
        width: 100%;
    }
}

.btn-audio-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-forest);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-audio-trigger:hover {
  background: var(--primary-forest);
  color: #ffffff;
  border-color: var(--primary-forest);
}

.btn-audio-trigger svg {
  stroke: currentColor;
}

/* ==========================================================================
   Hanging Bamboo Pole & Parchment Cards Layout
   ========================================================================== */

.bamboo-pole-row {
    position: relative;
    width: 100%;
    margin-bottom: 60px;
}

.bamboo-beam {
    width: 100%; 
    height: 38px; 
    background: linear-gradient(180deg, #8a5229 0%, #613719 35%, #3d200d 50%, #4d2b12 65%, #261307 100%);
    border-radius: 999px; 
    box-shadow: 0 10px 22px rgba(0,0,0,0.4), inset 0 3px 6px rgba(255,255,255,0.35), inset 0 -4px 6px rgba(0,0,0,0.7);
    position: relative; 
    z-index: 2;
}

.hanging-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    padding: 0 20px;
    margin-top: -6px;
    position: relative;
    z-index: 3;
}

@media (max-width: 1024px) {
    .hanging-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hanging-cards-grid { grid-template-columns: 1fr; }
}

.hanging-card {
    background: #fbf9f4;
    border: 2px solid #d4c5a9;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 14px 28px rgba(18, 28, 23, 0.15);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Longer Hanging Ropes */
.hanging-card::before, .hanging-card::after {
    content: '';
    position: absolute;
    top: -38px;
    width: 10px;
    height: 42px;
    background: #8c6d46;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 4;
}
.hanging-card::before { left: 28px; }
.hanging-card::after { right: 28px; }

.hanging-card:hover {
    transform: translateY(4px);
    box-shadow: 0 8px 20px rgba(18, 28, 23, 0.2);
}

.hanging-card-img {
    width: 100%;
    height: 170px;
    border-radius: 12px;
    overflow: hidden;
    background: #f4efe6;
    margin-bottom: 14px;
    border: 1px solid #ded8cb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hanging-card-img img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

/* ==========================================================================
   DusunLearn - Hanging 3D Wood Beams & Vocabulary Flashcard Grid
   ========================================================================== */

.vocab-row-container {
    position: relative;
    width: 100%;
    margin-bottom: 70px;
    padding: 30px 15px 40px 15px;
    background: linear-gradient(180deg, rgba(244, 239, 230, 0.88) 0%, rgba(235, 226, 211, 0.40) 100%), 
                url('../images/paddy.jpg') center/cover no-repeat;
    border-radius: 20px;
    border: 1px solid #ded8cb;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.05);
}

.vocab-3d-beam {
    width: 100%; 
    height: 38px; 
    background: linear-gradient(180deg, #8a5229 0%, #613719 35%, #3d200d 50%, #4d2b12 65%, #261307 100%); 
    border-radius: 999px; 
    box-shadow: 0 10px 22px rgba(0,0,0,0.4), inset 0 3px 6px rgba(255,255,255,0.35), inset 0 -4px 6px rgba(0,0,0,0.7); 
    position: relative; 
    z-index: 2;
}

.vocab-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    padding: 0 5px;
    margin-top: 18px;
    position: relative;
    z-index: 3;
}

.vocab-hanging-card {
    background: #fbf9f4;
    border: 2px solid #d4c5a9;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 28px rgba(18, 28, 23, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    margin-top: 30px;
}

.vocab-rope-left, .vocab-rope-right {
    position: absolute;
    top: -70px;
    width: 8px;
    height: 80px;
    background: linear-gradient(90deg, #5c3a21 0%, #a67c52 35%, #8c6d46 70%, #4a2f17 100%);
    border-radius: 4px;
    box-shadow: 2px 4px 6px rgba(0,0,0,0.35), inset 0 2px 3px rgba(255,255,255,0.25);
    z-index: 4;
}
.vocab-rope-left { left: 18%; }
.vocab-rope-right { right: 18%; }

/* Responsive Breakpoints & Mobile 2-Frame Layout */
@media (max-width: 1200px) {
    .vocab-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .hanging-cards-grid,
    .vocab-cards-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* 2 frames side-by-side on mobile */
        gap: 12px;
        padding: 0 5px;
    }
    
    .vocab-row-container {
        padding: 20px 8px 30px 8px;
    }

    /* Perfectly tuned rope dimensions for mobile 2-column view */
    .vocab-rope-left, 
    .vocab-rope-right {
        top: -55px !important;
        height: 60px !important;
        width: 7px !important;
    }
    
    .vocab-rope-left { left: 18px !important; }
    .vocab-rope-right { right: 18px !important; }
    
    .vocab-hanging-card {
        margin-top: 20px !important;
    }
}

@media (max-width: 768px) {
    .vocab-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
practice
========================================================================== */

.learn-container {
  max-width: 720px;
  margin: 0 auto;
}

.learn-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.learn-progress-wrap {
  flex: 1;
  margin: 0 16px;
  height: 8px;
  background: var(--warm-tan);
  border-radius: 999px;
  overflow: hidden;
}

.learn-progress-bar {
  height: 100%;
  background: var(--primary-forest);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.btn-exit-learn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
}

.btn-exit-learn:hover {
  color: var(--text-dark);
  border-color: var(--primary-forest);
}

/* Big Interactive Flashcard */
.learn-card-stage {
  perspective: 1000px;
  min-height: 380px;
  margin-bottom: 24px;
}

.learn-card {
  width: 100%;
  min-height: 380px;
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.learn-card-media {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
}

.learn-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learn-word-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 8px 0;
}

.learn-word-sub {
  font-size: 1.1rem;
  color: var(--text-body);
  margin: 0 0 4px 0;
}

.learn-word-secondary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}

.learn-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--warm-border);
  border-radius: 999px;
  color: var(--primary-forest);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.learn-audio-btn:hover {
  background: var(--primary-forest);
  color: #ffffff;
  border-color: var(--primary-forest);
}

/* Bottom Controls */
.learn-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-learn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--warm-border);
  background: var(--bg-card);
  color: var(--text-dark);
  transition: all 0.15s ease;
}

.btn-learn-nav:hover:not(:disabled) {
  border-color: var(--primary-forest);
  color: var(--primary-forest);
}

.btn-learn-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-learn-nav.primary {
  background: var(--primary-forest);
  color: #ffffff;
  border-color: var(--primary-forest);
}

.btn-learn-nav.primary:hover:not(:disabled) {
  background: var(--primary-forest-hover);
  color: #ffffff;
}

/* Completion Screen */
.learn-complete-box {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  padding: 48px 32px;
  text-align: center;
}

/* ==========================================================================
   Folklore 
   ========================================================================== */

.stories-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.story-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-forest);
}

.story-cover-wrap {
  height: 180px;
  background: var(--bg-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.story-title-dusun {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.story-title-translation {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-sage);
  margin: 0 0 12px 0;
}

.story-excerpt {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Detailed Dual-Language Reader Layout */
.story-reader-view {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-subtle);
  max-width: 900px;
  margin: 0 auto;
}

.story-reader-header {
  border-bottom: 1px solid var(--warm-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.story-reader-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 6px 0;
}

.story-dual-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .story-dual-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.story-text-pane {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
  white-space: pre-line;
}

.story-text-pane.dusun-pane {
  color: var(--text-dark);
  font-weight: 500;
}

.pane-label-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-forest);
  background: var(--bg-subtle);
  border: 1px solid var(--warm-border);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* --- Folklore Reader Attached UI & Clickable Dots --- */
.folklore-reader-wrap {
    padding: 24px;
    max-width: 950px;
    margin: 0 auto;
}

.folklore-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.folklore-back-link {
    color: #1c432d;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.folklore-story-progress {
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a5550;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Banner dicantumkan terus tanpa jurang terpisah */
.folklore-banner-card {
    position: relative;
    width: 100%;
    height: 140px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folklore-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.folklore-banner-title-center {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    margin: 0;
}

/* Kad Utama dicantumkan rapat di bawah banner */
.folklore-main-card {
    position: relative;
    background: #fdfbf7;
    border: 1px solid #dfb572;
    border-top: none; /* Buang border atas supaya bersambung terus dengan banner */
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    padding: 40px;
    box-shadow: 0 12px 35px rgba(18, 28, 23, 0.08);
    box-sizing: border-box;
    z-index: 2;
}

.folklore-page-indicator-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.folklore-page-line {
    flex-grow: 1;
    height: 1px;
    background: #d4c5a9;
}

.folklore-page-text {
    font-size: 0.78rem;
    font-weight: 800;
    color: #786d58;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.folklore-content-area {
    text-align: center;
    padding: 10px 0 20px 0;
}

.folklore-dusun-sentence {
    font-size: 1.6rem;
    font-weight: 800;
    color: #121c17;
    line-height: 1.45;
    margin: 0 0 20px 0;
}

.folklore-audio-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e6f4ea;
    color: #1c432d;
    border: 1px solid #c6ebd0;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}

.folklore-audio-trigger-btn:hover {
    background: #d1fae5;
}

.folklore-translation-box {
    background: #f4efe6;
    border: 1px solid #e5dfd3;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.folklore-translation-text {
    font-size: 0.92rem;
    color: #555c58;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

.folklore-bottom-controls-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
}

.folklore-lang-group {
    background: #e9e3d5;
    padding: 4px;
    border-radius: 999px;
    display: flex;
    gap: 4px;
    border: 1px solid #d4c5a9;
}

.folklore-lang-tab {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.folklore-lang-tab.active {
    background: #1c432d;
    color: #ffffff;
}

.folklore-lang-tab.inactive {
    background: transparent;
    color: #5c5240;
}

.folklore-card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5dfd3;
    padding-top: 20px;
}

.folklore-action-btn {
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.folklore-btn-prev {
    background: #f4efe6;
    color: #121c17;
    border: 1px solid #d4c5a9;
}

.folklore-btn-next {
    background: #1c432d;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(28, 67, 45, 0.2);
}

/* Titik Navigasi yang Boleh Diklik (Clickable Dots) */
.folklore-dots-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
}

.folklore-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4c5a9;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.folklore-dot.active {
    background: #1c432d;
    width: 12px;
    height: 12px;
}

.folklore-dot:hover {
    background: #1c432d;
}

/* --- Modern Circular Audio Trigger Button --- */
.folklore-audio-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    margin-top: 10px;
    transition: opacity 0.2s ease;
}

.folklore-audio-trigger-btn:hover {
    opacity: 0.85;
}

.folklore-audio-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1c432d;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(28, 67, 45, 0.25);
    flex-shrink: 0;
}

.folklore-audio-icon-circle svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.folklore-audio-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1c432d;
}

/* --- True 3D Layered Book Effect (Behind the Frame) --- */
.folklore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.folklore-card-wrapper {
    position: relative;
    background: #fdfbf7;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Menghasilkan bayang 3D tebal di sebelah kiri dan bawah yang bertindak sebagai jilidan di belakang kad */
    box-shadow: -10px 10px 0px 0px #bfa787, -14px 14px 25px rgba(84, 64, 42, 0.35), 0 10px 25px rgba(18, 28, 23, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-left: 12px; /* Memberi ruang untuk jilidan 3D di belakang sebelah kiri */
    margin-bottom: 8px;
}

.folklore-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: -12px 14px 0px 0px #bfa787, -16px 18px 30px rgba(84, 64, 42, 0.4), 0 14px 30px rgba(18, 28, 23, 0.12);
}

.folklore-card-img-wrap {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: #f4efe6;
    position: relative;
}

.folklore-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folklore-card-placeholder {
    width: 100%;
    height: 190px;
    background: linear-gradient(135deg, #f4efe6 0%, #e5dfd3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.folklore-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #fdfbf7;
}

.folklore-card-meta-top {
    font-size: 0.75rem;
    font-weight: 700;
    color: #786d58;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.folklore-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 10px 0;
}

.folklore-card-synopsis {
    font-size: 0.88rem;
    color: #6d665b;
    margin: 0 0 20px 0;
    flex-grow: 1;
    line-height: 1.45;
}

.folklore-card-footer-single {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #f1ede4;
    padding-top: 14px;
    margin-top: auto;
}

.folklore-read-btn-exclusive {
    background: #1c432d;
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(28,67,45,0.25);
    transition: background 0.2s;
}

.folklore-read-btn-exclusive:hover {
    background: #143221;
}

/* ==========================================================================
   Quiz
   ========================================================================== */

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quiz-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-forest);
  box-shadow: var(--shadow-hover);
}

.quiz-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.quiz-badge-status.passed {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #bbf7d0;
}

.quiz-badge-status.pending {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--warm-border);
}

/* Single Quiz Runner Container */
.quiz-runner-container {
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-subtle);
}

.question-block {
  padding: 24px 0;
  border-bottom: 1px solid var(--warm-border-light);
}

.question-block:last-of-type {
  border-bottom: none;
}

.question-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 16px 0;
  display: flex;
  gap: 10px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  background: var(--bg-sand);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.92rem;
  color: var(--text-body);
}

.option-label:hover {
  border-color: var(--primary-forest);
  background: #ffffff;
}

.option-label input[type="radio"] {
  accent-color: var(--primary-forest);
  width: 16px;
  height: 16px;
}

/* Quiz Result Scoreboard */
.quiz-result-banner {
  padding: 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 28px;
  border: 1px solid var(--warm-border);
}

.quiz-result-banner.passed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.quiz-result-banner.failed {
  background: #fef2f2;
  border-color: #fecaca;
}

/* --- Quiz & Assessment Custom UI Styles --- */
.quiz-banner {
    position: relative;
    border-radius: 18px;
    margin-bottom: 24px;
    background: linear-gradient(98deg, rgba(16, 32, 23, 0.45) 0%, rgba(18, 30, 22, 0.30) 55%, rgba(28, 22, 12, 0.40) 100%), 
                url('../assets/images/kinabalu.jpg') center/cover no-repeat;
    box-shadow: 0 8px 20px rgba(18, 28, 23, 0.14);
    overflow: hidden;
    color: #ffffff;
}

.quiz-banner-inner {
    display: flex;
    align-items: flex-end;
    padding: 20px 28px;
    gap: 20px;
}

.quiz-mascot-img {
    width: 140px;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: -20px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
    flex-shrink: 0;
}

.quiz-banner-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.quiz-banner-text p {
    font-size: 0.9rem;
    color: #f3f7f2;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(18, 28, 23, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quiz-card:hover {
    transform: translateY(-2px);
    border-color: #1c432d;
    box-shadow: 0 10px 24px rgba(18, 28, 23, 0.08);
}

.quiz-runner-container {
    max-width: 780px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.question-block {
    padding: 10px 0 20px 0;
}

.question-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #ded8cb;
    border-radius: 12px;
    background: #fbf9f4;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.95rem;
    font-weight: 600;
    color: #121c17;
}

.option-label:hover {
    border-color: #1c432d;
    background: #ffffff;
}

.option-label input[type="radio"] {
    accent-color: #1c432d;
    width: 18px;
    height: 18px;
}

/* Feedback box for wrong answers */
.quiz-feedback-box {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.92rem;
    line-height: 1.5;
}

.quiz-feedback-box.correct {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
/* ==========================================================================
   students notifications
   ========================================================================== */

   body.student-portal,
body.student-portal .main-content {
    background-color: #fbf9f2;
}

.dl-notif-page {
    width: 100%;
}

.dashboard-hero-banner.dl-notif-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 36px 0 28px;
    min-height: 215px;
    background: linear-gradient(95deg, rgba(24, 48, 68, 0.38) 0%, rgba(28, 52, 68, 0.24) 55%, rgba(22, 42, 34, 0.32) 100%),
                url('../assets/images/kinabalu.jpg') center 38%/cover no-repeat;
}

.dl-notif-hero .hero-left-content {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    min-width: 0;
    align-self: stretch;
}

.dl-notif-hero .mascot-floating-img {
    width: 195px;
    height: auto;
    max-height: 205px;
    object-fit: contain;
    align-self: flex-end;
    margin: 10px 0 0 0;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
    flex-shrink: 0;
}

.dl-notif-hero .hero-text-block {
    padding: 24px 0;
    min-width: 0;
}

.dl-notif-hero .hero-greeting-title {
    margin: 0 0 6px 0;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.dl-notif-hero .hero-greeting-sub {
    margin: 0 0 6px 0;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.dl-notif-status-line {
    font-size: 0.86rem;
    color: #f0f7f3;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.dl-mark-all-btn {
    position: absolute;
    right: 28px;
    bottom: 24px;
    z-index: 2;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.92);
    color: #1e3d2f;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    transition: transform 0.15s ease, background 0.15s ease;
}

.dl-mark-all-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: translateY(-1px);
}

.dl-mark-all-btn:disabled {
    opacity: 0.72;
    cursor: default;
}

/* Category Filter Bar */
.dl-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 2px 18px;
}

.dl-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1.5px solid #dce4de;
    background: #ffffff;
    color: #243b30;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(18, 28, 23, 0.04);
    transition: all 0.16s ease;
}

.dl-filter-pill:hover {
    border-color: #1e3d2f;
    background: #f4f8f5;
}

.dl-filter-pill.active {
    background: #1e3d2f;
    border-color: #1e3d2f;
    color: #ffffff;
}

.dl-filter-count {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef3ef;
    color: #243b30;
}

.dl-filter-pill.active .dl-filter-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* Date Buckets & Activity Feed Cards */
.dl-date-group {
    margin-bottom: 22px;
}

.dl-date-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3d5a4b;
    margin: 0 0 10px 4px;
}

.dl-date-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e3eae5;
}

.dl-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dl-swipe-shell {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #c53030;
}

.dl-swipe-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 22px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    gap: 6px;
    pointer-events: none;
}

.dl-notif-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1.5px solid #e6ece7;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(18, 28, 23, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    touch-action: pan-y;
}

.dl-notif-card.unread {
    background: #f4f9f5;
    border-color: #9ec0ab;
}

.dl-notif-card:hover {
    border-color: #2d5a43;
}

.dl-notif-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.dl-notif-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #e6efe9;
    color: #1e3d2f;
}

.dl-notif-icon.type-badge_unlock,
.dl-notif-icon.type-xp_reward,
.dl-notif-icon.type-level_up,
.dl-notif-icon.type-quiz_achievement {
    background: #fdf3dc;
    color: #9a6712;
}

.dl-notif-icon.type-streak_reminder {
    background: #fdeae4;
    color: #b4421e;
}

.dl-notif-icon.type-quiz_result {
    background: #e3f1eb;
    color: #1b5e3c;
}

.dl-notif-body {
    flex: 1;
    min-width: 0;
}

.dl-notif-top-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.dl-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e3d2f;
    flex-shrink: 0;
}

.dl-notif-card:not(.unread) .dl-unread-dot {
    display: none;
}

.dl-notif-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #162920;
}

.dl-notif-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a7065;
    margin-left: auto;
}

.dl-notif-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #465d52;
    line-height: 1.45;
}

.dl-notif-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.dl-action-btn {
    border: 1px solid #d5dfd8;
    background: #ffffff;
    color: #243b30;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dl-action-btn:hover {
    background: #eef4f0;
}

.dl-action-btn.delete:hover {
    background: #fde8e8;
    border-color: #f5b5b5;
    color: #b91c1c;
}

.dl-notif-card:not(.unread) .dl-mark-one-btn {
    display: none;
}

/* Empty State (Notification Center, no mascot) */
.dl-empty-card {
    display: none;
    text-align: center;
    padding: 44px 28px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(18, 28, 23, 0.05);
    border: 1px solid #eceae2;
}

.dl-empty-card.visible {
    display: block;
}

.dl-empty-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1b2e24;
}

.dl-empty-sub {
    margin: 0;
    font-size: 0.92rem;
    color: #5b6f65;
}

@media (max-width: 720px) {
    .dashboard-hero-banner.dl-notif-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
        margin-top: 8px;
    }
    .dl-notif-hero .mascot-floating-img {
        width: 96px;
        max-height: 115px;
        margin-bottom: -18px;
    }
    .dl-mark-all-btn {
        position: static;
        align-self: flex-end;
        margin-top: 8px;
    }
    .dl-notif-time {
        margin-left: 0;
    }
}

/* ==========================================================================
   Student Profile 
   ========================================================================== */

.profile-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .profile-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Card: Academic Identity */
.profile-id-card {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--primary-forest);
  color: var(--primary-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.profile-student-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.profile-student-role {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-sage);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.profile-meta-list {
  width: 100%;
  border-top: 1px solid var(--warm-border-light);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font-size: 0.86rem;
}

.profile-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-meta-row span:first-child {
  color: var(--text-muted);
}

.profile-meta-row span:last-child {
  font-weight: 700;
  color: var(--text-dark);
}

/* --- Badges & Achievements External CSS --- */

.badges-container-card {
    background: #ffffff;
    border: 1px solid #ded8cb;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.badges-header-row {
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
}

.badges-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 4px 0;
}

.badges-counter-text {
    font-size: 0.88rem;
    color: #666;
    margin: 0;
}

/* Unboxed Clean Grid Layout */
.badge-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px 20px;
    margin-top: 20px;
}

.academic-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px;
}

/* Hexagon Frame Styling */
.hexagon-frame-wrap {
    position: relative;
    width: 86px;
    height: 98px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexagon-frame-wrap:hover {
    transform: translateY(-3px);
}

.hexagon-shape {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #fce07d 0%, #d4af37 50%, #8a5a0c 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5px; /* Border thickness for the 3D rim */
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
}

.academic-badge-item.locked .hexagon-shape {
    background: linear-gradient(145deg, #e5e7eb 0%, #9ca3af 50%, #4b5563 100%);
}

.hexagon-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #ffffff 0%, #f7f1df 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
}

.academic-badge-item.locked .hexagon-content {
    background: linear-gradient(145deg, #f3f4f6 0%, #d1d5db 100%);
}

.hexagon-content img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.academic-badge-item.locked .hexagon-content img {
    filter: grayscale(100%) drop-shadow(0 2px 3px rgba(0,0,0,0.1));
    opacity: 0.6;
}

.badge-emoji-fallback {
    font-size: 1.8rem;
}

.lock-tag-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #374151;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    z-index: 2;
}

/* Typography & Flow Details */
.badge-title-text {
    font-size: 0.98rem;
    font-weight: 800;
    color: #121c17;
    margin: 4px 0 2px 0 ! important;
}

.badge-dusun-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1c432d;
    margin:0 0 3px 1 ! important;
}

.badge-criteria-text {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.35;
    margin: 0 0 4px 0 ! important;
    max-width: 180px;
}

.badge-status-footer {
    margin-top: 0 ! important ;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-awarded-text {
    color: #166534;
}

.badge-locked-text {
    color: #7b8480;
}

.badges-container-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--warm-border, #ded8cb);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.badges-header-row {
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
}

.badges-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 4px 0;
}

.badges-counter-text {
    font-size: 0.88rem;
    color: #666;
    margin: 0;
}

.badge-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.academic-badge-card {
    background: #fbfaf7;
    border: 1.5px solid #ded8cb;
    border-radius: 14px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.academic-badge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.academic-badge-card.unlocked {
    background: #ffffff;
    border-color: #d4af37; /* Gold accent frame border */
}

.academic-badge-card.locked {
    background: #f4f2eb;
    opacity: 0.9;
}

/* --- Hexagon Frame Styling --- */
.hexagon-frame-wrap {
    position: relative;
    width: 86px;
    height: 98px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
    transition: transform 0.2s ease;
}

.hexagon-shape {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d4af37 0%, #aa771c 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px; /* Creates inner border frame thickness */
}

.academic-badge-card.locked .hexagon-shape {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.hexagon-content {
    width: 100%;
    height: 100%;
    background: #fff9e6;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.academic-badge-card.locked .hexagon-content {
    background: #e5e7eb;
}

.hexagon-content img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.academic-badge-card.locked .hexagon-content img {
    filter: grayscale(100%);
    opacity: 0.65;
}

.badge-emoji-fallback {
    font-size: 2rem;
}

.lock-tag-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #374151;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- Typography & Details Layout --- */
.badge-title-text {
    font-size: 1rem;
    font-weight: 800;
    color: #121c17;
    margin: 0 0 2px 0;
}

.badge-dusun-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1c432d;
    margin-bottom: 8px;
}

.badge-criteria-text {
    font-size: 0.78rem;
    color: #555;
    line-height: 1.4;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.badge-status-footer {
    margin-top: auto;
    width: 100%;
}

.badge-awarded-pill {
    display: block;
    background: #e6f4ea;
    color: #14532d;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

.badge-locked-pill {
    display: block;
    background: #eae6df;
    color: #665c4f;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 5px;
    border-radius: 6px;
}

.academic-badge-item.locked h3,
.academic-badge-item.locked p,
.academic-badge-item.locked div,
.academic-badge-item.locked span:not(.lock-icon-css) {
    color: #718096 !important; /* Warna kelabu yang kemas dan profesional */
}

.academic-badge-item.locked .lock-tag-badge,
.academic-badge-item.locked .lock-icon-css {
    filter: none !important;
}

.lock-tag-badge {
    background: linear-gradient(135deg, #4a5568 0%, #1a202c 100%) !important;
    border: 2px solid #cbd5e0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(255, 255, 255, 0.4) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
/* ==========================================================================
   Student Profile Self-Service & Danger Zone (student/profile.php)
   ========================================================================== */

.profile-tab-nav {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--warm-border);
  margin-bottom: 24px;
}

.profile-tab-btn {
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-tab-btn:hover {
  color: var(--text-dark);
}

.profile-tab-btn.active {
  color: var(--primary-forest);
  border-bottom-color: var(--primary-forest);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

@media (max-width: 680px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}

.profile-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.danger-zone-box {
  margin-top: 36px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.danger-zone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--error-text);
  font-size: 1rem;
  font-weight: 800;
}

.btn-danger-academic {
  background: var(--error-text);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-danger-academic:hover {
  opacity: 0.9;
}

/* ==========================================================================
   Student Profile "Manage Account" Button, Avatar & Modal
   ========================================================================== */

/* Manage Account Button on Card */
.btn-manage-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  color: var(--primary-forest);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-manage-account:hover {
  background: var(--primary-forest);
  color: #ffffff;
  border-color: var(--primary-forest);
}

/* Avatar Image & Circle Styling */
.profile-avatar-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--primary-forest);
  color: var(--primary-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 auto 12px auto;
  overflow: hidden;
}

.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Manage Account Modal */
.academic-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 23, 0.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.academic-modal-window {
  background: var(--bg-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
  padding: 28px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--warm-border-light);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.modal-header-row h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-dark);
}

/* ==========================================================================
   Mobile Top Navbar & Responsive Sidebar Navigation System
   ========================================================================== */

/* 1. Base Desktop Sidebar Drawer */
.sidebar-drawer {
  width: 250px;
  background: var(--bg-sidebar, #f5f2eb);
  border-right: 1px solid var(--warm-border, #ded8cb);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  min-height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 24px 10px;
}

.sidebar-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-forest, #1e3d2f);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-forest, #1e3d2f);
  letter-spacing: -0.02em;
}

/* 2. Navigation Items */
.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body, #3c4a42);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg {
  color: var(--primary-sage, #52796f);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-subtle, #eeece4);
  color: var(--text-dark, #121c17);
}

.nav-item:hover svg {
  color: var(--primary-forest, #1e3d2f);
}

.nav-item.active {
  background: var(--primary-forest, #1e3d2f);
  color: #ffffff;
  font-weight: 700;
}

.nav-item.active svg {
  color: #ffffff;
}

.nav-item.sign-out-link {
  color: #991b1b;
}

.nav-item.sign-out-link svg {
  color: #991b1b;
}

.nav-badge-count {
  background: #d97706;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-signout-footer {
  border-top: 1px solid var(--warm-border, #ded8cb);
  padding-top: 14px;
}

/* 3. Mobile Header & Controls (Desktop Default: Hidden) */
.dusun-mobile-header {
  display: none;
}

.btn-sidebar-close {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* 4. Mobile & Tablet Screen Adaptations (<= 900px) */
@media (max-width: 900px) {
  .dusun-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--warm-border, #ded8cb);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 990;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .btn-mobile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-sand, #fbfaf7);
    border: 1px solid var(--warm-border, #ded8cb);
    border-radius: var(--radius-sm, 8px);
    color: var(--primary-forest, #1e3d2f);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .btn-mobile-icon:hover {
    background: var(--bg-subtle, #eeece4);
  }

  .mobile-bell-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #d97706;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
  }

  .btn-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--warm-border, #ded8cb);
    border-radius: 6px;
    color: var(--text-dark, #121c17);
    cursor: pointer;
  }

  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar-drawer.drawer-open {
    left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 23, 0.45);
    backdrop-filter: blur(2px);
    z-index: 995;
  }

  .sidebar-backdrop.backdrop-active {
    display: block;
  }
}

/* Sidebar Nav Links */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark, #121c17);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav-link:hover {
    background-color: #f1ede4;
    color: var(--primary-forest, #1e3d2f);
}

.sidebar-nav-link.active {
    background-color: var(--primary-forest, #1e3d2f);
    color: #ffffff;
    font-weight: 700;
}

.sidebar-nav-link.active svg {
    stroke: #ffffff;
}

.sidebar-nav-link svg {
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
}

/* ==========================================================================
   DusunLearn Vocabulary Learning Flow (Screenshots Exact Match)
   ========================================================================== */

/* --- 1. Category Directory Grid (Screenshot 2) --- */
.cat-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.cat-picker-card {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cat-picker-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 61, 47, 0.08);
}

.cat-art-box {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  background: #eef2f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}

.cat-art-box img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

.cat-tag-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c2613c;
  margin-bottom: 4px;
}

.cat-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 14px 0;
}

.cat-card-line {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: var(--primary-forest, #1e3d2f);
}

/* --- 2. Category Vocabulary Grid (Screenshot 3) --- */
.vocab-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 24px 0;
  flex-wrap: wrap;
  gap: 16px;
}

.vocab-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vocab-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #eaf1ed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.vocab-hero-icon img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

.vocab-progress-container {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.vocab-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  margin-bottom: 8px;
}

.vocab-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8e4db;
  overflow: hidden;
}

.vocab-progress-fill {
  height: 100%;
  background: #396f53;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.vocab-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.vocab-learn-tile {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.vocab-learn-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(30, 61, 47, 0.08);
}

.vocab-tile-art {
  width: 100%;
  height: 160px;
  border-radius: 16px;
  background: #faf7f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}

.vocab-tile-art img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}

.vocab-tile-word {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 2px 0;
}

.vocab-tile-trans {
  font-size: 0.86rem;
  color: var(--text-muted, #728077);
  margin: 0 0 14px 0;
}

.vocab-tile-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f2ede4;
  padding-top: 12px;
  margin-top: auto;
}

.vocab-tap-cta {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
}

.vocab-audio-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1b333;
  color: #121c17;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.vocab-audio-circle:hover {
  transform: scale(1.08);
}

.flashcard-stage-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
}

.flashcard-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  margin-bottom: 24px;
}

.flashcard-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.flashcard-image-bubble {
  width: 90px;
  height: 90px;
  border-radius: 22px;
  background: #eaf1ed;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.flashcard-image-bubble img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

.flashcard-dusun-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 2px 0;
}

.btn-play-pronunciation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #ded8cb;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark, #121c17);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.btn-play-pronunciation:hover {
  background: #fbfaf7;
  border-color: #396f53;
}

.flashcard-translations-grid {
  display: flex;
    flex-direction: column; 
    gap: 12px;              
    margin-bottom: 26px;
    width: 100%;
    max-width: 400px;       
    margin-right: auto;
}

.translation-pill-card {
  background: #fbf9f5;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 16px;
  padding: 16px 20px;
}

.translation-pill-card .pill-lang-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  margin-bottom: 4px;
}

.translation-pill-card .pill-word {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark, #121c17);
  margin: 0;
}

.flashcard-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.btn-card-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #ded8cb;
  background: #ffffff;
  color: var(--text-dark, #121c17);
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-card-nav:hover:not(:disabled) {
  border-color: #1e3d2f;
}

.btn-card-nav.primary {
  background: #1e3d2f;
  color: #ffffff;
  border-color: #1e3d2f;
}

.btn-card-nav.primary:hover {
  background: #152b21;
}

.btn-card-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Combined Category Cards (Visual Picture + Functional Actions + Progress)
   ========================================================================== */

.category-hybrid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.category-hybrid-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: var(--radius-lg, 16px);
  padding: 16px;
  box-shadow: var(--shadow-subtle, 0 2px 8px rgba(0, 0, 0, 0.04));
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.category-hybrid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(30, 61, 47, 0.08);
}

.hybrid-art-frame {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background: #f4efe6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}

.hybrid-art-frame img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

.hybrid-term-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-forest, #1e3d2f);
  backdrop-filter: blur(4px);
}

/* Titles */
.hybrid-tag-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c2613c;
  margin-bottom: 3px;
}

.hybrid-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 14px 0;
}

/* Progress Underline Bar */
.hybrid-progress-track {
  width: 100%;
  height: 5px;
  background: #eeeae0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.hybrid-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-forest, #1e3d2f);
  transition: width 0.3s ease;
}

/* Action Buttons */
.hybrid-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--warm-border-light, #ece8df);
  padding-top: 14px;
}

/* ==========================================================================
   Hybrid Category Cards (Dusun Emphasis, Trilingual Titles & Top Button)
   ========================================================================== */

/* Page Header Top Row with Action Button */
.categories-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

/* Large Dusun Title */
.hybrid-dusun-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

/* Combined Subtitle (English • Malay) */
.hybrid-sub-translations {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted, #728077);
  font-weight: 600;
  margin-bottom: 14px;
}

.hybrid-sub-translations .bullet-divider {
  color: var(--warm-border, #ded8cb);
  font-size: 0.8rem;
}

/* ==========================================================================
   Combined Vocabulary Flashcards (Merged Style - No Progress Bar)
   ========================================================================== */

.vocab-combined-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.vocab-combined-card {
  background: #ffffff;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.vocab-combined-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(30, 61, 47, 0.08);
}

/* Artwork Canvas with Category Tag */
.vocab-art-stage {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: 16px;
  background: #fdfbf7;
  border: 1px solid #f2ece0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}

.vocab-art-stage img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

.vocab-category-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Card Typography */
.vocab-dusun-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0 0 3px 0;
  letter-spacing: -0.01em;
}

.vocab-translations-sub {
  font-size: 0.85rem;
  color: var(--text-muted, #728077);
  font-weight: 600;
  margin-bottom: 14px;
}

/* Card Bottom Footer */
.vocab-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f2ede4;
  padding-top: 10px;
  margin-top: auto;
}

.vocab-practice-link {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  transition: color 0.15s ease;
}

.vocab-combined-card:hover .vocab-practice-link {
  color: var(--primary-forest, #1e3d2f);
}

.btn-audio-round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1b333;
  color: #121c17;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-audio-round:hover {
  transform: scale(1.08);
  background: #e09f1d;
}

/* ==========================================================================
   Big Flashcard Visual Canvas & Always-Visible Audio Button (student/learn.php)
   ========================================================================== */

.flashcard-stage-container {
  max-width: 760px;
  margin: 0 auto;
}

.flashcard-main-box {
    width: 100%;
    max-width: 560px;   
    min-height: 520px;  
    background: #fbf9f4;
    border: 2px solid #d4c5a9;
    border-radius: 20px;
    padding: 24px 30px; 
    box-shadow: 0 15px 30px rgba(18, 28, 23, 0.12);
    position: relative;
    z-index: 2;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-main-box::before,
.flashcard-main-box::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f4efe6;
    border: 2px solid #ded8cb;
    border-radius: 24px;
    top: 0;
    left: 0;
    z-index: -1;
}

.flashcard-main-box::before {
    transform: translate(6px, 6px) rotate(1deg);
    opacity: 0.8;
}

.flashcard-main-box::after {
    transform: translate(12px, 12px) rotate(2deg);
    opacity: 0.5;
}

/* Terjemahan Center */
.translation-pill-card {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pill-word {
    text-align: center !important;
    width: 100%;
    font-weight: 700;
    font-size: 1.1rem;
    color: #121c17;
}

.pill-lang-label {
    text-align: center !important;
    display: block;
    font-size: 0.75rem;
    color: #8c8375;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

/* Animasi Slide */
@keyframes cardSlideInNext {
    0% { opacity: 0; transform: translateX(40px) scale(0.96); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes cardSlideInPrev {
    0% { opacity: 0; transform: translateX(-40px) scale(0.96); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

.animate-next { animation: cardSlideInNext 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-prev { animation: cardSlideInPrev 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.flashcard-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  margin-bottom: 24px;
}

/* Big Image Showcase Canvas */
.flashcard-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.flashcard-image-bubble {
  width: 220px;
  height: 200px;
  border-radius: 24px;
  background: #f6f3eb;
  border: 1px solid #eee8dc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 16px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.flashcard-image-bubble img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.flashcard-image-bubble img:hover {
  transform: scale(1.05);
}

.flashcard-dusun-title {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-dark, #121c17);
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

/* Pronunciation Button */
.btn-play-pronunciation {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #fbfaf7;
  border: 1.5px solid var(--warm-border, #ded8cb);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark, #121c17);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.btn-play-pronunciation:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--primary-forest, #1e3d2f);
  color: var(--primary-forest, #1e3d2f);
  transform: translateY(-1px);
}

.btn-play-pronunciation:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f5f2eb;
  border-color: #e5e0d3;
  color: var(--text-muted, #728077);
}

/* Translation Cards */
.flashcard-translations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 26px;
}

@media (max-width: 600px) {
  .flashcard-translations-grid {
    grid-template-columns: 1fr;
  }
  .flashcard-image-bubble {
    width: 180px;
    height: 160px;
  }
}

.translation-pill-card {
  background: #fbf9f5;
  border: 1px solid var(--warm-border, #ded8cb);
  border-radius: 18px;
  padding: 18px 22px;
}

.translation-pill-card .pill-lang-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #728077);
  margin-bottom: 4px;
}

.translation-pill-card .pill-word {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark, #121c17);
  margin: 0;
}

/* Big Flashcard Visual Bubble & Large Fruit Image */
.flashcard-image-bubble {
    width: 200px;
    height: 160px;
    border-radius: 28px;
    background: #f6f3eb;
    border: 1px solid #eee8dc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    overflow: hidden;
    padding: 0; /* Removed padding so image fills the box */
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.flashcard-image-bubble img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Scales up the artwork to counteract transparent whitespace around PNG assets */
    transform: scale(1.45);
    transition: transform 0.25s ease;
}

.flashcard-image-bubble img:hover {
    transform: scale(1.55);
}

/* ==========================================================================
   Practice & Pronunciation Studio Styling (student/practice.php)
   ========================================================================== */

.practice-page-container {
    max-width: 820px;
    margin: 0 auto;
}

.pronounce-card-shell {
    background: #ffffff;
    border: 1px solid var(--warm-border, #ded8cb);
    border-radius: 28px;
    padding: 40px 48px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.pronounce-badge-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #728077);
    margin-bottom: 8px;
}

.pronounce-hero-word {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-dark, #121c17);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.pronounce-sub-meanings {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #728077);
    margin-bottom: 28px;
}

/* Center Audio Recording Pod */
.pronounce-mic-center {
    background: #fbf9f4;
    border: 1px solid #eee8db;
    border-radius: 24px;
    padding: 42px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 28px;
    transition: all 0.2s ease;
}

.pronounce-mic-center.listening {
    background: #fdf5f3;
    border-color: #fca5a5;
}

.mic-record-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--primary-forest, #1e3d2f);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(30, 61, 47, 0.22);
    transition: transform 0.15s ease, background 0.2s ease;
    outline: none;
}

.mic-record-btn:hover {
    transform: scale(1.05);
    background: #152b21;
}

.mic-record-btn.recording {
    background: #dc2626;
    animation: pulseRecordingWave 1.4s infinite;
}

@keyframes pulseRecordingWave {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.mic-status-hint {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted, #728077);
    margin-top: 16px;
}

/* Score, Accuracy & Feedback Grid */
.pronounce-stats-row {
    display: grid;
    grid-template-columns: 140px 180px 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.score-box-card {
    background: #ffffff;
    border: 1px solid var(--warm-border, #ded8cb);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-box-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #728077);
    margin-bottom: 6px;
}

.score-box-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-forest, #1e3d2f);
    line-height: 1;
}

.score-box-rating {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark, #121c17);
    line-height: 1.1;
}

.score-box-critique {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-body, #3c4a42);
    line-height: 1.45;
}

/* Bottom Action Row */
.pronounce-actions-shelf {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.btn-ref-listen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #ffffff;
    border: 1.5px solid var(--warm-border, #ded8cb);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark, #121c17);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-ref-listen:hover {
    background: #fbf9f4;
    border-color: var(--primary-forest, #1e3d2f);
    transform: translateY(-1px);
}

.btn-next-word {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: var(--primary-forest, #1e3d2f);
    color: #ffffff;
    border: 1.5px solid var(--primary-forest, #1e3d2f);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 61, 47, 0.15);
    transition: all 0.15s ease;
}

.btn-next-word:hover {
    background: #152b21;
    border-color: #152b21;
    transform: translateY(-1px);
}

.back-link-wrapper {
    margin-bottom: 20px;
}

@media (max-width: 680px) {
    .pronounce-stats-row {
        grid-template-columns: 1fr;
    }
    .pronounce-card-shell {
        padding: 24px;
    }
}

/* ==========================================================================
   Mobile Header & Responsive Drawer Core Styles
   ========================================================================== */

/* 1. Mobile Topbar */
.dusun-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #fbf9f4;
    border-bottom: 1px solid #ded8cb;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-mobile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #ded8cb;
    background: #ffffff;
    color: #1c432d;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.mobile-bell-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    background: #dc2626;
    border-radius: 50%;
}

/* 2. Slide Drawer Navigation (for Tablet & Phone) */
.sidebar-drawer {
    width: 260px;
    background: #fbf9f4;
    border-right: 1px solid #ded8cb;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 24px 28px 24px 20px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-brand-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 24px;
}

.sidebar-brand-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-motif-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #2a241e;
    border: 1.5px solid #d4a359;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d4a359;
    font-size: 1rem;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #121c17;
}

/* Nav Item Links */
.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav-list .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #121c17;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav-list .nav-item:hover {
    background: #f1ede4;
    color: #1e3d2f;
}

.sidebar-nav-list .nav-item.active {
    background: #1e3d2f;
    color: #ffffff;
    font-weight: 700;
}

.sidebar-nav-list .nav-item.active svg {
    stroke: #ffffff;
}

.nav-badge-count {
    background: #dc2626;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

/* Sidebar Footer & Sign Out */
.sidebar-signout-footer {
    border-top: 1px solid #ded8cb;
    padding-top: 16px;
    margin-top: 20px;
}

.nav-item.sign-out-link {
    color: #b91c1c !important;
}

.nav-item.sign-out-link:hover {
    background: #fee2e2 !important;
}

/* 3. Screen Breakpoint Switch (< 1025px) */
@media (max-width: 1024px) {
    .dusun-mobile-header {
        display: flex;
    }

    .app-layout {
        display: block !important;
    }

    .main-content {
        padding: 20px 16px 40px 16px !important;
        display: block !important;
        width: 100% !important;
    }

    #studentSidebar.sidebar-drawer {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    #studentSidebar.sidebar-drawer.drawer-open {
        transform: translateX(0) !important;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25) !important;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(18, 28, 23, 0.55);
        backdrop-filter: blur(2px);
        z-index: 950;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.backdrop-active {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 1025px) {
    .btn-sidebar-close {
        display: none !important;
    }
}

/*==============================================================================
  sidebar with hamburger menu for student page
  ===============================================================================*/
/* Student Top Header Bar: Spans Full Width When Closed, Aligns Over Main Content When Open */
body:has(#studentSidebar) .dusun-top-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 24px !important;
    min-height: 76px !important;
    background-color: #f7f5ef;
    border-bottom: 1px solid #e6e0d2;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    transition: margin-left 0.25s ease, width 0.25s ease !important;
}

body:has(#studentSidebar).student-sidebar-open .dusun-top-header {
    margin-left: 270px !important;
    width: calc(100% - 270px) !important;
}

.dusun-top-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.dusun-top-header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    margin-left: auto !important;
}

.dusun-header-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: #ffffff;
    color: #1c432d;
    border: 1.5px solid #e2ddd0;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.dusun-header-icon-btn svg {
    stroke: #1c432d;
}

.dusun-header-icon-btn:hover {
    background-color: #eef3ee;
    transform: translateY(-1px);
}

.dusun-bell-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Student Slide-Out Sidebar (#studentSidebar only): Full Height From Top Edge */
#studentSidebar.sidebar-drawer,
aside#studentSidebar.student-sidebar-custom-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    height: 100vh !important;
    padding-top: 8px !important;
    padding-right: 28px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease !important;
    z-index: 150 !important;
    background-color: #163624 !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(16, 42, 27, 0.45) 0%,
            rgba(16, 42, 27, 0.58) 55%,
            rgba(12, 32, 20, 0.72) 100%
        ),
        url('../images/sidebar.png') !important;
    background-size: cover, cover !important;
    background-position: center, center !important;
    background-repeat: no-repeat, no-repeat !important;
}

#studentSidebar.sidebar-drawer.drawer-open {
    transform: translateX(0) !important;
}

#studentSidebar .sidebar-motif-strip {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 20px !important;
    height: 100% !important;
    background-image: url('../images/motif.jpg') !important;
    background-repeat: repeat-y !important;
    background-size: 20px auto !important;
    background-position: center top !important;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

#studentSidebar .sidebar-top-wrapper,
#studentSidebar .sidebar-signout-footer {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

#studentSidebar .nav-item,
#studentSidebar .nav-item span,
#studentSidebar .nav-item svg,
#studentSidebar .nav-item a,
#studentSidebar .nav-item div {
    color: rgba(255, 255, 255, 0.96) !important;
    stroke: currentColor !important;
    opacity: 1 !important;
}

#studentSidebar .nav-item {
    background-color: rgba(12, 34, 21, 0.45) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#studentSidebar .nav-item svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    flex-shrink: 0;
}

#studentSidebar .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

#studentSidebar .nav-item.active {
    background-color: rgba(134, 173, 146, 0.65) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.student-logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 14px 16px 14px;
    position: relative;
}

.student-sidebar-logo {
    width: 100%;
    max-width: 175px;
    height: auto;
    max-height: 118px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.student-logo-header .btn-sidebar-close {
    position: absolute;
    right: 10px;
    top: 12px;
    color: #ffffff !important;
    stroke: #ffffff !important;
    background-color: rgba(12, 34, 21, 0.55) !important;
    border-radius: 8px;
}

#studentSidebar .sign-out-link,
#studentSidebar .sign-out-link span,
#studentSidebar .sign-out-link svg {
    color: #fecaca !important;
    stroke: #fecaca !important;
}

#studentSidebar .sign-out-link {
    background-color: rgba(69, 18, 18, 0.55) !important;
}

#studentSidebar .sign-out-link:hover {
    background-color: rgba(153, 27, 27, 0.75) !important;
    color: #ffffff !important;
}

/* Main Content Alignment When #studentSidebar Is Open on Wide Screens */
body:has(#studentSidebar) .app-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

body:has(#studentSidebar) .app-layout .main-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 20px 28px !important;
    box-sizing: border-box !important;
    transition: margin-left 0.25s ease, width 0.25s ease !important;
}

@media (min-width: 992px) {
    body:has(#studentSidebar).student-sidebar-open .app-layout .main-content {
        margin-left: 270px !important;
        width: calc(100% - 270px) !important;
        max-width: calc(100% - 270px) !important;
    }
}

@media (max-width: 639px) {
    body:has(#studentSidebar).student-sidebar-open .dusun-top-header {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Strictly cap DusunLearn logo sizes everywhere */
.dusun-top-logo {
    height: 46px !important;
    width: auto !important;
    max-width: 140px !important;
    max-height: 46px !important;
    object-fit: contain !important;
}

.student-sidebar-logo {
    width: auto !important;
    max-width: 150px !important;
    max-height: 95px !important;
    height: auto !important;
    object-fit: contain !important;
}

.mobile-header-logo {
    height: 36px !important;
    width: auto !important;
    max-width: 120px !important;
    max-height: 36px !important;
    object-fit: contain !important;
}

#sidebarOverlay.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 28, 19, 0.35);
    z-index: 140;
}

#sidebarOverlay.sidebar-backdrop.drawer-open {
    display: block;
}

.dusun-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 780px;
    margin: 0 0 20px 0;
}

.dusun-search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.dusun-search-input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 18px;
    border: 1.5px solid #cfd6ce;
    border-radius: 12px;
    background-color: #ffffff;
    color: #163624;
    font-size: 0.96rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dusun-search-input:focus {
    border-color: #274e37;
    box-shadow: 0 0 0 3px rgba(39, 78, 55, 0.12);
}

.dusun-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.dusun-search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #2b4c3b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}

.dusun-search-clear-btn:hover {
    background-color: rgba(22, 54, 36, 0.08);
    color: #163624;
}

.dusun-search-clear-btn.is-visible {
    display: inline-flex;
}

.dusun-search-submit-btn {
    height: 46px;
    padding: 0 24px;
    border: none;
    border-radius: 12px;
    background-color: #244532;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.dusun-search-submit-btn:hover {
    background-color: #1a3425;
}

.dusun-search-submit-btn:active {
    transform: scale(0.98);
}

.dusun-search-empty {
    display: none;
    padding: 18px 20px;
    border-radius: 12px;
    background-color: #f8f6f0;
    border: 1px solid #e2ddd0;
    color: #2b4c3b;
    font-size: 0.95rem;
    margin-top: 8px;
}

.dusun-search-empty.is-visible {
    display: block;
}
/*=========================================================
  Admin Date and Time Picker
  ===========================================================*/
.dl-admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dl-admin-modal-card {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dl-picker-card {
    background: #ffffff;
    border: 1.5px solid #ded8cb;
    border-radius: 10px;
    padding: 14px;
    max-width: 340px;
    margin: 0 auto;
}

.dl-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f3f4;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.dl-cal-month-label {
    font-weight: 700;
    font-size: 0.92rem;
    color: #121c17;
}

.dl-cal-nav {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #d5d9dc;
    background: #ffffff;
    color: #121c17;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.dl-cal-weekdays,
.dl-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 4px;
}

.dl-cal-weekdays span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334139;
    padding-bottom: 4px;
}

.dl-cal-day {
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #121c17;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.dl-cal-day:hover {
    background: #e6f0f2;
}

.dl-cal-day.is-muted {
    color: #b5bcc0;
    font-weight: 500;
}

.dl-cal-day.is-selected {
    background: #2f7a8a;
    color: #ffffff;
    font-weight: 700;
}

.dl-picker-divider {
    border: none;
    border-top: 1px solid #ece8de;
    margin: 12px 0;
}

.dl-time-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.dl-time-select {
    background: #f1f3f4;
    border: 1px solid #e2e5e8;
    border-radius: 7px;
    padding: 8px 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #121c17;
    text-align: center;
    cursor: pointer;
    outline: none;
}

.dl-set-time-btn {
    width: 100%;
    background: #2f7a8a;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.dl-set-time-btn:hover {
    background: #256472;
}

.dl-selected-preview {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1c432d;
    text-align: center;
}

/* =========================================================
   DUSUNLEARN STUDENT SIDE — PHONE, TABLET & LAPTOP SIZING
   ========================================================= */
:root {
    --font-body: clamp(0.95rem, 0.35vw + 0.88rem, 1.05rem);
    --font-sm: clamp(0.82rem, 0.2vw + 0.78rem, 0.9rem);
    --font-h1: clamp(1.45rem, 1.6vw + 1.1rem, 2.15rem);
    --font-h2: clamp(1.2rem, 1.1vw + 0.95rem, 1.6rem);
    --space-card: clamp(14px, 2vw, 28px);
    --space-section: clamp(16px, 2.5vw, 32px);
    --tap-min: 44px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    font-size: var(--font-body);
    line-height: 1.55;
}

img, svg, video, audio {
    max-width: 100%;
    height: auto;
}

/* Consistent readable scale across student pages */
.main-content h1,
.page-title {
    font-size: var(--font-h1);
    line-height: 1.2;
}

.main-content h2,
.section-title {
    font-size: var(--font-h2);
    line-height: 1.25;
}

.card,
.stat-card,
.module-card,
.badge-card,
.story-card,
.quiz-card {
    padding: var(--space-card);
    border-radius: 14px;
    min-width: 0;
}

/* Touch-friendly buttons, links & form controls */
button,
.btn,
input[type="submit"],
select,
input[type="text"],
input[type="search"] {
    min-height: var(--tap-min);
    font-size: var(--font-body);
}

/* Base (Phone: < 768px) — clean single-column flow */
.main-content {
    width: 100%;
    padding: 14px;
}

.hero-banner,
.welcome-banner,
.dashboard-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 18px 14px;
    overflow: hidden;
}

.hero-banner img,
.welcome-banner img,
.dashboard-hero img {
    max-width: 160px;
}

.stats-grid,
.cards-grid,
.modules-grid,
.badges-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.table-responsive,
table {
    max-width: 100%;
}

/* Tablet (768px – 1023px) — balanced 2-column cards & side-by-side banner */
@media (min-width: 768px) {
    .main-content {
        padding: 20px 24px;
    }

    .hero-banner,
    .welcome-banner,
    .dashboard-hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 22px 24px;
        gap: 20px;
    }

    .hero-banner img,
    .welcome-banner img,
    .dashboard-hero img {
        max-width: 190px;
    }

    .stats-grid,
    .cards-grid,
    .modules-grid,
    .badges-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

/* Laptop & Desktop (1024px+) — full workspace width & multi-column rhythm */
@media (min-width: 1024px) {
    .main-content {
        padding: var(--space-section);
        max-width: 1360px;
        margin: 0 auto;
    }

    .hero-banner img,
    .welcome-banner img,
    .dashboard-hero img {
        max-width: 230px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .modules-grid,
    .badges-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}