/* ===== Banking Dashboard Styles ===== */
:root {
  --primary: #0a3d62;
  --primary-light: #1e5a8e;
  --accent: #3498db;
  --accent-light: #5dade2;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --dark: #1c2833;
  --light: #f8f9fa;
  --gray: #bdc3c7;
  --gray-light: #ecf0f1;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #0a3d62 0%, #1c2833 100%);
  min-height: 100vh;
  color: var(--dark);
}

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

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 40px 35px;
  animation: slideUp 0.6s ease;
}

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

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo-img {
  width: 110px;
  height: auto;
  margin: 0 auto 15px;
  display: block;
  border-radius: 10px;
}

.login-header h1 {
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 5px;
}

.login-header p {
  color: #7f8c8d;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark);
  font-weight: 600;
  font-size: 14px;
}

.form-group label .req {
  color: var(--danger);
  margin-left: 2px;
}

.form-group label .opt {
  color: #95a5a6;
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.bank-result {
  margin-top: 8px;
  font-size: 14px;
  min-height: 20px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.bank-result.show {
  display: flex;
}

.bank-result.found {
  background: #e8f8f0;
  color: var(--success);
  border: 1px solid #abebc6;
}

.bank-result.notfound {
  background: #fef9e7;
  color: var(--warning);
  border: 1px solid #f8d7a0;
}

.bank-result.error {
  background: #fdedec;
  color: var(--danger);
  border: 1px solid #f5b7b1;
}

.bank-result .bank-icon {
  font-size: 18px;
}

.bank-result .bank-name {
  font-weight: 600;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 5px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 61, 98, 0.3);
}

.login-hint {
  margin-top: 20px;
  padding: 12px;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #566573;
  text-align: center;
}

.login-hint strong {
  color: var(--primary);
}

.error-msg {
  background: #fdecea;
  color: var(--danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  font-size: 14px;
  display: none;
  border-left: 4px solid var(--danger);
}

.error-msg.show {
  display: block;
}

/* ===== Dashboard Layout ===== */
.dashboard {
  display: none;
  min-height: 100vh;
  background: var(--light);
}

.dashboard.active {
  display: block;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, var(--primary) 0%, var(--dark) 100%);
  color: white;
  padding: 25px 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 30px;
  padding: 0 15px;
}

.sidebar-logo-img {
  width: 70px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
  border-radius: 8px;
}

.sidebar-logo h2 {
  font-size: 15px;
  color: white;
  line-height: 1.3;
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--gray);
  margin-top: 4px;
}

.nav-menu {
  list-style: none;
  padding: 0 15px;
}

.nav-item {
  padding: 14px 18px;
  margin-bottom: 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #d5dbdb;
}

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

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  padding: 0 20px;
}

.logout-btn {
  width: 100%;
  padding: 12px;
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.logout-btn:hover {
  background: var(--danger);
  color: white;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: 250px;
  padding: 30px;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.top-bar h1 {
  color: var(--primary);
  font-size: 26px;
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.user-details {
  font-size: 14px;
}

.user-details .name {
  font-weight: 600;
  color: var(--dark);
}

.user-details .role {
  color: #7f8c8d;
  font-size: 12px;
}

/* ===== Balance Card ===== */
.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  padding: 30px;
  color: white;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 40px;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.balance-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-amount {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
}

.balance-details {
  display: flex;
  gap: 30px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.balance-item {
  font-size: 14px;
}

.balance-item .label {
  opacity: 0.8;
  font-size: 12px;
}

.balance-item .value {
  font-weight: 600;
  font-size: 16px;
  margin-top: 2px;
}

.account-number {
  margin-top: 15px;
  font-size: 13px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-icon.green { background: #e8f8f0; color: var(--success); }
.stat-icon.blue { background: #ebf5fb; color: var(--accent); }
.stat-icon.orange { background: #fef9e7; color: var(--warning); }
.stat-icon.red { background: #fdedec; color: var(--danger); }

.stat-card .stat-label {
  font-size: 13px;
  color: #7f8c8d;
  margin-bottom: 5px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

/* ===== Content Sections ===== */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.content-section.active {
  display: block;
}

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

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

.section-header h2 {
  color: var(--primary);
  font-size: 22px;
}

/* ===== Transfer Form ===== */
.transfer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.transfer-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.transfer-card h3 {
  color: var(--primary);
  margin-bottom: 5px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.transfer-card .subtitle {
  color: #7f8c8d;
  font-size: 13px;
  margin-bottom: 20px;
}

.transfer-card.international {
  border-top: 4px solid var(--accent);
}

.transfer-card.domestic {
  border-top: 4px solid var(--success);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.btn-transfer {
  width: 100%;
  padding: 14px;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.btn-transfer.international {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
}

.btn-transfer.domestic {
  background: linear-gradient(135deg, var(--success), #229954);
}

.btn-transfer:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* ===== Transactions Table ===== */
.transactions-card {
  background: white;
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
}

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

.transactions-table thead th {
  text-align: left;
  padding: 14px 12px;
  background: var(--gray-light);
  color: var(--dark);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transactions-table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.transactions-table thead th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.transactions-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--gray-light);
  font-size: 14px;
}

.transactions-table tbody tr:hover {
  background: #fafbfc;
}

.txn-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.txn-type.international {
  background: #ebf5fb;
  color: var(--accent);
}

.txn-type.domestic {
  background: #e8f8f0;
  color: var(--success);
}

.txn-type.deposit {
  background: #fef9e7;
  color: var(--warning);
}

.txn-type.fee {
  background: #fdedec;
  color: var(--danger);
}

.txn-amount.debit {
  color: var(--danger);
  font-weight: 600;
}

.txn-amount.credit {
  color: var(--success);
  font-weight: 600;
}

.txn-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.txn-status.completed {
  background: #e8f8f0;
  color: var(--success);
}

.txn-status.pending {
  background: #fef9e7;
  color: var(--warning);
}

.txn-status.processing {
  background: #ebf5fb;
  color: var(--accent);
}

.no-transactions {
  text-align: center;
  padding: 40px;
  color: #95a5a6;
  font-size: 15px;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 35px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.4s ease;
}

.modal-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.modal-icon.success {
  background: #e8f8f0;
  color: var(--success);
}

.modal-icon.error {
  background: #fdedec;
  color: var(--danger);
}

.modal h3 {
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 10px;
}

.modal p {
  color: #566573;
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-details {
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 20px;
  text-align: left;
}

.modal-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.modal-detail-row .label {
  color: #7f8c8d;
}

.modal-detail-row .value {
  font-weight: 600;
  color: var(--dark);
}

.modal-btn {
  padding: 12px 35px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.modal-btn:hover {
  background: var(--primary-light);
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  top: 25px;
  right: 25px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateX(400px);
  transition: transform 0.4s ease;
  max-width: 380px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast-icon {
  font-size: 22px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }

.toast-message {
  font-size: 14px;
  color: var(--dark);
}

/* ===== Hamburger Menu Button (mobile only) ===== */
.hamburger-btn {
  display: none;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  font-size: 22px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.hamburger-btn:hover {
  background: var(--primary-light);
}

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* ===== Table Scroll Wrapper ===== */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Responsive ===== */

/* Tablet landscape & smaller laptops (≤1024px) */
@media (max-width: 1024px) {
  .main-content {
    padding: 25px;
  }
  .balance-amount {
    font-size: 38px;
  }
}

/* Tablets (≤992px) */
@media (max-width: 992px) {
  .transfer-container {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-content {
    padding: 22px;
  }
  .section-header h2 {
    font-size: 20px;
  }
}

/* Mobile phones (≤768px) — off-canvas sidebar */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 20px rgba(0,0,0,0.3);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Sidebar labels always visible in the slide-out panel */
  .sidebar-logo h2,
  .sidebar-logo p,
  .nav-item span:not(.nav-icon),
  .sidebar-footer {
    display: block;
  }
  .nav-item {
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
    padding: 18px;
  }

  .topbar-logo {
    width: 38px;
    height: 38px;
  }

  .top-bar h1 {
    font-size: 19px;
  }

  .user-info {
    padding: 8px 14px;
  }
  .user-details .name {
    font-size: 13px;
  }
  .user-details .role {
    font-size: 11px;
  }

  .balance-card {
    padding: 22px;
  }
  .balance-amount {
    font-size: 30px;
  }
  .balance-details {
    gap: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-card .stat-value {
    font-size: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .transfer-card {
    padding: 20px;
  }

  .transactions-card {
    padding: 16px;
  }

  .transactions-table thead th,
  .transactions-table tbody td {
    font-size: 12px;
    padding: 10px 8px;
    white-space: nowrap;
  }

  .modal {
    padding: 25px 20px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal h3 {
    font-size: 19px;
  }
  .modal-detail-row {
    font-size: 13px;
  }

  .toast {
    top: 15px;
    right: 15px;
    left: 15px;
    max-width: none;
    padding: 14px 18px;
    transform: translateY(-150px);
  }
  .toast.show {
    transform: translateY(0);
  }
}

/* Small phones (≤480px) */
@media (max-width: 480px) {
  .main-content {
    padding: 14px;
  }

  .topbar-logo {
    width: 34px;
    height: 34px;
  }

  .top-bar h1 {
    font-size: 17px;
  }

  .user-info {
    padding: 6px 12px;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .user-details .role {
    display: none;
  }

  .balance-card {
    padding: 18px;
  }
  .balance-amount {
    font-size: 26px;
  }
  .balance-details {
    gap: 14px;
  }
  .balance-item .value {
    font-size: 14px;
  }
  .account-number {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
  }
  .stat-card .stat-icon {
    margin-bottom: 0;
    width: 42px;
    height: 42px;
    font-size: 20px;
    flex-shrink: 0;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .transfer-card {
    padding: 16px;
  }
  .transfer-card h3 {
    font-size: 16px;
  }

  .form-group input,
  .form-group select {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    padding: 11px 13px;
  }

  .btn-transfer {
    font-size: 14px;
    padding: 13px;
  }

  .transactions-card {
    padding: 12px;
  }
  .transactions-table thead th,
  .transactions-table tbody td {
    font-size: 11px;
    padding: 9px 6px;
  }

  .modal {
    padding: 22px 16px;
  }
  .modal-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
  .modal h3 {
    font-size: 17px;
  }
  .modal-details {
    padding: 14px;
  }

  .login-card {
    padding: 30px 22px;
  }
}

/* Extra small phones (≤360px) */
@media (max-width: 360px) {
  .top-bar h1 {
    font-size: 15px;
  }
  .topbar-logo {
    width: 30px;
    height: 30px;
  }
  .balance-amount {
    font-size: 23px;
  }
}

/* Landscape orientation on phones — use available height better */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    width: 240px;
  }
  .balance-card {
    padding: 18px 22px;
  }
}

/* Print-friendly */
@media print {
  .sidebar,
  .hamburger-btn,
  .sidebar-overlay,
  .user-info,
  .logout-btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0;
  }
}
