/* Soephay Dashboard – Fintech-grade UI. Light theme, clear hierarchy, real patterns. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f1f5f9;
  --bg-page: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-light: rgba(15, 118, 110, 0.08);
  --accent: #0ea5e9;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ----- Auth ----- */
#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-page) 100%);
}
.auth-container {
  width: 100%;
  max-width: 400px;
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo { height: 40px; margin-bottom: 1rem; display: block; margin-left: auto; margin-right: auto; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.25rem; color: var(--text); }
.auth-header p { color: var(--text-muted); margin: 0; font-size: 0.9375rem; }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border: 1px solid var(--border);
}
.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tabs .tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.auth-tabs .tab:hover { color: var(--text); }
.auth-tabs .tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-error, .auth-success {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.auth-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.auth-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.auth-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.auth-form input,
.auth-form .auth-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.auth-form input::placeholder { color: var(--text-muted); }
.auth-form .auth-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
  margin-bottom: 0;
}
.auth-form .auth-submit:hover { background: var(--primary-hover); }
.auth-form .auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-form .auth-submit.loading { pointer-events: none; }
.auth-forgot { margin: -0.5rem 0 1rem; text-align: right; font-size: 0.875rem; }
.auth-forgot a { color: var(--primary); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.auth-checkbox input { width: auto; margin: 0.25rem 0 0; flex-shrink: 0; }
.auth-checkbox a { color: var(--primary); text-decoration: none; }
.auth-checkbox a:hover { text-decoration: underline; }
.auth-link { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* ----- App shell ----- */
#dashboard-view { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo-link {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
}
.sidebar-logo { height: 28px; }
.sidebar nav { flex: 1; padding: 0.75rem 0; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  border-right: 3px solid var(--primary);
  margin-right: -1px;
}
.nav-link svg { flex-shrink: 0; opacity: 0.85; }
.sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
}
.nav-link-external {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-link-external:hover { color: var(--primary); }
.sidebar-user {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sidebar-user span { display: block; margin-bottom: 0.5rem; word-break: break-all; }
#btn-logout {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
#btn-logout:hover { color: var(--danger); background: var(--danger-bg); border-color: #fecaca; }

/* ----- Main content ----- */
.main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  background: var(--bg-page);
}
.main h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ----- Cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}
.card h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 0.75rem; }

/* ----- Balance hero (Home & Wallet) ----- */
.balance-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #134e4a 100%);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}
.balance-hero .balance-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  margin: 0 0 0.25rem;
}
.balance-hero .balance-amount {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.balance-hero .balance-currency { font-size: 1rem; font-weight: 500; opacity: 0.9; margin-left: 0.25rem; }
.quick-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: #fff;
  color: var(--primary);
  border: none;
}
.btn-primary:hover { background: rgba(255,255,255,0.95); }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.6);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.8); }

/* ----- Section ----- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.section-link { font-size: 0.875rem; font-weight: 500; color: var(--primary); text-decoration: none; }
.section-link:hover { text-decoration: underline; }

/* ----- Transaction list (fintech table-style) ----- */
.txn-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.txn-list thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.txn-list th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.txn-list th:last-child { text-align: right; }
.txn-list tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.txn-list tbody tr:last-child { border-bottom: none; }
.txn-list tbody tr:hover { background: var(--surface-hover); }
.txn-list td {
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  vertical-align: middle;
}
.txn-list td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.txn-list .txn-desc { color: var(--text); font-weight: 500; }
.txn-list .txn-date { color: var(--text-muted); font-size: 0.875rem; }
.txn-list .txn-amount-in { color: var(--success); }
.txn-list .txn-amount-out { color: var(--danger); }
.txn-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.txn-badge-deposit { background: var(--success-bg); color: var(--success); }
.txn-badge-in { background: #eff6ff; color: #2563eb; }
.txn-badge-out { background: var(--danger-bg); color: var(--danger); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state p { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state a { color: var(--primary); font-weight: 500; text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-balance { height: 2.5rem; width: 140px; margin: 0.5rem 0; }
.skeleton-line { height: 1rem; margin-bottom: 0.75rem; }
.skeleton-line.short { width: 40%; }

/* ----- Wallet page ----- */
.balance-card .balance-amount { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.btn-action {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.btn-action:hover { background: var(--primary-hover); }
.card .inline { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.card .inline input { flex: 1; margin-bottom: 0; }
.msg { font-size: 0.875rem; margin-top: 0.5rem; }
.msg.success { color: var(--success); }
.msg.error { color: var(--danger); }

/* ----- Home welcome ----- */
.home-welcome { font-size: 1.125rem; color: var(--text-secondary); margin: 0 0 1.5rem; font-weight: 500; }

/* ----- Profile ----- */
.profile-detail { margin-bottom: 1rem; }
.profile-detail strong { color: var(--text); }
