/* ==========================================================================
   Aplikasi Manajemen Pembelajaran & Sistem Informasi Sekolah (Smart School Portal)
   Design System: Human-Crafted Aesthetic / Anti-AI (Clean, Professional, Slate & Royal Navy)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,500;1,600;1,700&display=swap');

:root {
  --primary-navy: #064e3b;
  --primary-blue: #047857;
  --primary-indigo: #065f46;
  --sidebar-gradient-start: #064e3b;
  --sidebar-gradient-mid: #065f46;
  --sidebar-gradient-end: #022c22;
  --sidebar-yellow: #f59e0b;
  --sidebar-yellow-light: #fef08a;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Status Colors */
  --color-hadir: #10b981;
  --bg-hadir: #ecfdf5;
  --border-hadir: #a7f3d0;
  
  --color-izin: #2563eb;
  --bg-izin: #eff6ff;
  --border-izin: #bfdbfe;
  
  --color-sakit: #d97706;
  --bg-sakit: #fffbeb;
  --border-sakit: #fde68a;
  
  --color-alpa: #dc2626;
  --bg-alpa: #fef2f2;
  --border-alpa: #fecaca;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR NAVIGATION (Sesuai Referensi Gambar)
   ========================================================================== */
.sidebar {
  width: 270px;
  background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-mid) 50%, var(--sidebar-gradient-end) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 50;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* Sidebar Menu */
.sidebar-menu {
  list-style: none;
  padding: 24px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.menu-category {
  display: none !important;
}

.menu-item {
  width: 100%;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fef08a;
}

/* Active State: White Rounded Pill Button with Green Text and Yellow Accent Bar */
.menu-item.active .menu-link {
  background: #ffffff;
  color: #064e3b;
  font-weight: 700;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  position: relative;
}

.menu-item.active .menu-link::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 22px;
  background: #f59e0b;
  border-radius: 4px;
}

.menu-item.active .menu-link .menu-icon svg {
  stroke: #064e3b;
}

.menu-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-chevron {
  margin-left: auto;
  opacity: 0.7;
  transition: transform 0.2s;
  color: #fef08a;
}

/* Sidebar User Info & Logout */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: #f59e0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: #fef08a;
  text-transform: capitalize;
  font-weight: 600;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT AREA & TOPBAR
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: linear-gradient(90deg, #064e3b 0%, #047857 55%, #065f46 100%);
  height: 68px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.btn-mobile-toggle,
.topbar-hamburger,
.menu-toggle,
#mobileMenuToggle {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Topbar Brand (Logo Sekolah, Nama Sekolah & Live Timer WIB) */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand .brand-logo-box {
  width: 42px;
  height: 42px;
  background: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid #facc15;
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
  aspect-ratio: 1 / 1;
}

.topbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-brand .brand-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.topbar-brand .brand-subtitle {
  font-size: 11.5px;
  color: #fef08a;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Role Logout Button */
.btn-role-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.btn-role-logout .logout-icon {
  transition: transform 0.2s ease;
}

.btn-role-logout:hover .logout-icon {
  transform: translateX(2px);
}

.btn-role-logout.admin {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-role-logout.admin:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-role-logout.guru {
  background: rgba(254, 240, 138, 0.2);
  color: #fef08a;
  border-color: rgba(254, 240, 138, 0.4);
}

.btn-role-logout.guru:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-role-logout.siswa {
  background: rgba(209, 250, 229, 0.2);
  color: #a7f3d0;
  border-color: rgba(209, 250, 229, 0.4);
}

.btn-role-logout.siswa:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

/* Content Padding */
.content-area {
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1400px;
  width: 100%;
}

/* ==========================================================================
   TOP 4 METRIC CARDS (Sesuai Referensi Gambar)
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 6px;
}

/* Icon Containers with Rounded Pastel Styling */
.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-box.orange { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.metric-icon-box.cyan { background: #ecfeff; color: #0891b2; border: 1px solid #cffafe; }
.metric-icon-box.green { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.metric-icon-box.amber { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }

/* ==========================================================================
   WIDGET: PELAJARAN SEDANG BERLANGSUNG
   ========================================================================== */
.card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.card-header-clean {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-header-clean h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state-text {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.active-lesson-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   WIDGET: REKAP KEHADIRAN (SISWA & GURU) DENGAN 4 BADGE PILLS
   ========================================================================== */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.attendance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.attendance-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attendance-card-header h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.attendance-pills-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-pill-box {
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.status-pill-box:hover {
  transform: translateY(-2px);
}

.status-pill-box.hadir {
  background: var(--bg-hadir);
  border: 1px solid var(--border-hadir);
  color: var(--color-hadir);
}

.status-pill-box.izin {
  background: var(--bg-izin);
  border: 1px solid var(--border-izin);
  color: var(--color-izin);
}

.status-pill-box.sakit {
  background: var(--bg-sakit);
  border: 1px solid var(--border-sakit);
  color: var(--color-sakit);
}

.status-pill-box.alpa {
  background: var(--bg-alpa);
  border: 1px solid var(--border-alpa);
  color: var(--color-alpa);
}

.status-pill-number {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.status-pill-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.attendance-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   WIDGET: ANALITIK BAWAH (PERINGKAT SISWA & SISWA ALPA TERBANYAK)
   ========================================================================== */
.bottom-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.header-left-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left-title h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.select-filter-sm {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #ffffff;
  cursor: pointer;
  outline: none;
}

/* Leaderboard Ranking List */
.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  margin-right: 12px;
}
.rank-badge.rank-1 { background: #fef08a; color: #854d0e; }
.rank-badge.rank-2 { background: #e2e8f0; color: #475569; }
.rank-badge.rank-3 { background: #fed7aa; color: #9a3412; }

.student-info-meta {
  display: flex;
  flex-direction: column;
}

.student-name-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.student-class-text {
  font-size: 11.5px;
  color: var(--text-muted);
}

.student-score-tag {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-blue);
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Alpa Alert List */
.alpa-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: var(--radius-sm);
}

.alpa-count-badge {
  background: #e53e3e;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   FLUID TABLES & GENERAL COMPONENTS
   ========================================================================== */
.data-table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-toolbar {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.custom-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tr:hover {
  background: #f8fafc;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
}
.btn-primary:hover {
  background: #1e40af;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Form inputs */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (ZettBOT v1.37.0)
   - Tablet Landscape & Portrait: 768px - 1024px
   - Smartphone Standard: 480px - 767px
   - Smartphone Compact: <= 479px
/* ==========================================================================
   MOBILE & TABLET APP-SHELL DESIGN SYSTEM (ZettBOT v1.38.0)
   - Bottom Navigation Bar (Docked Floating Bar ala Native App)
   - Bottom Sheet "Menu Lengkap" Overflow Drawer
   - Strict Anti-Zoom Scalability
   - Anti-Melar / Anti-Tertarik Horizontal Container Constraints
   ========================================================================== */

/* 1. Sembunyikan Bottom Nav Bar & Bottom Sheet pada Seluruh Layar (Smartphone, Tablet, Desktop) */
.bottom-nav-bar,
.bottom-sheet-container,
.bottom-sheet-backdrop {
  display: none !important;
}

@media (min-width: 1025px) {
  .bottom-nav-bar {
    display: none !important;
  }
}

/* 2. Universal Modal Dialog Styling (Auto Max-Height, High Elevation & Mobile Bottom-Sheet) */
[id^="modal"],
.modal,
.modal-overlay,
#imageLightboxModal {
  z-index: 1200 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

[id^="modal"] > div,
.modal-overlay > div {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* 3. Bottom Navigation Bar (Fixed Docked Bar di Dasar Layar) */
.bottom-nav-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  z-index: 1000;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px) + 2px);
  align-items: center;
  justify-content: space-around;
  user-select: none;
  -webkit-user-select: none;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  touch-action: manipulation;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
  color: #047857;
  transform: translateY(-1px);
}

.bottom-nav-item.active {
  color: #047857;
  font-weight: 700;
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  position: relative;
}

.bottom-nav-item.active .bottom-nav-icon svg {
  stroke: #047857;
  stroke-width: 2.3;
  filter: drop-shadow(0 2px 6px rgba(4, 120, 87, 0.25));
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
  text-align: center;
}

/* 4. Bottom Sheet Container (Overflow Menu Drawer) */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  pointer-events: none;
}

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

.bottom-sheet-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.2);
  z-index: 1060;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}

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

.bottom-sheet-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 4px;
  margin: 12px auto 6px;
  flex-shrink: 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.sheet-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.sheet-role-pill {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-sheet-close {
  background: #f1f5f9;
  border: none;
  color: #64748b;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-sheet-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.bottom-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 16px;
}

.sheet-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 540px) {
  .sheet-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

.sheet-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 6px 12px;
  transition: all 0.2s ease;
  color: #334155;
  touch-action: manipulation;
}

.sheet-menu-card:hover,
.sheet-menu-card:active {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.sheet-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

.sheet-card-label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

/* Card Icon Color Accents */
.bg-emerald { background: #ecfdf5; color: #047857; }
.bg-blue    { background: #eff6ff; color: #1d4ed8; }
.bg-indigo  { background: #e0e7ff; color: #4338ca; }
.bg-amber   { background: #fffbeb; color: #b45309; }
.bg-violet  { background: #f5f3ff; color: #6d28d9; }
.bg-cyan    { background: #ecfeff; color: #0e7490; }
.bg-teal    { background: #f0fdfa; color: #0f766e; }
.bg-slate   { background: #f1f5f9; color: #475569; }
.bg-rose    { background: #fff1f2; color: #e11d48; }

.card-logout {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

/* Body Scroll Locking when Sheet/Modal is Open & Auto-Hide Bottom Nav Bar */
body.sheet-open,
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

body.modal-open .bottom-nav-bar,
body.sheet-open .bottom-nav-bar {
  display: none !important;
}

/* TATA LETAK MONITORING KBM (DESKTOP DEFAULT) */
.kbm-monitoring-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

.kbm-inputs-column {
  min-width: 0;
}

/* SUPPRESSION TOPBAR & BOTTOM BAR SAAT ASESMEN CBT SISWA / FULLSCREEN KIOSK */
body.cbt-exam-fullscreen .topbar,
body.cbt-exam-fullscreen .bottom-nav-bar,
body.cbt-exam-fullscreen .bottom-sheet,
body.cbt-exam-fullscreen .bottom-sheet-container,
body.cbt-exam-fullscreen .bottom-sheet-backdrop,
body.cbt-exam-page .bottom-nav-bar,
body.cbt-exam-page .bottom-sheet-container,
body.cbt-exam-page .bottom-sheet-backdrop,
.cbt-kiosk-wrapper ~ .bottom-nav-bar,
.cbt-kiosk-wrapper ~ .bottom-sheet-container,
.cbt-kiosk-wrapper ~ .bottom-sheet-backdrop,
:fullscreen .topbar,
:fullscreen .bottom-nav-bar,
:fullscreen .bottom-sheet,
:fullscreen .bottom-sheet-container,
:fullscreen .bottom-sheet-backdrop,
:-webkit-full-screen .topbar,
:-webkit-full-screen .bottom-nav-bar,
:-webkit-full-screen .bottom-sheet,
:-webkit-full-screen .bottom-sheet-container,
:-webkit-full-screen .bottom-sheet-backdrop {
  display: none !important;
}

body.cbt-exam-fullscreen .main-wrapper,
body.cbt-exam-fullscreen .cbt-kiosk-wrapper,
:fullscreen .main-wrapper,
:fullscreen .cbt-kiosk-wrapper,
:-webkit-full-screen .main-wrapper,
:-webkit-full-screen .cbt-kiosk-wrapper {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 5. BREAKPOINT: TABLET & SMARTPHONE (max-width: 1024px) */
@media (max-width: 1024px) {
  /* HILANGKAN SIDEBAR DI SMARTPHONE & TABLET (Ganti Bottom Bar Sesuai Permintaan) */
  .sidebar,
  .sidebar.active,
  .btn-sidebar-close,
  .sidebar-backdrop {
    display: none !important;
  }

  /* TOPBAR FIXED DOCKED MENEMPEL DI ATAS (SEPERTI BOTTOM BAR MENEMPEL DI BAWAH) */
  .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    z-index: 990 !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 60px !important; /* Clearance untuk Topbar Fixed di atas */
    padding-bottom: 32px !important; /* Disesuaikan tanpa bottom nav */
  }

  /* App-Shell Centered Constraint (Anti-Melar di Tablet) */
  .content-area {
    max-width: 860px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 22px 20px 32px !important; /* Disesuaikan tanpa bottom nav */
  }

  /* Grid 2 Kolom Kompak Metrik di Tablet */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }

  .attendance-grid,
  .bottom-analytics-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card,
  .card-wide,
  .analytics-card,
  .attendance-card {
    border-radius: 16px;
  }
}

/* 6. BREAKPOINT: SMARTPHONE STANDAR (max-width: 768px) */
@media (max-width: 768px) {
  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .topbar-left {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .topbar-brand {
    gap: 8px;
  }

  .topbar-brand .brand-logo-box {
    width: 36px;
    height: 36px;
  }

  .topbar-brand .brand-title {
    font-size: 12px;
    max-width: 46vw;
  }

  .topbar-brand .brand-subtitle {
    font-size: 10px;
  }

  .topbar-right {
    gap: 8px;
  }

  .btn-role-logout {
    padding: 5px 10px;
    font-size: 11px;
    gap: 6px;
  }

  /* App-Shell Centered Constraint (Anti-Melar di Smartphone) */
  .content-area {
    max-width: 620px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 16px 14px 110px !important;
  }

  /* TATA LETAK MENU MONITORING KBM PADA SMARTPHONE (URUTAN KEBAWAH: 1. Catatan, 2. Upload, 3. Preview) */
  .kbm-monitoring-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .kbm-inputs-column {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .kbm-field-notes {
    order: 1 !important;
  }

  .kbm-field-upload {
    order: 2 !important;
  }

  .kbm-preview-column {
    order: 3 !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  .kbm-preview-column #photoPreviewContainer {
    height: 190px !important;
  }

  /* SOP Part 8.5: Grid 2 Kolom Kompak di HP (Anti-Tumpuk Vertikal) */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .metric-card {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .metric-value {
    font-size: 20px;
    margin-top: 2px;
  }

  .metric-label {
    font-size: 11px;
    line-height: 1.25;
  }

  .metric-icon-box {
    width: 36px;
    height: 36px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
  }

  .metric-icon-box svg {
    width: 18px;
    height: 18px;
  }

  .attendance-pills-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .status-pill-number {
    font-size: 20px;
  }

  .status-pill-label {
    font-size: 11px;
  }

  /* SOP Part 8.6: Fluid Table Typography & Multi-Tier Data */
  .custom-table {
    font-size: 12px;
  }

  .custom-table th {
    padding: 10px 10px;
    font-size: 11px;
  }

  .custom-table td {
    padding: 10px 10px;
    word-break: break-word;
    white-space: normal;
  }

  .table-toolbar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .table-toolbar form {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }

  .table-toolbar form label {
    font-size: 12px;
  }

  .table-toolbar form select,
  .table-toolbar form input {
    width: 100% !important;
    min-height: 44px;
  }

  .table-toolbar > div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .table-toolbar .btn,
  .table-toolbar a.btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  /* Thumb-Friendly Touch Targets */
  .btn {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Prevent automatic iOS input zoom on focus */
  .form-control,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  select.form-control,
  textarea.form-control {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Anti-Melar: Form Input Constraint */
  .modal-body form,
  .card-body form,
  .form-container {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Locked Media Aspect Ratio (Anti-Gepeng & Anti-Lonjong) */
  .teaching-photo-preview,
  #photoPreviewContainer img,
  .card-img-top,
  .banner-img,
  .preview-image-box img {
    aspect-ratio: 16 / 9;
    object-fit: cover !important;
    width: 100%;
    border-radius: 12px;
  }

  .brand-logo-box,
  .avatar-box,
  .profile-avatar-circle,
  .user-avatar-circle {
    aspect-ratio: 1 / 1;
    object-fit: cover !important;
    flex-shrink: 0;
  }

  /* Adaptive Modal: Bottom Sheet Transformation */
  [id^="modal"],
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  [id^="modal"] > div,
  .modal-overlay > div {
    max-height: 88vh !important;
    padding: 20px 16px 24px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
  }

  /* Radio Buttons & Attendance Pills in Table */
  .presensi-radio-label {
    min-width: 38px;
    min-height: 38px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }
}

/* 7. BREAKPOINT: SMARTPHONE COMPACT (max-width: 480px & 360px) */
@media (max-width: 480px) {
  .topbar {
    padding: 0 12px;
  }

  .role-name {
    display: none;
  }

  .btn-role-logout {
    padding: 7px 10px;
    border-radius: 12px;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-card {
    padding: 12px 10px;
  }

  .metric-value {
    font-size: 18px;
  }

  .bottom-nav-label {
    font-size: 10px;
    max-width: 58px;
  }

  .topbar-brand .brand-title {
    font-size: 11px;
    max-width: 38vw;
  }

  .topbar-brand .brand-subtitle {
    font-size: 9.5px;
  }
}

@media (max-width: 360px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .attendance-pills-row {
    grid-template-columns: 1fr;
  }

  .bottom-nav-label {
    display: none; /* Di layar ultra kecil <360px, tampilkan ikon bottom bar saja */
  }
}

/* ==========================================================================
   ANDROID APP DRAWER DESIGN SYSTEM (ZettBOT v1.66.0)
   - Launcher Layar Penuh Grid 4 Kolom Khusus Smartphone & Tablet
   - Model Android App Drawer Murni (Ikon Rounded Squircle + Gradien Vibran)
   - Real-Time Search Filter & Touch Feedback
   ========================================================================== */

/* Topbar Navigation Home/Dashboard Action */
.btn-topbar-dashboard {
  display: none !important; /* Disembunyikan agar tidak duplikat dengan .topbar-home-pill di pojok kanan */
}

.topbar-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.topbar-home-pill:hover,
.topbar-home-pill:active {
  background: #047857;
  border-color: #34d399;
  color: #ffffff;
}

/* 1. Visibilitas Default Desktop */
.android-app-drawer-wrapper {
  display: none;
}

/* 2. Tata Letak Android App Drawer */
.android-app-drawer-wrapper {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 6px 36px;
}

/* Banner Sambutan Bergaya Editorial Luxury (Smartphone & Tablet) */
.drawer-welcome-banner {
  background: var(--bg-card, #ffffff);
  background-image: radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.07) 0px, transparent 55%),
                    radial-gradient(at 0% 0%, rgba(248, 250, 252, 0.9) 0px, transparent 60%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px -3px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.drawer-welcome-banner:active {
  transform: scale(0.995);
}

.welcome-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.welcome-greeting-bold {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.025em;
}

.welcome-name-italic {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.01em;
}

.welcome-wave-emoji {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  vertical-align: -1px;
  transform-origin: 70% 70%;
  animation: waveHand 2.4s infinite ease-in-out;
}

@keyframes waveHand {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.welcome-sub-desc {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #64748b);
  font-weight: 400;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.welcome-sub-desc .sep {
  color: #10b981;
  font-weight: 700;
  font-size: 11px;
  user-select: none;
}

.welcome-sub-desc .highlight-text {
  color: #047857;
  font-weight: 600;
}

.welcome-sub-desc strong {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

@media (min-width: 640px) {
  .drawer-welcome-banner {
    padding: 18px 22px;
  }
  .welcome-greeting-bold {
    font-size: 23px;
  }
  .welcome-name-italic {
    font-size: 24px;
  }
  .welcome-wave-emoji {
    font-size: 24px;
  }
  .welcome-sub-desc {
    font-size: 14px;
  }
}

.drawer-search-input:focus {
  background: #ffffff;
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

/* 3. Grid 4 Kolom Android App Drawer */
.android-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 22px;
  column-gap: 10px;
  width: 100%;
  align-items: start;
}

.android-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px 4px 8px;
  border-radius: 16px;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.android-app-item:hover {
  background: rgba(241, 245, 249, 0.6);
  transform: translateY(-2px);
}

.android-app-item:active {
  transform: scale(0.92);
  background: rgba(226, 232, 240, 0.8);
}

/* Ikon Aplikasi Android: Rounded Squircle dengan Gradien Mewah */
.android-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.android-app-item:hover .android-app-icon {
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.android-app-icon svg {
  stroke-width: 2.1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Badge Notifikasi Ikon Android App Drawer (Pending Request) */
.android-app-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  line-height: 15px;
  border-radius: 9999px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Palet Warna Gradien Ikon Android App Launcher */
.android-app-icon.bg-teal    { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); color: #ffffff; }
.android-app-icon.bg-indigo  { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); color: #ffffff; }
.android-app-icon.bg-blue    { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: #ffffff; }
.android-app-icon.bg-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); color: #ffffff; }
.android-app-icon.bg-violet  { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); color: #ffffff; }
.android-app-icon.bg-cyan    { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); color: #ffffff; }
.android-app-icon.bg-amber   { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); color: #ffffff; }
.android-app-icon.bg-orange  { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); color: #ffffff; }
.android-app-icon.bg-rose    { background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%); color: #ffffff; }
.android-app-icon.bg-slate   { background: linear-gradient(135deg, #64748b 0%, #334155 100%); color: #ffffff; }

/* Label Teks di Bawah Ikon */
.android-app-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
  text-align: center;
  max-width: 82px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 4. BREAKPOINT RESPONSIVE SMARTPHONE & TABLET (max-width: 1024px) */
@media (max-width: 1024px) {
  .btn-topbar-dashboard {
    display: none !important;
  }

  /* Di Halaman Dashboard: Tampilkan App Drawer & Sembunyikan Widget Desktop */
  body.is-dashboard-page .desktop-dashboard-content {
    display: none !important;
  }

  body.is-dashboard-page .android-app-drawer-wrapper {
    display: block !important;
  }

  body.is-dashboard-page .main-wrapper,
  body.is-dashboard-page .content-area {
    padding-bottom: 110px !important; /* Clearance penuh agar seluruh baris ikon drawer & tombol logout bebas terjangkau jempol */
  }
}

/* Tablet (769px - 1024px): 5 Kolom Grid untuk Keseimbangan Proporsi */
@media (min-width: 769px) and (max-width: 1024px) {
  .android-app-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px;
  }
  .android-app-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
}

/* Smartphone Compact (<= 380px): Optimasi Grid 4 Kolom */
@media (max-width: 380px) {
  .android-app-grid {
    column-gap: 6px;
    row-gap: 16px;
  }
  .android-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    margin-bottom: 6px;
  }
  .android-app-icon svg {
    width: 24px;
    height: 24px;
  }
  .android-app-label {
    font-size: 10.5px;
    max-width: 72px;
  }
}

/* ==========================================================================
   SOP V1.67: RESPONSIVE SUB-FEATURE TABS BAR (STACKED DOWNWARDS ON SMARTPHONES)
   ========================================================================== */
.app-tabs-bar {
  background: #ffffff;
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-tab-item {
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* SMARTPHONE & TABLET COMPACT BREAKPOINT: DAFTAR FITUR TERSUSUN KEBAWAH */
@media (max-width: 768px) {
  .app-tabs-bar {
    flex-direction: column !important;
    overflow-x: visible !important;
    gap: 8px !important;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .app-tabs-bar > a,
  .app-tabs-bar > button,
  .app-tabs-bar .app-tab-item {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    white-space: normal !important;
    text-align: left !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
  }

  .app-tabs-bar > a > span:first-child,
  .app-tabs-bar > button > span:first-child,
  .app-tabs-bar .app-tab-item > span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* ==========================================================================
   ASWAJA & KARAKTER: RESPONSIVE GALLERY & ACTION TOOLBAR
   ========================================================================== */
.aswaja-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.aswaja-siswa-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .aswaja-siswa-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .aswaja-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
}

@media (max-width: 768px) {
  .aswaja-gallery-container {
    padding: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .aswaja-gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .aswaja-action-bar {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .aswaja-action-bar .btn,
  .aswaja-action-bar button,
  .aswaja-action-bar .aswaja-filter-form {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .aswaja-action-bar .aswaja-filter-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .aswaja-filter-form select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .aswaja-total-badge {
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   EKSTRAKURIKULER: PLOTTING SISWA STACKED (1 COLUMN / ANTI-HIMPIT)
   ========================================================================== */
.extra-plotting-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.extra-plotting-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .extra-plotting-filters {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   MODAL RESPONSIVE 2-COLUMN GRID HELPER
   ========================================================================== */
.modal-form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .modal-form-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   MODAL RESPONSIVE 3-COLUMN GRID HELPER
   ========================================================================== */
.modal-form-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .modal-form-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   TKA RESPONSIVE: DUAL-VIEW JADWAL & MONITORING (DESKTOP TABLE & MOBILE CARDS)
   ========================================================================== */
.tka-schedule-desktop-table {
  display: block;
}

.tka-schedule-mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  .tka-schedule-desktop-table {
    display: none !important;
  }

  .tka-schedule-mobile-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }
}

.tka-schedule-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tka-schedule-card.is-today {
  border-color: #86efac;
  background: #f0fdf4;
}

/* ==========================================================================
   TKA RESPONSIVE: JADWAL SAYA GRID
   ========================================================================== */
.tka-my-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

@media (max-width: 768px) {
  .tka-my-schedule-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   TKA RESPONSIVE: DUAL-VIEW GURU PENGAMPU MAPEL TKA
   ========================================================================== */
.tka-teacher-desktop-table {
  display: block;
}

.tka-teacher-mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  .tka-teacher-desktop-table {
    display: none !important;
  }

  .tka-teacher-mobile-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
}

.tka-teacher-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   ZETTBOT v1.76.0: UNIVERSAL MOBILE CLEARANCE & FLUID RESPONSIVE CONTAINERS
   ========================================================================== */
@media (max-width: 1024px) {
  .page-container,
  .content-body,
  .admin-profile-container {
    box-sizing: border-box !important;
    max-width: 100% !important;
    padding-bottom: 110px !important; /* Clearance penuh dari Bottom Navigation Bar */
  }
}

/* Responsive Grid untuk Editor Soal ATS (ats_soal.php) */
.ats-editor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .ats-editor-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .ats-editor-grid > div:first-child {
    position: static !important; /* Nonaktifkan sticky di mobile agar mengalir alami */
  }
}

/* Responsive Grid untuk Modal Input Form ATS (ats.php) */
.ats-modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .ats-modal-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* Pembungkus Tabel dengan Indikator Scroll Halus Mobile */
.table-scroll-hint {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Grid untuk Detail PHBI / PHBN (phbi.php) */
.phbi-details-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .phbi-details-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* Perbaikan Tipografi Label Menu Drawer Mobile agar Anti-Terpotong Kaku */
.android-app-label {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.bottom-sheet-body {
  max-height: 72vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

/* ZettBOT v1.80.0: Responsif Metrik Asesmen Siswa (CBT) Mobile & Tablet Anti-Terpotong */
.cbt-student-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.cbt-student-exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

@media (max-width: 900px) {
  .cbt-student-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .cbt-student-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cbt-student-exam-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Sub-Menu Sidebar (Asesmen Admin & Sub-Navigasi) */
.sidebar-submenu {
  list-style: none;
  padding: 6px 0 6px 24px;
  margin: 4px 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.submenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.submenu-link:hover {
  color: #fef08a;
  background: rgba(255, 255, 255, 0.12);
}

.submenu-link.active {
  color: #064e3b !important;
  background: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.submenu-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  transition: all 0.2s;
}

.submenu-link:hover .submenu-dot {
  background: #fef08a;
}

.submenu-link.active .submenu-dot {
  background: #059669;
}

/* Bilah Sub-Menu Tab Bar (Asesmen, Aswaja, TKA) */
.app-tabs-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
  background: #f8fafc;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .app-tabs-bar {
    flex-wrap: nowrap;
    white-space: nowrap;
    padding-bottom: 8px;
  }
}

/* ==========================================================================
   MODUL KOMUNIKASI & PERMOHONAN DOKUMEN SISWA (ZETTBOT v1.82.0)
   ========================================================================== */
.komunikasi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .komunikasi-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .komunikasi-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.req-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

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

.req-badge-processing {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

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

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

.req-action-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.req-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .req-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .req-filter-bar form {
    flex-direction: column;
    width: 100%;
  }
}

/* Modal Fluid & Responsive (Anti-Terpotong di Smartphone & Tablet) */
.modal-responsive-dialog {
  background: #ffffff;
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}

.modal-responsive-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-responsive-body {
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  box-sizing: border-box;
}

.modal-responsive-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

@media (max-width: 640px) {
  .modal-responsive-dialog {
    max-width: 100%;
    width: 96%;
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }
  .modal-responsive-header {
    padding: 12px 16px;
  }
  .modal-responsive-body {
    padding: 14px 16px;
  }
  .modal-responsive-footer {
    padding: 12px 16px;
  }
}



