:root {
  --bg: #F5F0E8;
  --surface: #FFFBF5;
  --card: #FFFFFF;
  --primary: #8B3A3A;
  --primary-dark: #6B2A2A;
  --primary-light: rgba(139, 58, 58, 0.1);
  --secondary: #C19E6D;
  --accent: #D4A574;
  --success: #5B8C5A;
  --danger: #8B1A1A;
  --warning: #C19E6D;
  --text: #2C1810;
  --text-muted: #8B7355;
  --border: #E0D5C5;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(44, 24, 16, 0.08);
  --accent-gold: #C19E6D;
  --accent-red: #8B1A1A;
  --bg-light: #FAF5EB;
  --text-light: #FFFFFF;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-screen {
  max-width: 420px;
  margin: 0 auto;
  padding: 15px 15px 100px 15px;
  min-height: 100vh;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.top-header .logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}
.top-header .logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.top-header .user-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flash-message {
  padding: 12px 15px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.flash-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.flash-error { background: #FFEBEE; color: #8B1A1A; border: 1px solid #EF9A9A; }
.flash-info { background: #FFF3E0; color: #8B5E3C; border: 1px solid #FFCC80; }

.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
  color: var(--text);
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(44, 24, 16, 0.12); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: var(--text-light); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: var(--text-light); }
.btn-success { background: var(--success); color: var(--text-light); }
.btn-warning { background: var(--secondary); color: var(--text-light); }
.btn-purple { background: var(--secondary); color: var(--text-light); }
.btn-inline { display: inline-block; width: auto; margin: 5px; padding: 10px 24px; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stew-grid {
  display: grid;
  gap: 10px;
}
.stew-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.stew-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px var(--primary-light); }
.stew-card:active { transform: scale(0.98); }
.stew-icon {
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 50%;
  flex-shrink: 0;
}
.stew-info { flex: 1; }
.stew-info .stew-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.stew-info .stew-price { font-size: 1.1rem; font-weight: 800; color: var(--primary); margin: 2px 0; }
.stew-info .stew-profit { font-size: 0.8rem; color: var(--text-muted); }
.stew-buy-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.stew-buy-btn:active { transform: scale(0.95); }

.floating-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--card);
  border-top: 2px solid var(--primary);
  padding: 8px 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(44, 24, 16, 0.08);
}
.floating-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.6rem;
  padding: 6px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
  min-width: 48px;
  text-align: center;
  gap: 2px;
}
.floating-nav-item:hover, .floating-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}
.floating-nav-item i {
  font-size: 1.2rem;
  transition: all 0.2s ease;
}
.floating-nav-item.active i {
  color: var(--primary);
}
.floating-nav-item span { font-weight: 500; }

.whatsapp-float {
  position: fixed;
  bottom: 80px;
  right: 15px;
  z-index: 1000;
}
.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
  transition: all 0.3s ease;
}
.whatsapp-btn:hover { transform: scale(1.05); }

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
  text-align: center;
}
.auth-logo { margin-bottom: 24px; }
.auth-logo .icon { font-size: 3.5rem; }
.auth-logo .name { font-size: 1.8rem; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.auth-logo .tagline { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 0 15px;
  box-shadow: 0 8px 30px rgba(44, 24, 16, 0.08);
  border: 1px solid var(--border);
}
.auth-card h2 { text-align: center; font-size: 1.2rem; margin-bottom: 20px; }
.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.auth-btn:active { transform: scale(0.97); }
.auth-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.auth-footer p { color: var(--text-muted); font-size: 0.85rem; }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 700; }

.balance-display {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 12px;
}
.balance-display .amount { font-size: 2rem; font-weight: 800; }
.balance-display .label { font-size: 0.75rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; }

.bank-details {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.bank-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.bank-details .detail-row:last-child { border-bottom: none; }
.bank-details .detail-label { color: var(--text-muted); }
.bank-details .detail-value { font-weight: 700; color: var(--text); }
.reference-note {
  background: var(--danger);
  color: var(--text-light);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 10px;
}

.weekend-badge {
  background: #FFEBEE;
  color: var(--danger);
  border: 1px solid #EF9A9A;
  padding: 10px;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.gift-code-input {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}
.gift-code-input input {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  text-transform: uppercase;
}
.gift-code-input input:focus { border-color: var(--primary); outline: none; }
.gift-code-input button {
  padding: 12px 20px;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.gift-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: var(--text-light);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}
.gift-btn:active { transform: scale(0.97); }

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 90%;
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 50px rgba(44, 24, 16, 0.15);
}
.modal-content h3 { text-align: center; margin-bottom: 15px; color: var(--text); }
.modal-close { float: right; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

.fee-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  font-size: 0.85rem;
}
.fee-row { display: flex; justify-content: space-between; padding: 3px 0; }

.team-member {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
}
.team-member .name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.team-member .detail { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.referral-link-box {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 700; color: var(--text); }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
table th, table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
table tr:hover { background: rgba(139, 94, 60, 0.03); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}
.badge-pending { background: #FFF3E0; color: #8B5E3C; }
.badge-approved { background: #E8F5E9; color: #2E7D32; }
.badge-rejected { background: #FFEBEE; color: #8B1A1A; }
.badge-bank { background: #E3F2FD; color: #1565C0; }
.badge-crypto { background: #F3E8FF; color: #6B21A8; }

.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}
.loading-content {
  background: var(--card);
  padding: 30px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 16px 40px rgba(44, 24, 16, 0.15);
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadingText { font-size: 0.9rem; color: var(--text-muted); }

.copy-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }

.copy-btn-sm {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  vertical-align: middle;
}
.copy-btn-sm:hover { color: var(--primary); background: var(--primary-light); }

.proof-thumb { max-width: 60px; max-height: 50px; border-radius: 4px; cursor: pointer; }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
  .app-screen { padding: 10px 10px 90px 10px; }
  .floating-nav { padding: 5px 5px; }
  .floating-nav-item { font-size: 0.55rem; min-width: 40px; padding: 4px 8px; }
  .floating-nav-item i { font-size: 1.1rem; }
  .whatsapp-float { bottom: 72px; right: 10px; }
  .whatsapp-btn { width: 46px; height: 46px; font-size: 1.2rem; }
}
