/* ==========================================================================
   SIBK - Sistem Informasi Bimbingan Konseling
   Modern Responsive Admin UI Stylesheet
   ========================================================================== */

:root {
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sidebar: #cbd5e1;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  --sidebar-width: 258px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
  color: var(--text-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo.has-img {
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

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

.brand-title {
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 99px;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 16px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-sidebar);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-link.active {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.nav-link.active svg {
  opacity: 1;
}

/* Collapsible Sidebar Accordion Groups */
.nav-group {
  margin-top: 4px;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-sidebar);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-group-toggle:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-group.open > .nav-group-toggle,
.nav-group.has-active > .nav-group-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-group-label svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-group.has-active > .nav-group-toggle .nav-group-label svg {
  color: #818cf8;
  opacity: 1;
}

.nav-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-group-count {
  font-size: 10.5px;
  font-weight: 600;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-group.open > .nav-group-toggle .nav-chevron {
  transform: rotate(90deg);
  opacity: 1;
}

.nav-group-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.nav-group.open > .nav-group-panel {
  grid-template-rows: 1fr;
}

.nav-group-items {
  min-height: 0;
  overflow: hidden;
  margin: 0 0 0 19px;
  padding-left: 10px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  transition: margin 0.2s ease;
}

.nav-group.open .nav-group-items {
  margin: 4px 0 6px 19px;
}

.nav-sublink {
  padding: 7px 10px;
  font-size: 12.8px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 2px;
  border-radius: 7px;
}

.nav-sublink:hover {
  color: #f8fafc;
}

.nav-subdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-sublink:hover .nav-subdot {
  background: #cbd5e1;
}

.nav-sublink.active .nav-subdot {
  background: #fff;
  transform: scale(1.25);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
}

.backup-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

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

.menu-toggle {
  display: none;
  background: var(--primary-soft);
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 95;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.open {
  display: block;
}

/* Mobile Quick All-Menus Bar */
.mobile-menu-strip {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}

.mobile-menu-strip::-webkit-scrollbar {
  display: none;
}

.mobile-menu-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  text-decoration: none;
}

.mobile-menu-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  z-index: 90;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.mobile-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  font-family: inherit;
}

.mobile-bottom-item svg {
  width: 18px;
  height: 18px;
}

.mobile-bottom-item.active {
  color: var(--primary);
}

.page-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.pill-success {
  background: var(--success-soft);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-meta {
  line-height: 1.2;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Container */
.page-body {
  padding: 24px;
  flex: 1;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: var(--danger-soft);  color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-soft);    color: #075985; border-color: #bae6fd; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
  line-height: 1.1;
}

.stat-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.stat-icon.emerald { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.rose { background: var(--danger-soft); color: var(--danger); }
.stat-icon.sky { background: var(--info-soft); color: var(--info); }

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.3;
  font-family: inherit;
}

.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0284c7; color: #fff; }
.btn-outline { background: #fff; color: var(--text-main); border-color: var(--border); }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Tables */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 240px;
  flex: 1;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.table-responsive {
  overflow-x: auto;
}

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

table.table thead th {
  text-align: left;
  padding: 11px 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.table tbody tr:hover {
  background: #f8fafc;
}

.per-page-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.per-page-wrap select {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success   { background: var(--success-soft); color: #065f46; }
.badge-warning   { background: var(--warning-soft); color: #92400e; }
.badge-danger    { background: var(--danger-soft);  color: #991b1b; }
.badge-info      { background: var(--info-soft);    color: #075985; }
.badge-primary   { background: var(--primary-soft); color: var(--primary); }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

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

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

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

/* Charts */
.chart-container {
  width: 100%;
  min-height: 260px;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 260px;
  display: block;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Action buttons group */
.action-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

.murid-cascade-box {
  margin-bottom: 8px;
}

.murid-kelas-select {
  border-color: #c7d2fe;
  background-color: #f8faff;
  font-weight: 600;
  color: #3730a3;
}

.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

/* Auth Login Page */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f172a;
  background: radial-gradient(circle at top right, #312e81 0%, #0f172a 60%);
  padding: 20px;
  overflow-x: hidden;
}

.login-page.bg-bimbingan_konseling {
  background:
    radial-gradient(circle at 14% 18%, rgba(79, 70, 229, 0.42) 0%, transparent 46%),
    radial-gradient(circle at 86% 82%, rgba(14, 165, 233, 0.30) 0%, transparent 48%),
    radial-gradient(circle at 82% 16%, rgba(167, 139, 250, 0.20) 0%, transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 52%, #0f2942 100%);
}

.login-page.bg-sekolah_modern {
  background:
    radial-gradient(circle at 82% 16%, rgba(16, 185, 129, 0.32) 0%, transparent 44%),
    radial-gradient(circle at 12% 84%, rgba(37, 99, 235, 0.32) 0%, transparent 48%),
    linear-gradient(135deg, #0b1f3a 0%, #0f3d3e 54%, #064e3b 100%);
}

.login-page.bg-harmoni_senja {
  background:
    radial-gradient(circle at 18% 22%, rgba(245, 158, 11, 0.30) 0%, transparent 44%),
    radial-gradient(circle at 84% 78%, rgba(236, 72, 153, 0.25) 0%, transparent 48%),
    linear-gradient(135deg, #1e1b4b 0%, #4c1d95 52%, #7c2d12 100%);
}

.login-page.bg-minimalis_terang {
  background:
    radial-gradient(circle at 18% 18%, rgba(79, 70, 229, 0.14) 0%, transparent 44%),
    radial-gradient(circle at 84% 82%, rgba(14, 165, 233, 0.16) 0%, transparent 46%),
    linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #eef2ff 100%);
}

.login-page.bg-kustom_gambar {
  background-color: #0f172a;
}

.login-bg-custom {
  position: fixed;
  inset: -24px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  transform: scale(1.04);
}

.login-bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.42;
}

.login-orb-1 {
  width: 380px;
  height: 380px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.7) 0%, transparent 70%);
}

.login-orb-2 {
  width: 420px;
  height: 420px;
  bottom: -110px;
  right: -70px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.6) 0%, transparent 70%);
}

.login-orb-3 {
  width: 280px;
  height: 280px;
  top: 42%;
  right: 12%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, transparent 70%);
}

.bg-sekolah_modern .login-orb-1 { background: radial-gradient(circle, rgba(16, 185, 129, 0.65) 0%, transparent 70%); }
.bg-sekolah_modern .login-orb-2 { background: radial-gradient(circle, rgba(59, 130, 246, 0.65) 0%, transparent 70%); }
.bg-harmoni_senja .login-orb-1 { background: radial-gradient(circle, rgba(245, 158, 11, 0.6) 0%, transparent 70%); }
.bg-harmoni_senja .login-orb-2 { background: radial-gradient(circle, rgba(236, 72, 153, 0.55) 0%, transparent 70%); }
.bg-harmoni_senja .login-orb-3 { background: radial-gradient(circle, rgba(139, 92, 246, 0.55) 0%, transparent 70%); }
.bg-minimalis_terang .login-orb { opacity: 0.28; }

.login-bg-art {
  position: fixed;
  inset: -28px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.login-bg-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.58) 0%, rgba(30, 27, 75, 0.52) 100%);
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 1;
}

#loginBgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  padding: 32px 32px 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.login-page.bg-minimalis_terang .login-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
}

.login-roles-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.login-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.login-footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #475569;
}

.login-footer-brand strong {
  color: var(--text-main);
}

.login-footer-credit {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

/* Artistic Vibrant Credit Badge: Created by: NW */
.nw-credit-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px 7px;
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, #16123f 0%, #311042 52%, #0d1f3a 100%) padding-box,
    linear-gradient(90deg, #ff2e93, #ff9f1c, #fde047, #00f5d4, #3b82f6, #ff2e93) border-box;
  background-size: 100% 100%, 240% 100%;
  box-shadow:
    0 6px 18px rgba(255, 46, 147, 0.28),
    0 2px 10px rgba(0, 245, 212, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: nwBorderFlow 5s linear infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.nw-credit-badge:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 10px 24px rgba(255, 46, 147, 0.40),
    0 4px 14px rgba(0, 245, 212, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.nw-sparkle {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #fde047;
  filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.85));
  animation: nwSparklePulse 2.4s ease-in-out infinite;
}

.nw-credit-label {
  font-family: 'Georgia', 'Palatino Linotype', 'Book Antiqua', serif;
  font-style: italic;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #f1f5f9;
  text-shadow: 0 1px 6px rgba(148, 163, 184, 0.45);
}

.nw-credit-monogram {
  position: relative;
  display: inline-block;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.14em;
  padding-bottom: 2px;
  background: linear-gradient(90deg, #ff4ecd 0%, #ffbe0b 32%, #00f5d4 66%, #60a5fa 85%, #ff4ecd 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 78, 205, 0.55));
  animation: nwTextShimmer 4s linear infinite;
}

.nw-credit-monogram::after {
  content: '';
  position: absolute;
  left: -1px;
  right: 1px;
  bottom: 0;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2e93, #fde047, #00f5d4);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.75);
}

@keyframes nwBorderFlow {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 240% 50%; }
}

@keyframes nwTextShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}

@keyframes nwSparklePulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.22) rotate(18deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .nw-credit-badge,
  .nw-sparkle,
  .nw-credit-monogram {
    animation: none;
  }
}

/* App Footer */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.app-footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.app-footer-brand strong {
  color: var(--text-main);
  font-weight: 600;
}

.app-footer-credit {
  display: inline-flex;
  align-items: center;
}

/* Responsive */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(84vw, 300px);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.35);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: inline-flex;
  }
  .main-content {
    margin-left: 0;
  }
  .topbar {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
  }
  .topbar-left {
    gap: 8px;
  }
  .page-heading {
    font-size: 15px;
  }
  .topbar-pill-ta,
  .topbar-pill-sync,
  .user-meta {
    display: none;
  }
  .user-chip {
    padding: 3px;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .mobile-menu-strip {
    display: flex;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .page-body {
    padding: 14px 12px 18px;
  }
  .app-footer {
    padding: 14px 14px 76px;
    flex-direction: column;
    text-align: center;
  }
  .app-footer-brand {
    justify-content: center;
  }
  .grid-2, .grid-3, .form-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-card {
    padding: 12px 14px;
  }
  .stat-value {
    font-size: 21px;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
  }
  .card-header {
    padding: 12px 14px;
    align-items: stretch;
  }
  .card-header > .action-group,
  .card-header > .btn {
    width: 100%;
    flex-wrap: wrap;
  }
  .card-body {
    padding: 14px;
  }
  .search-box {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar form,
  .table-toolbar form select {
    width: 100% !important;
  }
  .table-toolbar .per-page-wrap select {
    width: auto !important;
  }
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  table.table thead th,
  table.table tbody td {
    padding: 9px 10px;
    font-size: 12.5px;
  }
  .action-group {
    flex-wrap: wrap;
  }
  .form-control {
    font-size: 16px;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-dialog {
    max-height: 92vh;
  }
  .modal-header, .modal-body {
    padding: 14px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .form-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 22px 18px;
  }
}

@media print {
  .sidebar, .sidebar-backdrop, .topbar, .mobile-menu-strip, .mobile-bottom-nav, .app-footer, .no-print {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-body {
    padding: 0 !important;
  }
  .card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }
}
