/* ==========================================================================
   Nexora Bank - Design System & Stylesheet
   Theme: Deep Forest Green, Clean Modern Cards, Mobile-First Responsiveness
   ========================================================================== */

:root {
  /* Brand Palette */
  --primary-950: #022c22;
  --primary-900: #064e3b;
  --primary-800: #065f46;
  --primary-700: #047857;
  --primary-600: #059669;
  --primary-500: #10b981;
  --primary-400: #34d399;
  --primary-300: #6ee7b7;
  --primary-100: #d1fae5;
  --primary-50:  #ecfdf5;

  /* Neutrals & Surfaces */
  --bg-app: #f4f6f8;
  --card-bg: #ffffff;
  --card-subtle: #f8fafc;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Accent & Status */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #0284c7;
  --info-bg: #f0f9ff;

  /* Typography & Layout */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(6, 78, 59, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(6, 78, 59, 0.12);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Base Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #0d1f18; /* Elegant dark backdrop for desktop wrapper */
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Wrapper: Mobile-first viewport container */
.app-container {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--bg-app);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  padding-bottom: 90px; /* Room for fixed bottom nav */
}

/* Header Component */
.app-header {
  background-color: var(--primary-950);
  color: var(--text-white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-title span {
  color: var(--primary-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-950);
}

.avatar-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981, #065f46);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s;
}

.avatar-badge:hover {
  transform: scale(1.05);
}

/* User Dropdown */
.avatar-dropdown-container {
  position: relative;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  width: 220px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  overflow: hidden;
  z-index: 200;
}

.user-dropdown-menu.show {
  display: block;
}

.dropdown-user-info {
  padding: 12px 16px;
  background: var(--card-subtle);
  border-bottom: 1px solid var(--card-border);
}

.dropdown-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.dropdown-user-acc {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--card-subtle);
}

.dropdown-item.logout {
  color: var(--danger);
  border-top: 1px solid var(--card-border);
}

/* Dashboard Body Content */
.dashboard-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Greeting Section */
.greeting-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.greeting-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-950);
  line-height: 1.2;
}

.greeting-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--primary-50);
  color: var(--primary-800);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--primary-100);
}

/* Total Portfolio Card */
.portfolio-card {
  background: linear-gradient(135deg, #043d2e 0%, #064e3b 50%, #065f46 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--text-white);
  box-shadow: 0 12px 24px -4px rgba(6, 78, 59, 0.35);
  position: relative;
  overflow: hidden;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.portfolio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portfolio-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

.visibility-toggle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.visibility-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.portfolio-balance-wrapper {
  margin: 14px 0 16px;
}

.portfolio-balance {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.portfolio-balance .currency {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-300);
}

.portfolio-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.growth-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-300);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.portfolio-mini-chart {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sparkline-svg {
  width: 90px;
  height: 28px;
  overflow: visible;
}

/* Quick Action Grid */
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-950);
}

.section-action-link {
  font-size: 0.82rem;
  color: var(--primary-700);
  text-decoration: none;
  font-weight: 600;
}

.section-action-link:hover {
  text-decoration: underline;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  background: var(--card-bg);
  padding: 12px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  text-align: center;
}

.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

.action-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.quick-action-btn:hover .action-icon-circle {
  transform: scale(1.08);
}

.action-icon-transfer {
  background: #ecfdf5;
  color: var(--primary-700);
}

.action-icon-invest {
  background: #eff6ff;
  color: #2563eb;
}

.action-icon-loan {
  background: #fdf2f8;
  color: #db2777;
}

.action-icon-card {
  background: #fffbeb;
  color: #d97706;
}

.action-icon-topup {
  background: #f5f3ff;
  color: #7c3aed;
}

.action-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
}

/* Accounts Overview Section */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.account-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.account-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.account-type-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-badge-growth {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 2px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.account-balance-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.account-sub-no {
  font-size: 0.72rem;
  color: var(--text-light);
  font-family: monospace;
}

/* Investment Portfolio Chart Section */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

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

.chart-title-group {
  display: flex;
  flex-direction: column;
}

.chart-sub-stat {
  font-size: 0.8rem;
  color: var(--primary-700);
  font-weight: 600;
}

.time-filter-buttons {
  display: flex;
  background: var(--card-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.time-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.time-btn.active {
  background: var(--primary-900);
  color: white;
  box-shadow: var(--shadow-sm);
}

.chart-container {
  position: relative;
  height: 180px;
  width: 100%;
}

/* Recent Activity Feed */
.activity-feed-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.icon-credit {
  background: var(--success-bg);
  color: var(--success);
}

.icon-debit {
  background: var(--danger-bg);
  color: var(--danger);
}

.activity-details {
  display: flex;
  flex-direction: column;
}

.activity-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.activity-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.activity-amount {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.amount-credit {
  color: var(--success);
}

.amount-debit {
  color: var(--danger);
}

/* Fixed Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 10px 6px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  position: relative;
}

.nav-item i {
  font-size: 18px;
  margin-bottom: 3px;
}

.nav-item.active {
  color: var(--primary-800);
  font-weight: 700;
}

.nav-item.active i {
  transform: scale(1.1);
  color: var(--primary-700);
}

/* Form & Input Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-800), var(--primary-700));
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-900), var(--primary-800));
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--card-subtle);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Alert Boxes */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background-color: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background-color: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Admin Dashboard Specific Styles */
.admin-body {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background-color: var(--primary-950);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.admin-nav-item:hover, .admin-nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-nav-item.active {
  background: var(--primary-800);
  color: #ffffff;
  font-weight: 600;
}

.admin-main {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
}

.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover {
  background-color: #f8fafc;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-active {
  background: #dcfce7;
  color: #15803d;
}

.badge-suspended {
  background: #fee2e2;
  color: #b91c1c;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .admin-main {
    padding: 16px;
  }
}
