/* ==========================================================================
   E-LEARNIZ V3 — BRIGHT PLAYFUL CLASSROOM EDITION
   Authentic E-Learniz Components (Header, Sidebar, Daily Card Final,
   Course Card, User Task Profile, Sliding Task Filter, Subject Info Card,
   Docked Bottom Nav, Admin FAB) in a Bright, Cheerful Theme
   ========================================================================== */

:root {
  color-scheme: light;
  --bg-page: #f3f7ff;
  --bg-surface: #ffffff;
  --bg-subtle: #eef4ff;
  --bg-muted: #f8fafc;

  --input-bg: #ffffff;
  --input-border: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent: #2563eb;
  --accent-light: #38bdf8;
  --accent-soft: #dbeafe;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);

  --sun-amber: #f59e0b;
  --sun-amber-soft: #fef3c7;
  --mint-green: #10b981;
  --mint-green-soft: #d1fae5;
  --coral-rose: #f43f5e;
  --coral-rose-soft: #ffe4e6;
  --violet-purple: #8b5cf6;
  --violet-soft: #ede9fe;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 4px 14px rgba(37, 99, 235, 0.06);
  --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 14px 34px rgba(37, 99, 235, 0.13);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --header-h: 64px;
  --sidebar-w: 245px;
}

/* ==========================================================================
   DARK THEME PALETTE ([data-theme="dark"])
   Cool Midnight Navy & Crisp Accents
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0a0e17;
  --bg-surface: #121826;
  --bg-subtle: #1a2337;
  --bg-muted: #151d2e;

  --input-bg: #162036;
  --input-border: rgba(255, 255, 255, 0.14);

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.16);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);

  --sun-amber: #fbbf24;
  --sun-amber-soft: rgba(251, 191, 36, 0.16);
  --mint-green: #34d399;
  --mint-green-soft: rgba(52, 211, 153, 0.16);
  --coral-rose: #fb7185;
  --coral-rose-soft: rgba(251, 113, 133, 0.16);
  --violet-purple: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.16);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 14px 38px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] body {
  background-color: var(--bg-page);
  color: var(--text-main);
}

[data-theme="dark"] body::before {
  background-image:
    radial-gradient(circle at 8% 12%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 92% 18%, rgba(251, 191, 36, 0.05) 0%, transparent 35%),
    radial-gradient(circle at 50% 90%, rgba(52, 211, 153, 0.05) 0%, transparent 40%);
}

[data-theme="dark"] header#mainHeader {
  background: rgba(18, 24, 38, 0.92);
  border-bottom-color: var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sidebar {
  background: #121826;
  border-right-color: var(--border-color);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .daily-card-final,
[data-theme="dark"] .course-card,
[data-theme="dark"] .user-task-profile-card,
[data-theme="dark"] .subject-info-card,
[data-theme="dark"] .modal-dialog {
  background: #121826;
  border-color: var(--border-color);
}

[data-theme="dark"] .sic-icon-box,
[data-theme="dark"] .sic-stat-item,
[data-theme="dark"] .sic-edit-btn {
  background: #162036;
  border-color: var(--border-color);
}

[data-theme="dark"] .sic-stat-icon {
  background: #1a2337;
}

[data-theme="dark"] .utp-progress-text {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .top-cards-grid {
  border-color: var(--border-color);
}

[data-theme="dark"] .info-card-dynamic.seragam-row {
  background: rgba(56, 189, 248, 0.08);
}
[data-theme="dark"] .seragam-row .card-icon {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent);
}

[data-theme="dark"] .info-card-dynamic.kegiatan-row {
  background: rgba(52, 211, 153, 0.08);
}
[data-theme="dark"] .kegiatan-row .card-icon {
  background: rgba(52, 211, 153, 0.16);
  color: var(--mint-green);
}

[data-theme="dark"] .info-card-dynamic.catatan-row {
  background: rgba(251, 191, 36, 0.08);
}
[data-theme="dark"] .catatan-row .card-icon {
  background: rgba(251, 191, 36, 0.16);
  color: var(--sun-amber);
}

[data-theme="dark"] .task-shortcut-box {
  background: linear-gradient(135deg, #162238 0%, #1a2944 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .task-badge {
  border-color: #121826;
}

[data-theme="dark"] .tl-marker-final {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tl-marker-final::after {
  background: #121826;
}

[data-theme="dark"] .course-card.task-green-done {
  background: linear-gradient(145deg, #121826 0%, rgba(52, 211, 153, 0.1) 100%);
}

[data-theme="dark"] .course-card.task-red-deadline {
  background: linear-gradient(145deg, #121826 0%, rgba(251, 113, 133, 0.1) 100%);
}

[data-theme="dark"] .course-card.task-yellow-pending {
  background: linear-gradient(145deg, #121826 0%, rgba(251, 191, 36, 0.1) 100%);
}

[data-theme="dark"] .subject-title-box,
[data-theme="dark"] .teacher-info-box,
[data-theme="dark"] .stat-box {
  background: #162036;
  border-color: var(--border-color);
}

[data-theme="dark"] .subject-icon-box {
  background: #121826;
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .filter-group-wrapper,
[data-theme="dark"] .mapel-chip-tugas,
[data-theme="dark"] .subj-chip,
[data-theme="dark"] .subject-search-box input,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .card-ctrl-btn,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-edit-subject,
[data-theme="dark"] .modal-close-btn,
[data-theme="dark"] .empty-card-state {
  background: #162036;
  border-color: var(--border-color);
  color: var(--text-main);
}

[data-theme="dark"] .subject-search-box input:focus {
  border-color: var(--accent);
  background: #18243c;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #162036;
  border-color: var(--border-color);
  color: var(--text-main);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--accent);
  background: #18243c;
}

[data-theme="dark"] .modal-header {
  background: #162036;
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .dropdown,
[data-theme="dark"] .class-dropdown {
  background: #162036;
  border-color: var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dropdown-user-header {
  background: #1a253e;
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .dropdown a:hover,
[data-theme="dark"] .dropdown-class-trigger:hover {
  background: #1f2d4c;
}

[data-theme="dark"] .dropdown-class-sublist {
  background: #0f1524;
}

[data-theme="dark"] .dropdown-class-sublist button:hover,
[data-theme="dark"] .dropdown-class-sublist button.active {
  background: #1a253e;
}

[data-theme="dark"] #bottomNav {
  background: rgba(18, 24, 38, 0.96);
  border-top-color: var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .bn-center-btn {
  border-color: #121826;
}

[data-theme="dark"] .dc-inline-editor {
  background: #162036;
  border-color: var(--border-strong);
}

[data-theme="dark"] .login-glass-card {
  background: #121826;
  border-color: var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login-divider span {
  background: #121826;
}

[data-theme="dark"] .btn-guest-block {
  background: #162036;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Theme Toggle Item in Dropdown */
.dropdown-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  transition: background 0.2s;
  user-select: none;
}

.dropdown-theme-toggle:hover {
  background: var(--bg-muted);
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle-switch {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.25s ease;
}

[data-theme="dark"] .theme-toggle-switch {
  background: var(--accent);
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(18px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(56, 189, 248, 0.14) 0%, transparent 36%),
    radial-gradient(circle at 92% 18%, rgba(251, 191, 36, 0.14) 0%, transparent 32%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.10) 0%, transparent 38%);
  pointer-events: none;
  z-index: -1;
  transform: translateZ(0);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   HEADER (Authentic E-Learniz Top Header)
   ========================================================================== */
header#mainHeader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1002;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger 3-bars morphing to X */
.hamburger {
  width: 26px;
  height: 19px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 1px 0;
}

.hamburger span {
  display: block;
  height: 3px;
  background: var(--accent);
  border-radius: 4px;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Header Brand Logo (Left Header) */
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}

.header-brand:hover {
  opacity: 0.92;
}

.header-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-brand:hover .header-brand-icon {
  transform: scale(1.08);
}

.header-brand-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.2px;
}

.header-brand-text .brand-ver {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  letter-spacing: 0;
}

/* Visitor Trigger Eye Counter */
.visitor-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid #bfdbfe;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.visitor-trigger:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Class Switcher inside Dropdown */
.dropdown-class-wrap {
  border-bottom: 1px solid var(--border-color);
}

.dropdown-class-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.68rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}

.dropdown-class-trigger:hover {
  background: var(--bg-muted);
  color: var(--accent);
}

.d-class-left {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.d-class-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.active-class-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--sun-amber-soft);
  color: var(--sun-amber);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.d-class-right .caret-sm {
  font-size: 0.68rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.d-class-right .caret-sm.rotate {
  transform: rotate(180deg);
}

.dropdown-class-sublist {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0.35rem 0.65rem 0.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
}

.dropdown-class-sublist.show {
  display: flex;
  animation: dropdownSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown-class-sublist.is-closing {
  display: flex;
  animation: dropdownFadeOut 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.dropdown-class-sublist button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.52rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.dropdown-class-sublist button:hover {
  background: var(--bg-surface);
  color: var(--accent);
}

.dropdown-class-sublist button.active {
  background: var(--bg-surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Profile Box & Dropdown */
.profile-box {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 30px;
  transition: background 0.2s;
}

.profile-trigger:hover {
  background: var(--bg-subtle);
}

#greeting {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.caret {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.caret.rotate {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-surface);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  display: none;
  flex-direction: column;
  min-width: 210px;
  z-index: 1010;
  transform-origin: top right;
}

.dropdown.show {
  display: flex;
  animation: dropdownSpringIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown.is-closing {
  display: flex;
  animation: dropdownFadeOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.dropdown-user-header {
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-user-header strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.dropdown-user-header small {
  font-size: 0.73rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.dropdown a {
  padding: 0.7rem 1rem;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.dropdown a:hover {
  background: var(--bg-muted);
  color: var(--accent);
  transform: translateX(3px);
}

.dropdown a.danger-link {
  color: var(--coral-rose);
}

.dropdown a.danger-link:hover {
  background: var(--coral-rose-soft);
}

.dropdown a.dropdown-visitor-item {
  justify-content: space-between;
}

.dropdown a.dropdown-visitor-item > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.visitor-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.dropdown a.dropdown-visitor-item:hover .visitor-count-badge {
  background: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   SIDEBAR (Authentic E-Learniz Grouped Sidebar)
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--sidebar-w) - 10px);
  width: var(--sidebar-w);
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.06);
  padding: calc(var(--header-h) + 1rem) 1rem 2rem;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar.active {
  left: 0;
}

.sidebar h3 {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 0.4rem 0.35rem;
  font-weight: 800;
}

.sidebar h3:first-of-type {
  margin-top: 0.2rem;
}


.sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar ul li {
  position: relative;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-secondary);
  font-size: 0.87rem;
  font-weight: 600;
  border-left: 3.5px solid transparent;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.22s ease;
  user-select: none;
  will-change: transform;
}

.sidebar ul li i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.sidebar ul li span:not(.sidebar-badge):not(.sidebar-subj-badge) {
  transition: color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar ul li:hover {
  background: var(--bg-subtle);
  color: var(--accent);
  transform: translateX(5px);
  border-left-color: var(--accent);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08);
}

.sidebar ul li:hover i {
  transform: scale(1.18);
}

.sidebar ul li:active {
  transform: translateX(2px) scale(0.98);
  transition-duration: 0.08s;
}

.sidebar ul li.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.03));
  color: var(--accent);
  font-weight: 700;
  border-left: 3.5px solid var(--accent);
}

.sidebar ul li.active i {
  transform: scale(1.08);
}

.sidebar ul li.active:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.05));
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--coral-rose);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.sidebar-subj-badge {
  margin-left: auto;
  background: var(--sun-amber-soft);
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.sidebar ul li:hover .sidebar-badge {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.35);
}

.sidebar ul li:hover .sidebar-subj-badge {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Dark theme overrides for sidebar menu items */
[data-theme="dark"] .sidebar ul li:hover {
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  border-left-color: var(--accent);
}

[data-theme="dark"] .sidebar ul li.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.03));
  border-left-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .sidebar ul li.active:hover {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.22), rgba(56, 189, 248, 0.06));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  z-index: 1000;
}

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

/* ==========================================================================
   MAIN CONTENT & 2-COLUMN E-LEARNIZ LAYOUT
   ========================================================================== */
.content {
  padding: calc(var(--header-h) + 1.5rem) 1.25rem 2.5rem;
  max-width: 1240px;
  margin: 0 auto;
  transition: margin-left 0.3s ease;
}

.page-view {
  display: none;
  animation: fadeInSimple 0.3s ease;
}

.page-view.active {
  display: block;
}

.main-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.left-section,
.right-section {
  width: 100%;
}

#welcomeText,
.page-heading-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-heading-title i {
  color: var(--accent);
}

.right-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.right-section-header h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.right-section-header h3 i {
  color: var(--sun-amber);
}

.btn-inline-add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border-radius: 12px;
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-inline-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

@media (min-width: 1024px) {
  .hamburger {
    display: none;
  }

  .sidebar {
    left: 0 !important;
  }

  .overlay {
    display: none !important;
  }

  .content {
    margin-left: var(--sidebar-w);
    padding: calc(var(--header-h) + 1.75rem) 2rem 3rem;
    max-width: calc(100% - var(--sidebar-w));
  }

  .main-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.75rem;
  }

  .left-section {
    flex: 5;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }

  .right-section {
    flex: 7;
    min-width: 0;
  }
}

/* ==========================================================================
   1. DAILY CARD FINAL (Authentic E-Learniz Daily Card in Cheerful Theme)
   ========================================================================== */
.daily-card-final {
  --dc-col: #2563eb;
  position: relative;
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

/* Cheerful top decorative stripe */
.daily-card-final::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--dc-col), #38bdf8, #f59e0b);
}

/* Header */
.final-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
  gap: 0.75rem;
}

.final-badge-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.final-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--dc-col);
  border: 1px solid #bfdbfe;
}

.final-badge.besok {
  background: var(--sun-amber-soft);
  color: #d97706;
  border-color: #fde68a;
}

/* Tab hari Daily Card: Sen–Min */
.dc-day-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: -0.35rem 0 1.05rem;
}

.dc-day-tab {
  border: 1px solid var(--border-color);
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-radius: 9px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.36rem 0.6rem;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dc-day-tab:hover {
  border-color: var(--dc-col);
  color: var(--dc-col);
  transform: translateY(-1px);
}

.dc-day-tab.active {
  background: var(--dc-col);
  border-color: var(--dc-col);
  color: #ffffff;
}

.edit-mode-on .dc-day-tabs {
  display: none;
}

.dc-day-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dc-day-btn {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.18s; transition-timing-function: ease;
}

.dc-day-btn:hover {
  background: var(--dc-col);
  color: #ffffff;
  border-color: var(--dc-col);
}

.final-day {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.final-date {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  display: block;
  margin-top: 0.35rem;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Task Shortcut Box inside Daily Card */
.task-shortcut-box {
  position: relative;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.25s; transition-timing-function: ease;
  gap: 4px;
}

.task-shortcut-box i {
  font-size: 1.2rem;
  color: var(--dc-col);
  transition: transform 0.25s, color 0.25s;
}

.task-shortcut-box span {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--dc-col);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.task-shortcut-box:hover {
  background: var(--dc-col);
  border-color: var(--dc-col);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.task-shortcut-box:hover i,
.task-shortcut-box:hover span {
  color: #ffffff;
}

.task-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--coral-rose);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(244, 63, 94, 0.35);
}

.task-badge.zero {
  background: var(--mint-green);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* 3 Top Info Cards (Seragam, Kegiatan, Catatan) */
.top-cards-grid {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: 1.35rem;
}

.info-card-dynamic {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: filter 0.2s;
}

.info-card-dynamic:last-child {
  border-bottom: none;
}

.info-card-dynamic.seragam-row {
  background: #eff6ff;
}

.info-card-dynamic.kegiatan-row {
  background: #ecfdf5;
}

.info-card-dynamic.catatan-row {
  background: #fffbeb;
}

.card-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.seragam-row .card-icon {
  background: #dbeafe;
  color: #2563eb;
}

.kegiatan-row .card-icon {
  background: #d1fae5;
  color: #059669;
}

.catatan-row .card-icon {
  background: #fef3c7;
  color: #d97706;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.card-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--text-muted);
}

.card-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.card-val.small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Daily Card Sections (Timeline & Picket) */
.final-section {
  margin-top: 0.25rem;
}

.final-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.final-title i {
  color: var(--dc-col);
}

.final-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.final-spacer {
  height: 1.15rem;
}

/* Timeline Jadwal Pelajaran */
.final-timeline {
  display: flex;
  flex-direction: column;
}

.tl-item-final {
  display: grid;
  grid-template-columns: 7.2rem 2px 1fr;
  gap: 0 0.85rem;
  min-height: 2.5rem;
  position: relative;
  align-items: start;
}

.edit-mode-on .tl-item-final {
  padding-right: 28px;
}

.tl-time-final {
  grid-column: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dc-col);
  text-align: right;
  padding-top: 0.45rem;
  white-space: nowrap;
}

.tl-marker-final {
  grid-column: 2;
  width: 2px;
  background: #dbeafe;
  position: relative;
  align-self: stretch;
}

.tl-marker-final::after {
  content: '';
  position: absolute;
  top: 0.58rem;
  left: -4px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2.5px solid var(--dc-col);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.tl-item-final.is-now .tl-marker-final::after {
  background: var(--mint-green);
  border-color: var(--mint-green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.tl-subject-final {
  grid-column: 3;
  font-size: 0.86rem;
  color: var(--text-main);
  padding: 0.38rem 0.6rem 0.6rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
  word-break: break-word;
}

.tl-subject-final.clickable {
  cursor: pointer;
}

.tl-subject-final.clickable:hover {
  background: var(--bg-subtle);
  color: var(--dc-col);
}

.tl-item-final.is-now .tl-subject-final {
  background: var(--mint-green-soft);
  color: #065f46;
  font-weight: 700;
}

.tl-room-tag {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* Jadwal Piket Pills */
.picket-grid-big {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.picket-pill {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid #bfdbfe;
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.picket-pill::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dc-col);
  margin-right: 6px;
  vertical-align: middle;
}

.picket-pill:hover {
  background: var(--dc-col);
  border-color: var(--dc-col);
  color: #ffffff;
  transform: translateY(-1px);
}

.picket-pill:hover::before {
  background: #ffffff;
}

/* Daily Card Admin Action Buttons */
.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 11px;
  border: 1px solid var(--border-color);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.action-btn.edit:hover {
  background: var(--sun-amber-soft);
  color: #d97706;
  border-color: #fde68a;
}

.action-btn.save {
  background: var(--mint-green);
  color: #ffffff;
  border-color: var(--mint-green);
}

.action-btn.cancel {
  background: var(--coral-rose-soft);
  color: var(--coral-rose);
  border-color: #fecdd3;
}

.dc-inline-editor {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-muted);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dc-inline-editor label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.dc-inline-editor input,
.dc-inline-editor textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  font-size: 0.83rem;
}

.final-watermark {
  text-align: right;
  margin-top: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   2. COURSE CARD (Authentic E-Learniz Card for Pengumuman, Tugas, & Mapel)
   ========================================================================== */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem 2.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

.course-card:active {
  transform: translateY(-1px) scale(0.995);
}

/* Status Variants for Tugas & Course Cards */
.course-card.task-green-done {
  border-left-color: var(--mint-green);
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
}

.course-card.task-red-deadline {
  border-left-color: var(--coral-rose);
  background: linear-gradient(145deg, #ffffff 0%, #fff1f2 100%);
}

.course-card.task-yellow-pending {
  border-left-color: var(--sun-amber);
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
}

.course-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  padding-right: 2.2rem;
  line-height: 1.3;
}

.course-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.course-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.65rem;
  white-space: pre-line;
}

.course-card small {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
}

/* Subject Tag inside Tugas Card */
.card-subject-origin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--bg-subtle);
  padding: 0.24rem 0.65rem;
  border-radius: 8px;
  margin-bottom: 0.55rem;
}

/* Pinned Card Accent (Yellow Left Border & Subtle Glow — Req 8) */
.course-card.is-pinned {
  border-left-color: #f59e0b !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12), var(--shadow-sm);
}

/* Penanda prioritas dari jadwal hari ini/besok */
.card-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
  width: fit-content;
}

.card-priority-badge.is-today {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.card-priority-badge.is-tomorrow {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

[data-theme="dark"] .card-priority-badge.is-today {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .card-priority-badge.is-tomorrow {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .course-card.is-pinned {
  border-left-color: #fbbf24 !important;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.16), var(--shadow-sm);
}

/* Card 3-Dots Admin Menu (Top-Right — Req 7) */
.card-menu-container {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  z-index: 10;
}

.card-dots-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.card-dots-btn:hover,
.card-menu-container.is-open .card-dots-btn {
  background: var(--bg-subtle);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.12);
}

.card-dots-btn:active {
  transform: scale(0.92);
}

.card-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 155px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 25;
  transform-origin: top right;
}

.card-menu-container.is-open .card-dropdown-menu {
  display: flex;
  animation: dropdownSpringIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-menu-container.is-closing .card-dropdown-menu {
  display: flex;
  animation: dropdownFadeOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.card-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.52rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease;
}

.card-menu-item:hover {
  background: var(--bg-subtle);
  color: var(--accent);
  transform: translateX(4px);
}

.card-menu-item:active {
  transform: scale(0.97);
}

.card-menu-item.del:hover {
  background: #fff1f2;
  color: var(--coral-rose);
}

[data-theme="dark"] .card-menu-item.del:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--coral-rose);
}

/* Photo Grid (1, 2, 3, 4+ Photos like E-Learniz v2) */
.photo-grid {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
  border-radius: 12px;
  overflow: hidden;
}

.photo-grid.count-1 {
  grid-template-columns: 1fr;
  max-height: 280px;
}

.photo-grid.count-2 {
  grid-template-columns: 1fr 1fr;
  height: 190px;
}

.photo-grid.count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 110px 110px;
}

.photo-grid.count-3 .photo-item:first-child {
  grid-row: span 2;
}

.photo-grid.count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 110px 110px;
}

.photo-item {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-subtle);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.04);
}

/* Task Button Bottom-Left (.task-btn) — Prominent & High Contrast */
.task-btn {
  position: absolute;
  bottom: 0.85rem;
  left: 1.25rem;
  padding: 0.46rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid #2563eb;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.22s; transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.task-btn i {
  font-size: 0.95rem;
}

.task-btn:hover {
  transform: translateY(-2px);
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.task-btn:active {
  transform: translateY(0);
}

.task-btn.completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

.task-btn.completed:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.42);
}

[data-theme="dark"] .task-btn {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .task-btn:hover {
  background: #38bdf8;
  color: #0f172a;
}

[data-theme="dark"] .task-btn.completed {
  background: #10b981;
  color: #0f172a;
  border-color: #10b981;
}

/* Auto Number Bottom-Right (#autoNumber) */
#autoNumber,
.card-auto-number {
  position: absolute;
  bottom: 0.8rem;
  right: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ==========================================================================
   3. HALAMAN TUGAS (User Task Profile + Sliding Filter + Mapel Chips)
   ========================================================================== */
.user-task-profile-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
}

.utp-top-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.utp-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  border: 3px solid #bfdbfe;
  flex-shrink: 0;
}

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

.utp-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.utp-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.utp-status-row strong {
  color: var(--accent);
  font-weight: 800;
}

/* Thick Progress Bar with Text Inside (Authentic E-Learniz Tugas Bar) */
.utp-progress-track {
  position: relative;
  width: 100%;
  height: 26px;
  background: var(--bg-subtle);
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
}

.utp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  border-radius: 13px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.utp-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.utp-caption {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

/* Sliding 3-Tab Filter (#taskFilters) */
.filter-group-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.filter-slider-bg {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 3);
  background: var(--accent-gradient);
  border-radius: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.filter-group-wrapper.tab-done .filter-slider-bg {
  transform: translateX(100%);
}

.filter-group-wrapper.tab-all .filter-slider-bg {
  transform: translateX(200%);
}

.filter-tab-btn {
  position: relative;
  z-index: 2;
  border: none;
  background: transparent;
  padding: 0.6rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: color 0.25s;
  white-space: nowrap;
}

.filter-tab-btn.active {
  color: #ffffff;
}

.tab-count {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.filter-tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

@media (max-width: 560px) {
  .filter-tab-btn {
    font-size: 0.72rem;
    padding: 0.55rem 0.35rem;
    gap: 0.28rem;
  }

  .filter-tab-btn i {
    display: none;
  }

  .tab-count {
    font-size: 0.64rem;
    padding: 0 5px;
  }

  .mapel-chip-tugas {
    font-size: 0.74rem;
    padding: 0.4rem 0.7rem;
  }
}

/* Mapel Filter Chips Row (#mapelFilterChips) */
.mapel-chips-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1rem;
}

.mapel-chips-row::-webkit-scrollbar {
  display: none;
}

.mapel-chip-tugas {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mapel-chip-tugas:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mapel-chip-tugas:active {
  transform: scale(0.95);
}

.mapel-chip-tugas.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.mapel-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.mapel-chip-tugas.active .mapel-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-theme="dark"] .mapel-chip-count {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .mapel-chip-tugas.active .mapel-chip-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   4. HALAMAN SUBJECT (Authentic E-Learniz #subjectInfoCard)
   ========================================================================== */
.subject-info-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

/* Accent top highlight line */
.subject-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--subj-accent, var(--accent-gradient));
  border-radius: 999px 999px 0 0;
}

/* Top Row: Icon + Title & Teacher + Edit */
.sic-top-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.sic-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--bg-subtle);
  border: 1.5px solid #bfdbfe;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transition: transform 0.2s ease;
}

.sic-icon-box:hover {
  transform: scale(1.05);
}

.sic-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sic-header-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.sic-subject-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0;
}

.sic-teacher-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.sic-teacher-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.sic-teacher-name i {
  color: var(--accent);
  font-size: 0.78rem;
}

.sic-teacher-dot {
  color: var(--text-muted);
  opacity: 0.6;
}

.sic-phone-wrapper {
  display: inline-flex;
  align-items: center;
}

.wa-link {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: #059669;
  background: var(--mint-green-soft);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  text-decoration: none;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.wa-link:hover {
  transform: translateY(-1px);
  background: #a7f3d0;
  color: #047857;
}

.sic-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.sic-edit-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: scale(1.06);
}

/* Mini Stats Grid (3 Quick Badges) */
.sic-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.sic-stat-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sic-stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sic-stat-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sic-stat-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sic-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Progress Track (Mirroring user-task-profile-card) */
.sic-progress-track {
  margin-top: 0.1rem;
}

.sic-progress-fill {
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  transition: width 0.4s ease;
}

.sic-caption {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
  display: block;
  text-align: center;
  margin-top: -0.2rem;
}

@media (max-width: 480px) {
  .sic-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sic-stats-grid .sic-stat-item:last-child {
    grid-column: span 2;
  }
}

.status-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--mint-green-soft);
  color: #059669;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-badge.locked {
  background: var(--coral-rose-soft);
  color: var(--coral-rose);
  border: 1px solid #fecdd3;
}

.status-badge.active {
  background: var(--mint-green-soft);
  color: #059669;
  border: 1px solid #a7f3d0;
}

.progress-percent {
  color: var(--text-secondary);
}

/* Subject Toolbar (Search + Type Chips) */
.subject-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
  align-items: center;
}

.subject-search-box {
  flex: 1;
  min-width: 210px;
  position: relative;
}

.subject-search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.subject-search-box input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.3rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 0.84rem;
  color: var(--text-main);
  outline: none;
}

.subject-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.subject-type-chips {
  display: flex;
  gap: 0.4rem;
}

.subj-chip {
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.subj-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.subj-chip:active {
  transform: scale(0.95);
}

.subj-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

@media (max-width: 560px) {
  .subject-header-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   GLOBAL FOOTER (#globalFooter from E-Learniz v2)
   ========================================================================== */
#globalFooter {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem 5.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border-color);
}

#globalFooter .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
}

#globalFooter .footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

#globalFooter .footer-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid #bfdbfe;
  color: var(--accent);
  font-size: 0.95rem;
}

#globalFooter .footer-brand-name {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.88rem;
}

#globalFooter .footer-brand-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

#globalFooter .footer-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
}

#globalFooter .footer-version {
  color: var(--accent);
  font-weight: 800;
}

@media (min-width: 1024px) {
  #globalFooter {
    margin-left: var(--sidebar-w);
    padding-bottom: 2rem;
  }
}

/* ==========================================================================
   DOCKED MOBILE BOTTOM NAV (#bottomNav from E-Learniz v2)
   ========================================================================== */
#bottomNav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 998;
  padding: 0 0.35rem;
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  gap: 4px;
  height: 100%;
  transition: color 0.2s;
}

.bn-item i {
  font-size: 1.15rem;
  transition: transform 0.2s;
}

.bn-item.active {
  color: var(--accent);
}

.bn-item.active i {
  transform: translateY(-2px);
}

.bn-center-wrapper {
  position: relative;
  width: 64px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bn-center-btn {
  position: absolute;
  top: -18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 4px solid #ffffff;
  color: #ffffff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: transform 0.25s;
}

.bn-center-btn:hover {
  transform: scale(1.06);
}

@media (min-width: 1024px) {
  #bottomNav {
    display: none !important;
  }
}

/* ==========================================================================
   FLOATING ADMIN FAB (#adminFabContainer from E-Learniz v2)
   ========================================================================== */
#adminFabContainer {
  position: fixed;
  bottom: 5.2rem;
  right: 1.4rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

@media (min-width: 1024px) {
  #adminFabContainer {
    bottom: 2rem;
    right: 2rem;
  }
}

.fab-main {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s;
}

.fab-main:hover {
  transform: scale(1.08);
}

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.22s; transition-timing-function: ease;
}

#adminFabContainer.open .fab-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fab-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.fab-add {
  background: var(--mint-green);
}

.fab-edit {
  background: var(--sun-amber);
}

/* ==========================================================================
   MODALS, EMPTY STATES, TOASTS & LOGIN GLASS CARD
   ========================================================================== */
.empty-card-state {
  background: #ffffff;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-card-state i {
  font-size: 2rem;
  color: var(--accent-light);
  margin-bottom: 0.6rem;
}

.empty-card-state h4 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s;
}

.modal-backdrop.open,
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop.is-closing {
  opacity: 0 !important;
  visibility: visible !important;
  pointer-events: none !important;
  transition: opacity 0.22s ease !important;
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transform-origin: center center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog,
.modal-backdrop.is-open .modal-dialog {
  opacity: 1;
  animation: popUpSpring 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-backdrop.is-closing .modal-dialog {
  animation: popUpFadeOut 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-dialog.modal-lg {
  max-width: 660px;
}

.modal-dialog.modal-sm,
.modal-dialog.u-dialog-sm {
  max-width: 420px;
}

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

.modal-header h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.12rem;
  color: var(--text-main);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.modal-close-btn:hover {
  background: var(--coral-rose-soft);
  color: var(--coral-rose);
  border-color: var(--coral-rose);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

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

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 11px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group select option {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.form-group input[type="file"] {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-right: 0.75rem;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.form-group input[type="file"]::file-selector-button:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Drag and Drop Uploader */
.dropzone {
  border: 2px dashed var(--input-border);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  background: var(--input-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.dropzone:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.dropzone.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: scale(1.01);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  transform: translateY(-2px) scale(1.08);
}

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

.dropzone-main-text {
  font-size: 0.88rem;
  color: var(--text-main);
}

.dropzone-browse {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dropzone-sub-text {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Image Preview Grid */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.preview-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
  animation: fadeInSimple 0.2s ease;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-card .btn-remove-img {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
  z-index: 3;
}

.preview-card .btn-remove-img:hover {
  background: var(--coral-rose);
  transform: scale(1.1);
}

.preview-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.35rem;
  z-index: 2;
  text-align: center;
  padding: 0.5rem;
}

.preview-card-overlay i {
  font-size: 1.1rem;
  color: var(--accent-light);
}

.preview-badge-r2 {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.form-group input[type="color"] {
  height: 42px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 10px;
}

.form-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.check-pill:hover {
  border-color: var(--accent);
}

.check-pill input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-primary {
  padding: 0.68rem 1.2rem;
  border-radius: 12px;
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, filter 0.18s ease;
  transform: translateZ(0);
}

.btn-primary:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97) translateZ(0);
}

.btn-secondary {
  padding: 0.68rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  transform: translateZ(0);
}

.btn-secondary:hover {
  transform: translateY(-1.5px) translateZ(0);
  background: var(--bg-muted);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.97) translateZ(0);
}

.btn-block {
  width: 100%;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 3000;
}

.toast-msg {
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   LOGIN PAGE (Authentic E-Learniz .glass-card in Bright Cheerful Theme)
   ========================================================================== */
.login-page-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.login-glass-card {
  width: 420px;
  max-width: 94vw;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #dbeafe;
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.14);
  overflow: hidden;
}

.login-card-header {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 2rem 1.75rem 1.6rem;
  text-align: center;
  position: relative;
}

.login-header-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  color: #fde047;
  font-size: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.login-card-header h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.login-card-header p {
  font-size: 0.84rem;
  opacity: 0.92;
}

.login-card-body {
  padding: 1.6rem 1.75rem 1.8rem;
}

.login-alert {
  background: var(--coral-rose-soft);
  color: var(--coral-rose);
  border: 1px solid #fecdd3;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.login-divider {
  text-align: center;
  margin: 1.1rem 0;
  position: relative;
}

.login-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-color);
}

.login-divider span {
  position: relative;
  background: #ffffff;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-guest-block {
  width: 100%;
  padding: 0.68rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #bfdbfe;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.btn-guest-block:hover {
  background: #dbeafe;
}

/* Multi-Step Login Components */
.login-step-back {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
  z-index: 5;
}

.login-step-back:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.login-step-pills {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.3s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.step-dot.active {
  width: 24px;
  background: #ffffff;
}

.login-class-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.login-class-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.login-class-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.login-class-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.lcc-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.login-class-card:hover .lcc-icon {
  background: var(--accent);
  color: #ffffff;
}

.lcc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lcc-text strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  color: var(--text-main);
}

.lcc-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.lcc-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.login-class-card:hover .lcc-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.staff-login-link-wrap {
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.btn-staff-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-family: inherit;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.btn-staff-link:hover {
  color: var(--accent);
  background: var(--bg-subtle);
}

.login-search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  margin-bottom: 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-search-box i {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
}

.login-search-box input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.login-search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
}

.student-list-scroll {
  max-height: 290px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 4px;
  scrollbar-width: thin;
}

.student-select-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.15s; transition-timing-function: ease;
}

.student-select-item:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
  transform: translateX(3px);
}

.ssi-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ssi-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ssi-meta strong {
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ssi-lock-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #b45309;
  background: var(--sun-amber-soft);
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  line-height: 1.2;
}

[data-theme="dark"] .ssi-lock-badge {
  color: var(--sun-amber);
}

.student-select-item.is-privileged:hover {
  border-color: var(--sun-amber);
}

.ssi-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ssi-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.student-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.confirm-profile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.5rem 1.5rem;
  gap: 0.45rem;
}

.confirm-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
  border: 4px solid var(--bg-subtle);
  margin-bottom: 0.4rem;
  animation: popUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-class-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--sun-amber-soft);
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .confirm-class-pill {
  color: var(--sun-amber);
}

.confirm-greeting {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.2rem 0 0;
}

.confirm-question {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 300px;
}

.btn-confirm-enter {
  padding: 0.82rem 1.4rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.step-pane {
  display: none;
  animation: fadeInSimple 0.25s ease;
}

.step-pane.active {
  display: block;
}

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

@keyframes popUp {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   UNIVERSAL TOAST SYSTEM (Req 4)
   ========================================================================== */
.universal-toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.6rem;
  z-index: 99999;
  pointer-events: none;
  max-width: 90vw;
  width: auto;
}

.u-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.15rem;
  background: var(--bg-surface);
  border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.22s, transform 0.22s;
  max-width: 420px;
  cursor: pointer;
}

.u-toast.is-closing {
  animation: toastSlideOut 0.22s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
}

.u-toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.u-toast-success .u-toast-icon { color: var(--mint-green); }
.u-toast-error .u-toast-icon { color: var(--coral-rose); }
.u-toast-warning .u-toast-icon { color: var(--sun-amber); }
.u-toast-info .u-toast-icon { color: var(--accent); }

.u-toast-msg {
  flex: 1;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}

.u-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.85rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.u-toast-close:hover {
  color: var(--text-main);
}

[data-theme="dark"] .u-toast {
  background: #162036;
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
  .universal-toast-container {
    bottom: 5.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 2rem);
  }
}

/* ==========================================================================
   UNIVERSAL DROPDOWN (Accessible Custom Select Replacement — Req 9)
   ========================================================================== */
.u-dropdown {
  position: relative;
  width: 100%;
  user-select: none;
}

.u-dropdown.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.u-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
  text-align: left;
}

.u-dropdown-trigger:focus,
.u-dropdown.is-open .u-dropdown-trigger {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.u-dropdown-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.u-dropdown.is-open .u-dropdown-arrow {
  transform: rotate(180deg);
}

.u-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 1050;
  transform-origin: top center;
}

.u-dropdown.is-open .u-dropdown-menu {
  display: flex;
  animation: dropdownSpringIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.u-dropdown.is-closing .u-dropdown-menu {
  display: flex;
  animation: dropdownFadeOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.u-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease;
}

.u-dropdown-option:hover {
  background: var(--bg-subtle);
  color: var(--accent);
  transform: translateX(4px);
}

.u-dropdown-option:active {
  transform: scale(0.98);
}

.u-dropdown-option.is-selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.u-dropdown-check {
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0;
}

.u-dropdown-option.is-selected .u-dropdown-check {
  opacity: 1;
}

[data-theme="dark"] .u-dropdown-menu {
  background: #162036;
  border-color: var(--border-color);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   DETAIL CARD SQUARE PHOTOS & PHOTO VIEWER MODE (Req 12)
   ========================================================================== */
.detail-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.detail-photo-thumb {
  width: 110px;
  height: 110px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s;
  background: var(--bg-muted);
}

.detail-photo-thumb:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  border-color: var(--accent);
}

.detail-photo-thumb:active {
  transform: scale(0.96);
}

.detail-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-photo-thumb .thumb-zoom-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Photo Viewer Mode inside Modal */
.detail-photo-viewer {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-photo-viewer.active {
  display: flex;
  animation: fadeInSimple 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.detail-photo-viewer.is-closing {
  display: flex;
  animation: dropdownFadeOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

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

.pv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.pv-back-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.pv-image-container {
  position: relative;
  width: 100%;
  background: #000000;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 65vh;
}

.pv-image-container img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

.pv-fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition-property: background-color, border-color, color, opacity, transform, box-shadow; transition-duration: 0.2s; transition-timing-function: ease;
}

.pv-fullscreen-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   TASK SEARCH BOX (Halaman Tugas — Req 10)
   ========================================================================== */
.tugas-search-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.55rem 0.95rem;
  margin-top: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1rem;
}

.tugas-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tugas-search-box i {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tugas-search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.86rem;
  width: 100%;
}

/* ==========================================================================
   DAILY CARD INLINE EDITING (Req 2 - Restored Behavior from v2)
   ========================================================================== */
.daily-card-final.edit-mode-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card);
}

.editable-text {
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  border-radius: 6px;
  min-width: 1.5rem;
}

.edit-mode-on .editable-text {
  cursor: text;
  border: 1px dashed var(--accent);
  background: rgba(37, 99, 235, 0.04);
  padding: 2px 6px;
  outline: none !important;
}

.edit-mode-on .editable-text:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
}

.edit-mode-on .editable-text:focus {
  border: 1.5px solid var(--accent);
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none !important;
}

.edit-mode-on .tl-time-final.editable-text {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2px;
}

.edit-mode-on .tl-subject-final.editable-text {
  padding: 3px 8px;
}

.edit-mode-on .tl-item-final.is-now .tl-subject-final {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--mint-green);
  color: var(--text-main);
}

.edit-mode-on .info-card-dynamic .card-val.editable-text {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
}

[data-theme="dark"] .edit-mode-on .editable-text {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.06);
}

[data-theme="dark"] .edit-mode-on .editable-text:hover {
  background: rgba(56, 189, 248, 0.12);
}

[data-theme="dark"] .edit-mode-on .editable-text:focus {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* Inline Delete Button (Fixed Absolute Positioning like v2) */
.btn-del-inline {
  display: none;
  border: none;
  cursor: pointer;
}

.edit-mode-on .tl-item-final .btn-del-inline {
  display: flex;
  position: absolute;
  right: 0;
  top: 0.45rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4757;
  color: #ffffff;
  font-size: 0.65rem;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.edit-mode-on .tl-item-final .btn-del-inline:hover {
  transform: scale(1.15);
  background: #e03242;
}

.edit-mode-on .picket-pill .btn-del-inline {
  display: flex;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff4757;
  color: #ffffff;
  font-size: 0.55rem;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(255, 71, 87, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.edit-mode-on .picket-pill .btn-del-inline:hover {
  transform: scale(1.15);
  background: #e03242;
}

/* Add Buttons (Clean Full Width like v2) */
.btn-add-inline {
  display: none;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.52rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1.5px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.edit-mode-on .btn-add-inline {
  display: flex;
}

.btn-add-inline:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.dc-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   ALL SUBJECTS OVERVIEW GRID (Req 14)
   ========================================================================== */
.all-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.all-subject-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.all-subject-card:hover {
  transform: translateY(-4px) translateZ(0);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.all-subject-card:active {
  transform: translateY(-1px) scale(0.99) translateZ(0);
}

.asc-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.asc-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #ffffff;
  flex-shrink: 0;
}

.asc-title-wrap h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.asc-title-wrap span {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.asc-stats {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
}

.asc-stat-pill {
  flex: 1;
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.asc-stat-num {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.asc-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   JUICY & LIGHTWEIGHT ANIMATIONS (Req 15 & User Polish)
   High-performance GPU-composited animations with tactile spring easing
   ========================================================================== */
@keyframes dropdownSpringIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
  }
  65% {
    transform: scale(1.015) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dropdownSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popUpSpring {
  0% {
    opacity: 0;
    transform: scale(0.90) translateY(18px);
  }
  70% {
    transform: scale(1.018) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes itemPopIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dropdownFadeOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.93) translateY(-8px);
  }
}

@keyframes popUpFadeOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.93) translateY(12px);
  }
}

@keyframes fadeOutSimple {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ==========================================================================
   PERFORMANCE LAYER (GPU Compositor Optimization)
   Promote cards, modals, dropdowns, and toasts to their own compositor layer
   so animations run at 60-120fps with negligible CPU/GPU overhead.
   ========================================================================== */
header#mainHeader { background: var(--bg-surface); }
#bottomNav { background: var(--bg-surface); }
[data-theme="dark"] header#mainHeader,
[data-theme="dark"] #bottomNav { background: #121826; }

.course-card,
.daily-card-final,
.user-task-profile-card,
.subject-info-card,
.all-subject-card,
.modal-dialog,
.dropdown,
.u-dropdown-menu,
.card-dropdown-menu,
.u-toast {
  transform: translateZ(0);
  backface-visibility: hidden;
}
