.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(250px, 1fr);
  align-items: stretch;
  gap: 12px;
  width: min(100%, 540px);
}

.dashboard-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.dashboard-notification-btn {
  flex: 0 0 auto;
}

.dashboard-mobile-logout {
  flex: 0 0 auto;
}

@media (min-width: 981px) {
  .dashboard-mobile-logout {
    display: none !important;
  }
}

.dashboard-head-actions .filter-trigger {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--soft);
}

.dashboard-head-actions .filter-trigger svg {
  width: 26px;
  height: 26px;
}

.dashboard-head-actions .notification-button-icon {
  width: 28px;
  height: 28px;
}

.dashboard-head-actions .filter-trigger:hover {
  border-color: transparent;
  background: transparent;
  color: var(--gold-2);
  transform: none;
}

.dashboard-head-actions .filter-trigger:active,
.dashboard-head-actions .filter-trigger:focus-visible,
.dashboard-head-actions .filter-popover[open] .filter-trigger {
  border-color: rgba(216, 180, 106, 0.36);
  background: rgba(216, 180, 106, 0.10);
  color: var(--gold-2);
  outline: none;
}

.period-box {
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
}

.account-filter-box {
  min-width: 0;
}

.dashboard-filter {
  flex: 0 0 auto;
}

.period-box label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.period-controls {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
}

.input.compact,
.select.compact {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 720px) {
  .dashboard-actions {
    grid-template-columns: 1fr;
    width: min(100%, 360px);
  }
}

.metric-card {
  position: relative;
  container-type: inline-size;
  min-height: 132px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(44px, 1fr) auto;
  row-gap: 10px;
  padding: 20px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: -34px;
  right: -24px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  opacity: 0.12;
  background: var(--gold-2);
}

.metric-blue::after,
.metric-green::after,
.metric-red::after,
.metric-purple::after {
  background: var(--gold-2);
}

.metric-label {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.metric-values {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.metric-money-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.metric-money {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  color: var(--gold-2);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: nowrap;
}

.metric-money-stack.is-compact .metric-money.primary {
  font-size: clamp(19px, 1.75vw, 23px);
}

.metric-money-stack.is-tight .metric-money.primary {
  font-size: clamp(17px, 1.45vw, 20px);
}

.metric-money.secondary {
  margin-top: 0;
  color: var(--soft);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 850;
  letter-spacing: 0;
}

.metric-money-stack.is-compact .metric-money.secondary,
.metric-money-stack.is-tight .metric-money.secondary {
  font-size: clamp(16px, 1.45vw, 19px);
}

.metric-note {
  position: relative;
  z-index: 1;
  align-self: end;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  margin-top: 16px;
}

.dash-card {
  padding: 22px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
}

.section-kicker {
  margin-bottom: 3px;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.dash-card .btn.small {
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 12px;
  background: rgba(216, 180, 106, 0.10);
  border-color: rgba(216, 180, 106, 0.24);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 850;
}

.account-list,
.budget-list {
  display: grid;
  gap: 10px;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.account-item strong,
.budget-item strong {
  color: var(--text);
  font-size: 14px;
}

.item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-opening {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.account-opening::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(216, 180, 106, 0.1);
}

.account-opening strong {
  color: var(--soft);
  font-size: 12px;
}

.account-balance {
  color: var(--gold-2);
  font-size: 17px;
  font-weight: 950;
  white-space: nowrap;
}

.account-current {
  flex: 0 0 auto;
  text-align: right;
}

.account-current > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.budget-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.budget-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.budget-track {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.budget-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, var(--green));
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.18);
}

.empty-panel {
  padding: 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px dashed rgba(216, 180, 106, 0.24);
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.activity-card {
  margin-top: 16px;
}

.activity-card table {
  min-width: 880px;
}

.activity-card th:nth-child(1) { width: 11%; }
.activity-card th:nth-child(2) { width: 15%; }
.activity-card th:nth-child(3) { width: 17%; }
.activity-card th:nth-child(4) { width: 17%; }
.activity-card th:nth-child(5) { width: 18%; }
.activity-card th:nth-child(6) { width: 22%; }

.activity-card td:nth-child(5) {
  white-space: nowrap;
}

.activity-card .money.negative {
  color: #fda4af;
  font-weight: 900;
}

.activity-card .money.positive {
  color: #86efac;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 190px) {
  .metric-money {
    font-size: 22px;
  }

  .metric-money-stack.is-compact .metric-money.primary {
    font-size: 19px;
  }

  .metric-money-stack.is-tight .metric-money.primary {
    font-size: 16px;
  }

  .metric-money.secondary,
  .metric-money-stack.is-compact .metric-money.secondary,
  .metric-money-stack.is-tight .metric-money.secondary {
    font-size: 15px;
  }
}
