/* ═══════════════════════════════════════════════
   PayQRIS — E-Wallet Style CSS
   Base font: 13px | Professional & clean
   ═══════════════════════════════════════════════ */

:root {
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #eff6ff;
  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --warning:        #d97706;
  --warning-light:  #fffbeb;
  --info:           #0284c7;
  --info-light:     #f0f9ff;
  --text:           #111827;
  --text-muted:     #6b7280;
  --border:         #e5e7eb;
  --bg:             #f9fafb;
  --bg-white:       #ffffff;
  --sidebar-w:      220px;
  --header-h:       54px;
  --radius:         10px;
  --shadow:         0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
}

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

html { font-size: 13px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.page-content {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #1e293b;
  color: #cbd5e1;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-brand a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sidebar-brand-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; flex-shrink: 0; }
.sidebar-brand-text { font-weight: 700; font-size: 13px; color: white; }
.sidebar-brand-sub  { font-size: 10px; color: #64748b; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #475569; padding: 8px 8px 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  position: relative;
  cursor: pointer;
}
.nav-item i { width: 16px; font-size: 13px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--primary); color: white; }

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 8px; }
.sidebar-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: #64748b; }
.sidebar-logout { color: #64748b; padding: 4px; border-radius: 6px; flex-shrink: 0; }
.sidebar-logout:hover { color: #ef4444; text-decoration: none; }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.topbar-title { font-size: 14px; font-weight: 700; }
.hamburger { display: none; background: none; border: none; font-size: 18px; cursor: pointer; padding: 6px; color: var(--text); border-radius: 8px; }
.hamburger:hover { background: var(--bg); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-balance { background: var(--primary-light); color: var(--primary); padding: 5px 10px; border-radius: 8px; font-weight: 700; font-size: 12px; }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 12px; }

/* ── Wallet Card ─────────────────────────────────── */
.wallet-card {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 16px;
  color: white;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(37,99,235,.3);
}
.wallet-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.wallet-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.wallet-label { font-size: 11px; opacity: .8; margin-bottom: 2px; }
.wallet-balance { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.wallet-logo { width: 44px; height: 44px; background: rgba(255,255,255,.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.wallet-accnum { font-size: 16px; font-weight: 700; letter-spacing: 3px; display: flex; align-items: center; gap: 8px; }
.copy-btn-white { background: rgba(255,255,255,.2); border: none; color: white; cursor: pointer; border-radius: 6px; padding: 3px 6px; font-size: 11px; }
.copy-btn-white:hover { background: rgba(255,255,255,.3); }

/* Mini wallet strip */
.wallet-mini {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 12px;
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(37,99,235,.25);
}

/* ── Quick Actions ───────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; flex: 1; min-width: 60px; }
.quick-action-btn:hover { text-decoration: none; }
.qa-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.qa-blue   { background: var(--primary-light); color: var(--primary); }
.qa-green  { background: var(--success-light); color: var(--success); }
.qa-orange { background: var(--warning-light); color: var(--warning); }
.qa-purple { background: #f3e8ff; color: #7c3aed; }
.quick-action-btn span { font-size: 11px; font-weight: 600; color: var(--text); }

/* ── Transfer Layout ─────────────────────────────── */
.transfer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Profile Grid ────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Stats Grid ──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  min-width: 0;
}
.stat-icon {
  width: 38px; height: 38px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 15px; flex-shrink: 0;
}
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-value { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Card ────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: white;
  gap: 8px;
  flex-wrap: wrap;
}
.card-title { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.card-title i { color: var(--primary); }
.card-body { padding: 16px; }
.mb-3 { margin-bottom: 12px; }

/* ── Tables ──────────────────────────────────────── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th { background: var(--bg); padding: 9px 12px; font-weight: 600; font-size: 11px; color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 5px; color: var(--text); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--text);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: #9ca3af; }
.form-control:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none; line-height: 1.4;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success   { background: var(--success); color: white; }
.btn-danger    { background: var(--danger); color: white; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-block     { width: 100%; justify-content: center; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-xs        { padding: 3px 7px; font-size: 11px; border-radius: 6px; }

/* ── Alerts ──────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; }
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--info-light);    color: #075985; border: 1px solid #bae6fd; }

/* ── Badges ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.badge-sukses  { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-gagal   { background: #fee2e2; color: #991b1b; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-dibatalkan { background: #f3f4f6; color: #6b7280; }

/* ── Page header ─────────────────────────────────── */
.page-header { margin-bottom: 18px; }
.page-header h1 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.page-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Divider ─────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── Copy button ─────────────────────────────────── */
.copy-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 3px 5px; border-radius: 4px; font-size: 12px; }
.copy-btn:hover { color: var(--primary); background: var(--primary-light); }

/* ── Auth Pages ──────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }
.auth-card { background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-icon { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), #7c3aed); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; margin: 0 auto 12px; }
.auth-logo h1 { font-size: 20px; font-weight: 800; color: var(--text); }
.auth-logo p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 12px; margin: 16px 0; position: relative; }
.auth-divider::before,.auth-divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ── Utility ─────────────────────────────────────── */
.text-xs     { font-size: 11px; }
.text-sm     { font-size: 12px; }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.font-bold   { font-weight: 700; }
.font-mono   { font-family: 'Courier New', monospace; }
.flex        { display: flex; }
.items-center{ align-items: center; }
.gap-2       { gap: 8px; }
.mb-3        { margin-bottom: 12px; }

/* ── Mobile Nav ──────────────────────────────────── */
.mobile-nav { display: none; }

/* ── Mobile Overlay ──────────────────────────────── */
@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }

  .mobile-nav {
    display: block;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 90;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  }
  .mobile-nav-inner { display: flex; }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 8px 4px 10px; gap: 3px;
    color: var(--text-muted); font-size: 10px; text-decoration: none;
    transition: color .15s;
    border-top: 2px solid transparent;
  }
  .mobile-nav-item i { font-size: 18px; }
  .mobile-nav-item.active { color: var(--primary); border-top-color: var(--primary); }

  .page-content { padding: 14px; padding-bottom: 72px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .transfer-layout { grid-template-columns: 1fr; }

  .wallet-card { border-radius: 12px; padding: 16px; }
  .wallet-balance { font-size: 22px; }

  .quick-actions { gap: 8px; }
  .qa-icon { width: 44px; height: 44px; font-size: 16px; }

  table { font-size: 11px; }
  thead th { padding: 7px 8px; }
  tbody td { padding: 8px; }

  .card-header { padding: 10px 12px; }
  .card-body { padding: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .wallet-accnum { font-size: 13px; letter-spacing: 2px; }
  .topbar { padding: 0 12px; }
  .page-header h1 { font-size: 16px; }
}
