/* Index page  */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #080c10;
  --surface: #0f1520;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.13);
  --accent: #00e5a0;
  --accent2: #00b87a;
  --text: #f0f4f8;
  --muted: #637083;
  --error: #ff5c5c;
  --card-bg: rgba(15, 21, 32, 0.92);
}

html,
body {
  height: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ── animated background ── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 229, 160, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(0, 80, 255, 0.07) 0%, transparent 60%),
    var(--bg);
}

.bg-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── floating orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  left: -100px;
  background: rgba(0, 229, 160, 0.07);
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  right: -80px;
  background: rgba(0, 100, 255, 0.06);
  animation-delay: -4s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 60%;
  background: rgba(0, 229, 160, 0.04);
  animation-delay: -8s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(30px, -20px) scale(1.05);
  }
}

/* ── layout ── */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
}

/* ── left panel ── */
.left-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-text {
  padding: 2rem 0;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-title span {
  color: var(--accent);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.stat {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  animation: fadeUp 0.6s ease both;
}

.stat:nth-child(1) {
  animation-delay: 0.1s;
}

.stat:nth-child(2) {
  animation-delay: 0.2s;
}

.stat:nth-child(3) {
  animation-delay: 0.3s;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* mini transaction feed */
.tx-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: slideIn 0.5s ease both;
}

.tx-item:nth-child(1) {
  animation-delay: 0.4s;
}

.tx-item:nth-child(2) {
  animation-delay: 0.55s;
}

.tx-item:nth-child(3) {
  animation-delay: 0.7s;
}

.tx-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-time {
  font-size: 0.68rem;
  color: var(--muted);
}

.tx-amount {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.tx-amount.credit {
  color: var(--accent);
}

.tx-amount.debit {
  color: var(--muted);
}

/* ── right panel (form) ── */
.right-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  overflow-y: auto;
}

.form-card {
  width: 100%;
  max-width: 400px;
  animation: fadeUp 0.5s ease both;
}

.form-header {
  margin-bottom: 2rem;
}

.form-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.form-subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.form-subtitle a:hover {
  text-decoration: underline;
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.8rem;
}

.tab {
  flex: 1;
  padding: 7px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
}

.tab.active {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}

.field {
  margin-bottom: 1.1rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-wrap {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.field-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 13px 12px 40px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.field-input:focus {
  border-color: var(--accent);
  background: rgba(0, 229, 160, 0.04);
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input.error-state {
  border-color: var(--error);
}

.toggle-pw {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.toggle-pw:hover {
  color: var(--text);
}

.field-error {
  font-size: 0.72rem;
  color: var(--error);
  margin-top: 4px;
  display: none;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.forgot a {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.forgot a:hover {
  text-decoration: underline;
}

.btn-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  background: #00ffb0;
}

.btn-submit:active {
  transform: scale(0.99);
}

.btn-submit:disabled {
  background: #1a3d30;
  color: var(--muted);
  cursor: not-allowed;
}

.btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.3rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.alert {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert.error {
  background: rgba(255, 92, 92, 0.08);
  border-color: rgba(255, 92, 92, 0.3);
  color: #ff8080;
}

.alert.success {
  background: rgba(0, 229, 160, 0.08);
  border-color: rgba(0, 229, 160, 0.3);
  color: var(--accent);
}

/* ── animations ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

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

/* ── responsive ── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .left-panel {
    display: none;
  }

  .right-panel {
    padding: 1.5rem;
  }
}


/* ═══════════════════════════════════════════════════════════
   REMMITTAZI — MOBILE RESPONSIVE (FIXED)
   ═══════════════════════════════════════════════════════════ */

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

/* ── TABLET (≤1024px) ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .two-col { grid-template-columns: 1fr !important; }
  .transfer-grid { grid-template-columns: 1fr !important; }
  .inv-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .inv-form-grid { grid-template-columns: 1fr !important; }
  .content { padding: 1.25rem 1.5rem !important; }
  .balance-amount { font-size: 2rem !important; }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {

  /* CRITICAL: Fix scrolling */
  html {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
  }
  body {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
  }
  .app {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }
  .main {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    overflow: visible !important;
    min-height: 0 !important;
    flex: 1 !important;
  }
  .content {
    flex: none !important;
    overflow: visible !important;
    padding: 1rem !important;
    height: auto !important;
  }
  .view.active {
    display: block !important;
    overflow: visible !important;
  }

  /* Sidebar */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 50;
    transition: left 0.25s ease;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { left: 0; }
  .hamburger { display: flex; }

  /* Topbar */
  .topbar {
    padding: 0.75rem 1rem !important;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0 !important;
  }
  .topbar-title { font-size: 0.95rem !important; }
  .date-pill { display: none !important; }

  /* Greeting */
  .greeting { margin-bottom: 1rem !important; }
  .greeting h2 { font-size: 1.15rem !important; }
  .greeting p { font-size: 0.8rem !important; }

  /* Balance card */
  .balance-card { padding: 1.2rem !important; overflow: hidden !important; }
  .balance-amount { font-size: 1.8rem !important; }
  .balance-sub { font-size: 0.72rem !important; margin-bottom: 1rem !important; }
  .balance-actions { flex-wrap: wrap !important; gap: 8px !important; }
  .bal-btn { padding: 8px 12px !important; font-size: 0.78rem !important; }

  /* Currency tabs */
  .currency-tabs { width: 100% !important; justify-content: center !important; }
  .currency-tab { flex: 1 !important; text-align: center !important; padding: 6px 8px !important; font-size: 0.75rem !important; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .stat-card { padding: 0.9rem !important; }
  .stat-card-value { font-size: 1.05rem !important; }
  .stat-card-label { font-size: 0.65rem !important; }

  /* Layouts → single column */
  .two-col,
  .transfer-grid,
  .inv-form-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .inv-stats { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

  /* Panels */
  .panel { padding: 1rem !important; border-radius: 12px !important; margin-bottom: 1rem !important; }
  .panel-header { flex-wrap: wrap !important; gap: 8px !important; }
  .panel-title { font-size: 0.88rem !important; }

  /* Quick actions */
  .quick-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .quick-btn { padding: 12px 8px !important; }

  /* Tables */
  .inv-table, .inv-items-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap !important;
  }
  .inv-table th, .inv-table td { font-size: 0.75rem !important; padding: 7px 8px !important; }

  /* Transaction rows */
  .tx-row { padding: 8px 4px !important; gap: 10px !important; }
  .tx-icon { width: 32px !important; height: 32px !important; font-size: 0.62rem !important; }
  .tx-desc { font-size: 0.78rem !important; }
  .tx-meta { font-size: 0.65rem !important; }
  .tx-amt { font-size: 0.82rem !important; }

  /* Filters */
  .filters-bar { flex-direction: column !important; gap: 8px !important; }
  .search-wrap { min-width: 100% !important; width: 100% !important; }
  .filter-input { width: 100% !important; }

  /* Modals → bottom sheet style */
  .modal-overlay.open { align-items: flex-end !important; padding: 0 !important; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    padding: 1.5rem !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .modal-title { font-size: 1rem !important; }
  .modal-close { right: 1rem !important; top: 1rem !important; }

  /* Forms — 16px prevents iOS zoom */
  .form-input { padding: 13px 14px !important; font-size: 16px !important; }
  .form-select { font-size: 16px !important; }
  .submit-btn { padding: 14px !important; font-size: 0.9rem !important; }
  .amount-input { padding-left: 36px !important; }

  /* Pagination */
  .pagination { flex-direction: column !important; gap: 8px !important; text-align: center !important; }

  /* Inline grid overrides for views with inline styles */
  #view-vouchers > .greeting + div { display: flex !important; flex-direction: column !important; gap: 1rem !important; }
  #view-profile > div[style*="grid-template-columns"] { display: flex !important; flex-direction: column !important; gap: 1rem !important; }
  #view-settings > div[style*="grid-template-columns"] { display: flex !important; flex-direction: column !important; gap: 1rem !important; }
  #view-tax > div[style*="grid-template-columns"] { display: flex !important; flex-direction: column !important; gap: 1rem !important; }

  /* Detail rows */
  .detail-row { font-size: 0.8rem !important; padding: 7px 0 !important; }

  /* Copy feedback */
  .copy-feedback { font-size: 0.78rem !important; padding: 8px 16px !important; bottom: 20px !important; }
}

/* ── SMALL PHONE (≤400px) ── */
@media (max-width: 400px) {
  .balance-amount { font-size: 1.4rem !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .inv-stats { grid-template-columns: 1fr !important; }
  .balance-actions { flex-direction: column !important; }
  .bal-btn { width: 100% !important; justify-content: center !important; }
  .quick-grid { grid-template-columns: 1fr 1fr !important; }
  .currency-tab { font-size: 0.7rem !important; padding: 5px 6px !important; }
  .stat-card-value { font-size: 0.95rem !important; }
  .topbar-title { font-size: 0.85rem !important; }
}