:root {
  --tf-burgundy: #8e0c3a;
  --tf-blue: #0072bc;
  --tf-blue-hover: #005a94;
  --tf-text: #484a4c;
  --tf-text-light: #767676;
  --tf-border: #e5e5e5;
  --tf-font: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.trustfi-dashboard {
  margin: 0;
  min-height: 100vh;
  font-family: var(--tf-font);
  color: var(--tf-text);
  background: var(--tf-burgundy);
}

.trustfi-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 40px;
}

/* Top maroon strip: logo + avatar */
.trustfi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: 8px;
}

.trustfi-logo {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
}

.trustfi-logo svg {
  display: block;
  height: 28px;
  width: auto;
}

.trustfi-logo-tag {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
}

.trustfi-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.trustfi-avatar:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* White card */
.trustfi-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 0 32px 36px;
}

/* Nav inside white card */
.trustfi-card-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 28px;
}

.trustfi-card-nav a {
  color: var(--tf-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 12px;
  margin-bottom: -15px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.trustfi-card-nav a:hover {
  color: var(--tf-burgundy);
}

.trustfi-card-nav a.active {
  color: var(--tf-text);
  border-bottom-color: var(--tf-burgundy);
}

/* Dashboard title + tabs */
.trustfi-dashboard-head {
  margin-bottom: 24px;
}

.trustfi-dashboard-head h1 {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

.trustfi-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--tf-border);
}

.trustfi-tabs a {
  color: var(--tf-text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 0 0 10px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
}

.trustfi-tabs a.active {
  color: var(--tf-blue);
  border-bottom-color: var(--tf-blue);
}

/* Two-column main area */
.trustfi-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
}

.account-group {
  margin-bottom: 22px;
}

.account-group-label {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.account-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f2f2f2;
}

.account-row-link:hover {
  background: #fafafa;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 4px;
  text-decoration: none;
}

.account-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-dot.checking { background: #0072bc; }
.account-dot.savings { background: #4caf50; }
.account-dot.credit { background: #f5a623; }

.account-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.account-type {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.4px;
}

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

.account-row-balance-wrap {
  text-align: right;
  flex-shrink: 0;
}

.account-row-balance {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}

.account-available {
  display: block;
  font-size: 11px;
  color: var(--tf-text-light);
  margin-top: 2px;
}

/* Sidebar */
.trustfi-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trustfi-widget {
  padding: 0 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--tf-border);
}

.trustfi-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.trustfi-widget h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.widget-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.widget-select {
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 2px;
  font-family: inherit;
  color: #666;
  background: #fff;
}

.widget-settings {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

.widget-login-activity .widget-header {
  margin-bottom: 10px;
}

.login-activity-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: #f3f3f3;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.login-activity-filter-icon {
  color: #888;
  flex-shrink: 0;
}

.login-activity-filter-chevron {
  margin-left: auto;
  color: #888;
}

.login-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.login-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.login-date-badge {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #f3f3f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  flex-shrink: 0;
}

.login-date-month {
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: capitalize;
}

.login-date-day {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.login-time {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.login-activity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 4px;
}

.login-activity-more {
  font-size: 12px;
  color: var(--tf-text-light);
}

.login-activity-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--tf-blue);
  text-decoration: none;
  white-space: nowrap;
}

.login-activity-link:hover {
  text-decoration: underline;
}

.widget-balance {
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-amount {
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.widget-trend.up {
  color: #4caf50;
  font-size: 11px;
}

.bank-icons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bank-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.bank-icon-more {
  background: #ddd;
  color: #666;
}

.btn-trustfi {
  background: var(--tf-blue);
  color: white;
  border: none;
  border-radius: 3px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-trustfi:hover {
  background: var(--tf-blue-hover);
}

.trustfi-quick-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trustfi-quick-links li {
  margin-bottom: 8px;
}

.trustfi-quick-links a {
  color: var(--tf-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.trustfi-quick-links a:hover {
  text-decoration: underline;
}

.ext-icon {
  color: var(--tf-blue);
  flex-shrink: 0;
  display: flex;
}

/* News section */
.trustfi-news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--tf-border);
}

.trustfi-news-col h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.news-item {
  margin-bottom: 22px;
}

.news-item:last-child {
  margin-bottom: 0;
}

.news-item h3 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.news-item h3 a {
  color: var(--tf-blue);
  text-decoration: none;
}

.news-item h3 a:hover {
  text-decoration: underline;
}

.news-item p {
  margin: 0 0 5px;
  font-size: 13px;
  color: var(--tf-text-light);
  line-height: 1.5;
}

.news-item time {
  font-size: 12px;
  color: #999;
}

.demo-badge {
  position: fixed;
  bottom: 12px;
  right: 12px;
  background: #333;
  color: #fff;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  opacity: 0.85;
  z-index: 9999;
}

.demo-badge a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .trustfi-page {
    padding: 12px 12px 32px;
  }

  .trustfi-card {
    padding: 0 18px 24px;
  }

  .trustfi-content-grid,
  .trustfi-news-grid {
    grid-template-columns: 1fr;
  }

  .trustfi-card-nav {
    gap: 8px 14px;
  }
}
