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

:root {
  --primary-blue: #0052cc;
  --dark-blue: #003da5;
  --light-gray: #f5f7fa;
  --border-gray: #d0d8e0;
  --text-dark: #1a1f36;
  --text-light: #6b7280;
  --success: #0fa66f;
  --danger: #d32f2f;
  --warning: #f59e0b;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-gray);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--primary-blue);
  color: white;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: white;
  border-bottom: 1px solid var(--border-gray);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Sidebar */
.logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
  color: white;
  font-size: 20px;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.logo-icon > div {
  background: white !important;
  border-radius: 1px !important;
}

.logo-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.account-selector {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.account-selector label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  letter-spacing: 0.4px;
}

.account-selector select {
  width: 100%;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.account-selector select:hover {
  background: rgba(255, 255, 255, 0.2);
}

.account-selector select option {
  background: var(--dark-blue);
  color: white;
}

.nav-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.nav-section {
  padding: 0.5rem 0;
}

.nav-section-title {
  padding: 0.6rem 1.25rem;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.65;
  letter-spacing: 0.5px;
}

.nav-item {
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.85);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: white;
  color: white;
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Header */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.support-banner {
  background: var(--primary-blue);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.live-chat-btn {
  background: var(--success);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-chat-btn:hover {
  background: #0d8659;
  transform: translateY(-1px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
}

.user-status {
  font-size: 10px;
  color: var(--text-light);
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 10px;
  color: var(--success);
  font-weight: 600;
  background: #f0fdf4;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  border: 1px solid var(--border-gray);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.card-subtitle {
  font-size: 10px;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 0.4rem;
}

/* Alert Banner */
.alert-banner {
  background: #f0f4ff;
  border-left: 4px solid var(--primary-blue);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid #d6e0ff;
}

.alert-icon {
  color: var(--primary-blue);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
  font-size: 13px;
}

.alert-text {
  font-size: 12px;
  color: var(--text-light);
}

/* Balance Card */
.balance-card {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.balance-amount {
  font-size: 48px;
  font-weight: 800;
  margin: 1rem 0;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.balance-info {
  font-size: 12px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.balance-change {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.balance-change.positive {
  color: #86efac;
}

.balance-chart {
  margin-top: 1.5rem;
  height: 80px;
  position: relative;
  z-index: 1;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Action Cards */
.action-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.action-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 8px 16px rgba(0, 82, 204, 0.1);
  transform: translateY(-2px);
}

.action-icon {
  width: 48px;
  height: 48px;
  background: #f0f4ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.2s ease;
}

.action-card:hover .action-icon {
  background: var(--primary-blue);
  color: white;
  transform: scale(1.1);
}

.action-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
}

/* Account Cards */
.account-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.account-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.08);
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.account-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.4px;
}

.account-status {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: #f0fdf4;
  color: var(--success);
  border-radius: 16px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.account-balance {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  letter-spacing: -0.4px;
}

.account-available {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.account-number {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.account-apr {
  margin-top: 0.6rem;
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border-gray);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--light-gray);
  border-bottom: 1px solid var(--border-gray);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.4px;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-gray);
  font-size: 12px;
}

tbody tr:hover {
  background: var(--light-gray);
}

.transaction-type {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.transaction-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.transaction-icon.in {
  background: #f0fdf4;
  color: var(--success);
}

.transaction-icon.out {
  background: #fef2f2;
  color: var(--danger);
}

.transaction-status {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.transaction-status.completed {
  background: #f0fdf4;
  color: var(--success);
}

.transaction-status.pending {
  background: #fffbeb;
  color: #b45309;
}

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

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

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

/* Buttons */
button, .btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 82, 204, 0.15);
}

.btn-primary:hover {
  background: var(--dark-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
}

.btn-secondary {
  background: white;
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

.btn-secondary:hover {
  background: var(--light-gray);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 11px;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 12px;
  letter-spacing: 0.2px;
}

input, select, textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.08);
}

/* Login Screen */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.login-box {
  background: white;
  border-radius: 12px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 60px;
  height: 60px;
  background: var(--light-gray);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 1.25rem;
}

.login-logo-icon svg {
  width: 36px;
  height: 36px;
  color: var(--primary-blue);
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
  letter-spacing: -0.4px;
}

.login-subtitle {
  font-size: 13px;
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-button {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 82, 204, 0.15);
  letter-spacing: 0.2px;
}

.login-button:hover {
  background: var(--dark-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
}

.login-error {
  background: #fef2f2;
  color: var(--danger);
  padding: 0.85rem;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 1rem;
  border: 1px solid #fee2e2;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text-dark);
  transform: scale(1.1);
}

/* Live Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 360px;
  height: 480px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 999;
  border: 1px solid var(--border-gray);
}

.chat-header {
  background: var(--primary-blue);
  color: white;
  padding: 1.25rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-weight: 700;
  font-size: 13px;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-close:hover {
  transform: scale(1.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-bubble {
  background: var(--light-gray);
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 11px;
  max-width: 70%;
  line-height: 1.4;
}

.chat-message.user .chat-bubble {
  background: var(--primary-blue);
  color: white;
}

.chat-input-area {
  padding: 0.85rem;
  border-top: 1px solid var(--border-gray);
  display: flex;
  gap: 0.4rem;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  padding: 0.55rem;
  font-size: 11px;
}

.chat-send {
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  transition: all 0.2s ease;
}

.chat-send:hover {
  background: var(--dark-blue);
}

/* Stock Radar */
.stock-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.stock-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.08);
}

.stock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.stock-symbol {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dark);
}

.stock-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0.4rem 0;
}

.stock-change {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stock-change.positive {
  color: var(--success);
}

.stock-change.negative {
  color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-wrapper {
    display: flex;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .nav-section {
    display: flex;
    padding: 0;
    flex-shrink: 0;
  }

  .nav-item {
    padding: 0.6rem 0.9rem;
    white-space: nowrap;
  }

  .content {
    padding: 1rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .balance-amount {
    font-size: 32px;
  }

  .login-box {
    padding: 1.75rem;
  }

  .chat-widget {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    bottom: 0;
    right: 0;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.hidden {
  display: none !important;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  border: 2px solid var(--light-gray);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--border-gray);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}
