/* Geneva Heritage Bank — Custom Styles */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #070e1c;
  background-image:
    radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(29, 53, 99, 0.4) 0px, transparent 50%);
  min-height: 100vh;
}

.font-serif { font-family: 'Playfair Display', serif; }

.gold-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.btn-gold {
  background: linear-gradient(180deg, #e6c87a 0%, #d4af37 50%, #b8932b 100%);
  color: #070e1c;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #b8932b;
}
.btn-gold:hover { box-shadow: 0 0 20px rgba(212, 175, 55, 0.4); transform: translateY(-1px); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: #e6c87a;
  border: 1px solid #d4af37;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-outline:hover { background: rgba(212, 175, 55, 0.1); }

.btn-ghost {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #1d3563;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-ghost:hover { background: #10203c; color: white; }

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  border-radius: 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.card-dark {
  background: linear-gradient(180deg, #10203c 0%, #0b1426 100%);
  border: 1px solid #1d3563;
  border-radius: 0.75rem;
  color: #e2e8f0;
}

.input {
  width: 100%;
  background: #0b1426;
  border: 1px solid #1d3563;
  color: white;
  padding: 0.625rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.input:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}
.input.light {
  background: white;
  color: #0f172a;
  border-color: #e2e8f0;
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-dark { color: #475569; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-pending { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-completed, .badge-approved { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rejected { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7, 14, 28, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; backdrop-filter: blur(4px);
}
.modal-box {
  background: linear-gradient(180deg, #10203c 0%, #0b1426 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Receipt printable */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; color: black !important; }
  .receipt { box-shadow: none !important; border: 1px solid #000 !important; }
}

.receipt {
  background: white;
  color: #0f172a;
  border-radius: 0.5rem;
  padding: 2.5rem;
  max-width: 640px;
  margin: 2rem auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

table.tx-table {
  width: 100%;
  border-collapse: collapse;
}
table.tx-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 1px solid #1d3563;
}
table.tx-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #1d3563;
}
table.tx-table tr:hover td {
  background: rgba(29, 53, 99, 0.3);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: #1d3563;
  border-radius: 24px; transition: .3s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .3s;
}
input:checked + .toggle-slider { background: #d4af37; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* =========================================================
   APP SHELL — Responsive sidebar + main layout
   ========================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-sidebar {
  width: 18rem;
  background: #0b1426;
  border-right: 1px solid #16294f;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
.app-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #0b1426;
  border-bottom: 1px solid #16294f;
  position: sticky;
  top: 0;
  z-index: 40;
}
.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid #1d3563;
  color: #cbd5e1;
  padding: 0.4rem 0.7rem;
  border-radius: 0.375rem;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,14,28,0.7);
  backdrop-filter: blur(2px);
  z-index: 49;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 1023px) {
  /* CRITICAL: switch from flex-row to block so the sidebar can be
     position:fixed without reserving horizontal space in the layout. */
  .app-shell {
    display: block;
    min-height: 100vh;
  }
  .mobile-topbar { display: flex; }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 17rem;
    max-width: 85vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    /* Remove the sticky positioning that was reserving flex space */
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-main {
    width: 100%;
    max-width: 100%;
    margin-left: 0;       /* explicitly: no offset on mobile */
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .app-sidebar { width: 16rem; max-width: 80vw; }
  .input { font-size: 16px; } /* prevent iOS zoom on focus */
  table.tx-table th,
  table.tx-table td { padding: 0.5rem 0.6rem; font-size: 0.78rem; }
  .modal-box { padding: 1.25rem; }
}

/* =========================================================
   UNIVERSAL PRO MODAL — used across all pages, user + admin
   Logo-branded, smooth animation, fully responsive
   ========================================================= */
.gh-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 28, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.gh-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.gh-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #10203c 0%, #0b1426 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 1rem;
  box-shadow: 0 25px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.1) inset;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  overflow: hidden;
}
.gh-modal-overlay.show .gh-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gh-modal-header {
  background: linear-gradient(180deg, rgba(212,175,55,0.08) 0%, transparent 100%);
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}
.gh-modal-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: rgba(7, 14, 28, 0.6);
  border: 2px solid rgba(212,175,55,0.4);
  padding: 8px;
  animation: gh-modal-logo-pulse 2.5s ease-in-out infinite;
}
.gh-modal-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes gh-modal-logo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(212,175,55,0); }
}
.gh-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #fff;
  margin: 0 0 0.25rem;
}
.gh-modal-brand {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d4af37;
}

.gh-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.gh-modal-icon.success { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.gh-modal-icon.error   { background: rgba(244,63,94,0.15);  color: #fb7185; border: 1px solid rgba(244,63,94,0.3); }
.gh-modal-icon.info    { background: rgba(212,175,55,0.15); color: #e6c87a; border: 1px solid rgba(212,175,55,0.3); }

.gh-modal-body {
  padding: 1.25rem 1.5rem;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}
.gh-modal-actions {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.gh-modal-actions .btn-gold,
.gh-modal-actions .btn-ghost,
.gh-modal-actions .btn-outline {
  min-width: 120px;
}
.gh-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #1d3563;
  background: rgba(7,14,28,0.5);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.gh-modal-close:hover { color: #fff; border-color: #d4af37; }

/* =========================================================
   COUNTRY SEARCH SELECT
   ========================================================= */
.country-select {
  position: relative;
}
.country-select .country-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #0b1426;
  border: 1px solid #1d3563;
  border-radius: 0.375rem;
  padding: 4px;
  margin: 0;
  list-style: none;
  z-index: 60;
  display: none;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.country-select.open .country-options { display: block; }
.country-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background 0.15s;
}
.country-option img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border: 1px solid #1d3563;
  flex-shrink: 0;
}
.country-option:hover,
.country-option.highlight {
  background: rgba(212,175,55,0.1);
  color: #fff;
}
.country-option.hidden { display: none; }

/* =========================================================
   LANGUAGE SWITCHER — small refinements
   ========================================================= */
.lang-menu li a img { border-radius: 2px; }

/* =========================================================
   HOMEPAGE small touches
   ========================================================= */
@media (max-width: 768px) {
  .receipt { padding: 1.25rem; margin: 0.5rem; }
}

/* =========================================================
   GLOBAL MOBILE FIT — applied across the whole site
   so every post-login page fits in a phone browser
   ========================================================= */

/* Prevent horizontal scroll across the whole document */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Make all images and media fluid */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* Long numbers / IBANs / emails should never blow out a row */
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 1023px) {
  /* Reduce default page padding inside .app-main on tablets */
  .app-main > div { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 640px) {
  /* Tighter outer padding on phones so cards use full width */
  .app-main > div { padding: 0.875rem !important; }

  /* All cards on phones: less padding, less rounded, full-width feel */
  .card, .card-dark {
    border-radius: 0.6rem;
  }

  /* Forms: full-width buttons by default on phones unless explicitly sized */
  .btn-gold, .btn-outline, .btn-ghost {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  /* Stack any flex row whose children are too wide */
  .stack-on-mobile { flex-direction: column !important; align-items: stretch !important; }
  .stack-on-mobile > * { width: 100% !important; }

  /* Large balance / hero numbers: shrink + wrap */
  .text-5xl { font-size: 2rem !important; line-height: 1.1 !important; word-break: break-all; }
  .text-4xl { font-size: 1.75rem !important; line-height: 1.15 !important; word-break: break-all; }
  .text-3xl { font-size: 1.5rem !important; line-height: 1.2 !important; }

  /* Modals: smaller padding, tighter title */
  .gh-modal-header { padding: 1.1rem 1rem 0.75rem; }
  .gh-modal-body   { padding: 0.9rem 1rem; font-size: 0.9rem; }
  .gh-modal-actions { padding: 0 1rem 1.1rem; }
  .gh-modal-title  { font-size: 1.15rem; }
  .gh-modal-logo   { width: 56px; height: 56px; }
  .gh-modal-icon   { width: 44px; height: 44px; font-size: 1.15rem; }
  .gh-modal-actions .btn-gold,
  .gh-modal-actions .btn-ghost,
  .gh-modal-actions .btn-outline { min-width: 0; width: 100%; }

  /* Tables: force horizontal scroll instead of overflow.
     Wrap every <table> in its own scroll container via display:block + overflow */
  table.tx-table,
  table:not(.tx-table) {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  table.tx-table thead,
  table.tx-table tbody,
  table.tx-table tr { display: table; width: 100%; table-layout: auto; }
  table.tx-table th,
  table.tx-table td {
    padding: 0.5rem 0.55rem !important;
    font-size: 0.75rem !important;
  }

  /* Long monospace numbers (card PAN, account, IBAN) wrap nicely */
  .font-mono, code, pre { word-break: break-all; }

  /* Inputs: bigger tap targets, no iOS zoom */
  .input, select.input, textarea.input { font-size: 16px !important; padding: 0.7rem 0.85rem; }
  .label { font-size: 0.7rem; }

  /* Page header titles never overflow */
  h1, h2, h3 { word-break: break-word; }

  /* Buttons in toolbars wrap */
  .actions-row, .toolbar-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .actions-row > a, .actions-row > button,
  .toolbar-row > a, .toolbar-row > button { flex: 1 1 auto; min-width: 0; }

  /* Receipt printable — readable on phones */
  .receipt {
    padding: 1rem !important;
    margin: 0 !important;
    border-radius: 0.4rem;
    box-shadow: none;
  }
  .receipt table th, .receipt table td { padding: 0.4rem 0.3rem !important; font-size: 0.75rem !important; }

  /* Country select dropdown sized for phone */
  .country-select .country-options { max-height: 220px; }

  /* Login PIN / OTP field: keep large enough, but never wider than viewport */
  input[type="tel"], input[inputmode="numeric"] {
    letter-spacing: 0.3em !important;
    font-size: 1.25rem !important;
  }

  /* Sidebar nav links a touch tighter */
  .app-sidebar nav a { padding: 0.65rem 0.85rem; font-size: 0.85rem; }

  /* Card visual (the virtual credit card preview) shrinks on phones */
  .virtual-card { aspect-ratio: 1.586 / 1; padding: 1rem !important; }
  .virtual-card .text-2xl { font-size: 1.1rem !important; }
  .virtual-card .tracking-widest { letter-spacing: 0.08em !important; }
}

/* Very small phones (≤ 380px) — last-mile fixes */
@media (max-width: 380px) {
  .app-main > div { padding: 0.65rem !important; }
  .text-5xl { font-size: 1.7rem !important; }
  .text-4xl { font-size: 1.45rem !important; }
  .gh-modal-title { font-size: 1.05rem; }
  .app-sidebar { width: 16rem; }
  .btn-gold, .btn-outline, .btn-ghost { font-size: 0.85rem; padding: 0.6rem 0.85rem; }
  .label { font-size: 0.65rem; }
}
