/* Ghana Savings Collector - Production */
:root {
  --primary: #4b0082;
  --primary-light: #6b2aa8;
  --primary-dark: #36005e;
  --bg: #E5E4E2;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #d0d0d0;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 2px 8px rgba(75, 0, 130, 0.08);
  --shadow-lg: 0 8px 24px rgba(75, 0, 130, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh;
}

.icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }
.icon-primary { stroke: var(--primary); }
.icon-white { stroke: #fff; }
.icon-muted { stroke: var(--text-muted); }
.icon-success { stroke: var(--success); }
.icon-danger { stroke: var(--danger); }

.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-padded { padding-bottom: 80px; }

/* Header */
.header {
  background: var(--primary); color: #fff; padding: 16px;
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.header-content {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.header-title {
  font-size: 1.1rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm); transition: background 0.2s;
}
.header-btn:hover { background: rgba(255,255,255,0.15); }

/* Cards */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.85rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: none; border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; width: 100%; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: rgba(75, 0, 130, 0.05); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.875rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-md); font-size: 1rem; background: var(--surface);
  color: var(--text); transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.1); }
.input-group { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon + .form-input { padding-left: 44px; }
.input-action { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; }

.link { color: var(--primary); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* Auth */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon {
  width: 64px; height: 64px; background: var(--primary);
  border-radius: var(--radius-lg); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 16px;
}
.auth-logo h1 { font-size: 1.5rem; color: var(--primary); font-weight: 700; }
.auth-logo p { color: var(--text-secondary); margin-top: 4px; font-size: 0.95rem; }
.auth-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow-lg); }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 0.9rem; }

/* Plan selection */
.plan-options { display: flex; gap: 10px; margin-bottom: 16px; }
.plan-option {
  flex: 1; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); cursor: pointer; text-align: center; transition: all 0.2s;
}
.plan-option:hover { border-color: var(--primary); }
.plan-option.active { border-color: var(--primary); background: rgba(75, 0, 130, 0.06); }
.plan-option input { display: none; }
.plan-option-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.plan-option-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow); text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin: 8px 0 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* Progress */
.progress-section { margin: 16px 0; }
.progress-bar-bg { width: 100%; height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 6px; transition: width 0.6s ease; }
.progress-info { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.85rem; color: var(--text-secondary); }

/* Payment methods */
.payment-methods { display: flex; flex-direction: column; gap: 10px; }
.payment-method {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: var(--text);
}
.payment-method:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.payment-method.active { border-color: var(--primary); background: rgba(75, 0, 130, 0.04); }
.payment-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: rgba(75, 0, 130, 0.08); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.payment-icon .icon { stroke: var(--primary); }
.payment-info h3 { font-size: 1rem; font-weight: 600; }
.payment-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.payment-check {
  margin-left: auto; width: 22px; height: 22px;
  border: 2px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.payment-method.active .payment-check { background: var(--primary); border-color: var(--primary); }
.payment-method.active .payment-check svg { opacity: 1 !important; display: block !important; }

/* Lists */
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bg); }
.list-item:last-child { border-bottom: none; }
.list-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: rgba(75, 0, 130, 0.08); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.list-content { flex: 1; min-width: 0; }
.list-title { font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.list-action { font-weight: 600; font-size: 0.95rem; color: var(--primary); }
.list-action.success { color: var(--success); }
.list-action.danger { color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-md); margin-bottom: 16px; }
.tab { flex: 1; padding: 10px; border: none; background: none; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--bg);
  padding: 8px 0 16px; z-index: 100; box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.bottom-nav-content { max-width: 480px; margin: 0 auto; display: flex; justify-content: space-around; align-items: center; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 12px; text-decoration: none; color: var(--text-muted);
  font-size: 0.7rem; font-weight: 500; transition: color 0.2s;
  border: none; background: none; cursor: pointer;
}
.nav-item.active { color: var(--primary); }
.nav-item .icon { stroke: currentColor; }

/* Admin */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg);
  border-radius: var(--radius-md); margin-bottom: 12px;
}
.search-bar input { flex: 1; border: none; background: none; font-size: 0.95rem; outline: none; color: var(--text); }
.user-row {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border-radius: var(--radius-lg);
  margin-bottom: 8px; box-shadow: var(--shadow);
}
.user-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.9rem; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.95rem; }
.user-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.user-progress { width: 60px; text-align: right; }
.user-progress-value { font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.user-progress-label { font-size: 0.7rem; color: var(--text-muted); }

/* Amount */
.amount-input-wrapper { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.amount-currency { font-size: 1.2rem; font-weight: 600; color: var(--primary); }
.amount-input { flex: 1; font-size: 2rem; font-weight: 700; text-align: center; border: none; border-bottom: 2px solid var(--border); background: none; color: var(--text); padding: 8px; outline: none; transition: border-color 0.2s; }
.amount-input:focus { border-color: var(--primary); }
.amount-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.amount-preset { padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 0.9rem; font-weight: 500; color: var(--text); cursor: pointer; transition: all 0.2s; }
.amount-preset:hover, .amount-preset.active { border-color: var(--primary); background: rgba(75, 0, 130, 0.06); color: var(--primary); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px; width: 100%; max-width: 480px;
  transform: translateY(100%); transition: transform 0.3s ease-out;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* Toast */
.toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 440px; }
.toast { padding: 14px 18px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 0.9rem; animation: slideDown 0.3s ease; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.w-full { width: 100%; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

@media (min-width: 640px) { .container { max-width: 520px; } .auth-page { padding: 40px 24px; } }
