:root {
  --sidebar-width: 292px;
  --topbar-height: 72px;
  --sidebar-bg: #0b1220;
  --sidebar-bg-2: #111827;
  --sidebar-card: #172033;
  --sidebar-text: #e5e7eb;
  --sidebar-muted: #94a3b8;
  --sidebar-line: rgba(255, 255, 255, .08);
  --brand: #2563eb;
  --brand-2: #38bdf8;
  --page-bg: #f4f7fb;
  --content-text: #0f172a;
}

body {
  background: var(--page-bg);
}

body.with-sidebar {
  min-height: 100vh;
  overflow-x: hidden;
}

.card {
  border: 0;
  border-radius: 18px;
}

.shadow-soft {
  box-shadow: 0 12px 36px rgba(15, 23, 42, .08);
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

.badge-status {
  min-width: 64px;
}

.qr-card {
  break-inside: avoid;
  page-break-inside: avoid;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 14px;
  margin: 10px;
  width: 230px;
  display: inline-block;
  text-align: center;
  background: #fff;
}

.qr-box {
  width: 160px;
  height: 160px;
  margin: 8px auto;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, .25), transparent 35%),
    linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  box-shadow: 18px 0 45px rgba(15, 23, 42, .22);
  transition: transform .24s ease;
}

.sidebar-hidden .app-sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-brand {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 900;
  font-size: 1.22rem;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .38);
}

.brand-text {
  min-width: 0;
}

.brand-title {
  display: block;
  color: #fff;
  font-weight: 850;
  letter-spacing: .2px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  display: block;
  color: var(--sidebar-muted);
  font-size: .76rem;
  margin-top: 3px;
}

.sidebar-close {
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.sidebar-user {
  margin: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .88rem;
}

.sidebar-user-meta {
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 750;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .22);
  color: #bfdbfe;
  border: 1px solid rgba(147, 197, 253, .18);
  font-size: .72rem;
  font-weight: 700;
}

.sidebar-section-label {
  padding: 4px 16px 8px;
  color: #7f8ea3;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .68rem;
  font-weight: 800;
}

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

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

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

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 650;
  font-size: .92rem;
  line-height: 1.25;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .09);
  transform: translateX(2px);
}

.sidebar-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .3);
}

.sidebar-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
  color: #dbeafe;
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: .02em;
  border: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-link.active .sidebar-icon {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
}

.sidebar-link-text {
  min-width: 0;
  white-space: normal;
}

.sidebar-link-logout {
  color: #fecaca;
}

.sidebar-link-logout:hover {
  color: #fff;
  background: rgba(220, 53, 69, .22);
}

.app-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left .24s ease;
}

.sidebar-hidden .app-content {
  margin-left: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, .24);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(148, 163, 184, .38);
  border-radius: 14px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
}

.sidebar-toggle:hover {
  background: #f8fafc;
}

.sidebar-toggle-bars,
.sidebar-toggle-bars::before,
.sidebar-toggle-bars::after {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: #0f172a;
  content: '';
}

.sidebar-toggle-bars::before {
  transform: translateY(-6px);
}

.sidebar-toggle-bars::after {
  transform: translateY(4px);
}

.topbar-kicker {
  font-size: .74rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
}

.topbar-title {
  font-weight: 850;
  color: var(--content-text);
  line-height: 1.1;
  font-size: 1.08rem;
  margin-top: 4px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-weight: 700;
}

.topbar-user .mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #e0ecff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .78rem;
}

.app-main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-hidden .app-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .app-content,
  .sidebar-hidden .app-content {
    margin-left: 0;
  }

  .app-topbar {
    padding: 10px 16px;
  }

  .app-main {
    padding: 16px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, .44);
    opacity: 1;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .sidebar-hidden .sidebar-backdrop {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media print {
  .no-print,
  nav,
  .app-sidebar,
  .app-topbar,
  .sidebar-backdrop {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .app-content,
  .sidebar-hidden .app-content {
    margin-left: 0 !important;
  }

  main.container,
  .app-main {
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Biodata siswa - foto profil */
.biodata-profile-photo,
.biodata-profile-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 28px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
  border: 5px solid #fff;
  background: linear-gradient(135deg, #e0ecff, #f8fafc);
  color: #2563eb;
  font-size: 4rem;
}

.biodata-form-photo,
.biodata-form-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0ecff, #f8fafc);
  color: #2563eb;
  border: 4px solid #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
  font-size: 3rem;
}

.biodata-table-photo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

.biodata-table-photo-empty {
  font-size: 1.2rem;
}

.sidebar-avatar-photo,
.mini-avatar-photo {
  object-fit: cover;
  padding: 0;
}
