/* ============================================
   E-RAPOR DIGITAL - Tema Baru (Cantik & Beda)
   ============================================ */

:root {
  --primary: #4A90D9;
  --primary-dark: #3d7ab8;
  --primary-light: #b8d4f0;
  --accent: #5B9BD5;
  --accent-light: #e3effa;
  --secondary: #5B9BD5;
  --success: #4A90D9;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #e8f0fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-muted: #6C757D;
  --border: #a8c8e8;
  --border-light: #b8d4f0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(74, 144, 217, 0.08);
  --shadow-lg: 0 8px 32px rgba(74, 144, 217, 0.12);
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body,
body.app-body {
  background: linear-gradient(165deg, #e8f0fa 0%, #f0eef8 35%, #e8f4f0 70%, #fef9f0 100%) !important;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
/* Dashboard: area isi beragam warna (biru, ungu muda, hijau muda, krem) */
body:not(.login-wrap) .main-container {
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 25%, #f8fafc 50%, #f5faf8 75%, #fffefb 100%);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(74, 144, 217, 0.1), 0 4px 20px rgba(88, 80, 120, 0.06), 0 2px 12px rgba(34, 120, 90, 0.04);
  margin-top: 1rem;
  margin-bottom: 2rem;
  margin-left: 1rem;
  margin-right: 1rem;
  border: 1px solid rgba(168, 200, 232, 0.4);
  min-height: 60vh;
}
@media (min-width: 576px) {
  body:not(.login-wrap) .main-container {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}
@media (min-width: 768px) {
  body:not(.login-wrap) .main-container {
    margin-left: 2rem;
    margin-right: 2rem;
  }
}

h1, h2, h3, h4, h5, h6, .fw-bold {
  font-family: var(--font-heading);
}

/* Override Bootstrap primary ke tema medium blue */
.border-primary { border-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }

/* Navbar - fixed: selalu di layer paling depan, tidak ikut scroll */
.navbar.navbar-app,
.navbar-app,
nav.navbar-app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  width: 100%;
  background: linear-gradient(160deg, #0f2744 0%, #152a45 45%, #1a365d 100%) !important;
  background-color: #0f2744 !important;
  box-shadow: 0 4px 24px rgba(15, 39, 68, 0.5);
  padding: 0.4rem 0;
  border-bottom: 3px solid rgba(255,255,255,0.15);
}
/* Agar konten tidak tertutup navbar (hanya halaman yang punya navbar) */
body:not(.login-wrap) {
  padding-top: 56px;
}
.navbar-app .container-fluid {
  flex-wrap: nowrap;
}

/* Brand: Logo + Identitas Sekolah */
.navbar-school-brand {
  text-decoration: none;
  color: #fff !important;
  transition: opacity 0.2s;
}
.navbar-school-brand:hover {
  opacity: 0.95;
  color: #fff !important;
}
/* Logo sekolah di navbar: ukuran tetap, tidak boleh membesar */
.navbar-app .navbar-school-logo-wrap {
  flex-shrink: 0;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.navbar-app .navbar-school-logo-wrap img,
.navbar-app .navbar-school-logo,
.navbar-app img.navbar-school-logo {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
  border-radius: 6px;
  display: block !important;
  flex: none !important;
  box-sizing: border-box;
}
.navbar-app .navbar-school-logo-placeholder {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 10px;
  background: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-sizing: border-box;
}
.navbar-school-info {
  line-height: 1.25;
  min-width: 0;
}
.navbar-school-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.navbar-school-address {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.navbar-school-name-mobile {
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Nav links */
.nav-links-wrap {
  gap: 0.15rem;
}
.navbar-app .nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 0.5rem 0.7rem !important;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.navbar-app .nav-link:hover {
  background: rgba(255,255,255,0.18);
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.navbar-app .nav-link.active {
  background: rgba(255,255,255,0.25);
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}
.navbar-app .dropdown-toggle::after { margin-left: 0.35em; }
.navbar-app .dropdown-menu {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
}
.navbar-app .dropdown-menu.dropdown-menu-dark {
  background: linear-gradient(180deg, #0f2744 0%, #152a45 100%);
  border-color: rgba(255,255,255,0.12);
}
.navbar-app .dropdown-item {
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}
.navbar-app .dropdown-item:hover { background: var(--primary-light); }
.navbar-app .dropdown-menu-dark .dropdown-item:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.navbar-app .dropdown-header {
  font-size: 0.7rem;
  padding: 0.35rem 0.85rem;
}

/* Right block: TA + User + Logout */
.navbar-right {
  flex-shrink: 0;
}
.navbar-ta-label,
.navbar-user-role {
  display: block;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.navbar-ta-value,
.navbar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.navbar-vr {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.2);
}
.navbar-app .btn-logout {
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-heading);
}
.navbar-toggler-custom {
  padding: 0.4rem 0.5rem;
}
.navbar-toggler-custom:focus {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

/* Main container - lebar nyaman & jarak dari tepi (tanpa ganggu responsif) */
.main-container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
@media (min-width: 576px) {
  .main-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 768px) {
  .main-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 992px) {
  .main-container {
    max-width: 1100px;
    padding-left: 2.25rem;
    padding-right: 2.25rem;
  }
}
@media (min-width: 1200px) {
  .main-container {
    max-width: 1200px;
    padding-left: 2.75rem;
    padding-right: 2.75rem;
  }
}
@media (min-width: 1400px) {
  .main-container {
    max-width: 1280px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* Cards - isi dashboard lebih kaya (gradien header halus) */
.card-app,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.06);
  transition: box-shadow 0.3s ease, transform 0.25s ease;
  background: #fff;
}
.card-app:hover,
.card:hover {
  box-shadow: 0 12px 28px rgba(74, 144, 217, 0.12);
}
.card-app .card-header,
.card .card-header {
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbfe 0%, #fff 100%);
  color: #333333;
}
.card-app .card-body,
.card .card-body {
  padding: 1.25rem;
}
.card.border-0 {
  border: 1px solid var(--border);
}
.card.border-start {
  border-left-width: 4px;
  border-left-color: var(--primary);
}

/* Welcome banner - gradien multiwarna (biru + teal + ungu lembut) */
.welcome-banner {
  background: linear-gradient(135deg, #2d6cb0 0%, #3b82c4 25%, #2d9488 55%, #5b7cc9 85%, #6b8edc 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: #fff;
  box-shadow: 0 10px 36px rgba(45, 108, 176, 0.25), 0 4px 16px rgba(45, 148, 136, 0.12);
  border: 1px solid rgba(255,255,255,0.25);
}
.welcome-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 100%);
  pointer-events: none;
}
.welcome-banner h2 { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; margin-bottom: 0.35rem; z-index: 1; }
.welcome-banner-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  z-index: 1;
  position: relative;
}
.welcome-banner .badge { font-weight: 500; padding: 0.35rem 0.75rem; z-index: 1; border-radius: 10px; }
.welcome-banner .badge.bg-white { background: rgba(255,255,255,0.2) !important; color: #fff !important; }
.welcome-banner .badge.bg-warning { background: rgba(255,255,255,0.35) !important; color: #fff !important; }
.welcome-banner .badge.bg-info { background: rgba(255,255,255,0.3) !important; color: #fff !important; }
.welcome-banner .badge.bg-secondary { background: rgba(255,255,255,0.25) !important; color: #fff !important; }

/* Menu cards - variasi warna (biru, teal, ungu, amber) + hover tegas */
.menu-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  background: #fff !important;
  border-left: 4px solid #4A90D9;
  cursor: pointer;
}
.menu-card.bg-secondary.bg-opacity-10 { border-left-color: #6b7280 !important; }
.menu-card.bg-success.bg-opacity-10 { border-left-color: #0d9488 !important; }
.menu-card.bg-primary.bg-opacity-10 { border-left-color: #4A90D9 !important; }
.menu-card.bg-warning.bg-opacity-10 { border-left-color: #d97706 !important; }
.menu-card.bg-info.bg-opacity-10 { border-left-color: #5b7cc9 !important; }
.menu-card.bg-danger.bg-opacity-10 { border-left-color: #dc2626 !important; }
.menu-card.bg-secondary.bg-opacity-10,
.menu-card.bg-success.bg-opacity-10,
.menu-card.bg-primary.bg-opacity-10,
.menu-card.bg-warning.bg-opacity-10,
.menu-card.bg-info.bg-opacity-10,
.menu-card.bg-danger.bg-opacity-10 {
  background: #fff !important;
}
.menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.1), 0 0 0 2px rgba(74, 144, 217, 0.2);
  border-left-width: 5px;
  border-left-color: #3d7ab8 !important;
}
.menu-card .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #b8d4f0 !important;
  color: #4A90D9 !important;
}
.menu-card:hover .icon-wrap {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.25);
}
.menu-card .icon-wrap.bg-success,
.menu-card .icon-wrap.bg-primary,
.menu-card .icon-wrap.bg-secondary,
.menu-card .icon-wrap.bg-warning,
.menu-card .icon-wrap.bg-danger,
.menu-card .icon-wrap.bg-info {
  background: #b8d4f0 !important;
  color: #4A90D9 !important;
}
.menu-card h6 { font-family: var(--font-heading); font-weight: 600; margin-bottom: 0.15rem; color: #333333; }
.menu-card small { color: var(--text-muted); font-size: 0.8rem; }
.menu-card:hover h6 { color: #1a365d; }

/* Kartu statistik - warna berbeda per tipe + hover tegas */
.main-container .card.bg-success.bg-opacity-10 {
  border-left: 4px solid #0d9488 !important;
  border: 1px solid rgba(13, 148, 136, 0.2) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.06) !important;
  background: linear-gradient(135deg, #fff 0%, #f0fdfa 100%) !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
.main-container .card.bg-warning.bg-opacity-10 {
  border-left: 4px solid #d97706 !important;
  border: 1px solid rgba(217, 119, 6, 0.2) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.06) !important;
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%) !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
.main-container .card.bg-primary.bg-opacity-10 {
  border-left: 4px solid #4A90D9 !important;
  border: 1px solid rgba(74, 144, 217, 0.2) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.08) !important;
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%) !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
.main-container .card.bg-danger.bg-opacity-10 {
  border-left: 4px solid #dc2626 !important;
  border: 1px solid rgba(220, 38, 38, 0.2) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.06) !important;
  background: linear-gradient(135deg, #fff 0%, #fef2f2 100%) !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
.main-container .card.bg-success.bg-opacity-10:hover,
.main-container .card.bg-warning.bg-opacity-10:hover,
.main-container .card.bg-primary.bg-opacity-10:hover,
.main-container .card.bg-danger.bg-opacity-10:hover {
  box-shadow: 0 14px 32px rgba(0,0,0,0.08), 0 0 0 2px rgba(74, 144, 217, 0.15) !important;
  transform: translateY(-5px);
}
.main-container .card.bg-success.bg-opacity-10 .icon-wrap.rounded-3 {
  background: #ccfbf1 !important;
  color: #0d9488 !important;
  border-radius: 14px !important;
  transition: transform 0.25s ease;
}
.main-container .card.bg-warning.bg-opacity-10 .icon-wrap.rounded-3 {
  background: #fef3c7 !important;
  color: #d97706 !important;
  border-radius: 14px !important;
  transition: transform 0.25s ease;
}
.main-container .card.bg-primary.bg-opacity-10 .icon-wrap.rounded-3 {
  background: #b8d4f0 !important;
  color: #4A90D9 !important;
  border-radius: 14px !important;
  transition: transform 0.25s ease;
}
.main-container .card.bg-danger.bg-opacity-10 .icon-wrap.rounded-3 {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-radius: 14px !important;
  transition: transform 0.25s ease;
}
.main-container .card.bg-success.bg-opacity-10:hover .icon-wrap.rounded-3,
.main-container .card.bg-warning.bg-opacity-10:hover .icon-wrap.rounded-3,
.main-container .card.bg-primary.bg-opacity-10:hover .icon-wrap.rounded-3,
.main-container .card.bg-danger.bg-opacity-10:hover .icon-wrap.rounded-3 {
  transform: scale(1.08);
}
.main-container .card.bg-success.bg-opacity-10 a,
.main-container .card.bg-warning.bg-opacity-10 a,
.main-container .card.bg-primary.bg-opacity-10 a,
.main-container .card.bg-danger.bg-opacity-10 a {
  color: #333333;
}
.main-container .card.bg-success.bg-opacity-10 .fw-bold,
.main-container .card.bg-warning.bg-opacity-10 .fw-bold,
.main-container .card.bg-primary.bg-opacity-10 .fw-bold,
.main-container .card.bg-danger.bg-opacity-10 .fw-bold {
  color: #333333;
}

/* Tables - header #F8F9FA, teks #333 */
.table-app { font-size: 0.9rem; }
.table-app tbody td { padding: 0.75rem 1rem; vertical-align: middle; }
.table-app thead th,
.table thead th {
  font-weight: 600;
  font-family: var(--font-heading);
  color: #333333;
  background: #F8F9FA !important;
  border-bottom: 2px solid var(--border);
  padding: 0.75rem 1rem;
}
.table-app tbody tr:hover { background: #b8d4f0; }
.table thead th { font-family: var(--font-heading); color: #333333; }

/* Buttons - animasi hover tegas (ring + naik + scale) menegaskan bisa diklik */
.btn-app {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 0.5rem 1.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}
.btn-app:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.35), 0 0 0 3px rgba(74, 144, 217, 0.25);
}
.btn-app:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 2px 10px rgba(74, 144, 217, 0.3);
  transition-duration: 0.1s;
}
.btn-primary {
  background: #4A90D9;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}
.btn-primary:hover {
  background: #3d7ab8;
  border: none;
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(74, 144, 217, 0.45), 0 0 0 3px rgba(74, 144, 217, 0.3);
}
.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.4);
}
.btn-success {
  background: #4A90D9;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}
.btn-success:hover {
  background: #3d7ab8;
  border: none;
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(74, 144, 217, 0.45), 0 0 0 3px rgba(74, 144, 217, 0.3);
}
.btn-success:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.4);
}
.btn-outline-primary {
  border: 1px solid #4A90D9;
  color: #4A90D9;
  border-radius: var(--radius-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}
.btn-outline-primary:hover {
  background: #b8d4f0;
  border-color: #4A90D9;
  color: #3d7ab8;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 14px rgba(74, 144, 217, 0.25), 0 0 0 2px rgba(74, 144, 217, 0.2);
}
.btn-outline-primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.3);
}
.btn-outline-primary.btn-sm { border-radius: 10px; }

/* Form controls - medium blue: focus #4A90D9 */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid #a8c8e8;
  background: #f0f6fc;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: #4A90D9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
  outline: none;
  background: #fff;
}
.form-control.bg-light { background: #f0f6fc !important; }
.form-label { font-weight: 600; color: #333333; }
.form-select.bg-light { background: #f0f6fc !important; }

/* Page title - seperti gambar: heading #333333 */
.page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: #333333;
  margin-bottom: 0.25rem;
}
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.main-container h6.text-uppercase,
.main-container h5,
.main-container h4 {
  color: #333333;
  font-family: var(--font-heading);
}
.section-heading { margin-bottom: 1rem; }
.section-heading .text-uppercase { letter-spacing: 0.05em; }
/* Variasi warna judul section: biru, hijau, ungu */
.main-container .section-heading:nth-of-type(1) .text-uppercase { color: #2d6cb0 !important; }
.main-container .section-heading:nth-of-type(2) .text-uppercase { color: #0d9488 !important; }
.main-container .section-heading:nth-of-type(3) .text-uppercase { color: #5b7cc9 !important; }
.section-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* Alerts */
.alert { border-radius: 10px; border: none; }

/* ============================================
   LOGIN PAGE - Biru elegan & cantik
   ============================================ */
:root {
  /* Gradasi 4 warna panel login: gelap → sedang → terang (tetap biru) */
  --login-color-1: #0c1929;
  --login-color-2: #1a365d;
  --login-color-3: #1e40af;
  --login-color-4: #2563eb;
  --login-bg-start: #0f172a;
  --login-bg-mid: #1e3a5f;
  --login-bg-end: #1e40af;
  --login-accent: #2563eb;
  --login-accent-light: #93c5fd;
  --login-shadow: 30, 64, 175;
}
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(155deg,
    var(--login-bg-start) 0%,
    var(--login-bg-mid) 45%,
    var(--login-bg-end) 100%);
  padding: 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 15% 30%, rgba(37, 99, 235, 0.18) 0%, transparent 55%),
              radial-gradient(ellipse 50% 40% at 85% 70%, rgba(30, 64, 175, 0.15) 0%, transparent 50%);
  pointer-events: none;
}
.login-page {
  width: 100%;
  max-width: 1020px;
  position: relative;
  z-index: 1;
}
.login-card-holder {
  width: 100%;
  border-radius: 24px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.4) 100%);
  box-shadow: 0 25px 50px -12px rgba(var(--login-shadow), 0.25),
              0 0 0 1px rgba(255,255,255,0.5) inset;
  backdrop-filter: blur(16px);
}
.login-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(var(--login-shadow), 0.08),
              0 1px 3px rgba(0,0,0,0.04);
  min-height: 560px;
  border: 1px solid rgba(147, 197, 253, 0.35);
}

/* Panel kiri: gradasi 4 warna biru (gelap → cantik) */
.login-panel-left {
  flex: 1;
  min-width: 320px;
  padding: 3rem 2.5rem;
  background: linear-gradient(165deg,
    var(--login-color-1) 0%,
    var(--login-color-2) 33%,
    var(--login-color-3) 66%,
    var(--login-color-4) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.login-panel-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}
.login-brand-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.35);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
}
.login-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.login-subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.92);
  line-height: 1.5;
  max-width: 300px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.login-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  animation: login-blob-float 12s ease-in-out infinite;
}
.login-blob-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(37, 99, 235, 0.2) 50%, transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}
.login-blob-2 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(30, 64, 175, 0.15) 60%, transparent 80%);
  bottom: 15%;
  left: -80px;
  animation-delay: -4s;
}
.login-blob-3 {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(37, 99, 235, 0.18) 100%);
  bottom: -40px;
  right: 25%;
  animation-delay: -8s;
}
@keyframes login-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10px, -15px) scale(1.05); }
  66% { transform: translate(-8px, 10px) scale(0.98); }
}

/* Panel kanan: putih, form seperti gambar */
.login-panel-right {
  flex: 1;
  min-width: 320px;
  padding: 2.5rem 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #FFFFFF;
}
.login-form-wrapper { max-width: 340px; margin: 0 auto; width: 100%; }
.login-form-header { text-align: center; margin-bottom: 1.75rem; }
.login-form-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, var(--login-accent-light) 0%, #dbeafe 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--login-accent);
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(var(--login-shadow), 0.15);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.login-form-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}
.login-form-desc {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}
.login-form-header p { font-size: 0.9rem; color: #64748b; margin: 0; }
.login-alert { border-radius: 12px; border: none; font-size: 0.9rem; padding: 0.75rem 1rem; margin-bottom: 1.25rem; }
.login-form .login-field { margin-bottom: 1.25rem; }
.login-form .form-label { font-size: 0.85rem; font-weight: 600; color: #334155; margin-bottom: 0.4rem; }
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap i {
  position: absolute;
  left: 1rem;
  color: #3b82f6;
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s;
}
.login-input-wrap .form-control {
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input-wrap .form-control:focus {
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px rgba(var(--login-shadow), 0.2);
  outline: none;
  background: #fff;
}
.login-input-wrap:focus-within i { color: var(--login-accent); }
.login-input-wrap .form-control::placeholder { color: #94a3b8; }
.btn-login {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color: #fff;
  background: linear-gradient(165deg,
    var(--login-color-1) 0%,
    var(--login-color-2) 33%,
    var(--login-color-3) 66%,
    var(--login-color-4) 100%);
  border: none;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(var(--login-shadow), 0.35);
}
.btn-login:hover {
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(var(--login-shadow), 0.4), 0 0 0 3px rgba(var(--login-shadow), 0.2);
}
.btn-login:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 0 0 2px rgba(var(--login-shadow), 0.35);
}
.login-forgot { text-align: center; margin: 1rem 0 0; font-size: 0.9rem; }
.login-forgot a { color: #64748b; text-decoration: none; transition: color 0.2s; }
.login-forgot a:hover { color: var(--login-accent); }
.login-footer { text-align: center; font-size: 0.8rem; color: #64748b; margin-top: auto; padding-top: 1.5rem; }

/* Responsive: mobile stack */
@media (max-width: 767px) {
  .login-wrap {
    padding: 1rem 0.75rem;
  }
  .login-card-holder {
    padding: 6px;
    border-radius: 20px;
    box-shadow:
      0 20px 40px -12px rgba(var(--login-shadow), 0.22),
      0 0 0 1px rgba(255,255,255,0.15),
      0 20px 50px -15px rgba(0,0,0,0.45);
  }
  .login-container {
    min-height: auto;
    border-radius: 16px;
  }
  .login-panel-left {
    min-height: 200px;
    padding: 2rem 1.5rem;
    text-align: center;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .login-brand { display: flex; flex-direction: column; align-items: center; }
  .login-brand-icon { margin-left: auto; margin-right: auto; }
  .login-tagline { margin-left: auto; margin-right: auto; text-align: center; }
  .login-features { justify-content: center; }
  .login-panel-right { padding: 2rem 1.5rem 1.5rem; }
  .login-form-wrapper { max-width: 100%; }
}

/* Content card wrapper (untuk halaman di ?p=) */
/* Nilai di bawah KKM (merah) - input & span */
.table-nilai-harian .nilai-di-bawah-kkm,
.table-nilai-harian input.nilai-di-bawah-kkm,
.table-hover .nilai-di-bawah-kkm,
.table-hover input.nilai-di-bawah-kkm,
.nilai-di-bawah-kkm,
input.nilai-di-bawah-kkm,
.form-control.nilai-di-bawah-kkm,
span.nilai-di-bawah-kkm {
  color: #dc2626 !important;
  font-weight: 600;
}
input.nilai-di-bawah-kkm,
.form-control.nilai-di-bawah-kkm {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
}
input.nilai-di-bawah-kkm:focus,
.form-control.nilai-di-bawah-kkm:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25) !important;
  color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

.content-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  background: #fff;
}

/* ============================================
   RESPONSIVE - HP & Laptop
   ============================================ */
html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Container & content - responsif, tetap lebar terbatas & berjarak */
.main-container {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  max-width: 100%;
}
@media (min-width: 576px) {
  .main-container {
    padding-top: 1.25rem;
    padding-bottom: 1.75rem;
  }
}
@media (min-width: 992px) {
  .main-container {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }
}

.content-card {
  padding: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
@media (min-width: 576px) {
  .content-card { padding: 1.25rem 1.5rem; }
}
@media (min-width: 768px) {
  .content-card { padding: 1.5rem 2rem; }
}

/* Welcome banner - mobile */
.welcome-banner {
  padding: 1.25rem 1rem;
}
.welcome-banner h2 {
  font-size: 1.25rem;
}
@media (min-width: 576px) {
  .welcome-banner { padding: 1.5rem 1.5rem; }
  .welcome-banner h2 { font-size: 1.4rem; }
}
@media (min-width: 768px) {
  .welcome-banner { padding: 1.75rem 2rem; }
  .welcome-banner h2 { font-size: 1.5rem; }
}

/* Menu cards - stack rapi di HP */
.menu-card {
  padding: 1rem;
}
.menu-card .icon-wrap {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}
@media (min-width: 576px) {
  .menu-card { padding: 1.25rem; }
  .menu-card .icon-wrap { width: 48px; height: 48px; font-size: 1.35rem; }
}

/* Tabel: scroll horizontal di HP */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}
.table {
  min-width: 100%;
}

/* Tabel nilai harian: di ponsel scroll horizontal, kolom nilai tetap lebar agar angka terlihat penuh */
.table-responsive-nilai {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overflow-y: visible;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
@media (min-width: 768px) {
  .table-responsive-nilai {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}
@media (max-width: 767.98px) {
  .table-nilai-harian {
    min-width: 560px;
  }
}
.table-nilai-harian thead th:nth-child(1) { min-width: 42px; }
.table-nilai-harian thead th:nth-child(2) { min-width: 100px; }
.table-nilai-harian thead th:nth-child(n+3):not(:last-child) { min-width: 76px; }
.table-nilai-harian thead th:last-child { min-width: 76px; }
.table-nilai-harian tbody td:nth-child(1) { min-width: 42px; }
.table-nilai-harian tbody td:nth-child(2) { min-width: 100px; }
.table-nilai-harian tbody td:nth-child(n+3):not(:last-child) { min-width: 76px; }
.table-nilai-harian tbody td:last-child { min-width: 76px; }
@media (max-width: 767.98px) {
  .table-nilai-harian thead th:nth-child(1),
  .table-nilai-harian thead th:nth-child(2),
  .table-nilai-harian tbody td:nth-child(1),
  .table-nilai-harian tbody td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #ffffff;
    box-shadow: 4px 0 6px -2px rgba(0,0,0,0.08);
  }
  .table-nilai-harian thead th:nth-child(1),
  .table-nilai-harian thead th:nth-child(2) {
    background: #f8f9fa;
  }
  .table-nilai-harian tbody tr:nth-child(odd) td:nth-child(1),
  .table-nilai-harian tbody tr:nth-child(odd) td:nth-child(2) {
    background: #f8f9fa;
  }
  .table-nilai-harian thead th:nth-child(2),
  .table-nilai-harian tbody td:nth-child(2) {
    left: 42px;
  }
  .table-nilai-harian thead th:nth-child(1) { z-index: 2; }
  .table-nilai-harian tbody td:nth-child(1) { z-index: 2; }
}
.table-nilai-harian .kd-input {
  min-width: 68px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 767.98px) {
  .table-nilai-harian .kd-input {
    min-width: 72px;
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .table thead th,
  .table tbody td {
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
  }
  .table .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
  }
}

/* Tabel nama siswa: kolom No + Nama Siswa fixed, scroll horizontal di bawah */
.table-responsive-sticky-name {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  padding-bottom: 0.5rem;
}
.table-responsive-sticky-name .table-sticky-name {
  min-width: 100%;
}
@media (max-width: 767.98px) {
  .table-responsive-sticky-name .table-sticky-name {
    min-width: 520px;
  }
}
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(1),
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(2),
.table-responsive-sticky-name .table-sticky-name tbody td:nth-child(1),
.table-responsive-sticky-name .table-sticky-name tbody td:nth-child(2) {
  position: sticky;
  z-index: 1;
  background: #ffffff;
  box-shadow: 4px 0 6px -2px rgba(0,0,0,0.08);
}
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(1),
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(2) {
  background: #f8f9fa;
}
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(1),
.table-responsive-sticky-name .table-sticky-name tbody td:nth-child(1) {
  left: 0;
  min-width: 48px;
  z-index: 2;
}
.table-responsive-sticky-name .table-sticky-name thead th:nth-child(2),
.table-responsive-sticky-name .table-sticky-name tbody td:nth-child(2) {
  left: 48px;
  min-width: 140px;
}
.table-responsive-sticky-name .table-sticky-name thead.table-light th:nth-child(1),
.table-responsive-sticky-name .table-sticky-name thead.table-light th:nth-child(2) {
  background: #f8f9fa;
}
.table-responsive-sticky-name .table-sticky-name tbody tr:nth-child(odd) td:nth-child(1),
.table-responsive-sticky-name .table-sticky-name tbody tr:nth-child(odd) td:nth-child(2) {
  background: #f8f9fa;
}
.table-responsive-sticky-name .table-sticky-name.table-hover tbody tr:hover td:nth-child(1),
.table-responsive-sticky-name .table-sticky-name.table-hover tbody tr:hover td:nth-child(2) {
  background: #e7f1ff;
}
/* Variant: 3 kolom sticky (No, NIS, Nama Siswa) */
.table-responsive-sticky-name .table-sticky-3col thead th:nth-child(2),
.table-responsive-sticky-name .table-sticky-3col tbody td:nth-child(2) {
  min-width: 100px;
  left: 48px;
}
.table-responsive-sticky-name .table-sticky-3col thead th:nth-child(3),
.table-responsive-sticky-name .table-sticky-3col tbody td:nth-child(3) {
  position: sticky;
  left: 148px;
  min-width: 140px;
  z-index: 1;
  background: #ffffff;
  box-shadow: 4px 0 6px -2px rgba(0,0,0,0.08);
}
.table-responsive-sticky-name .table-sticky-3col thead.table-light th:nth-child(3) {
  background: #f8f9fa;
}
.table-responsive-sticky-name .table-sticky-3col tbody tr:nth-child(odd) td:nth-child(3) {
  background: #f8f9fa;
}
.table-responsive-sticky-name .table-sticky-3col.table-hover tbody tr:hover td:nth-child(3) {
  background: #e7f1ff;
}
.table-responsive-sticky-name .scroll-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #6c757d);
  margin-top: 0.35rem;
  margin-bottom: 0;
}
.table-responsive-sticky-name .scroll-hint i {
  margin-right: 0.25rem;
}

/* Form & input - penuh di mobile */
@media (max-width: 575.98px) {
  .form-control, .form-select {
    font-size: 16px; /* hindari zoom di iOS */
  }
  .row.g-2, .row.g-3 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
}

/* Navbar - mobile */
@media (max-width: 991.98px) {
  .navbar-app {
    padding: 0.35rem 0;
  }
  .navbar-app .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .navbar-school-brand {
    max-width: calc(100vw - 120px);
  }
  .navbar-school-name-mobile {
    max-width: calc(100vw - 140px);
    font-size: 0.8rem;
  }
  .navbar-collapse {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .navbar-collapse .navbar-nav {
    gap: 0.1rem;
  }
  .navbar-collapse .nav-link {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.875rem;
  }
  .navbar-right {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .navbar-user-name {
    font-size: 0.8rem;
  }
  .navbar-ta-value {
    font-size: 0.75rem;
  }
  .navbar-app .btn-logout {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 575.98px) {
  .navbar-school-name-mobile {
    max-width: 120px;
  }
}

/* Card & page header di mobile */
@media (max-width: 575.98px) {
  .card-body {
    padding: 1rem !important;
  }
  .card-header {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
  }
  .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .page-title, h4.fw-bold {
    font-size: 1.1rem;
  }
}

/* Cetak: kertas A4 */
@page {
  size: A4;
  margin: 15mm;
}
@media print {
  body { margin: 0; padding: 0; }
  .navbar-app, .no-print { display: none !important; }
}
