* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Inter", sans-serif;
  background: #f3f5f9;
  color: #0a2342;
  min-height: 100vh;
}

/* ── HEADER ── */
.ma-header {
  background: linear-gradient(135deg, #021633, #0a2342);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
}
.ma-header .hc {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  margin: auto;
  padding: 0 20px;
}
.back-btn {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.8;
}
.back-btn:hover {
  opacity: 1;
}
.ma-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}
.container {
  max-width: 1100px;
  margin: auto;
  padding: 0 20px;
}
.page-body {
  padding: 40px 0 80px;
}

/* ── HERO ── */
.total-hero {
  background: linear-gradient(135deg, #4b38f5, #6a5cff);
  color: white;
  border-radius: 22px;
  padding: 40px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.total-hero h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
  margin-bottom: 6px;
}
.total-hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}
.total-hero p {
  opacity: 0.75;
  font-size: 0.88rem;
  margin-top: 6px;
}
.hero-meta {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.hero-meta-item {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.82rem;
}
.hero-meta-item span {
  display: block;
  opacity: 0.7;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.hero-meta-item strong {
  font-size: 1rem;
  font-weight: 700;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-self: flex-start;
}
.hero-action-btn {
  padding: 11px 22px;
  border: none;
  border-radius: 22px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  display: inline-block;
  font-family: "Inter", sans-serif;
}
.hero-action-btn.light {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-action-btn.white {
  background: white;
  color: #4b38f5;
}
.hero-action-btn:hover {
  transform: translateY(-2px);
}

/* ── ACCOUNT COUNT PILLS ── */
.accounts-summary {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.summary-pill {
  background: white;
  border-radius: 14px;
  padding: 16px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 160px;
}
.summary-pill .pill-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.summary-pill .pill-icon.blue {
  background: #f0f2ff;
  color: #4b38f5;
}
.summary-pill .pill-icon.teal {
  background: #e0faf6;
  color: #00bfa6;
}
.summary-pill .pill-icon.orange {
  background: #fff3e0;
  color: #f57c00;
}
.summary-pill .pill-icon.grey {
  background: #f5f5f5;
  color: #888;
}
.summary-pill .pill-text span {
  font-size: 0.72rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}
.summary-pill .pill-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 4px solid #4b38f5;
}

/* ── ACCOUNT CARDS ── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}
.acc-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: 0.3s;
  border: 2px solid transparent;
}
.acc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}
.acc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}
.acc-card.checking::before {
  background: linear-gradient(90deg, #4b38f5, #6a5cff);
}
.acc-card.savings::before {
  background: linear-gradient(90deg, #00bfa6, #00e5cc);
}
.acc-card.business::before {
  background: linear-gradient(90deg, #f57c00, #ffa040);
}

.acc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.acc-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.acc-card.checking .acc-card-icon {
  background: #f0f2ff;
  color: #4b38f5;
}
.acc-card.savings .acc-card-icon {
  background: #e0faf6;
  color: #00bfa6;
}
.acc-card.business .acc-card-icon {
  background: #fff3e0;
  color: #f57c00;
}

.acc-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #e8f5e9;
  color: #2e7d32;
}
.acc-status-badge.inactive {
  background: #fce4ec;
  color: #c62828;
}

.acc-card h4 {
  font-size: 0.82rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.acc-balance {
  font-size: 2rem;
  font-weight: 700;
  color: #0a2342;
  margin-bottom: 4px;
  line-height: 1;
}
.acc-balance-sub {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 16px;
}
.acc-num {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 6px;
  font-family: monospace;
  letter-spacing: 1px;
}
.acc-routing {
  font-size: 0.78rem;
  color: #bbb;
  margin-bottom: 20px;
  font-family: monospace;
}

.acc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: #f8f9fc;
  border-radius: 12px;
}
.acc-stat span {
  font-size: 0.7rem;
  color: #aaa;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.acc-stat strong {
  font-size: 0.88rem;
  font-weight: 700;
}
.acc-stat strong.green {
  color: #2e7d32;
}
.acc-stat strong.red {
  color: #c62828;
}

.acc-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.acc-mini-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  font-family: "Inter", sans-serif;
  text-decoration: none;
  display: inline-block;
}
.acc-mini-btn.primary {
  background: #f0f2ff;
  color: #4b38f5;
}
.acc-mini-btn.success {
  background: #e8f5e9;
  color: #2e7d32;
}
.acc-mini-btn.neutral {
  background: #f5f5f5;
  color: #555;
}
.acc-mini-btn:hover {
  filter: brightness(0.92);
}

/* ── TRANSACTIONS ── */
.txn-section {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  margin-bottom: 40px;
}
.txn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.txn-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.txn-header a {
  font-size: 0.82rem;
  color: #4b38f5;
  text-decoration: none;
  font-weight: 600;
}
.txn-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.txn-filter-btn {
  padding: 6px 16px;
  border: 1.5px solid #e0e4ee;
  border-radius: 20px;
  background: white;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: 0.2s;
  color: #555;
}
.txn-filter-btn.active {
  background: #4b38f5;
  color: white;
  border-color: #4b38f5;
}
.txn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #f0f2f5;
}
.txn-row:last-child {
  border-bottom: none;
}
.txn-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.txn-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.txn-icon-wrap.cr {
  background: #e8f5e9;
  color: #2e7d32;
}
.txn-icon-wrap.db {
  background: #ffebee;
  color: #c62828;
}
.txn-info strong {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
}
.txn-info span {
  font-size: 0.76rem;
  color: #888;
}
.txn-right {
  text-align: right;
}
.txn-amount {
  font-weight: 700;
  font-size: 0.93rem;
}
.txn-amount.cr {
  color: #2e7d32;
}
.txn-amount.db {
  color: #c62828;
}
.txn-acct-tag {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 2px;
  display: block;
}
.empty-txn {
  text-align: center;
  color: #aaa;
  padding: 32px;
  font-size: 0.9rem;
}

/* ── DARK MODE ── */
.dark-mode {
  background: #121212;
  color: #e0e0e0;
}
.dark-mode .acc-card,
.dark-mode .txn-section,
.dark-mode .summary-pill {
  background: #1c1f35;
  color: #e0e0e0;
}
.dark-mode .acc-balance {
  color: #e0e0e0;
}
.dark-mode .acc-card h4,
.dark-mode .acc-num,
.dark-mode .acc-routing {
  color: #888;
}
.dark-mode .acc-stats {
  background: #13162a;
}
.dark-mode .acc-stat span {
  color: #666;
}
.dark-mode .txn-row {
  border-bottom-color: #2e3250;
}
.dark-mode .txn-info span,
.dark-mode .empty-txn,
.dark-mode .txn-acct-tag {
  color: #666;
}
.dark-mode .summary-pill .pill-text span {
  color: #666;
}
.dark-mode .txn-filter-btn {
  background: #1c1f35;
  border-color: #2e3250;
  color: #aaa;
}
.dark-mode .txn-filter-btn.active {
  background: #4b38f5;
  color: white;
}
.dark-mode .acc-mini-btn.neutral {
  background: #2e3250;
  color: #aaa;
}

@media (max-width: 700px) {
  .total-hero {
    flex-direction: column;
    gap: 20px;
  }
  .hero-actions {
    width: 100%;
  }
  .accounts-grid {
    grid-template-columns: 1fr;
  }
  .hero-meta {
    gap: 10px;
  }
}
