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

:root {
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --secondary: #047857;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --radius: 12px;
}

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

.hidden { display: none !important; }

/* ================= AUTH PAGE ================= */
.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  background: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
}

.logo { text-align: center; margin-bottom: 24px; }
.logo h1 { font-size: 28px; color: var(--primary); }
.logo p { color: var(--text-light); font-size: 14px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ================= FORMS ================= */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ================= BUTTONS ================= */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: #065f46; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
  background: var(--danger);
  color: white;
}

.btn-small:hover { background: #b91c1c; }

/* ================= NAVBAR ================= */
.navbar {
  background: var(--card);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links span { font-weight: 500; }
.nav-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ================= DASHBOARD ================= */
.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ================= ACCOUNTS ================= */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.account-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  border-radius: var(--radius);
  position: relative;
}

.account-card.savings {
  background: linear-gradient(135deg, var(--secondary) 0%, #065f46 100%);
}

.account-card.frozen {
  background: linear-gradient(135deg, var(--warning) 0%, #92400e 100%);
}

.account-card.closed {
  background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
}

.account-card .acc-type {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}

.account-card .acc-number {
  font-size: 18px;
  font-family: monospace;
  margin: 8px 0;
  letter-spacing: 2px;
}

.account-card .acc-balance {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.account-card .acc-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ================= ACTIONS ================= */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.action-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.action-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.action-icon { font-size: 32px; }

/* ================= TRANSACTIONS ================= */
.transactions-list {
  max-height: 400px;
  overflow-y: auto;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.tx-item:last-child { border-bottom: none; }

.tx-info { display: flex; flex-direction: column; gap: 2px; }
.tx-type {
  font-weight: 600;
  font-size: 14px;
}
.tx-desc {
  font-size: 13px;
  color: var(--text-light);
}
.tx-date {
  font-size: 12px;
  color: var(--text-light);
}

.tx-amount {
  font-weight: 700;
  font-size: 16px;
  text-align: right;
}

.tx-amount.deposit { color: var(--secondary); }
.tx-amount.withdrawal { color: var(--danger); }
.tx-amount.transfer_out { color: var(--danger); }
.tx-amount.transfer_in { color: var(--secondary); }

/* ================= MODAL ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-content {
  background: var(--card);
  padding: 28px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-content h3 { margin-bottom: 16px; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* ================= MESSAGES ================= */
.message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.message.show { display: block; }
.message.success { background: #d1fae5; color: #065f46; }
.message.error { background: #fee2e2; color: #991b1b; }

.demo-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
}

.loading {
  color: var(--text-light);
  text-align: center;
  padding: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

/* ================= ADMIN ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}

.stat-card h3 {
  font-size: 32px;
  margin-bottom: 4px;
}

.stat-card p {
  font-size: 14px;
  opacity: 0.9;
}

.admin-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tr:hover { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.active { background: #d1fae5; color: #065f46; }
.badge.frozen { background: #fef3c7; color: #92400e; }
.badge.closed { background: #e5e7eb; color: #374151; }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .actions-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .navbar { padding: 12px 16px; }
  .dashboard { padding: 16px; }
  .auth-box { padding: 24px; }
}
