/* CSS kustom untuk website pemantau hafalan siswa */
/* Menggunakan desain Glassmorphism modern, responsif, dan premium */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Palette Warna Premium (Sleek Dark Mode & Vibrant Accents) */
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.7);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.2);
  
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.2);

  --danger: #ef4444; /* Rose */
  --danger-glow: rgba(239, 68, 68, 0.2);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;
  
  --sidebar-width: 260px;
  --header-height: 70px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 16px;
  --box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base Reset & Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Sidebar Navigation */
aside.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.nav-item.active a, .nav-item a:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.user-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 1px solid var(--primary);
}

.user-info-text {
  overflow: hidden;
}

.user-name-small {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-role-small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
}

/* Main Content Area */
main.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

/* Header Dashboard */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.header-title-section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.header-title-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Notifications Button & Dropdown */
.notification-bell-container {
  position: relative;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.badge-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-main);
}

.badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background-color: var(--danger);
  border-radius: 8px;
  border: 1.5px solid var(--bg-main);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notification-dropdown {
  position: absolute;
  top: 55px;
  right: 0;
  width: 320px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.notification-dropdown.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

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

.notification-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.btn-link-clear {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}

.notification-list {
  max-height: 250px;
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.notification-item:hover {
  background: var(--bg-card-hover);
}

.notification-item.unread {
  background: rgba(99, 102, 241, 0.05);
}

.notification-item h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.notification-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.notification-item span {
  font-size: 0.7rem;
  color: var(--primary);
  display: block;
  margin-top: 6px;
}

.notification-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--box-shadow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Dashboard Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--primary-glow);
  color: var(--primary);
}

.stat-icon.success {
  background: var(--success-glow);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-glow);
  color: var(--warning);
}

.stat-icon.danger {
  background: var(--danger-glow);
  color: var(--danger);
}

.stat-details h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-details p {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Content Grid for Dashboards */
.content-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.content-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* Card Header styles */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-success:hover {
  background: #059669;
}

.btn-danger-action {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-action:hover {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Modern Data Table */
.table-container {
  overflow-x: auto;
  width: 100%;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

table.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-main);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.lancar {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge.cukup {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge.kurang {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 9l3 3 3-3' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

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

/* Login Page Styling */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  margin-bottom: 28px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.login-logo .logo-icon {
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--box-shadow);
  animation: modalSlideUp 0.3s ease-out;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

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

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.1);
}

/* Student Profile Detail Layout */
.student-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 2px solid var(--primary);
}

.student-detail-info h2 {
  font-size: 1.4rem;
  color: #fff;
}

.student-detail-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* Custom Progress Bar */
.progress-bar-container {
  background: rgba(255, 255, 255, 0.08);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
  position: relative;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary), var(--success));
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 1s ease-in-out;
}

/* Responsive Grid Adjustments */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Interactive list items */
.list-item-clickable {
  cursor: pointer;
  transition: var(--transition-smooth);
}
.list-item-clickable:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Rapot Cetak Bulanan (Print Layout View - hidden by default, visible during print) */
.report-card-print-container,
.presence-print-container {
  display: none;
}

/* Keyframes for animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Mobile Menu Button */
.btn-mobile-menu {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Media Queries */
@media (max-width: 992px) {
  aside.sidebar {
    transform: translateX(-100%);
  }
  
  aside.sidebar.mobile-open {
    transform: translateX(0);
  }
  
  main.main-content {
    margin-left: 0;
    padding: 24px;
  }
  
  .btn-mobile-menu {
    display: block;
    margin-right: 12px;
  }
  
  .content-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ================= DESAIN PREMIUM MOBILE DASHBOARD GURU & MENU ================= */

/* Header Mobile Profile */
.teacher-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.teacher-mobile-header h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

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

/* Horizontal Scroll Filters */
.scroll-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 0 20px 0;
  scrollbar-width: none; /* Firefox */
}

.scroll-filters::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
}

.filter-pill {
  padding: 8px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.filter-pill.active {
  background: #059669; /* Emerald Green */
  border-color: #059669;
  color: #fff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Green Gradient Dashboard Card (Premium) */
.dashboard-green-card {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.25);
  border: none;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.dashboard-green-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(16, 185, 129, 0.35);
}

.dashboard-green-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.card-header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.card-header-title i {
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 4px;
}

.card-header-title i:hover {
  opacity: 0.8;
}

.card-main-value {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-sub-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.card-sub-box:hover {
  background: rgba(255, 255, 255, 0.15);
}

.card-sub-box i {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
}

.card-sub-info {
  display: flex;
  flex-direction: column;
}

.card-sub-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.card-sub-val {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

/* Menu Grid (2x4) */
.menu-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}

.menu-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.menu-item-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: none;
  border: none;
}

.menu-item-box:hover {
  transform: translateY(-3px);
}

.menu-item-box:hover .menu-icon-wrapper {
  transform: scale(1.05);
}

.menu-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
}

.menu-item-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  max-width: 80px;
  line-height: 1.3;
}

/* Colors for specific menus */
.menu-input-hafalan {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
}
.menu-target-progres {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.menu-cetak-rapot {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.menu-presensi {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.menu-jurnal {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.menu-cetak-jurnal {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.25);
}
.menu-logout {
  background: rgba(225, 29, 72, 0.15);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.25);
}



/* Bottom Navigation Bar for Mobile */
@media (min-width: 993px) {
  #app-bottom-nav,
  .bottom-nav-bar {
    display: none !important;
  }
}

.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: rgba(15, 23, 42, 0.85); /* Slate Dark */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: none; /* Desktop hidden */
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  padding: 0 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1;
}

.bottom-nav-item i {
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.bottom-nav-item:hover {
  color: #fff;
}

.bottom-nav-item.active {
  color: #10b981; /* Green emerald matching screenshot active state */
}

/* Media Query overrides for Mobile & Tablet Dashboard View */
@media (max-width: 992px) {
  .bottom-nav-bar {
    display: flex;
  }
  
  main.main-content {
    padding-bottom: 90px !important; /* Prevent bottom nav overlapping content */
  }
  
  .menu-grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 12px;
  }
}

@media (max-width: 480px) {
  .menu-grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
  }
  
  .menu-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.3rem;
  }
  
  .menu-item-label {
    font-size: 0.75rem;
  }

  .teacher-mobile-header h2 {
    font-size: 1.4rem;
  }
}

/* PRINT MEDIA: Optimasi total untuk cetak Rapot Bulanan A4 */
/* ======================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0; /* Menghilangkan judul, url, dan header/footer default browser */
  }

  @page landscape-page {
    size: A4 landscape;
    margin: 0; /* Menghilangkan header/footer default browser untuk landscape */
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    font-family: 'Times New Roman', serif;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* Sembunyikan seluruh elemen dashboard */
  aside.sidebar,
  .mobile-header,
  #app-sidebar,
  #main-dashboard-header,
  #app-bottom-nav,
  .bottom-nav-bar,
  #toast-container,
  #toast-container *,
  .modal-backdrop,
  main.main-content > section,
  .notification-bell-container {
    display: none !important;
  }

  /* Sembunyikan main-content, tapi tampilkan rapot print yang ada DI DALAM app-container */
  main.main-content {
    display: none !important;
  }
  
  /* Sembunyikan seluruh cetak secara default */
  .report-card-print-container,
  .presence-print-container {
    display: none !important;
  }
  
  /* Tampilkan modul cetak spesifik berdasarkan class body dengan margin/padding fisik halaman */
  body.print-mode-report .report-card-print-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 15mm 15mm !important;
    box-sizing: border-box;
    position: relative !important; /* Memposisikan barcode secara absolute */
  }

  body.print-mode-presence #presence-rekap-print {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10mm 15mm !important;
    box-sizing: border-box;
    position: static !important;
    page: landscape-page; /* Memaksa mode A4 Landscape saat mencetak rekap presensi */
  }

  body.print-mode-journal #journal-rekap-print {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 15mm 15mm !important;
    box-sizing: border-box;
    position: static !important;
  }

  /* Layout khusus tabel presensi landscape agar pas halaman dan tidak terpotong */
  .presence-print-container table.print-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .presence-print-container table.print-table th,
  .presence-print-container table.print-table td {
    padding: 3px 1px !important;
    font-size: 7.5pt !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .presence-print-container table.print-table td:nth-child(2) {
    text-align: left !important;
    white-space: normal !important;
    font-size: 7.5pt !important;
  }
  
  .report-card-header {
    text-align: center;
    border-bottom: 3px double #000;
    padding-bottom: 10px;
    margin-bottom: 18px;
  }
  
  .report-card-header h2 {
    font-size: 14pt;
    font-family: 'Times New Roman', serif;
    color: #000;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
  
  .report-card-header h3 {
    font-size: 12pt;
    font-family: 'Times New Roman', serif;
    color: #000;
    text-transform: uppercase;
    margin: 6px 0;
  }
  
  .report-card-header p {
    font-size: 9.5pt;
    color: #333;
    margin: 2px 0;
  }
  
  .report-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
  }
  
  .report-info-grid table {
    width: 100%;
    border: none;
  }
  
  .report-info-grid td {
    padding: 3px 4px;
    border: none !important;
    font-size: 10pt;
    vertical-align: top;
    line-height: 1.5;
  }
  
  table.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    page-break-inside: auto;
  }
  
  table.print-table thead {
    display: table-header-group;
  }

  table.print-table tr {
    page-break-inside: avoid;
  }
  
  table.print-table th {
    background: #e8e8e8 !important;
    color: #000 !important;
    border: 1px solid #333 !important;
    padding: 7px 8px;
    font-size: 9.5pt;
    text-align: center;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
  }
  
  table.print-table td {
    border: 1px solid #555 !important;
    padding: 6px 8px;
    font-size: 9.5pt;
    color: #000 !important;
    vertical-align: top;
    line-height: 1.4;
    font-family: 'Times New Roman', serif;
  }

  h4.print-section-title {
    font-size: 10.5pt;
    font-weight: bold;
    margin: 14px 0 6px 0;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    font-family: 'Times New Roman', serif;
  }
  
  .signature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 100px; /* Memberi ruang di bawah untuk QR Code absolute */
    position: relative; /* Izinkan pemosisian QR Code absolute */
    text-align: center;
    page-break-inside: avoid;
    font-family: 'Times New Roman', serif;
    font-size: 10pt;
  }
  
  .signature-box {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .signature-line {
    border-bottom: 1px solid #000;
    width: 180px;
    margin: 0 auto;
  }

  #print-general-notes {
    border: 1px solid #333;
    padding: 10px 12px;
    font-size: 9.5pt;
    min-height: 60px;
    margin-bottom: 20px;
    line-height: 1.5;
    font-family: 'Times New Roman', serif;
  }
}

/* ================= RESPONSIVE LAYOUT & SEGMENT CONTROL KEHADIRAN ================= */

@media (max-width: 992px) {
  #main-dashboard-header {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  .card-header .tab-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .card-header .tab-buttons .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px;
  }
}

/* Segment Control Kehadiran */
.attendance-toggle-group {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.att-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  transition: all 0.2s ease;
  user-select: none;
  min-width: 36px;
  height: 36px;
}

/* Hadir (Green) */
input[value="H"]:checked + .att-hadir {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.att-hadir:hover {
  border-color: var(--success);
  color: var(--success);
}

/* Sakit (Yellow) */
input[value="S"]:checked + .att-sakit {
  background: var(--warning) !important;
  color: #111827 !important;
  border-color: var(--warning) !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.att-sakit:hover {
  border-color: var(--warning);
  color: var(--warning);
}

/* Izin (Blue) */
input[value="I"]:checked + .att-izin {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}
.att-izin:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Alpa (Red) */
input[value="A"]:checked + .att-alfa {
  background: var(--danger) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}
.att-alfa:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Show full words on desktop */
@media (min-width: 576px) {
  .att-btn {
    min-width: 64px;
  }
  .att-hadir::after { content: "adir"; }
  .att-sakit::after { content: "akit"; }
  .att-izin::after { content: "zin"; }
  .att-alfa::after { content: "lpa"; }
}

/* Mobile Header Notification overrides */
.mobile-header .notification-bell-container {
  position: relative;
}
.mobile-header .btn-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-header .notification-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  left: auto;
  transform: none;
  width: 290px;
  z-index: 1000;
}

/* Avatar Dropdown Pop-up Menu */
.avatar-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: rgba(30, 41, 59, 0.95); /* Slate Dark */
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.avatar-dropdown-menu.hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.95);
}

.avatar-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.avatar-dropdown-menu .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.avatar-dropdown-menu .dropdown-item.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15); /* Red/rose tint */
  color: #f87171;
}
