:root {
  --ui-bg-top: #0b1328;
  --ui-bg-bottom: #111827;
  --ui-surface: rgba(255, 255, 255, 0.06);
  --ui-surface-strong: rgba(255, 255, 255, 0.1);
  --ui-border: rgba(255, 255, 255, 0.12);
  --ui-text: #f8fafc;
  --ui-muted: rgba(248, 250, 252, 0.76);
  --ui-primary: #3b82f6;
  --ui-primary-soft: rgba(59, 130, 246, 0.22);
  --ui-danger-soft: rgba(239, 68, 68, 0.22);
  --ui-success-soft: rgba(34, 197, 94, 0.2);
  --ui-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
  --ui-radius-md: 14px;
  --ui-radius-lg: 18px;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 8% 0%, rgba(59, 130, 246, 0.2), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(14, 165, 233, 0.16), transparent 24%),
    linear-gradient(180deg, var(--ui-bg-top) 0%, var(--ui-bg-bottom) 100%);
}

:where(a, button, input, select, textarea) {
  font: inherit;
}

:where(h1, h2, h3, h4) {
  letter-spacing: 0.01em;
}

:where(a) {
  color: inherit;
}

:where(button, .btn, .submit-btn, .toggle-btn, .delete-btn, .home-btn, .back-btn) {
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

:where(button:hover, .btn:hover, .submit-btn:hover, .toggle-btn:hover, .delete-btn:hover):not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.95);
  outline-offset: 2px;
}

:where(
  .back-btn,
  .home-btn,
  .nav-btn,
  .menu-toggle,
  .desktop-nav ul li a,
  .mobile-sidebar ul li a
) {
  border-radius: 12px;
}

:where(
  .back-btn,
  .home-btn,
  .nav-btn,
  .menu-toggle,
  .desktop-nav ul li a,
  .mobile-sidebar ul li a
):hover {
  background: var(--ui-surface-strong);
}

:where(
  .page-header,
  .header-bss,
  .card,
  .hero-card,
  .form-card,
  .list-card,
  .info-card,
  .event-mini-card,
  .leader-card,
  .announcement-card,
  .michango-panel
) {
  border-color: var(--ui-border);
  box-shadow: var(--ui-shadow);
}

:where(.page-header, .header-bss) {
  background: rgba(15, 23, 42, 0.82);
  border-bottom: 1px solid var(--ui-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:where(
  .card,
  .hero-card,
  .form-card,
  .list-card,
  .info-card,
  .event-mini-card,
  .leader-card,
  .announcement-card,
  .michango-panel,
  .report-center-card,
  .michango-summary-card
) {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

:where(.card, .hero-card, .form-card, .list-card, .report-center-card, .michango-panel) {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

:where(input, select, textarea) {
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

:where(input::placeholder, textarea::placeholder) {
  color: rgba(248, 250, 252, 0.55);
}

:where(
  .btn,
  .submit-btn,
  .preview-report-btn,
  .download-report-btn,
  .toggle-btn
) {
  background: var(--ui-primary-soft);
  color: #dbeafe;
}

:where(.delete-btn) {
  background: var(--ui-danger-soft);
}

:where(.alert.success, .success) {
  background: var(--ui-success-soft);
}

:where(.alert.error, .error) {
  background: var(--ui-danger-soft);
}

:where(table) {
  width: 100%;
  border-collapse: collapse;
}

:where(th, td) {
  border-color: var(--ui-border);
}

:where(th) {
  background: rgba(59, 130, 246, 0.15);
  color: #dbeafe;
}

:where(.modal-content, .michango-panel, .report-preview-shell) {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--ui-border);
}

:where(p, .helper-text, .title-wrap p, .summary-label) {
  color: var(--ui-muted);
}

.global-back-to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.9);
  color: #fff;
  cursor: pointer;
  z-index: 2400;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.global-back-to-top .fallback-arrow {
  font-size: 1rem;
  line-height: 1;
}

.global-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 767px) {
  :where(button, .btn, .submit-btn, .toggle-btn, .delete-btn, .home-btn, .back-btn) {
    min-height: 44px;
  }

  :where(.page-header, .header-bss) {
    border-radius: 0 0 14px 14px;
  }

  :where(.card, .hero-card, .form-card, .list-card, .michango-panel) {
    border-radius: 16px;
  }

  .global-back-to-top {
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
  }
}
