:root {
  --sidebar-bg: #0B3B91;
  --sidebar-hover: #1E5BC6;
  --sidebar-active: #4F7FBC;
  --sidebar-text: #FFFFFF;
  --sidebar-muted: rgba(255, 255, 255, 0.82);

  --primary: #0D6EFD;
  --primary-deep: #084ECC;
  --primary-soft: #E9F2FF;
  --bg: #F5F8FD;
  --surface: #FFFFFF;
  --surface-alt: #FFFFFF;
  --muted: #6B7280;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --text: #1F2937;
  --border: #E5E7EB;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell { display: flex; min-height: 100vh; }
.main-content {
  /* flex: 1; */
  /* padding: 28px 30px 36px; */
  transition: margin 0.3s ease;
  /* width: 100%;
  max-width: 1550px; */
  /* margin: 0 auto; */
}

.main-content > * {
  animation: uiFade 0.35s ease;
}

@keyframes uiFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card,
.panel,
.stat-card,
.quick-action-card,
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.95);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.panel:hover,
.stat-card:hover,
.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
}

.btn.small { padding: 7px 12px; font-size: 0.85rem; }
.btn:disabled, .btn.loading { opacity: 0.7; pointer-events: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: 22px;
  border: 1px solid rgba(226,232,240,0.95);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.topbar-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topbar-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-title small {
  color: var(--muted);
  font-size: 0.94rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.12);
  cursor: pointer;
}

.search {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  min-width: 220px;
}

.search input {
  border: none;
  background: transparent;
  padding: 10px 14px;
  width: 100%;
  min-width: 0;
}

.search input:focus { outline: none; }

.notification-toggle,
.user-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  position: relative;
}

.notification-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 320px;
  max-height: 420px;
  overflow: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  z-index: 1100;
}

.notification-dropdown.show { display: block; }

.user-menu img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

input, select, textarea {
  font-family: inherit;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:hover, select:hover, textarea:hover { border-color: #cbd5e1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

form .form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
form .form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

table tbody td {
  padding: 13px 16px;
  border-top: 1px solid rgba(226,232,240,0.8);
  color: var(--text);
}

table tbody tr:nth-child(even) { background: rgba(248,250,252,0.9); }
table tbody tr:hover { background: rgba(37,99,235,0.05); }

.badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}

.badge.success,
.status-chip.lunas {
  background: rgba(34,197,94,0.16);
  color: #15803D;
}

.badge.warning,
.status-chip.cicilan {
  background: rgba(245,158,11,0.14);
  color: #B45309;
}

.badge.danger,
.status-chip.belum {
  background: rgba(239,68,68,0.12);
  color: #B91C1C;
}

.page-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.overlay{position:fixed;inset:0;background:rgba(2,6,23,0.45);display:none;place-items:center;z-index:1200}
.overlay.show{display:grid}

.page-hero,
.page-hero-card {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(255, 255, 255, 1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-hero h2,
.page-hero-card h2 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
}

.page-hero p,
.page-hero-card p {
  margin: 0;
  color: var(--muted);
}

.stats-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 0 0 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 138px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.18rem;
}

.stat-card-icon.primary { background: #E8F1FF; color: var(--primary); }
.stat-card-icon.success { background: #DCFCE7; color: #16A34A; }
.stat-card-icon.warning { background: #FEF3C7; color: #F59E0B; }
.stat-card-icon.info { background: #E0F2FE; color: #3B82F6; }
.stat-card-icon.danger { background: #FEE2E2; color: #EF4444; }

.stat-card-content {
  flex: 1;
  min-width: 0;
}

.stat-card-content h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-card-content p {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfefe 0%, #f8fbff 100%);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chart-shell {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f8fbff 0%, #fdfefe 100%);
  border: 1px solid var(--border);
  padding: 16px;
}

.chart-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-actions button,
.chart-actions .btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chart-actions button.active,
.chart-actions button:hover,
.chart-actions .btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, #f8fbff 0%, #fdfefe 100%);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.filter-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}

.filter-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-form-group label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  min-width: 220px;
}

.search-box i {
  color: var(--muted);
}

.search-box input,
.search-box select {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  box-shadow: none;
  margin: 0;
}

.search-box input:focus,
.search-box select:focus {
  border: none;
  background: transparent;
  box-shadow: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}

.status-chip.lunas,
.badge.success {
  background: rgba(34, 197, 94, 0.16);
  color: #15803D;
}

.status-chip.cicilan,
.status-chip.akan-dibuka,
.badge.warning {
 background: rgba(245, 158, 11, 0.14);
 color: #B45309;
}

.status-chip.belum,
.status-chip.ditutup,
.badge.danger {
 background: rgba(239, 68, 68, 0.12);
 color: #B91C1C;
}

.status-chip.beasiswa,
.status-chip.info,
.status-chip.dibuka,
.badge.info {
 background: rgba(59, 130, 246, 0.16);
 color: #1D4ED8;
}

.modern-table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.modern-table tbody td {
  padding: 13px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--text);
}

.modern-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.9);
}

.modern-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

@media (max-width: 1100px) {
  .main-content { padding: 22px 20px 28px; }
  .topbar { padding: 18px 20px; }
  form .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .main-content { margin-left: 0; padding: 18px; }
  .mobile-toggle { display: inline-grid; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-left, .topbar-actions { width: 100%; justify-content: space-between; }
  .search { min-width: 0; flex: 1; }
}

@media (max-width: 640px) {
  .main-content { padding: 14px; }
  .topbar { padding: 16px; border-radius: 16px; }
  .topbar-left, .topbar-actions { flex-direction: column; align-items: stretch; }
  .topbar-actions { gap: 10px; }
  .search { width: 100%; }
  .btn, .btn.small { width: 100%; }
  table { min-width: 620px; }
}
