/* ==========================================================================
   PMBM MODERN ADMIN & SISWA PORTAL STYLESHEET
   Ultra-lightweight, Responsive, Modern SaaS Dashboard — EMIS GTK Style
   ========================================================================== */

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

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Sidebar Dark Teal (EMIS GTK Kemenag Style) */
  --sidebar-bg: #064e3b;
  --sidebar-bg-hover: rgba(255,255,255,0.12);
  --sidebar-bg-active: #ffffff;
  --sidebar-text: rgba(255,255,255,0.85);
  --sidebar-text-active: #064e3b;
  --sidebar-text-header: rgba(255,255,255,0.48);
  --sidebar-accent: #10b981;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-brand-bg: #022c22;

  /* Color Palette */
  --color-primary: #0f766e;
  --color-primary-rgb: 15, 118, 110;
  --color-primary-hover: #115e59;
  --color-primary-subtle: #f0fdfa;
  --color-success: #10b981;
  --color-success-subtle: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-subtle: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-subtle: #fef2f2;
  --color-info: #0284c7;
  --color-info-subtle: #f0f9ff;
  --color-dark: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
  --color-white: #ffffff;

  --sidebar-width: 295px;
  --topbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 14px -1px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 0.925rem;
  color: var(--color-slate-800);
  background-color: #f0f4f8;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Layout Classes */
.layout-row {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
}

.layout-column {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.flex {
  flex: 1 1 auto;
}

/* ==========================================================================
   SIDEBAR — EMIS GTK DARK TEAL STYLE
   ========================================================================== */
#aside.page-sidenav {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: transform var(--transition-normal), width var(--transition-normal);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
}

#aside .sidenav {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Brand Area */
#aside .navbar {
  height: var(--topbar-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--sidebar-brand-bg);
  flex-shrink: 0;
}

#aside .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  width: 100%;
}

#aside .navbar-brand img {
  max-height: 38px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

#aside .navbar-brand span {
  color: #ffffff !important;
}

#aside .navbar-brand small {
  /* color set dynamically by PHP */
}

.scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.scrollable::-webkit-scrollbar {
  width: 4px;
}

.scrollable::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}

.scrollable::-webkit-scrollbar-track {
  background: transparent;
}

/* Nav links in sidebar */
#aside .nav {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 12px 10px;
  margin: 0;
  gap: 1px;
}

#aside .nav-header {
  padding: 18px 12px 5px;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--sidebar-text-header);
  user-select: none;
}

#aside .nav-header:first-child {
  padding-top: 8px;
}

#aside .nav li {
  position: relative;
}

#aside .nav li a {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.865rem;
  transition: var(--transition-fast);
  position: relative;
  gap: 6px;
}

#aside .nav li a:hover {
  color: #ffffff;
  background: var(--sidebar-bg-hover);
}

/* Active Item — EMIS GTK Kemenag Pill Putih Kontras */
#aside .nav li.active > a,
#aside .nav li a.active {
  color: #064e3b !important;
  background: #ffffff !important;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

#aside .nav li.active > a .nav-icon,
#aside .nav li a.active .nav-icon,
#aside .nav li.active > a .nav-icon i,
#aside .nav li a.active .nav-icon i {
  color: #059669 !important;
}

#aside .nav li.active > a .nav-text,
#aside .nav li a.active .nav-text {
  color: #064e3b !important;
}

#aside .nav li.active > a::before,
#aside .nav li a.active::before {
  display: none;
}

#aside .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  font-size: 1.08rem;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

#aside .nav li a:hover .nav-icon,
#aside .nav li.active > a .nav-icon {
  color: var(--sidebar-accent);
}

#aside .nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#aside .nav-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* Submenu & Dropdown Navigation */
#aside .nav-caret {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.25s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

#aside .nav-link-dropdown:not(.collapsed) .nav-caret,
#aside .nav-item-dropdown.active > a .nav-caret {
  transform: rotate(180deg);
  color: var(--sidebar-accent);
}

#aside .nav-sub {
  list-style: none;
  padding: 4px 0 6px 14px;
  margin: 2px 0 4px 10px;
  border-left: 1.5px dashed rgba(255, 255, 255, 0.15);
}

#aside .nav-sub li {
  margin-bottom: 2px;
}

#aside .nav-sub li a {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.75);
}

#aside .nav-sub li a:hover {
  color: #ffffff;
  background: var(--sidebar-bg-hover);
}

#aside .nav-sub li.active > a,
#aside .nav-sub li a.active {
  color: #ffffff;
  background: var(--sidebar-bg-active);
  font-weight: 700;
}

/* Hover reveal on desktop screens (sub menu hanya muncul ketika menu di klick atau diarahkan) */
@media (min-width: 992px) {
  #aside .nav-item-dropdown:hover > .nav-sub.collapse:not(.show) {
    display: block !important;
    animation: fadeInSub 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  #aside .nav-item-dropdown:hover > .nav-link-dropdown .nav-caret {
    transform: rotate(180deg);
    color: var(--sidebar-accent);
  }
}

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

/* Sidebar Bottom User/Logout Area */
#aside .sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

/* Main Content Wrapper */
#main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f4f8;
  transition: margin-left var(--transition-normal), width var(--transition-normal);
  width: calc(100% - var(--sidebar-width));
}

/* Auto-Hide / Collapsed Sidebar State (Desktop Full-Width) */
html.sidebar-is-collapsed body #aside.page-sidenav,
body.sidebar-collapsed #aside.page-sidenav {
  transform: translateX(-100%) !important;
  box-shadow: none !important;
}

html.sidebar-is-collapsed body #main,
body.sidebar-collapsed #main {
  margin-left: 0 !important;
  width: 100% !important;
}

/* Sidebar Menu Tooltip (Modern Dark Glass style) */
.sidebar-menu-tooltip .tooltip-inner {
  background-color: #0f172a;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.815rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  max-width: 320px;
  text-align: left;
  pointer-events: none;
}
.sidebar-menu-tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: #0f172a !important;
}
.sidebar-menu-tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: #0f172a !important;
}
.sidebar-menu-tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #0f172a !important;
}
.sidebar-menu-tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #0f172a !important;
}

/* ==========================================================================
   PAGE HEADER / TOPBAR
   ========================================================================== */
#header.page-header {
  height: var(--topbar-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-slate-200);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}

#header .navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
}

.nav-user-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-slate-700);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
}

.nav-user-avatar:hover {
  background: var(--color-slate-100);
}

.nav-user-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-slate-200);
}

/* Dropdown Menu Styles */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  z-index: 1050;
  min-width: 14rem;
  padding: 8px;
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--color-slate-700);
  text-align: left;
  list-style: none;
  background-color: #ffffff;
  background-clip: padding-box;
  border: 1px solid var(--color-slate-200);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

.dropdown-menu.show {
  display: block !important;
}

.dropdown-menu-end, .dropdown-menu-right {
  right: 0 !important;
  left: auto !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  clear: both;
  font-weight: 500;
  color: var(--color-slate-700);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  border-radius: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
  gap: 8px;
}

.dropdown-item:hover, .dropdown-item:focus {
  color: var(--color-dark);
  background-color: var(--color-slate-100);
}

.dropdown-item.text-danger:hover {
  color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

.dropdown-divider {
  height: 0;
  margin: 6px 0;
  overflow: hidden;
  border-top: 1px solid var(--color-slate-100);
}

/* ==========================================================================
   PAGE HERO / TITLE AREA
   ========================================================================== */
.page-hero {
  padding: 22px 24px 0;
}

.page-title h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-dark);
  margin: 0;
  letter-spacing: -0.02em;
}

.page-title small {
  color: var(--color-slate-500);
  font-size: 0.88rem;
}

.page-content {
  padding: 20px 24px 40px;
  flex: 1;
}

/* Hero School Banner Card */
.school-banner-card {
  background: linear-gradient(135deg, #094540 0%, #0f766e 60%, #14b8a6 100%);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  color: var(--color-white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(15, 118, 110, 0.35);
  margin-bottom: 20px;
}

.school-banner-card .school-logo {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-banner-card .school-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.school-banner-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--color-white);
}

.school-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   METRIC & STAT CARDS
   ========================================================================== */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  margin-bottom: 20px;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 16px 22px;
  background: transparent;
  border-bottom: 1px solid var(--color-slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h5, .card-header h6 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0;
}

.card-body {
  padding: 22px;
}

.stat-widget {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  height: 100%;
}

.stat-widget:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-widget-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-widget-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1.1;
  margin-bottom: 12px;
}

.progress {
  height: 8px;
  background-color: var(--color-slate-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

.progress-bar.gd-primary { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.progress-bar.gd-success { background: linear-gradient(90deg, #059669, #10b981); }
.progress-bar.gd-warning { background: linear-gradient(90deg, #d97706, #f59e0b); }
.progress-bar.gd-danger  { background: linear-gradient(90deg, #dc2626, #ef4444); }
.progress-bar.gd-info    { background: linear-gradient(90deg, #0284c7, #38bdf8); }

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.badge-pill { border-radius: var(--radius-pill); }

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill-pending { background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.status-pill-accepted { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.status-pill-rejected { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }

/* Modern badge overrides */
.badge-success, .badge.bg-success {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0;
}
.badge-danger, .badge.bg-danger {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca;
}
.badge-warning, .badge.bg-warning {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a;
}
.badge-info, .badge.bg-info {
  background-color: #e0f2fe !important;
  color: #075985 !important;
  border: 1px solid #bae6fd;
}
.badge.bg-light {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
}

.btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; border-color: var(--color-warning); }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-info { background: var(--color-info); color: #fff; border-color: var(--color-info); }
.btn-info:hover { background: #0369a1; color: #fff; }
.btn-light { background: #fff; color: var(--color-dark); border-color: var(--color-slate-200); }
.btn-light:hover { background: var(--color-slate-100); }
.btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--color-primary); color: #fff; }
.btn-outline-danger { color: var(--color-danger); border-color: var(--color-danger); background: transparent; }
.btn-outline-danger:hover { background: var(--color-danger); color: #fff; }
.btn-outline-secondary { color: var(--color-slate-600); border-color: var(--color-slate-300); background: transparent; }
.btn-outline-secondary:hover { background: var(--color-slate-100); }
.btn-secondary { background: var(--color-slate-600); color: #fff; border-color: var(--color-slate-600); }
.btn-secondary:hover { background: var(--color-slate-700); color: #fff; }

/* ==========================================================================
   TABLES & DATATABLES
   ========================================================================== */
.table-responsive {
  border-radius: var(--radius-lg);
  overflow-x: auto;
  border: 1px solid var(--color-slate-300);
}

.table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.table th {
  background: #f1f5f9;
  color: var(--color-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 2px solid var(--color-slate-300);
}

.table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-slate-200);
  color: var(--color-slate-800);
  font-size: 0.88rem;
}

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

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label, label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-slate-800);
  margin-bottom: 6px;
  display: block;
}

.form-control,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-dark);
  background: #ffffff;
  border: 1.5px solid var(--color-slate-300);
  border-radius: 10px !important;
  height: 42px;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3.5px rgba(15, 118, 110, 0.18);
  background: #fff;
}

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

.input-group .form-control {
  border-radius: 0 10px 10px 0 !important;
}

.input-group .input-group-text {
  border-radius: 10px 0 0 10px !important;
  border: 1.5px solid #cbd5e1;
  border-right: 0;
  color: #334155;
  font-size: 0.885rem;
  font-weight: 600;
  background-color: #f1f5f9;
}

/* Nav Pills (Used in Tabs & Menu) */
.nav-pills {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-pills.flex-column {
  flex-direction: column;
}

.nav-pills .nav-link {
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--color-slate-600);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-pills .nav-link:hover {
  background: var(--color-slate-100);
  color: var(--color-dark);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-slate-200);
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  gap: 4px;
}

.nav-tabs .nav-link {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-slate-500);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
}

.nav-tabs .nav-link:hover {
  color: var(--color-primary);
  background: var(--color-slate-50);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: var(--color-primary) !important;
  border-bottom: 2.5px solid var(--color-primary) !important;
  background: transparent !important;
}

/* Legacy normalizer */
.page-container {
  padding: 0 !important;
  max-width: 100% !important;
}
.padding { padding: 0 !important; }
.text-highlight { color: var(--color-dark) !important; font-weight: 700; }

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.modal.fade .modal-dialog {
  transition: transform 0.25s ease-out;
  transform: translate(0, -30px);
}
.modal.show .modal-dialog { transform: none; }
.modal-backdrop {
  position: fixed; top: 0; left: 0; z-index: 1050;
  width: 100vw; height: 100vh; background-color: #0f172a;
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 0.55; }
.modal-dialog {
  position: relative; width: auto; margin: 1.75rem auto;
  pointer-events: none; max-width: 520px;
}
@media (min-width: 576px) {
  .modal-dialog { max-width: 520px; margin: 1.75rem auto; }
  .modal-sm { max-width: 380px; }
}
@media (min-width: 992px) { .modal-lg, .modal-xl { max-width: 800px; } }
@media (min-width: 1200px) { .modal-xl { max-width: 1140px; } }
.modal-dialog-centered {
  display: flex; align-items: center;
  min-height: calc(100% - 3.5rem);
}
.modal-content {
  position: relative; display: flex; flex-direction: column;
  width: 100%; pointer-events: auto; background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3); outline: 0; overflow: hidden;
}
.modal-header {
  display: flex; flex-shrink: 0; align-items: center;
  justify-content: space-between; padding: 18px 24px;
  border-bottom: 1px solid var(--color-slate-100);
}
.modal-header .btn-close { padding: 0.5rem; margin: -0.5rem -0.5rem -0.5rem auto; }
.modal-body { position: relative; flex: 1 1 auto; padding: 22px; }
.modal-footer {
  display: flex; flex-wrap: wrap; flex-shrink: 0; align-items: center;
  justify-content: flex-end; padding: 14px 22px;
  border-top: 1px solid var(--color-slate-100); gap: 10px;
}

/* Page Footer */
#footer.page-footer {
  padding: 16px 24px;
  background: var(--color-white);
  border-top: 1px solid var(--color-slate-200);
  font-size: 0.84rem;
  color: var(--color-slate-500);
  margin-top: auto;
  width: 100%;
}

/* ==========================================================================
   AUTH / LOGIN PAGE — RESPONSIVE & LONG SCHOOL NAME FIX
   ========================================================================== */
body.auth-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.18) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(15, 118, 110, 0.25) 0%, transparent 50%),
              linear-gradient(135deg, #042f2c 0%, #064e3b 40%, #0f766e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-sans);
  overflow-x: hidden;
}

.auth-page-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.auth-container {
  width: 100%;
  max-width: 460px;
  margin: auto;
}

/* FIX: Judul lembaga panjang — fluid font agar tidak terpotong */
.auth-page-wrapper h3 {
  font-size: clamp(1.05rem, 3.5vw, 1.45rem);
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

.auth-brand-logo {
  height: clamp(56px, 9vw, 76px);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  transition: transform var(--transition-normal);
  max-width: 90px;
  object-fit: contain;
}

.auth-brand-logo:hover {
  transform: scale(1.06);
}

.auth-card {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 36px 32px 30px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-group .input-icon {
  position: absolute;
  left: 14px;
  color: var(--color-slate-400);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color var(--transition-fast);
  z-index: 2;
}

.auth-input-group .form-control {
  padding-left: 44px;
  height: 48px;
  border-radius: 12px !important;
  border: 1.5px solid var(--color-slate-200);
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  background-color: var(--color-slate-50);
}

.auth-input-group .form-control:focus {
  background-color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.auth-input-group .form-control:focus ~ .input-icon,
.auth-input-group:focus-within .input-icon {
  color: var(--color-primary);
}

/* CLOUDFLARE TURNSTILE CLEAN WRAPPER (ELIMINATES RED TESTING BANNER OVERFLOW) */
.cf-turnstile-outer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cf-turnstile-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 302px;
  height: 66px;
  max-height: 66px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-auth-submit {
  height: 48px;
  background: linear-gradient(135deg, #0f766e 0%, #0d5c4b 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  transition: all var(--transition-fast);
  width: 100%;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #115e59 0%, #042f2c 100%);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.45);
  transform: translateY(-1px);
  color: #ffffff;
}

.auth-footer-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  text-align: center;
  margin: 24px auto 10px;
  max-width: 440px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}

.auth-footer-sub {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==========================================================================
   IMPERSONATION ALERT BAR
   ========================================================================== */
.impersonation-alert-bar {
  position: relative;
  z-index: 1015;
}

/* ==========================================================================
   FORM ROWS & DETAIL SCREENS
   ========================================================================== */
.form-group.row {
  margin-bottom: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.form-group.row .col-form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  padding-top: calc(0.375rem + 1px);
  padding-bottom: calc(0.375rem + 1px);
  line-height: 1.5;
}

/* ==========================================================================
   DATATABLES MODERN
   ========================================================================== */
.dataTables_wrapper {
  color: #1e293b;
  font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_length label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: #334155; font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length select {
  height: 38px; padding: 4px 12px; border-radius: 8px !important;
  border: 1.5px solid #cbd5e1; background-color: #ffffff;
  color: #0f172a; font-weight: 600; cursor: pointer; outline: none;
}
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.dataTables_wrapper .dataTables_filter { float: right; }
.dataTables_wrapper .dataTables_filter label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: #334155; font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_filter input {
  height: 38px; padding: 6px 14px; border-radius: 8px !important;
  border: 1.5px solid #cbd5e1; background-color: #ffffff;
  color: #0f172a; font-size: 0.85rem; outline: none; min-width: 200px;
  transition: all 0.2s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.dataTables_wrapper .dataTables_info {
  font-size: 0.84rem; font-weight: 600; color: #475569; padding-top: 6px;
}
.dataTables_wrapper .dataTables_paginate {
  display: inline-flex; gap: 4px; align-items: center;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 12px !important; border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important; background: #ffffff !important;
  color: #1e293b !important; font-weight: 600; font-size: 0.82rem;
  cursor: pointer; transition: all 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f1f5f9 !important; border-color: #94a3b8 !important; color: #0f172a !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #0f766e !important; border-color: #0f766e !important; color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.25);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.45; cursor: not-allowed; background: #f8fafc !important;
  border-color: #e2e8f0 !important; color: #94a3b8 !important;
}
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  cursor: pointer; user-select: none;
  background-color: #f1f5f9; color: #0f172a; font-weight: 700;
}
table.dataTable thead th.sorting:hover { background-color: #e2e8f0; }

/* ==========================================================================
   MOBILE & SMARTPHONE RESPONSIVENESS (< 992px & < 576px)
   ========================================================================== */
@media (max-width: 991.98px) {
  /* Off-canvas sidebar */
  #aside.page-sidenav {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 270px !important;
    max-width: 85vw !important;
    z-index: 1050 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35) !important;
  }

  #aside.page-sidenav.show {
    transform: translateX(0) !important;
  }

  /* Backdrop overlay */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 20, 40, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    transition: opacity 0.3s ease;
    opacity: 0;
  }

  .sidebar-backdrop.show {
    display: block !important;
    opacity: 1 !important;
  }

  /* Main content 100% on mobile */
  #main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Topbar adjustments */
  #header.page-header {
    padding: 0 14px !important;
    height: 58px !important;
  }

  .page-content {
    padding: 14px 12px 32px !important;
  }

  .page-hero {
    padding: 14px 12px 0 !important;
  }

  .card-body {
    padding: 14px 12px !important;
  }

  .card-header {
    padding: 12px 14px !important;
  }

  .table-responsive,
  .dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media (max-width: 575.98px) {
  .page-title h2 {
    font-size: 1.2rem !important;
  }

  .page-hero .d-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .modal-dialog {
    margin: 8px auto !important;
    max-width: 96vw !important;
  }

  .modal-body {
    padding: 14px !important;
  }

  .nav-user-avatar {
    padding: 4px !important;
  }

  .btn {
    font-size: 0.83rem !important;
  }

  /* Auth page mobile fix */
  .auth-card {
    padding: 24px 18px !important;
  }

  .auth-container {
    max-width: 100% !important;
  }

  .auth-page-wrapper h3 {
    font-size: clamp(0.95rem, 5vw, 1.2rem) !important;
  }

  .auth-brand-logo {
    height: 52px !important;
  }
}

/* Print-friendly: hide sidebar on print */
@media print {
  #aside.page-sidenav,
  #header.page-header,
  .sidebar-backdrop { display: none !important; }
  #main { margin-left: 0 !important; width: 100% !important; }
}
