:root {
  --primary: #1a6fc4;
  --primary-dark: #155a9e;
  --sidebar-width: 240px;
  --topbar-height: 56px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4f8;
}

/* ── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0d47a1 0%, #1a6fc4 50%, #1e90c4 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}


.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .login-icon-wrap {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #1a6fc4, #0d47a1);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .9rem;
  box-shadow: 0 6px 20px rgba(26, 111, 196, .35);
}

.login-logo .login-icon-wrap i {
  font-size: 2rem;
  color: #fff;
}

.login-logo h4 {
  margin: 0 0 .15rem;
  font-weight: 800;
  font-size: 1.5rem;
  color: #1a1a2e;
  letter-spacing: -.01em;
}

.login-logo .login-logo-sub {
  font-size: .82rem;
  color: #999;
  margin: 0;
}

/* ── LAYOUT ─────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #1a2744;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 999;
}

.sidebar-overlay.show {
  display: block;
}

.sidebar-header {
  padding: 1.2rem 1.4rem .8rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-logo i {
  font-size: 1.4rem;
  color: #7ec8e3;
}

.sidebar-masjid {
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
  margin-top: .7rem;
  margin-bottom: .3rem;
}

.sidebar-nav {
  flex: 1;
  padding: .5rem 0;
  overflow-y: auto;
}

.nav-link-side {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1rem;
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: .88rem;
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.nav-link-side:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.nav-link-side.active {
  background: var(--primary);
  color: #fff;
}

.nav-link-side i {
  font-size: 1rem;
  width: 1.2rem;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
  padding: .8rem 1rem .3rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: rgba(255, 255, 255, .8);
  font-size: .85rem;
}

.sidebar-user i {
  font-size: 1.5rem;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.topbar-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a2e;
  flex: 1;
}

.sidebar-toggle {
  color: #555;
  padding: .2rem .4rem;
}

.main-content {
  flex: 1;
  padding: 1.25rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── COMPONENTS ─────────────────────────────── */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary-custom:hover {
  background: var(--primary-dark);
  color: #fff;
}

.badge-aktif {
  background: #d4edda;
  color: #155724;
}

.badge-tidak {
  background: #f8d7da;
  color: #721c24;
}

.badge-tunggu {
  background: #fff3cd;
  color: #856404;
}

.badge-tolak {
  background: #f8d7da;
  color: #721c24;
}

.badge-bayar {
  background: #d4edda;
  color: #155724;
}

.badge-tertunggak {
  background: #f8d7da;
  color: #721c24;
}

.badge-selesai {
  background: #d4edda;
  color: #155724;
}

.badge-proses {
  background: #fff3cd;
  color: #856404;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: .5rem;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  padding-left: 1.4rem;
  padding-right: 1.4rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-bottom: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
  text-align: end;
}

@media (max-width: 768px) {
  .stat-card {
    padding: .5rem .6rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: .95rem;
  }
}

.card {
  background: #fff;
  border-radius: 12px;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e8f0f8;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  font-size: .88rem;
  padding: .75rem 1rem;
  color: #1a1a2e;
}

.kelulusan-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid #f0f4f8;
}

.kelulusan-row:last-child {
  border-bottom: none;
}

/* ── Dashboard cards ── */
.alert-bar {
  border-radius: 10px;
  padding: .9rem 1.2rem;
  font-size: .92rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

@media (max-width: 576px) {
  .alert-bar {
    font-size: .75rem;
    padding: .75rem 1rem;
  }
}

.alert-bar--danger {
  background: #f8d7da;
  border-color: #e74c3c;
  color: #721c24;
}

.alert-bar--warning {
  background: #fff3cd;
  border-color: #f0c040;
  color: #856404;
}

.alert-bar__link {
  color: inherit;
  font-weight: 700;
}

.dash-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
  overflow: hidden;
}

.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  border-bottom: 1px solid #f0f4f8;
  background: #fafafa;
  gap: .7rem;
}

.dash-card__body {
  padding: .5rem;
}

.dash-card__body.p-0 {
  padding: 0;
}

.dash-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

.dash-badge--warning {
  background: #fff3cd;
  color: #856404;
}

.dash-badge--info {
  background: #cff4fc;
  color: #0c5460;
}

.dash-badge--secondary {
  background: #e2e3e5;
  color: #383d41;
}

.dash-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.1rem;
  border-bottom: 1px solid #f5f5f5;
  transition: background .15s;
}

.dash-row:last-child {
  border-bottom: none;
}

.dash-row:hover {
  background: #f9fbff;
}

.dash-row__info {
  flex: 1;
  min-width: 0;
}

.dash-row__name {
  font-weight: 600;
  font-size: .92rem;
}

.dash-row__sub {
  font-size: .78rem;
  color: #999;
  margin-top: .1rem;
}

.dash-row__arrow {
  font-size: 1.2rem;
  color: #ccc;
  line-height: 1;
}

.dash-tag {
  font-size: .75rem;
  background: #fff3cd;
  color: #856404;
  padding: .2rem .55rem;
  border-radius: 6px;
  white-space: nowrap;
}

.dash-empty {
  text-align: center;
  color: #aaa;
  font-size: .88rem;
  padding: 1.2rem;
}

.dash-more {
  text-align: center;
  padding: .5rem;
  font-size: .82rem;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
}

.dash-table thead tr {
  background: #f8f9fa;
}

.dash-table th,
.dash-table td {
  padding: .65rem;
  border-bottom: 1px solid #f0f4f8;
  text-align: left;
}

.dash-table tbody tr:hover {
  background: #f9fbff;
}

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

.dash-progress {
  height: 14px;
  border-radius: 10px;
  background: #f0f0f0;
  overflow: hidden;
}

.dash-progress__bar {
  height: 100%;
  background: #2ecc71;
  border-radius: 10px;
  transition: width .4s ease;
}

.dash-section-title {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .6rem;
  color: #444;
}

/* ── Pagination ─────────────────────────────── */
.pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .84rem;
  margin-left: auto;
  background: #fafafa;
}

.pg-info {
  color: #888;
  white-space: nowrap;
}

.pg-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 .4rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #444;
  font-size: .83rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.pg-btn:hover:not(:disabled) {
  background: #f0f4ff;
  border-color: var(--primary);
  color: var(--primary);
}

.pg-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.pg-btn:disabled {
  opacity: .35;
  cursor: default;
}

.pg-arrow {
  color: #666;
}

.pg-ellipsis {
  color: #aaa;
  padding: 0 .2rem;
  line-height: 32px;
}

.pg-size {
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}

.pg-size-label {
  color: #888;
}

.pg-size-select {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: .2rem .5rem;
  font-size: .83rem;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 576px) {
  .dash-card__header {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .pagination-controls {
    margin-top: 12px;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .pg-btn {
    min-width: 28px;
    height: 28px;
    font-size: .78rem;
  }

  .pg-size-select {
    font-size: .78rem;
  }

  .pg-ellipsis,
  .pg-btn.pg-edge {
    display: none;
  }
}

.bayaran-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 1rem;
  border-bottom: 1px solid #f0f4f8;
}

.bayaran-row:last-child {
  border-bottom: none;
}

.info-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8f0f8;
  overflow: hidden;
}

.info-card-title {
  font-weight: 700;
  font-size: .85rem;
  color: var(--primary);
  padding: .6rem 1rem;
  background: #f0f7ff;
  border-bottom: 1px solid #e8f0f8;
}

.btn-xs {
  font-size: .75rem;
  padding: .15rem .4rem;
}

/* ── MOBILE ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }
}