/* =========================
   PSB 2026 — Mobile-First Design System
   ========================= */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --psb-grad-1: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 50%, #ec4899 100%);
  --psb-grad-2: linear-gradient(135deg, #22c55e 0%, #06b6d4 50%, #6366f1 100%);
  --psb-grad-3: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --psb-blue: #0ea5e9;
  --psb-purple: #8b5cf6;
  --psb-pink: #ec4899;
  --psb-green: #22c55e;
  --psb-amber: #f59e0b;
  --psb-red: #ef4444;
  --psb-slate: #64748b;
  --psb-radius: 16px;
  --psb-radius-sm: 12px;
  --psb-radius-xs: 8px;
  --psb-shadow: 0 4px 24px rgba(2, 6, 23, .06);
  --psb-shadow-lg: 0 10px 28px rgba(2, 6, 23, .08);
  --psb-transition: all .2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Gradients ── */
.bg-psb-grad {
  background: var(--psb-grad-1) !important;
}

.bg-psb-grad-2 {
  background: var(--psb-grad-2) !important;
}

.bg-psb-grad-3 {
  background: var(--psb-grad-3) !important;
}

/* ── Card Soft ── */
.card-soft {
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: var(--psb-shadow);
  border-radius: var(--psb-radius);
  transition: var(--psb-transition);
}

.card-soft:hover {
  box-shadow: var(--psb-shadow-lg);
}

/* ── Badge Soft ── */
.badge-soft {
  border-radius: 999px;
  padding: .4rem .7rem;
  font-weight: 800;
  letter-spacing: .3px;
}

/* ── Buttons ── */
.btn-pill {
  border-radius: 999px;
  font-weight: 700;
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-menunggu {
  background: #fef3c7;
  color: #92400e;
}

.status-menunggu::before {
  background: #f59e0b;
}

.status-diverifikasi {
  background: #dbeafe;
  color: #1e40af;
}

.status-diverifikasi::before {
  background: #3b82f6;
}

.status-diterima {
  background: #dcfce7;
  color: #166534;
}

.status-diterima::before {
  background: #22c55e;
}

.status-ditolak {
  background: #fee2e2;
  color: #991b1b;
}

.status-ditolak::before {
  background: #ef4444;
}

/* ── Stat Cards ── */
.stat-card {
  border-radius: var(--psb-radius);
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: var(--psb-shadow);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: var(--psb-transition);
  overflow: hidden;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--psb-shadow-lg);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--psb-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card .stat-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--psb-slate);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stat card text container */
.stat-card>div:not(.stat-icon) {
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .stat-card {
    padding: .75rem;
    gap: .5rem;
  }

  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: .9rem;
  }

  .stat-card .stat-value {
    font-size: 1rem;
  }

  .stat-card .stat-label {
    font-size: .7rem;
  }
}

/* ── Hero Card ── */
.hero-card {
  border-radius: var(--psb-radius);
  padding: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, .08);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Sidebar Gradient ── */
.sidebar-gradient {
  background: var(--psb-grad-1);
}

.sidebar .nav-link,
.sidebar .nav-title {
  color: rgba(255, 255, 255, .92) !important;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .14) !important;
  color: #fff !important;
}

.sidebar .nav-link.active-link {
  background: rgba(255, 255, 255, .18) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ── Mobile Card List (pendaftar) ── */
.registrant-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: var(--psb-radius);
  padding: 1rem;
  box-shadow: var(--psb-shadow);
  transition: var(--psb-transition);
}

.registrant-card:hover {
  box-shadow: var(--psb-shadow-lg);
}

.registrant-card+.registrant-card {
  margin-top: .75rem;
}

/* ── Info Row (for detail page) ── */
.info-row {
  display: flex;
  flex-direction: column;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

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

.info-row .info-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--psb-slate);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}

.info-row .info-value {
  font-weight: 700;
  color: #0f172a;
}

/* ── Bottom Nav (shared: pendaftar + admin) ── */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 23, 42, .08);
  padding: .4rem .6rem calc(.4rem + env(safe-area-inset-bottom));
  z-index: 1030;
}

.mobile-bottom-nav a {
  text-decoration: none;
}

.mobile-bottom-nav .item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  padding: .35rem .4rem;
  border-radius: var(--psb-radius-sm);
  color: var(--psb-slate);
  font-size: .68rem;
  font-weight: 700;
  transition: var(--psb-transition);
}

.mobile-bottom-nav .item i {
  font-size: 1.1rem;
}

.mobile-bottom-nav .item.active {
  background: rgba(14, 165, 233, .1);
  color: #0284c7;
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* ── Animation: Fade In Up ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp .4s ease-out both;
}

.animate-in:nth-child(1) {
  animation-delay: 0s;
}

.animate-in:nth-child(2) {
  animation-delay: .05s;
}

.animate-in:nth-child(3) {
  animation-delay: .1s;
}

.animate-in:nth-child(4) {
  animation-delay: .15s;
}

.animate-in:nth-child(5) {
  animation-delay: .2s;
}

.animate-in:nth-child(6) {
  animation-delay: .25s;
}

/* ── Desktop table show / mobile card show ── */
.desktop-only {
  display: none !important;
}

.mobile-only {
  display: block !important;
}

@media (min-width: 992px) {
  .desktop-only {
    display: block !important;
  }

  .desktop-only.table-responsive {
    display: block !important;
  }

  .mobile-only {
    display: none !important;
  }

  .stat-card .stat-value {
    font-size: 2rem;
  }

  .hero-card {
    padding: 2rem;
  }

  .hero-card::after {
    width: 300px;
    height: 300px;
  }

  /* Sidebar spacing for admin content area */
  .sidebar~.wrapper {
    margin-left: 256px;
  }
}

/* ── Body padding-bottom for bottom nav on mobile ── */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 72px;
  }

  .body.flex-grow-1 {
    padding-bottom: 1rem !important;
  }

  /* Hide sidebar on mobile by default */
  .sidebar {
    margin-left: -256px;
  }

  .sidebar-show .sidebar {
    margin-left: 0;
  }

  /* Adjust content for mobile */
  .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ── Search bar mobile ── */
.search-bar-mobile {
  width: 100%;
}

@media (min-width: 768px) {
  .search-bar-mobile {
    max-width: 320px;
  }
}

/* ── File list item ── */
.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  transition: var(--psb-transition);
}

.file-list-item:last-child {
  border-bottom: none;
}

.file-list-item:hover {
  background: rgba(15, 23, 42, .02);
}

/* ── Quick Tip Box ── */
.tip-box {
  border-radius: var(--psb-radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.tip-box .tip-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--psb-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

/* =========================
   PRINT: Force 1 page A4 Portrait
   ========================= */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {

  .mobile-bottom-nav,
  .header,
  .sidebar,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding-bottom: 0 !important;
  }

  .wrapper,
  .body,
  .container-fluid {
    padding: 0 !important;
    margin: 0 !important;
  }

  .card-soft {
    box-shadow: none !important;
  }

  .psb-print-a4 {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .psb-print-a4 .card-soft {
    padding: 10px !important;
  }

  .psb-print-header {
    padding: 10px !important;
  }

  h1,
  h2,
  h3 {
    margin: 0 0 6px 0 !important;
  }

  .mt-3 {
    margin-top: 8px !important;
  }

  .mt-4 {
    margin-top: 10px !important;
  }

  .mb-2 {
    margin-bottom: 6px !important;
  }

  .row.g-3 {
    --cui-gutter-y: .5rem !important;
    --cui-gutter-x: .5rem !important;
  }

  .fs-5 {
    font-size: 1.05rem !important;
  }

  .fs-4 {
    font-size: 1.2rem !important;
  }

  .small,
  small {
    font-size: .78rem !important;
  }
}