/* ==========================================================================
   DIBSII - Digitalisasi Informasi dan Penilaian Santri
   Core Stylesheet, Theme Engine, Animations, & Cover Screen
   ========================================================================== */

:root {
  /* DIBSII Purple & Green Palette */
  --primary-purple: #6320EE;
  --primary-purple-hover: #5214D6;
  --primary-purple-light: #F3E8FF;
  --primary-purple-text: #581C87;

  --primary-green: #10B981;
  --primary-green-hover: #059669;
  --primary-green-light: #ECFDF5;
  --primary-green-text: #065F46;

  /* SKL 5-Aspect Color System */
  --aspect-life-skills: #2563EB;   /* Biru (30%) */
  --aspect-diniyah: #DC2626;       /* Merah (20%) */
  --aspect-vokasional: #16A34A;    /* Hijau (20%) */
  --aspect-akademik: #CA8A04;      /* Kuning/Amber (15%) */
  --aspect-formal: #9333EA;        /* Ungu (15%) */

  /* Neutral Surface & Backgrounds (Light Theme) */
  --bg-body: #E2E8F0;
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-overlay: rgba(15, 23, 42, 0.6);

  /* Typography Families */
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-data: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;

  /* Typography & Text - Senior Friendly High Contrast (#111111 & Deep Charcoal) */
  --text-main: #111111;
  --text-muted: #27303F;
  --text-light: #475569;
  --text-inverse: #FFFFFF;

  /* Borders & Shadows - Crisp, Defined Boundaries */
  --border-light: #CBD5E1;
  --border-color: #CBD5E1;
  --border-focus: #7C3AED;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.14);
  --shadow-sheet: 0 -8px 32px rgba(15, 23, 42, 0.2);

  /* Spacing - Generous & Ergonomic */
  --nav-height: calc(74px + env(safe-area-inset-bottom, 0px));
  --header-height: 76px;
}

/* ==========================================================================
   Dark Theme Overrides - High Contrast for Low-Vision Accessibility
   ========================================================================== */
body.dark-mode {
  --bg-body: #090D16;
  --bg-app: #0F172A;
  --bg-card: #1E293B;
  --bg-subtle: #334155;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  --text-main: #FFFFFF;
  --text-muted: #CBD5E1;
  --text-light: #94A3B8;

  --border-light: #475569;
  --border-color: #475569;
  --border-focus: #A78BFA;

  --primary-purple-light: #312E81;
  --primary-purple-text: #DDD6FE;
  --primary-green-light: #064E3B;
  --primary-green-text: #A7F3D0;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.75);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-body);
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography Hierarchy & Headings */
h1, h2, h3, h4, h5, h6,
.font-heading,
.header-title,
.card-title,
.sheet-title,
.cover-title,
.cover-logo-title,
.brand-name {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}

/* Tabular Data, Scores, & Numeric Precision */
.font-data,
.score-badge,
.stat-number,
.stat-value,
.badge-score,
.data-table,
.skl-score,
.score-ring-text {
  font-family: var(--font-data);
  font-feature-settings: 'tnum' on, 'cv05' on;
}

/* Arabic / Diniyah Typography */
.font-arabic,
.text-arabic,
[lang="ar"],
.arabic-verse,
.arabic-text {
  font-family: var(--font-arabic);
  font-size: 1.3em;
  line-height: 1.85;
  direction: rtl;
  text-align: right;
}

/* ==========================================================================
   Full-Screen Edge-to-Edge Responsive Layout Engine
   Guarantees 100% full screen width & height on ALL devices:
   Mobile, Tablets, Laptops, Desktops, and Ultra-Wide displays.
   No outer gaps, no margins, no squished boxes.
   ========================================================================== */
html, body {
  width: 100vw;
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  margin: 0;
  padding: 0 !important;
  background-color: var(--bg-app);
  overflow: hidden;
}

body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  min-height: 100%;
  min-height: 100dvh;
  min-height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

.app-container {
  width: 100vw !important;
  width: 100% !important;
  max-width: 100vw !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  height: var(--app-height, 100dvh) !important;
  min-height: 100% !important;
  min-height: 100dvh !important;
  min-height: var(--app-height, 100dvh) !important;
  max-height: 100% !important;
  max-height: 100dvh !important;
  max-height: var(--app-height, 100dvh) !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Ensure full screen on all media queries */
@media (min-width: 768px) {
  body {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    background: var(--bg-app);
  }
  .app-container {
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 0 !important;
  }
  .app-container {
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 1440px) {
  .app-container {
    max-width: 100% !important;
    max-height: 100vh !important;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  body {
    padding: 0 !important;
  }
  .app-container {
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
  }
}

/* ==========================================================================
   Global App Header with Realtime Clock, Theme Toggle & Profile Dropdown
   ========================================================================== */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 2px solid var(--border-light);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 500;
  min-height: var(--header-height);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

@media (min-width: 768px) {
  .app-header {
    padding: 14px 28px;
  }
}

@media (min-width: 1024px) {
  .app-header {
    padding: 16px 40px;
  }
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  padding: 3px;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.header-text-group {
  display: flex;
  flex-direction: column;
}

.header-app-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-portal-pill {
  font-size: 12.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1.5px solid currentColor;
}

/* Realtime Clock in Header - Sharp, Large & Clear */
.header-realtime-clock {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.header-clock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--primary-green);
  animation: clockPulse 1.5s infinite;
}

@keyframes clockPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Header Center Actions (Notification Center Bell In Center) */
.header-center-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Header Right Actions */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Theme Toggle Button (Light/Dark Mode) */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 2px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--border-light);
  transform: rotate(15deg);
}

/* Cloud Sync Status Button */
.header-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  line-height: 1;
}

.header-sync-btn:hover {
  border-color: var(--primary-purple);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.header-sync-btn .sync-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  display: inline-block;
  background-color: #10B981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.7);
  transition: all 0.3s ease;
}

.header-sync-btn.connecting .sync-dot {
  background-color: #F59E0B;
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.7);
}

.header-sync-btn.offline .sync-dot {
  background-color: #EF4444;
  box-shadow: 0 0 7px rgba(239, 68, 68, 0.7);
}

.header-sync-btn .sync-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.header-sync-btn:hover .sync-icon {
  opacity: 1;
}

.header-sync-btn .sync-icon.spinning svg,
.header-sync-btn.syncing .sync-icon svg {
  animation: dibsiiSpin 1s linear infinite;
}

@keyframes dibsiiSpin {
  100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .header-sync-btn .sync-label {
    display: none;
  }
  .header-sync-btn {
    padding: 6px 8px;
  }
}

/* Header Login CTA Button (Cover & Public Mode) */
.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-purple), #7C3AED);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(99, 32, 238, 0.28);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(99, 32, 238, 0.38);
}

.header-login-btn:active {
  transform: scale(0.96);
}

/* Profile Dropdown Trigger Button */
.header-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
}

.header-profile-btn:hover,
.header-profile-btn.active {
  background-color: var(--primary-purple-light);
  border-color: var(--primary-purple);
  box-shadow: 0 2px 8px rgba(99, 32, 238, 0.12);
}

.header-profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 1.5px solid rgba(99, 32, 238, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-profile-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  line-height: 1;
  margin-right: 2px;
}

.header-profile-btn.active .header-profile-arrow {
  transform: rotate(180deg);
  color: var(--primary-purple);
}

/* Notification Bell Button in Header */
.header-notif-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.header-notif-btn svg {
  width: 19px;
  height: 19px;
  stroke: var(--text-main);
  transition: transform 0.2s ease;
  transform-origin: top center;
}

@keyframes bellRinging {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-14deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-6deg); }
  100% { transform: rotate(0deg); }
}

.header-notif-btn:hover {
  background-color: var(--border-light);
  transform: scale(1.05);
}

.header-notif-btn:hover svg {
  animation: bellRinging 0.65s ease;
}

.header-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  animation: pulseNotifBadge 2.2s infinite ease-in-out;
  font-family: var(--font-data);
}

@keyframes pulseNotifBadge {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px rgba(239, 68, 68, 0.8); }
}

/* Notification Items in Modal / Bottom Sheet */
.notif-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.notif-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.notif-chip:hover {
  background-color: var(--border-light);
  color: var(--text-main);
}

.notif-chip.active {
  background-color: var(--primary-purple);
  color: #FFFFFF;
  border-color: var(--primary-purple);
  box-shadow: 0 2px 8px rgba(99, 32, 238, 0.25);
}

.notif-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 56vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.notif-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.notif-item-card:hover {
  border-color: var(--primary-purple);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.notif-item-card.unread {
  background-color: var(--bg-app);
  border-left: 4px solid var(--primary-purple);
}

.notif-item-card.read {
  background-color: var(--bg-card);
  border-left: 4px solid #10B981;
  opacity: 0.95;
}

.notif-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-content-box {
  flex: 1;
  min-width: 0;
}

.notif-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.notif-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.notif-time {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.notif-msg {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-purple);
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.notif-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
  opacity: 0.8;
}

/* ==========================================================================
   Profile Dropdown Floating Menu (Ultra-Responsive & Cross-Device)
   ========================================================================== */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 265px;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 80px);
  max-height: calc(100vh - 80px);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-header,
.dropdown-user-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, var(--bg-subtle), var(--bg-card));
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dropdown-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--primary-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 32, 238, 0.15);
}

.dropdown-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropdown-user-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.dropdown-user-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-role {
  font-size: 11px;
  color: var(--primary-purple);
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-list,
.dropdown-menu-list {
  padding: 6px 0 24px 0;
  list-style: none;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.dropdown-list::-webkit-scrollbar {
  width: 5px;
}
.dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 10px;
}
.dropdown-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  user-select: none;
  box-sizing: border-box;
}

.dropdown-item:hover {
  background-color: var(--primary-purple-light);
  color: var(--primary-purple);
  padding-left: 17px;
}

.dropdown-item.danger {
  color: #DC2626;
  border-top: 1.5px dashed var(--border-light);
  margin-top: 6px;
  padding-top: 11px;
  padding-bottom: 11px;
  font-weight: 700;
}

.dropdown-item.danger:hover {
  background-color: #FEF2F2;
  color: #B91C1C;
  padding-left: 17px;
}

body.dark-mode .dropdown-item.danger:hover {
  background-color: rgba(220, 38, 38, 0.15);
  color: #F87171;
}

/* Responsiveness for Header on Small Mobile Phones (< 400px) */
@media (max-width: 400px) {
  .app-header {
    padding: 8px 10px;
  }
  .header-logo {
    width: 38px;
    height: 38px;
  }
  .header-app-title {
    font-size: 14.5px;
  }
  .header-portal-pill {
    font-size: 9.5px;
    padding: 1.5px 5px;
  }
  .header-realtime-clock {
    font-size: 10px;
  }
  .header-right-actions {
    gap: 5px;
  }
  .theme-toggle-btn,
  .header-notif-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .header-profile-btn {
    padding: 2px 6px 2px 2px;
  }
  .header-profile-avatar {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .profile-dropdown-menu {
    width: 250px;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 65px);
    max-height: calc(100vh - 65px);
    right: -4px;
  }
}

/* Responsiveness for Very Small Screens (< 340px) */
@media (max-width: 340px) {
  #header-clock-text {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-profile-arrow {
    display: none;
  }
}

/* ==========================================================================
   COVER SCREEN (HALAMAN AWAL / PORTAL PUBLIK TERPADU)
   ========================================================================== */
.cover-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px 44px 14px;
  min-height: auto;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.cover-glow-bg {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(99, 32, 238, 0.15) 0%, rgba(16, 185, 129, 0.08) 60%, transparent 80%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.cover-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 100%;
  width: 100%;
  padding: 16px 8px 24px 8px;
}

/* Simplified Elegant Cover Logo */
.cover-logo-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-logo-aura {
  position: absolute;
  inset: -8px;
  border-radius: 32px;
  background: radial-gradient(circle, rgba(99, 32, 238, 0.28) 0%, rgba(16, 185, 129, 0.15) 60%, transparent 75%);
  filter: blur(10px);
  animation: logoAuraGentle 3.5s ease-in-out infinite alternate;
  pointer-events: none;
}

.cover-logo-badge {
  position: relative;
  width: 114px;
  height: 114px;
  border-radius: 28px;
  background: #FFFFFF;
  padding: 10px;
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 28px rgba(99, 32, 238, 0.18), 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoSoftFloat 3.5s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cover-logo-wrapper:hover .cover-logo-badge {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 34px rgba(99, 32, 238, 0.25);
}

.cover-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

@keyframes logoSoftFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes logoAuraGentle {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.08); opacity: 0.85; }
}

.cover-arabic {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Amiri', serif;
}

.cover-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.cover-title span {
  color: var(--primary-purple);
}

.cover-subtitle {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-green-text);
  margin-bottom: 4px;
}

.cover-school-name {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.cover-motto-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--primary-purple-light);
  color: var(--primary-purple-text);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Call To Action Buttons Group */
.cover-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .cover-cta-group {
    flex-direction: row;
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
    gap: 14px;
  }

  .btn-cover-start {
    width: auto !important;
    flex: 0 1 auto !important;
    min-width: 200px !important;
    max-width: 320px !important;
  }

  .btn-cover-explore {
    width: auto !important;
    flex: 0 1 auto !important;
    min-width: 160px !important;
    max-width: 280px !important;
  }
}

.btn-cover-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  background: linear-gradient(135deg, var(--primary-purple), #7C3AED);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 32, 238, 0.3);
  transition: all 0.2s ease;
  width: 100%;
  flex: 1;
  min-height: 48px;
  height: auto;
  box-sizing: border-box;
}

.btn-cover-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 32, 238, 0.4);
}

.btn-cover-start:active {
  transform: scale(0.97);
}

.btn-cover-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  min-width: 140px;
  min-height: 44px;
  height: auto;
  box-sizing: border-box;
}

.btn-cover-explore:hover {
  background-color: var(--bg-subtle);
  border-color: var(--primary-purple-light);
  transform: translateY(-1px);
}

.btn-cover-explore:active {
  transform: scale(0.97);
}

/* Cover Info & Portal Section */
.cover-info-section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cover-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cover-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .cover-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cover-login-cta-card {
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99, 32, 238, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1.5px dashed var(--primary-purple-light);
  border-radius: var(--radius-md);
  margin-top: 6px;
}

/* ==========================================================================
   LOGIN SCREEN (HALAMAN 2: LOGIN RESMI DIBSII)
   ========================================================================== */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px 16px;
  min-height: 100%;
  width: 100%;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.login-glow-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(99, 32, 238, 0.1) 0%, rgba(46, 129, 158, 0.08) 50%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.login-card-container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 2;
  margin: auto;
  box-sizing: border-box;
}

.login-main-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.03);
  padding: 24px 20px 22px 20px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

/* Symbol Back Button in Top-Right Corner of Login Form */
.login-back-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.login-back-btn:hover {
  background-color: var(--primary-purple-light);
  color: var(--primary-purple);
  border-color: var(--primary-purple);
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(99, 32, 238, 0.15);
}

.login-back-btn:active {
  transform: scale(0.92);
}

.login-header-box {
  text-align: center;
  margin-bottom: 16px;
}

.login-logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.login-logo-circle {
  width: 66px;
  height: 66px;
  object-fit: contain;
  border-radius: 50%;
  background-color: #FFFFFF;
  padding: 5px;
  border: 2px solid rgba(99, 32, 238, 0.12);
  box-shadow: 0 4px 14px rgba(99, 32, 238, 0.1);
  display: inline-block;
  transition: transform 0.25s ease;
}

.login-logo-circle:hover {
  transform: scale(1.04);
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 300px;
  margin: 0 auto;
}

/* ==========================================================================
   DYNAMIC OUTLINED FLOATING INPUT FIELDS (GOOGLE MATERIAL SPEC)
   ========================================================================== */
.floating-field-group {
  position: relative;
  margin-bottom: 18px;
  text-align: left;
}

.floating-field-box {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 52px;
  cursor: text;
  pointer-events: auto;
}

.floating-field-box:focus-within {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3.5px rgba(99, 32, 238, 0.14);
}

.floating-field-icon {
  padding-left: 14px;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  pointer-events: none;
}

.floating-field-box:focus-within .floating-field-icon {
  color: var(--primary-purple);
}

.floating-field-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 15px 12px 13px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  width: 100%;
  z-index: 1;
  pointer-events: auto;
}

/* Floating Label Animation: Awalnya di dalam kolom, pindah ke garis tengah atas saat diklik / terisi */
.floating-field-label {
  position: absolute;
  left: 42px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 6px;
  background-color: transparent;
  border-radius: 4px;
  z-index: 2;
  line-height: 1;
}

/* Animasi mengambang ke garis atas kolom saat focus atau input terisi */
.floating-field-box:focus-within .floating-field-label,
.floating-field-input:not(:placeholder-shown) + .floating-field-label,
.floating-field-input:focus + .floating-field-label {
  top: -10px;
  left: 14px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 700;
  background-color: var(--bg-card);
  color: var(--primary-purple);
}

.floating-field-box:not(:focus-within) .floating-field-input:not(:placeholder-shown) + .floating-field-label {
  color: var(--text-muted);
}

.floating-field-toggle-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 3;
}

.floating-field-toggle-btn:hover {
  color: var(--primary-purple);
  transform: scale(1.1);
}

/* Input Icon Box for Modals & Registration Forms */
.input-icon-box {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 42px;
}

.input-icon-box:focus-within {
  border-color: var(--primary-purple) !important;
  box-shadow: 0 0 0 3px rgba(99, 32, 238, 0.14) !important;
}

.input-icon-box:focus-within span {
  color: var(--primary-purple) !important;
}

/* Autocomplete Suggestions Dropdown on Login */
.username-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--primary-purple);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(99, 32, 238, 0.12);
  z-index: 100;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.username-autocomplete-header {
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.username-autocomplete-scroll {
  overflow-y: auto;
  max-height: 200px;
}

.username-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.username-autocomplete-item:last-child {
  border-bottom: none;
}

.username-autocomplete-item:hover {
  background: rgba(99, 32, 238, 0.08);
}

.user-auto-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-auto-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.user-auto-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.3;
  flex-wrap: wrap;
}

.user-auto-role-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 12px;
}

.user-auto-uname {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.user-auto-uname code {
  background: var(--bg-subtle);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--primary-purple);
  font-weight: 700;
  font-size: 10.5px;
}

.user-auto-select-arrow {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-purple);
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.username-autocomplete-item:hover .user-auto-select-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.username-autocomplete-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.forgot-password-row {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 18px;
}

.forgot-password-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-purple);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.forgot-password-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.login-submit-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 16px 0 10px 0;
}

.btn-login-submit {
  width: 100%;
  max-width: 100%;
  height: 56px;
  min-height: 56px;
  margin: 0 auto;
  padding: 0 22px;
  border-radius: 12px;
  background: #6C5CE7;
  background-image: linear-gradient(135deg, #6C5CE7 0%, #7C3AED 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(108, 92, 231, 0.35);
  transition: all 0.22s ease;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  position: relative;
  z-index: 5;
  user-select: none;
  box-sizing: border-box;
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  background: #5B4CD9;
  background-image: linear-gradient(135deg, #5B4CD9 0%, #6D28D9 100%);
  box-shadow: 0 6px 22px rgba(108, 92, 231, 0.45);
}

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

.btn-login-submit .vector-png-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-login-submit:hover .vector-png-icon {
  transform: scale(1.25) rotate(-10deg);
}

.login-footer-text {
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.login-footer-link {
  color: #2E819E;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.login-footer-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Login Registration Section */
.login-register-prompt-box {
  margin-top: 14px;
  text-align: center;
}

.login-register-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.login-register-divider::before,
.login-register-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.login-register-divider span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn-login-register {
  width: 100%;
  min-height: 44px;
  height: auto;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(46, 129, 158, 0.08);
  color: #1F647E;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid rgba(46, 129, 158, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.btn-login-register:hover {
  background: rgba(46, 129, 158, 0.16);
  border-color: #1F647E;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(46, 129, 158, 0.18);
}

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

@media (min-width: 640px) {
  .btn-login-submit {
    max-width: 340px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ==========================================================================
   Dynamic Role-Based Registration Cards & Forms
   ========================================================================== */
.reg-categories-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}

.reg-category-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.reg-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-purple);
  box-shadow: 0 6px 18px rgba(99, 32, 238, 0.12);
}

.reg-category-card.card-wali:hover {
  border-color: #2563EB;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(37, 99, 235, 0.07));
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15);
}

.reg-category-card.card-guru:hover {
  border-color: #059669;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.03), rgba(5, 150, 105, 0.07));
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.15);
}

.reg-category-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reg-category-content {
  flex: 1;
  min-width: 0;
}

.reg-category-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reg-category-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.2s ease;
}

.reg-category-card:hover .reg-category-arrow {
  transform: translateX(3px);
  color: var(--primary-purple);
}

.reg-category-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

.reg-category-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.reg-back-step-btn {
  background: none;
  border: none;
  color: var(--primary-purple);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin-bottom: 12px;
  transition: opacity 0.15s ease;
}

.reg-back-step-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Segmented Role Selector Tabs */
.role-segmented-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}

.role-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 3px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.role-tab-btn .role-tab-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.role-tab-btn .role-tab-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.role-tab-btn:hover {
  background-color: rgba(99, 32, 238, 0.06);
}

.role-tab-btn.active {
  background-color: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.role-tab-btn.active .role-tab-label {
  color: var(--primary-purple);
  font-weight: 800;
}

/* Role Active Banner */
.role-active-banner {
  background: linear-gradient(135deg, rgba(99, 32, 238, 0.05), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(99, 32, 238, 0.12);
  border-left: 3.5px solid var(--primary-purple);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: left;
}

/* Input Fields with Icon Prefix & Toggle */
.input-with-icon,
.input-with-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.input-with-icon .form-input,
.input-with-icon .form-control,
.input-with-icon-wrapper .form-control,
.form-control.has-icon-left {
  padding-left: 46px !important;
}

.input-with-icon .form-control.has-icon-both,
.input-with-icon-wrapper .form-control.has-icon-both,
.form-control.has-icon-both {
  padding-left: 46px !important;
  padding-right: 46px !important;
}

.input-toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-toggle-password:hover {
  color: var(--text-main);
}

/* Demo Accounts Section */
.demo-section-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-light);
}

.demo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.demo-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-section-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: var(--primary-green-light);
  color: var(--primary-green-text);
}

.demo-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.demo-card-item:hover {
  background-color: var(--primary-purple-light);
  border-color: var(--primary-purple);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(99, 32, 238, 0.08);
}

.demo-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.demo-card-info {
  text-align: left;
}

.demo-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.demo-card-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.demo-card-action {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-purple);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.demo-card-item:hover .demo-card-action {
  background-color: var(--primary-purple);
  color: #FFFFFF;
  border-color: var(--primary-purple);
}

/* ==========================================================================
   PROFILE LISTVIEW STYLING (RESPONSIVE MODERN LISTVIEW DESIGN)
   ========================================================================== */
.profile-hero-card {
  background: linear-gradient(135deg, rgba(99, 32, 238, 0.09) 0%, rgba(16, 185, 129, 0.08) 50%, rgba(2, 132, 199, 0.09) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-hero-avatar-box {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 3px solid var(--primary-purple);
  box-shadow: 0 6px 20px rgba(99, 32, 238, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-hero-avatar-box:hover {
  transform: scale(1.06) rotate(2deg);
}

.profile-hero-name {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.2px;
  word-break: break-word;
}

.profile-hero-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 8px;
  background-color: var(--primary-purple-light);
  color: var(--primary-purple-text);
  border: 1px solid rgba(99, 32, 238, 0.15);
  box-shadow: 0 2px 6px rgba(99, 32, 238, 0.08);
}

.listview-group {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.listview-group:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.listview-header {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 11px 16px 8px 16px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.listview-header svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.listview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s ease;
  min-height: 56px;
}

.listview-item:last-child {
  border-bottom: none;
}

.listview-item.clickable {
  cursor: pointer;
}

.listview-item.clickable:hover {
  background-color: var(--bg-subtle);
}

.listview-item.clickable:active {
  background-color: var(--primary-purple-light);
}

.listview-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.listview-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listview-item.clickable:hover .listview-icon-box {
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.listview-icon-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.listview-content {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.listview-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.listview-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.listview-action {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Responsiveness enhancements for small phones (< 380px) */
@media (max-width: 380px) {
  .profile-hero-card {
    padding: 16px 12px;
  }
  .profile-hero-avatar-box {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }
  .profile-hero-name {
    font-size: 15.5px;
  }
  .listview-header {
    padding: 9px 12px 6px 12px;
    font-size: 10.5px;
  }
  .listview-item {
    padding: 10px 12px;
  }
  .listview-icon-box {
    width: 34px;
    height: 34px;
  }
  .listview-icon-box svg {
    width: 16px;
    height: 16px;
  }
  .listview-value {
    font-size: 12.5px;
  }
  .listview-left {
    gap: 9px;
  }
}

/* Responsiveness enhancements for Tablets & Desktops (> 640px) */
@media (min-width: 640px) {
  .profile-hero-card {
    padding: 28px 24px;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .listview-group {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ==========================================================================
   INTERACTIVE ACTION CARDS (CLICKABLE ACTION CARDS WITH CHEVRON)
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  text-align: left;
}

.card.card-clickable {
  cursor: pointer;
  user-select: none;
}

.card.card-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--primary-purple);
  box-shadow: 0 6px 18px rgba(99, 32, 238, 0.08);
}

.card.card-clickable:active {
  transform: translateY(0) scale(0.99);
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-size: 19px !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  line-height: 1.35 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-description {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  line-height: 1.5 !important;
  margin-top: 6px;
}

/* ==========================================================================
   ASPECT MASTER-DETAIL LISTVIEW & MODAL STYLING
   ========================================================================== */
.aspect-listview-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.aspect-listview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-purple);
}

.aspect-listview-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background-color: var(--card-accent, var(--primary-purple));
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.aspect-listview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.aspect-listview-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aspect-listview-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.aspect-listview-title {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.aspect-listview-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.aspect-listview-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
}

.aspect-listview-cta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-purple);
}

/* Modal Filter Chips & Search Box */
.modal-filter-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.modal-filter-chips::-webkit-scrollbar {
  display: none;
}

.modal-filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.modal-filter-chip.active {
  background-color: var(--primary-purple);
  color: #FFFFFF;
  border-color: var(--primary-purple);
  box-shadow: 0 2px 8px rgba(99, 32, 238, 0.25);
}

.modal-search-box {
  position: relative;
  margin-bottom: 12px;
}

.modal-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-search-input:focus {
  border-color: var(--primary-purple);
  background-color: var(--bg-card);
}

.modal-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Indicator Detail Item inside Modal */
.indicator-detail-item {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: background-color 0.15s ease;
}

.indicator-detail-item.evaluated {
  border-left: 3.5px solid var(--primary-green);
  background-color: var(--bg-card);
}

.indicator-detail-item.unevaluated {
  border-left: 3.5px solid var(--border-light);
  opacity: 0.88;
}

.indicator-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.indicator-item-num {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
}

.indicator-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.indicator-score-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.indicator-notes-box {
  font-size: 11px;
  color: var(--primary-purple-text);
  background-color: var(--primary-purple-light);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 6px;
  border-left: 2px solid var(--primary-purple);
  line-height: 1.35;
}

/* ==========================================================================
   CRUD MANAGEMENT STYLING (SISWA, KELAS, GURU, AKUN)
   ========================================================================== */
.crud-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.crud-item-card:hover {
  border-color: var(--primary-purple);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.crud-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.crud-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.crud-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.crud-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.crud-item-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.2;
}

.crud-item-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.crud-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.crud-badge-role {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.crud-badge-role.super_admin,
.crud-badge-role.super-admin {
  background-color: #FAF5FF;
  color: #7C3AED;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.crud-badge-role.kepala_sekolah {
  background-color: #FEF3C7;
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.crud-badge-role.admin {
  background-color: #FEE2E2;
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.crud-badge-role.wali_kelas_guru {
  background-color: #ECFDF5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.crud-badge-role.wali_kelas {
  background-color: #ECFDF5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.crud-badge-role.guru {
  background-color: #F0FDFA;
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.crud-badge-role.wali_murid,
.crud-badge-role.ortu {
  background-color: #EFF6FF;
  color: #2563EB;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   SUPER ADMIN EMAIL DATABASE STYLING
   ========================================================================== */
.email-db-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-db-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.email-db-item:hover {
  border-color: var(--primary-purple);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.email-db-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.email-db-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: #FAF5FF;
  color: #7C3AED;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.email-db-title {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-main);
  word-break: break-all;
}

.email-db-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.email-db-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 8px;
}

.crud-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.crud-status-dot.active {
  background-color: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.crud-status-dot.inactive {
  background-color: #94A3B8;
}

.crud-status-dot.pending {
  background-color: #F59E0B;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* ==========================================================================
   Interactive Toggle Switch (Admin Approval & Status Toggle with ON / OFF)
   ========================================================================== */
.switch-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 62px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #64748B;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Keterangan Teks ON / OFF di dalam Switch */
.switch-slider:after {
  position: absolute;
  content: "OFF";
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  line-height: 28px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  z-index: 1;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .switch-slider {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(34px);
}

.switch-toggle input:checked + .switch-slider:after {
  content: "ON";
  right: auto;
  left: 9px;
  color: #FFFFFF;
}

.switch-toggle input:focus + .switch-slider {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

/* Label Status Tambahan di samping Switch Toggle */
.toggle-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.toggle-status-badge.on {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.toggle-status-badge.off {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.toggle-status-badge.pending {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.user-approval-toggle-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.user-approval-toggle-box.status-pending {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.user-approval-toggle-box.status-active {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.user-approval-toggle-box.status-inactive,
.user-approval-toggle-box.status-rejected {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   SMOOTH LOADING OVERLAY
   ========================================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-app);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.loading-logo-box {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background-color: #FFFFFF;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(99, 32, 238, 0.2), 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  animation: logoPulse 1.8s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.92; }
  50% { transform: scale(1.03); opacity: 1; }
}

.loading-spinner {
  position: absolute;
  inset: -6px;
  border-radius: 28px;
  border: 3.5px solid transparent;
  border-top-color: var(--primary-purple);
  border-right-color: var(--primary-green);
  animation: spinLoader 0.9s infinite linear;
}

@keyframes spinLoader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.loading-text {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Main Content Area (Scrollable Viewport)
   ========================================================================== */
.app-main {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 18px 44px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  transition: background-color 0.25s ease;
}

@media (min-width: 768px) {
  .app-main {
    padding: 24px 32px 36px 32px;
  }
}

@media (min-width: 1024px) {
  .app-main {
    padding: 28px 44px 44px 44px;
  }
}

@media (min-width: 1440px) {
  .app-main {
    padding: 32px 56px 48px 56px;
  }
}

/* Bottom Navigation Bar (Senior-Friendly, High Contrast & Spacious) */
.bottom-nav {
  flex-shrink: 0;
  width: 100%;
  height: calc(74px + env(safe-area-inset-bottom, 0px));
  min-height: calc(74px + env(safe-area-inset-bottom, 0px));
  background-color: var(--bg-card);
  border-top: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
  position: relative;
  z-index: 100;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

@media (display-mode: standalone) {
  .bottom-nav {
    height: calc(72px + max(16px, env(safe-area-inset-bottom, 16px))) !important;
    min-height: calc(72px + max(16px, env(safe-area-inset-bottom, 16px))) !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: #27303F;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 4px;
  gap: 5px;
  transition: all 0.15s ease-in-out;
  border-radius: var(--radius-sm);
  min-width: 0;
}

.nav-item svg {
  width: 30px;
  height: 30px;
  margin-bottom: 2px;
  stroke: #27303F;
  stroke-width: 2.4;
  transition: stroke 0.15s ease, transform 0.15s ease;
}

.nav-item:hover {
  color: var(--primary-purple);
}

.nav-item:hover svg {
  stroke: var(--primary-purple);
}

.nav-item.active {
  color: var(--primary-purple);
  font-weight: 900;
}

.nav-item.active svg {
  stroke: var(--primary-purple);
  stroke-width: 2.8;
  transform: scale(1.08);
}

@media (min-width: 768px) {
  .bottom-nav {
    height: 80px;
    min-height: 80px;
    padding: 0 24px;
    justify-content: space-around;
    gap: 16px;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    background-color: var(--bg-card);
  }
  .nav-item {
    flex: 1;
    flex-direction: row;
    gap: 12px;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 20px;
    border-radius: 16px;
    min-width: 0;
    max-width: none;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-item svg {
    width: 28px;
    height: 28px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .nav-item.active {
    background-color: var(--primary-purple-light);
    color: var(--primary-purple);
  }
}

/* ==========================================================================
   MODAL / BOTTOM SHEET COMPONENT
   ========================================================================== */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

.bottom-sheet {
  width: 100%;
  max-width: 100%;
  max-height: 88vh;
  background-color: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.sheet-overlay.active .bottom-sheet {
  transform: translateY(0);
}

/* Tablet & Desktop: Elegantly Center Bottom Sheet as Modal Dialog */
@media (min-width: 768px) {
  .sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .sheet-overlay:not(.fullscreen-sheet) .bottom-sheet {
    max-width: 740px;
    width: 92%;
    max-height: 86vh;
    border-radius: 24px;
    border: 1px solid var(--border-light);
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(99, 32, 238, 0.08);
    transform: scale(0.95) translateY(12px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  }
  .sheet-overlay.active:not(.fullscreen-sheet) .bottom-sheet {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  .sheet-drag-handle {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .sheet-overlay:not(.fullscreen-sheet) .bottom-sheet {
    max-width: 820px;
  }
}

/* Mode Fullscreen 1 Layar Penuh untuk Penilaian Micro-Skill */
.sheet-overlay.fullscreen-sheet {
  padding: 0;
  align-items: stretch;
  background-color: rgba(15, 23, 42, 0.75);
}

.sheet-overlay.fullscreen-sheet .bottom-sheet {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.sheet-overlay.fullscreen-sheet .sheet-drag-handle {
  display: none;
}

.sheet-overlay.fullscreen-sheet .sheet-header {
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border-light);
  flex-shrink: 0;
}

.sheet-overlay.fullscreen-sheet .sheet-body {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: 16px 18px 24px 18px;
}

.sheet-header {
  padding: 14px 18px 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.sheet-drag-handle {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background-color: #CBD5E1;
  border-radius: var(--radius-full);
}

body.dark-mode .sheet-drag-handle {
  background-color: #475569;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-close-btn {
  background: var(--bg-subtle);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sheet-close-btn:hover {
  background-color: var(--border-light);
  color: var(--text-main);
}

.sheet-body {
  padding: 16px 18px 24px 18px;
  overflow-y: auto;
  flex: 1;
}

.sheet-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-app);
  display: flex;
  gap: 10px;
}

/* Toast Notifications (Centered Modal Popup / Center Screen Island) */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 440px;
  z-index: 12000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.toast {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.94);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 20px;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.2) inset;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastCenterPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1), toastCenterFadeOut 0.28s ease 2.7s forwards;
  transition: transform 0.15s ease, opacity 0.15s ease;
  user-select: none;
  max-width: 100%;
}

.toast:hover {
  transform: scale(1.02);
}

.toast:active {
  transform: scale(0.96);
}

.toast-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast.success {
  background: rgba(6, 78, 59, 0.95);
  box-shadow: 0 20px 45px -8px rgba(6, 95, 70, 0.55), 0 0 0 1.5px rgba(52, 211, 153, 0.45) inset;
}
.toast.success .toast-icon-circle {
  background: #10B981;
  color: #FFFFFF;
}

.toast.info {
  background: rgba(49, 46, 129, 0.95);
  box-shadow: 0 20px 45px -8px rgba(79, 70, 229, 0.55), 0 0 0 1.5px rgba(129, 140, 248, 0.45) inset;
}
.toast.info .toast-icon-circle {
  background: #6366F1;
  color: #FFFFFF;
}

.toast.warning {
  background: rgba(120, 53, 15, 0.95);
  box-shadow: 0 20px 45px -8px rgba(217, 119, 6, 0.55), 0 0 0 1.5px rgba(251, 191, 36, 0.45) inset;
}
.toast.warning .toast-icon-circle {
  background: #F59E0B;
  color: #FFFFFF;
}

.toast.error {
  background: rgba(127, 29, 29, 0.95);
  box-shadow: 0 20px 45px -8px rgba(220, 38, 38, 0.55), 0 0 0 1.5px rgba(248, 113, 113, 0.45) inset;
}
.toast.error .toast-icon-circle {
  background: #EF4444;
  color: #FFFFFF;
}

@keyframes toastCenterPopIn {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(18px);
  }
  65% {
    transform: scale(1.02) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes toastCenterFadeOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
}

/* ==========================================================================
   AVATAR PHOTO & UPLOAD INTERFACE STYLING
   ========================================================================== */
.profile-hero-avatar-box {
  overflow: hidden;
  position: relative;
}

.profile-hero-avatar-box img,
.profile-avatar img,
.header-profile-avatar img,
.dropdown-user-avatar img,
.crud-item-avatar img,
.demo-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* Upload Avatar Component */
.avatar-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  text-align: center;
}

.avatar-upload-preview-wrapper {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto 10px auto;
  cursor: pointer;
}

.avatar-upload-preview {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background-color: var(--primary-purple-light);
  border: 3px solid var(--primary-purple);
  box-shadow: 0 4px 14px rgba(99, 32, 238, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-upload-preview-wrapper:hover .avatar-upload-preview {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(99, 32, 238, 0.3);
}

.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-upload-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-purple);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.avatar-upload-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}

.avatar-upload-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Quick Avatar Photo Edit Button on Hero Card */
.profile-hero-edit-avatar-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-purple);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.profile-hero-edit-avatar-btn:hover {
  background-color: var(--primary-purple);
  color: #FFFFFF;
}

/* Clickable Profile Avatar with Edit Badge */
.profile-avatar-clickable {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.profile-avatar-clickable:hover {
  transform: scale(1.05);
}

.profile-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-purple);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 2;
}

/* Preset Avatar Selection Grid */
.avatar-preset-section {
  width: 100%;
  margin-top: 14px;
  text-align: center;
}

.avatar-preset-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.avatar-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.avatar-preset-item {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xs);
}

.avatar-preset-item:hover {
  transform: scale(1.15);
  border-color: var(--primary-purple);
  background: var(--primary-purple-light);
}

.avatar-preset-item:active {
  transform: scale(0.95);
}

/* ==========================================================================
   PWA HOME SCREEN INSTALLATION MODAL STYLING
   ========================================================================== */
.pwa-install-card {
  background: linear-gradient(135deg, rgba(99, 32, 238, 0.08), rgba(16, 185, 129, 0.08));
  border: 1.5px solid var(--primary-purple);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.pwa-install-app-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(99, 32, 238, 0.25);
  margin: 0 auto 10px auto;
  border: 2px solid #FFFFFF;
  display: block;
  object-fit: cover;
}

.pwa-step-box {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  text-align: left;
  border: 1px solid var(--border-light);
}

.pwa-step-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   ID CARD GENERATOR SYSTEM (8 TEMPLATES, DUAL ORIENTATION, DUAL SIDES & PRINT)
   ========================================================================== */
.idcard-modal-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.idcard-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.idcard-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.idcard-btn-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  user-select: none;
}

.idcard-btn-pill:hover {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
}

.idcard-btn-pill.active {
  background-color: var(--primary-purple);
  color: #FFFFFF;
  border-color: var(--primary-purple);
  box-shadow: 0 2px 8px rgba(99, 32, 238, 0.25);
}

/* Template Selector Carousel / Horizontal Scroll List */
.idcard-templates-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
}

.idcard-template-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.idcard-template-chip:hover {
  transform: translateY(-2px);
  border-color: var(--primary-purple);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.idcard-template-chip.active {
  border-color: var(--primary-purple);
  background-color: var(--primary-purple-light);
  box-shadow: 0 0 0 2px rgba(99, 32, 238, 0.2);
}

.idcard-template-chip-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.idcard-template-chip-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* Preview Stage Container */
.idcard-stage-container {
  background-color: var(--bg-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  min-height: 280px;
}

/* Card Physical Structure */
.idcard-badge {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  user-select: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.idcard-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

/* Vertical Dimensions (54mm x 86mm ratio) */
.idcard-badge.vertical {
  width: 250px;
  height: 390px;
}

/* Horizontal Dimensions (86mm x 54mm ratio) */
.idcard-badge.horizontal {
  width: 370px;
  height: 236px;
}

/* Header within Card */
.idcard-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.idcard-header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background-color: #FFFFFF;
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.idcard-header-text {
  flex: 1;
  text-align: left;
}

.idcard-school-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.15;
  text-transform: uppercase;
}

.idcard-school-arabic {
  font-size: 8.5px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 1px;
}

/* Front Vertical Body */
.idcard-body-vertical {
  flex: 1;
  padding: 10px 14px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.idcard-avatar-frame-vertical {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  margin-bottom: 8px;
  overflow: hidden;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}

.idcard-avatar-frame-vertical img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idcard-person-name {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 2px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idcard-person-id {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-family: monospace;
}

.idcard-person-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.idcard-qr-box {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}

.idcard-qr-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.idcard-qr-text {
  font-size: 8px;
  text-align: left;
  line-height: 1.2;
}

/* Front Horizontal Body */
.idcard-body-horizontal {
  flex: 1;
  padding: 8px 14px 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.idcard-avatar-frame-horizontal {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  flex-shrink: 0;
}

.idcard-avatar-frame-horizontal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idcard-info-horizontal {
  flex: 1;
  text-align: left;
  min-width: 0;
}

/* Back Side Content */
.idcard-back-body {
  flex: 1;
  padding: 10px 12px 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 8.5px;
  line-height: 1.35;
  text-align: left;
  position: relative;
  z-index: 2;
}

.idcard-rules-list {
  padding-left: 14px;
  margin: 4px 0 6px 0;
  font-size: 8px;
}

.idcard-rules-list li {
  margin-bottom: 2px;
}

.idcard-sign-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(0,0,0,0.15);
}

.idcard-stamp-badge {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #DC2626;
  color: #DC2626;
  border-radius: 4px;
  font-size: 7.5px;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.idcard-barcode-sim {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 900;
  text-align: center;
  background: repeating-linear-gradient(90deg, #000 0px, #000 2px, transparent 2px, transparent 4px, #000 4px, #000 5px, transparent 5px, transparent 8px);
  height: 16px;
  width: 100px;
  margin: 2px auto 0 auto;
}

/* ==========================================================================
   CARD TEMPLATE THEMES
   ========================================================================== */

/* 0. TEMPLATE RESMI TERUNGGAH: INSAN MULIA (EMERALD GREEN & GOLD LUXURY) */
.idcard-theme-insan_mulia {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(10, 43, 37, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.idcard-slot-hole {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.idcard-theme-insan_mulia .idcard-header {
  background: linear-gradient(145deg, #0A2B25 0%, #0F3E36 45%, #145344 100%) !important;
  color: #FFFFFF !important;
  padding: 20px 10px 12px 10px !important;
  position: relative;
  border-bottom: 2.5px solid #D4AF37 !important;
  box-shadow: 0 4px 10px rgba(10, 43, 37, 0.25);
}

.idcard-theme-insan_mulia .idcard-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(212, 175, 55, 0.18) 0%, transparent 60%),
              radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.idcard-theme-insan_mulia .idcard-header-logo {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  border: 1.5px solid #D4AF37 !important;
  background: #0A2B25 !important;
  padding: 3px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.idcard-theme-insan_mulia .idcard-school-title {
  color: #FFFFFF !important;
  font-size: 11.5px !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.idcard-theme-insan_mulia .idcard-school-sub {
  color: #FDE047 !important;
  font-size: 8px !important;
  font-style: italic !important;
  font-weight: 600 !important;
  margin-top: 1px;
}

/* Insan Mulia Two-Column Body: Details on Left, Large QR on Right */
.idcard-insanmulia-body {
  display: flex;
  padding: 10px 12px 8px 12px;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  background: radial-gradient(circle at 90% 10%, rgba(13, 148, 136, 0.04) 0%, transparent 70%),
              radial-gradient(circle at 10% 90%, rgba(212, 175, 55, 0.04) 0%, transparent 70%),
              #FFFFFF;
  position: relative;
  z-index: 2;
}

.idcard-insanmulia-details {
  flex: 1.15;
  text-align: left;
  min-width: 0;
}

.idcard-insanmulia-photo-frame {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3.5px solid #D4AF37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.4), 0 4px 12px rgba(0, 0, 0, 0.18);
  background: #0A2B25;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.idcard-insanmulia-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idcard-insanmulia-label {
  font-size: 8px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.idcard-insanmulia-val-name {
  font-size: 11px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.2;
  margin-bottom: 5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idcard-insanmulia-val {
  font-size: 9px;
  font-weight: 800;
  color: #0F172A;
}

/* Aligned ID Card Data Table with Parallel Colons */
.idcard-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.idcard-data-table td {
  vertical-align: top;
  padding: 1.5px 0;
}

.idcard-data-label {
  font-size: 7.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.idcard-data-colon {
  font-size: 7.5px;
  font-weight: 800;
  color: #475569;
  text-align: center;
  user-select: none;
}

.idcard-data-val {
  font-size: 8.5px;
  font-weight: 800;
  color: #0F172A;
  word-break: break-word;
  line-height: 1.25;
}

.idcard-data-val.idcard-data-name {
  font-size: 9.5px;
  font-weight: 900;
  color: #0F172A;
  text-transform: uppercase;
}

.idcard-footer-table {
  border-collapse: collapse;
  font-size: 7px;
  line-height: 1.25;
  opacity: 0.95;
}

.idcard-insanmulia-qr-col {
  flex: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.idcard-insanmulia-qr-box {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.idcard-insanmulia-qr-box img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
}

.idcard-insanmulia-qr-caption {
  font-size: 7.5px;
  font-weight: 900;
  color: #0F172A;
  text-transform: uppercase;
  margin-top: 5px;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

/* Insan Mulia Footer */
.idcard-insanmulia-footer {
  background: linear-gradient(145deg, #0A2B25 0%, #0F3E36 50%, #145344 100%) !important;
  color: #FFFFFF !important;
  padding: 8px 10px !important;
  border-top: 2px solid #D4AF37 !important;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 7.5px;
  line-height: 1.35;
  position: relative;
}

.idcard-insanmulia-footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 28%;
  right: 28%;
  height: 3.5px;
  background: linear-gradient(90deg, transparent, #D4AF37, #FDE047, #D4AF37, transparent);
  border-radius: 4px 4px 0 0;
}

/* Custom Uploaded Template Background Container */
.idcard-custom-uploaded-bg {
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* 1. TEMPLATE: ROYAL TEAL */
.idcard-theme-royal_teal {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #99F6E4;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.idcard-theme-royal_teal .idcard-header {
  background: linear-gradient(145deg, #042F2E 0%, #0D9488 50%, #115E59 100%) !important;
  color: #FFFFFF !important;
  padding: 20px 10px 12px 10px !important;
  position: relative;
  border-bottom: 2.5px solid #2DD4BF !important;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}
.idcard-theme-royal_teal .idcard-header-logo {
  border: 1.5px solid #2DD4BF !important;
  background: #042F2E !important;
}
.idcard-theme-royal_teal .idcard-school-title {
  color: #FFFFFF !important;
}
.idcard-theme-royal_teal .idcard-school-sub {
  color: #99F6E4 !important;
}
.idcard-theme-royal_teal .idcard-insanmulia-photo-frame {
  border: 3.5px solid #2DD4BF !important;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.4), 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  background: #042F2E !important;
}

/* 2. TEMPLATE: NAVY GOLD */
.idcard-theme-navy_gold {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.idcard-theme-navy_gold .idcard-header {
  background: linear-gradient(145deg, #0B1329 0%, #1E3A8A 50%, #172554 100%) !important;
  color: #FFFFFF !important;
  padding: 20px 10px 12px 10px !important;
  position: relative;
  border-bottom: 2.5px solid #F59E0B !important;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}
.idcard-theme-navy_gold .idcard-header-logo {
  border: 1.5px solid #F59E0B !important;
  background: #0B1329 !important;
}
.idcard-theme-navy_gold .idcard-school-title {
  color: #FFFFFF !important;
}
.idcard-theme-navy_gold .idcard-school-sub {
  color: #FDE68A !important;
}
.idcard-theme-navy_gold .idcard-insanmulia-photo-frame {
  border: 3.5px solid #F59E0B !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  background: #0B1329 !important;
}

/* 3. TEMPLATE: BURGUNDY LUXURY */
.idcard-theme-burgundy_luxury {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #FECDD3;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(136, 19, 55, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.idcard-theme-burgundy_luxury .idcard-header {
  background: linear-gradient(145deg, #450A0A 0%, #881337 50%, #701A75 100%) !important;
  color: #FFFFFF !important;
  padding: 20px 10px 12px 10px !important;
  position: relative;
  border-bottom: 2.5px solid #FDA4AF !important;
  box-shadow: 0 4px 10px rgba(136, 19, 55, 0.25);
}
.idcard-theme-burgundy_luxury .idcard-header-logo {
  border: 1.5px solid #FDA4AF !important;
  background: #450A0A !important;
}
.idcard-theme-burgundy_luxury .idcard-school-title {
  color: #FFFFFF !important;
}
.idcard-theme-burgundy_luxury .idcard-school-sub {
  color: #FCE7F3 !important;
}
.idcard-theme-burgundy_luxury .idcard-insanmulia-photo-frame {
  border: 3.5px solid #FDA4AF !important;
  box-shadow: 0 0 0 2px rgba(253, 164, 175, 0.4), 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  background: #450A0A !important;
}

/* 4. TEMPLATE: CLEAN MINIMALIST */
.idcard-theme-clean_minimalist {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.idcard-theme-clean_minimalist .idcard-header {
  background: linear-gradient(145deg, #0F172A 0%, #334155 60%, #1E293B 100%) !important;
  color: #FFFFFF !important;
  padding: 20px 10px 12px 10px !important;
  position: relative;
  border-bottom: 2.5px solid #10B981 !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}
.idcard-theme-clean_minimalist .idcard-header-logo {
  border: 1.5px solid #10B981 !important;
  background: #0F172A !important;
}
.idcard-theme-clean_minimalist .idcard-school-title {
  color: #FFFFFF !important;
}
.idcard-theme-clean_minimalist .idcard-school-sub {
  color: #A7F3D0 !important;
}
.idcard-theme-clean_minimalist .idcard-insanmulia-photo-frame {
  border: 3.5px solid #10B981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  background: #0F172A !important;
}

/* 3D INTERACTIVE CARD FLIP (PORTAL ORANG TUA & GURU) */
.idcard-flip-wrap {
  perspective: 1200px;
  display: inline-block;
  margin: 0 auto;
}

.idcard-flip-inner {
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.idcard-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.idcard-flip-front,
.idcard-flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
}

.idcard-flip-back {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(180deg);
}

/* WIDGET KARTU SANTRI RESMI DI PORTAL ORANG TUA */
.ortu-idcard-card {
  background: linear-gradient(135deg, rgba(15, 62, 54, 0.05) 0%, rgba(13, 148, 136, 0.08) 100%);
  border: 1.5px solid rgba(13, 148, 136, 0.3);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.ortu-idcard-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.ortu-idcard-preview-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 8px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.8) 100%);
  border-radius: var(--radius-sm, 8px);
  border: 1px dashed rgba(13, 148, 136, 0.25);
  margin-bottom: 12px;
  overflow-x: auto;
}

/* Print Output Styling */
#idcard-print-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Sembunyikan SEMUA elemen aplikasi utama saat print berlangsung */
  body > *:not(#idcard-print-container):not(#idcard-print-iframe),
  .app-container,
  .app-header,
  .app-main,
  .bottom-nav,
  .sheet-overlay,
  .dialog-modal-overlay,
  .loading-overlay,
  .toast-container,
  .idcard-control-row,
  .idcard-templates-strip,
  .idcard-wizard-box,
  .sheet-drag-handle,
  .sheet-header,
  .sheet-footer,
  .btn,
  .no-print {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Tampilkan HANYA kontainer cetak ID Card */
  #idcard-print-container {
    display: flex !important;
    visibility: visible !important;
    flex-wrap: wrap !important;
    gap: 6mm !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    background: #FFFFFF !important;
  }

  #idcard-print-container * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .idcard-badge {
    box-shadow: none !important;
    border: 1px dashed #94A3B8 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .idcard-badge.vertical {
    width: 54mm !important;
    height: 86mm !important;
    min-width: 54mm !important;
    min-height: 86mm !important;
    max-width: 54mm !important;
    max-height: 86mm !important;
  }

  .idcard-badge.horizontal {
    width: 86mm !important;
    height: 54mm !important;
    min-width: 86mm !important;
    min-height: 54mm !important;
    max-width: 86mm !important;
    max-height: 54mm !important;
  }
}

