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

:root {
  --primary: #0a5c36;
  --primary-dark: #07452a;
  --primary-light: #0e7a48;
  --accent: #c8a96e;
  --accent-dark: #b8954f;
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --bg-dark: #1a1f2e;
  --text: #1a1f2e;
  --text-light: #6b7280;
  --text-white: #ffffff;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

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

.view { display: none !important; }
.view.active { display: block !important; }

/* Auth - Split Layout */
.auth-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.auth-hero {
  flex: 1;
  background: linear-gradient(135deg, #064e2a 0%, #0a5c36 40%, #0e7a48 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.hero-content {
  max-width: 480px;
}

.hero-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2.5rem;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  font-weight: 500;
}

.hf-icon {
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.auth-form-section {
  width: 100%;
  max-width: 480px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-header { margin-bottom: 1.5rem; text-align: left; }

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-text h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.logo-text p { font-size: 0.85rem; color: var(--text-light); margin-top: 0.15rem; }

.logo-icon-sm {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 0.7rem; border: none; background: var(--bg); cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--text-light); transition: all 0.2s; }
.tab-btn.active { background: var(--primary); color: white; }
.tab-btn:hover:not(.active) { background: #e5e7eb; }

.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.8rem; color: var(--text-light); }

.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; color: var(--text-light); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.75rem; border: none; border-radius: var(--radius-sm);
  background: #5865F2; color: white; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.btn-discord:hover { background: #4752C4; }

.cmd-box {
  background: #1a1f2e; color: #a8f0a8; padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm); font-family: 'Courier New', monospace;
  font-size: 1rem; user-select: all; word-break: break-all;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text); }
.form-group input, .form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}
.form-group input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,92,54,0.1); }

.btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }

.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 0.75rem; text-align: center; }
.result-msg { color: var(--success); font-size: 0.85rem; margin-top: 0.75rem; }
.transfer-user-item:hover { background: var(--bg); }

/* Navbar */
.navbar {
  background: var(--bg-dark);
  color: white;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 0.75rem; }
.nav-logo-img { height: 32px; width: auto; object-fit: contain; }
.nav-title { font-size: 1.1rem; font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 1rem; }
.nav-greeting { font-size: 0.9rem; color: #9ca3af; }

/* Layout */
.app-layout { 
  display: flex; 
  margin-top: 56px; 
  min-height: calc(100vh - 56px); 
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--bg); color: var(--primary); }
.nav-item.active { background: rgba(10,92,54,0.08); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 0.8rem; width: 20px; text-align: center; }

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 1.5rem 2rem;
  min-width: 0;
  box-sizing: border-box;
}

.page { display: none; }
.page.active { display: block; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h3 { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 600; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  text-align: center;
}

.stat-label { font-size: 0.8rem; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.35rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }

/* Tables */
.table-wrapper, .transactions-table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th, .table td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-light); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.table tbody tr:hover { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-info { background: #dbeafe; color: #2563eb; }

.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }

/* Account cards in dashboard */
.accounts-list { display: grid; gap: 1rem; }

.account-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.account-card .acct-name { font-weight: 600; font-size: 0.95rem; }
.account-card .acct-type { font-size: 0.8rem; color: var(--text-light); }
.account-card .acct-balance { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.account-card .acct-id { font-size: 0.75rem; color: var(--text-light); }

/* Loan cards */
.loan-card {
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.loan-card .loan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.loan-card .loan-amount { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.loan-card .loan-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; font-size: 0.85rem; color: var(--text-light); }
.loan-card .loan-details span { display: block; }
.loan-card .loan-details strong { color: var(--text); }

/* Savings */
.savings-card {
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.savings-card .savings-name { font-size: 1.1rem; font-weight: 600; }
.savings-card .savings-balance { font-size: 2rem; font-weight: 700; margin: 0.5rem 0; }
.savings-card .savings-rate { font-size: 0.9rem; opacity: 0.85; }

/* Admin */
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Verify View */
.verify-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 2rem;
  background: var(--bg);
}

.verify-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.verify-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.verify-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.verify-details {
  margin-bottom: 1rem;
}

.verify-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.verify-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.command-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a1f2e;
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  margin-bottom: 1rem;
}

.command-box code {
  flex: 1;
  color: #a8f0a8;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  user-select: all;
  word-break: break-all;
}

.command-box .btn {
  white-space: nowrap;
}

.verify-note {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .auth-page { flex-direction: column; }
  .auth-hero { padding: 2rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-features { gap: 0.75rem; }
  .hero-feature { font-size: 0.9rem; }
  .auth-form-section { width: 100%; min-width: unset; padding: 2rem; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1rem; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 0; }
  .auth-form-section { padding: 1.5rem; }
}

/* Chat overlay */
.chat-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-container {
  width: 420px;
  max-width: 90vw;
  height: 520px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.chat-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f8f9fa;
}

.chat-msg {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  max-width: 80%;
  font-size: 0.88rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg-bot {
  background: #e9ecef;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg-user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  display: flex;
  padding: 0.75rem;
  gap: 0.5rem;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
}


