:root {
  --blue: #1b49a5;
  --blue-d: #13367d;
  --blue-l: #e9f0fc;
  --ink: #0f1b3d;
  --mist: #f4f7fc;
  --card-bg: #ffffff;
  --line: #d8e2f0;
  --line-light: #edf2f9;
  --mute: #586685;
  --ok: #107e46;
  --ok-bg: #e6f6ee;
  --warn: #b26e03;
  --warn-bg: #fdf3e2;
  --bad: #c52727;
  --bad-bg: #fde8e8;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(15, 27, 61, 0.05);
  --shadow-md: 0 6px 24px rgba(15, 27, 61, 0.08);
  --shadow-lg: 0 12px 36px rgba(15, 27, 61, 0.12);
  --top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 "Schibsted Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--mist);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

main { flex: 1; }
.wrap {
  width: min(100% - 2.5rem, 1020px);
  margin: 0 auto;
  padding: 2.25rem 0 3.5rem;
}

/* Typography & Links */
a { color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--blue-d); }
h1 {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  line-height: 1.18;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h2 {
  font-size: 1.35rem;
  margin: 1.5rem 0 0.85rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h3 { font-size: 1.15rem; margin: 0 0 0.5rem; font-weight: 600; }
h4 { font-size: 1rem; margin: 0 0 0.35rem; font-weight: 600; }
p { max-width: 65ch; margin: 0 0 1rem; }
.mute { color: var(--mute); }
.small { font-size: 0.875rem; }
.text-center { text-align: center; }
.center { justify-content: center; align-items: center; }

/* Header & Top Navigation */
.top {
  background: #183e92;
  color: #fff;
  padding-top: var(--top);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(10, 25, 65, 0.16);
}
.top .in {
  width: min(100% - 2.5rem, 1020px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand-link { display: inline-flex; align-items: center; }
.brand-logo { height: 30px; width: auto; display: block; }

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
}
.desktop-nav a {
  color: rgba(255, 255, 255, 0.88);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.desktop-nav a:hover, .desktop-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.nav-highlight {
  background: #f7a229 !important;
  color: #0d1e44 !important;
  font-weight: 700 !important;
}
.nav-highlight:hover { background: #ea961e !important; }
.nav-cta {
  background: #fff !important;
  color: var(--blue) !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--blue-l) !important; }

.user-pill-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  margin-left: 0.5rem;
}
.user-nav-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}
.inline-form { display: inline; margin: 0; }
.logout-link {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 0.825rem;
  cursor: pointer;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 0.65rem;
  transition: color 0.15s ease;
}
.logout-link:hover { color: #fff; text-decoration: underline; }

/* Mobile Hamburger Toggle */
.hamburger-btn {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 42px;
  height: 42px;
  padding: 8px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  border-radius: 8px;
  transition: background 0.15s ease;
  z-index: 110;
}
.hamburger-btn:hover, .hamburger-btn:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}
.hamburger-btn .bar {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.hamburger-btn.is-active .bar-1 { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-active .bar-2 { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-active .bar-3 { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Navigation Drawer */
.mobile-menu-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(10, 25, 65, 0.18);
  border-bottom: 2px solid var(--line);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 105;
}
.mobile-menu-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu-content {
  padding: 1.25rem 1.5rem 1.75rem;
  max-width: 500px;
  margin: 0 auto;
}
.mobile-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--mist);
  border-radius: 10px;
  margin-bottom: 1rem;
  color: var(--ink);
}
.mobile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  background: var(--blue-l);
  color: var(--blue);
}
.mobile-cta-item {
  background: var(--blue);
  color: #fff !important;
  justify-content: center;
  margin-top: 0.5rem;
}
.mobile-cta-item:hover { background: var(--blue-d); }
.mobile-nav-item.highlight {
  background: var(--warn-bg);
  color: var(--warn);
}
.mobile-nav-divider {
  height: 1px;
  background: var(--line);
  margin: 0.75rem 0;
}
.mobile-logout-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: 1px solid var(--bad);
  color: var(--bad);
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}
.mobile-logout-btn:hover {
  background: var(--bad-bg);
}
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 61, 0.4);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Card Container Styles */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--blue);
  color: #fff;
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 0.68rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--blue-d);
  border-color: var(--blue-d);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 73, 165, 0.25);
}
.btn.alt {
  background: #fff;
  color: var(--blue);
  border-color: var(--line);
}
.btn.alt:hover {
  background: var(--blue-l);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(15, 27, 61, 0.08);
}
.btn.sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.875rem;
  border-radius: 6px;
}
.btn.bad {
  background: #fff;
  color: var(--bad);
  border-color: var(--bad);
}
.btn.bad:hover {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(197, 39, 39, 0.2);
}
.btn.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: 10px;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.825rem;
  font-weight: 600;
  background: var(--mist);
  color: var(--ink);
  line-height: 1.3;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.b-active, .b-approved {
  color: var(--ok);
  background: var(--ok-bg);
}
.b-pending, .b-submitted {
  color: var(--warn);
  background: var(--warn-bg);
}
.b-declined {
  color: var(--bad);
  background: var(--bad-bg);
}
.network-badge {
  background: var(--blue-l);
  color: var(--blue);
  font-weight: 700;
}

/* Forms & Inputs */
form.f {
  display: grid;
  gap: 1.15rem;
  margin-top: 1rem;
}
form.f.wide {
  grid-template-columns: 1fr 1fr;
}
.wide .full {
  grid-column: 1 / -1;
}
label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--ink);
}
input, select, textarea {
  font: inherit;
  font-size: 15px;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 73, 165, 0.18);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}
.err {
  color: var(--bad);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
  font-weight: 500;
}

/* Alerts and Notes */
.note {
  background: var(--blue-l);
  border-left: 4px solid var(--blue);
  padding: 0.85rem 1.15rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
}
.error-note {
  background: var(--bad-bg);
  border-left-color: var(--bad);
  color: #7a1515;
}
.warning-note {
  background: var(--warn-bg);
  border-left-color: var(--warn);
  color: #6a4200;
}

/* Auth Cards (Login & Register) */
.auth-wrapper {
  max-width: 500px;
  margin: 1.5rem auto 3rem;
}
.auth-card {
  padding: 2.25rem 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.auth-card.wide-card {
  max-width: 620px;
}
.auth-header {
  margin-bottom: 1.75rem;
}
.auth-header h1 {
  font-size: 1.85rem;
  margin-bottom: 0.35rem;
}
.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-light);
}

/* Landing Page Hero & Features */
.landing-hero {
  max-width: 760px;
  margin: 1.5rem auto 3rem;
  padding: 2rem 1rem 1rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.12;
  margin-bottom: 1.15rem;
  letter-spacing: -0.03em;
}
.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--mute);
  max-width: 60ch;
  margin: 0 auto 2rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 3.5rem;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.step-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-l);
  color: var(--blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

/* User Dashboard */
.page-container {
  width: 100%;
}
.page-narrow {
  max-width: 720px;
  margin: 0 auto;
}
.profile-header-card {
  background: #ffffff;
  padding: 1.75rem;
  border-radius: 14px;
}
.profile-header-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.user-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #3b6bdc);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(27, 73, 165, 0.3);
}
.user-main-info {
  flex: 1;
}
.user-name-title {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}
.user-meta-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.user-handle {
  color: var(--mute);
  font-weight: 500;
  font-size: 0.95rem;
}
.meta-separator {
  color: var(--line);
}
.dashboard-activation-banner {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #fdfaf3;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid #fae6c0;
}
.modern-facts {
  margin: 0;
  display: grid;
  gap: 0;
}
.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-light);
}
.fact-row:last-child {
  border-bottom: 0;
}
.fact-row dt {
  color: var(--mute);
  font-size: 0.95rem;
  font-weight: 500;
}
.fact-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.tin-code {
  font-family: ui-monospace, Menlo, monospace;
  background: var(--blue-l);
  color: var(--blue);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Crypto Selection Interface (User Subscribe) */
.section-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
  margin-bottom: 0.85rem;
}
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}
.crypto-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.crypto-card:hover {
  border-color: #9cbbf2;
  transform: translateY(-1px);
}
.crypto-card.selected {
  border-color: var(--blue);
  background: #f6f9fe;
  box-shadow: 0 4px 14px rgba(27, 73, 165, 0.12);
}
.crypto-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crypto-card-icon img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: contain;
}
.crypto-card-info {
  flex: 1;
  display: grid;
  line-height: 1.25;
}
.crypto-name {
  font-size: 0.95rem;
  color: var(--ink);
}
.crypto-network {
  font-size: 0.8rem;
  color: var(--mute);
}
.crypto-check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s ease;
}
.crypto-card.selected .crypto-check-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Payment Summary Box */
.payment-details-card {
  border-radius: 14px;
}
.payment-amount-box {
  background: var(--mist);
  padding: 1.25rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.pay-amount-display {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0.4rem;
}
.payment-address-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.qr-container {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.85rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.qr-image {
  width: 150px;
  height: 150px;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}
.address-copy-block {
  display: flex;
  flex-direction: column;
}
.label-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.addr-box {
  display: flex;
  gap: 0.5rem;
}
.addr-box input {
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 0.875rem;
  background: #f9fbfd;
  color: var(--ink);
  font-weight: 500;
}
.copy-btn {
  padding: 0.65rem 1.15rem;
}
.crypto-note {
  font-size: 0.875rem;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  border-left: 3px solid var(--warn);
  margin-top: 0.85rem;
}
.confirm-form-section {
  border-top: 1px solid var(--line-light);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}
.btn-submit-pay {
  padding: 0.85rem;
  font-size: 1.05rem;
  border-radius: 10px;
}

/* Admin Dashboard & Management */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-page-header h1 {
  margin: 0 0 0.25rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.stat-pending .stat-icon-wrap { background: var(--warn-bg); color: var(--warn); }
.stat-active .stat-icon-wrap { background: var(--ok-bg); color: var(--ok); }
.stat-total .stat-icon-wrap { background: var(--blue-l); color: var(--blue); }
.stat-number {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--mute);
  font-weight: 500;
}

/* Navigation Sub-Tabs in Admin */
.sub {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid var(--line);
  margin: 0.5rem 0 1.5rem;
  padding-bottom: 0;
}
.sub::-webkit-scrollbar {
  display: none;
}
.sub a {
  white-space: nowrap;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: var(--mute);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
}
.sub a:hover {
  color: var(--blue);
}
.sub a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Tables */
.modern-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
}
.modern-table th {
  background: #f9fbfe;
  color: var(--mute);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.modern-table td {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid var(--line-light);
  vertical-align: middle;
}
.modern-table tr:hover td {
  background: #fbfdff;
}
.coin-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.coin-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}
.addr-snippet code, .tx-hash-badge {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.825rem;
  background: var(--mist);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}
.time-ago {
  font-size: 0.85rem;
  color: var(--mute);
}
.user-table-link strong {
  display: block;
  color: var(--ink);
}
.user-sub-id {
  font-size: 0.8rem;
  color: var(--mute);
}
.row-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.status-toggle-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* File Upload in Form */
.file-upload-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.current-icon-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  border: 1px solid var(--line);
  padding: 2px;
}

/* Modal Dialog */
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(92vw, 440px);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog::backdrop {
  background: rgba(15, 27, 61, 0.5);
  backdrop-filter: blur(2px);
}
dialog[open] {
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-inner {
  padding: 1.75rem;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.modal-close-x {
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--mute);
  cursor: pointer;
  padding: 0 0.25rem;
  border-radius: 4px;
}
.modal-close-x:hover {
  color: var(--ink);
}
.tick {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.5s 0.15s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
  color: var(--mute);
  font-size: 0.875rem;
  text-align: center;
  background: #fff;
  margin-top: auto;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
  .mobile-menu-drawer, .mobile-backdrop {
    display: block;
  }
  .wrap {
    width: min(100% - 1.75rem, 1020px);
    padding: 1.5rem 0 2.5rem;
  }
  form.f.wide {
    grid-template-columns: 1fr;
  }
  .payment-address-wrap {
    grid-template-columns: 1fr;
  }
  .qr-container {
    max-width: 200px;
    margin: 0 auto 1rem;
  }
}

@media (max-width: 480px) {
  .wrap {
    width: min(100% - 1.25rem, 1020px);
    padding: 1rem 0 2rem;
  }
  .card {
    padding: 1.15rem 1rem;
    border-radius: 10px;
  }
  .auth-card {
    padding: 1.35rem 1rem;
  }
  .addr-box {
    flex-direction: column;
  }
  .profile-header-content {
    flex-direction: column;
    text-align: center;
  }
  .user-meta-sub {
    justify-content: center;
  }
  .fact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .fact-row dd {
    text-align: left;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .file-upload-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .crypto-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Portal Login Styles */
.admin-auth-wrapper {
  max-width: 440px;
  margin: 3rem auto 4rem;
}
.admin-card {
  border: 1px solid #c7d7ef;
  box-shadow: 0 12px 36px rgba(10, 25, 65, 0.12);
  background: #ffffff;
  position: relative;
  overflow: hidden;
}
.admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #183e92, #3b6bdc, #107e46);
}
.admin-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f0f4fa;
  border: 1px solid #d0ddee;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--blue-d);
  margin: 0 auto;
}
.admin-shield-icon {
  font-size: 1rem;
}
.btn-admin-auth {
  background: #153578;
  border-color: #153578;
  color: #fff;
  padding: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn-admin-auth:hover {
  background: #0f275a;
  border-color: #0f275a;
}
.admin-auth-security-notice {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-light);
}

/* Table Scrolling and Responsive Mobile Card List */
.scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin-bottom: 0.5rem;
}
.scroll::-webkit-scrollbar {
  height: 6px;
}
.scroll::-webkit-scrollbar-thumb {
  background: #c3d2e8;
  border-radius: 4px;
}
.desktop-table-view {
  display: block;
}
.mobile-card-list {
  display: none;
}

@media (max-width: 680px) {
  .desktop-table-view {
    display: none !important;
  }
  .mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .mobile-data-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.1rem;
    box-shadow: 0 2px 6px rgba(15, 27, 61, 0.04);
  }
  .mobile-data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--line-light);
  }
  .mobile-card-title {
    font-size: 1.05rem;
    color: var(--ink);
  }
  .mobile-data-card-body {
    display: grid;
    gap: 0.5rem;
    font-size: 0.9rem;
  }
  .mobile-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }
  .field-label {
    color: var(--mute);
    font-size: 0.85rem;
    font-weight: 500;
  }
  .field-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
  }
  .mobile-data-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.85rem;
    margin-top: 0.85rem;
    border-top: 1px solid var(--line-light);
  }
  .btn.full-width {
    width: 100%;
    justify-content: center;
  }
}

/* Admin Notification Bell & Popover Dropdown */
.notif-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notif-bell-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}
.notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.notif-badge-pill {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #183e92;
}
.notif-pulse {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e53e3e;
  opacity: 0.6;
  animation: notifPulse 2s infinite ease-out;
  pointer-events: none;
}
@keyframes notifPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -10px;
  width: 330px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(10, 25, 65, 0.22);
  border: 1px solid var(--line);
  z-index: 150;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.notif-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.notif-dropdown-header {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
}
.notif-dropdown-body {
  max-height: 300px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-light);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}
.notif-item:hover {
  background: #f4f8fe;
}
.notif-item-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.notif-item-info {
  flex: 1;
  line-height: 1.3;
}
.notif-item-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.notif-item-desc {
  font-size: 0.825rem;
  color: var(--mute);
}
.notif-item-time {
  font-size: 0.75rem;
  color: var(--blue);
  margin-top: 0.25rem;
}
.notif-empty {
  padding: 2rem 1rem;
  color: var(--mute);
}
.notif-dropdown-footer {
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-top: 1px solid var(--line-light);
  text-align: center;
}
.notif-dropdown-footer a {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--blue);
}

/* Mobile Bell in Header */
.mobile-header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.mobile-header-bell {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
}
.mobile-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #e53e3e;
  border-radius: 50%;
  border: 1.5px solid #183e92;
}
.mobile-notice-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fef4e5;
  border: 1px solid #f6cf8a;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  color: #8c5302;
  font-size: 0.875rem;
  text-decoration: none;
}

@media (max-width: 768px) {
  .mobile-header-actions {
    display: flex;
  }
}

/* History Controls & Filters */
.history-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-light);
}
.history-filter-tabs {
  display: flex;
  gap: 0.4rem;
  background: var(--mist);
  padding: 0.25rem;
  border-radius: 8px;
}
.filter-tab {
  padding: 0.35rem 0.8rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--mute);
  text-decoration: none;
  transition: all 0.15s ease;
}
.filter-tab.active, .filter-tab:hover {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.history-search-form {
  margin: 0;
}
.search-input-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.history-search-input {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
  min-width: 220px;
}
.mini-copy-btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.95rem;
  opacity: 0.65;
  transition: opacity 0.15s ease;
}
.mini-copy-btn:hover {
  opacity: 1;
}

@media (max-width: 580px) {
  .history-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .history-filter-tabs {
    justify-content: space-between;
  }
  .search-input-wrap {
    width: 100%;
  }
  .history-search-input {
    min-width: 0;
    flex: 1;
  }
}

/* Animated Red & Green Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 440px;
  width: calc(100% - 2.5rem);
}

.toast-card {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem 1.15rem;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(10, 25, 65, 0.28);
  position: relative;
  overflow: hidden;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
.toast-card.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-card.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Green Success Toast */
.toast-card.toast-success {
  background: #0c361e;
  border: 1.5px solid #168a4e;
  color: #ffffff;
}
.toast-success .toast-icon {
  background: #107e46;
  color: #ffffff;
}
.toast-success .toast-title {
  color: #a4f5c6;
}
.toast-success .toast-message {
  color: #f0fbf5;
}
.toast-success .toast-progress-fill {
  background: #27d071;
}

/* Red Error / Alert Toast */
.toast-card.toast-error {
  background: #3d1010;
  border: 1.5px solid #cb2828;
  color: #ffffff;
}
.toast-error .toast-icon {
  background: #c52727;
  color: #ffffff;
}
.toast-error .toast-title {
  color: #ffb5b5;
}
.toast-error .toast-message {
  color: #fff2f2;
}
.toast-error .toast-progress-fill {
  background: #ff5454;
}

.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.toast-content {
  flex: 1;
  line-height: 1.35;
}
.toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 0.25rem;
}
.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-word;
}
.toast-close-btn {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.toast-close-btn:hover {
  color: #ffffff;
}
.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
}
.toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress 5s linear forwards;
}
.toast-card:hover .toast-progress-fill {
  animation-play-state: paused;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 540px) {
  .toast-container {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
    width: auto;
  }
}

/* PWA App Install Banner (Floating Compact Card) */
.pwa-install-banner,
#install.install {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 440px;
  width: auto;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
  from {
    transform: translateY(60px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-install-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(24, 62, 146, 0.16);
  box-shadow: 0 12px 32px -4px rgba(15, 27, 61, 0.2), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pwa-install-icon,
#install img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 27, 61, 0.12);
}

.pwa-install-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.pwa-install-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.pwa-install-desc {
  font-size: 0.8rem;
  color: var(--mute);
  margin-top: 2px;
  line-height: 1.3;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-btn-action {
  padding: 0.45rem 1rem !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
  white-space: nowrap;
}

.pwa-btn-dismiss {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f4f9;
  color: #64748b;
  border: none;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pwa-btn-dismiss:hover {
  background: #e2e8f0;
  color: var(--ink);
}

@media (max-width: 540px) {
  .pwa-install-banner,
  #install.install {
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: none;
    width: auto;
  }
  .pwa-install-card {
    padding: 0.65rem 0.85rem;
    gap: 0.65rem;
  }
}
