/* ============================================================
   PIGGYBANK — "ARCADE CABINET" THEME (mood board 3, Asa-approved)
   Cream grid-paper board · hot pig pink · arcade sky · coin gold
   Heavy ink borders, hard shadows, Press Start 2P + VT323
   Same selector contract as the old theme — JS untouched.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* --- CSS Variables --- */
:root {
  --cream:      #FFF3DC;
  --cream-2:    #FBE9C8;
  --grid:       #F7E3C0;
  --pink:       #FF8FA3;
  --pink-deep:  #E4566E;
  --pink-soft:  #FFC7D1;
  --sky:        #66C7F4;
  --sky-deep:   #2F9BD6;
  --sky-soft:   #C9EBFB;
  --gold:       #FFC93C;
  --gold-deep:  #E0A800;
  --gold-soft:  #FFE9A8;
  --ink:        #38201C;
  --ink-soft:   #6B4A42;
  --white:      #FFFFFF;
  --green:      #1F8A4C;
  --green-soft: #DFF6E7;
  --red:        #E4566E;
  --red-soft:   #FFE3E8;

  /* legacy aliases (templates/JS may reference) */
  --bg: var(--cream);
  --gold-light: var(--gold-deep);
  --green-game: var(--green);
  --green-light: #2EB367;
  --red-game: var(--red);
  --red-light: var(--pink-deep);
  --blue-accent: var(--sky-deep);
  --parch-light: var(--white);
  --parch-mid: var(--cream);
  --parch-dark: var(--cream-2);
  --parch-text: var(--ink);
  --parch-muted: var(--ink-soft);
  --wood-light: var(--ink);
  --wood-mid: var(--ink);
  --wood-dark: var(--ink);
  --wood-darkest: var(--ink);
  --sidebar-bg: var(--cream);
  --sidebar-border: var(--ink);
  --nav-active-bg: var(--pink);
  --sidebar-w: 224px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 12px; }

body {
  font-family: 'VT323', monospace;
  background: var(--cream);
  background-image:
    linear-gradient(var(--grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 32px 32px;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 19px;
}

a { color: var(--sky-deep); text-decoration: none; }
a:hover { color: var(--pink-deep); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--cream-2); }
::-webkit-scrollbar-thumb { background: var(--pink); border: 3px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--pink-deep); }

/* --- Layout --- */
.app-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 5px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar::after { display: none; }

.sidebar-brand {
  padding: 18px 14px 16px;
  border-bottom: 5px solid var(--ink);
  background: var(--pink);
  text-align: center;
}
.sidebar-brand .brand-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink), 4px 4px 0 var(--gold);
  letter-spacing: 1px;
}
.sidebar-brand .brand-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--ink);
  background: var(--gold);
  display: inline-block;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  margin-top: 10px;
  letter-spacing: 1px;
}
.sidebar-brand .brand-trees { display: none; }

.sidebar-nav { flex: 1; padding: 14px 10px; list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  margin-bottom: 7px;
  color: var(--ink);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  border: 3px solid transparent;
  letter-spacing: 1px;
  opacity: 1;
  transition: none;
}
.sidebar-nav li a .nav-arrow {
  opacity: 0;
  font-size: 11px;
  margin-left: auto;
  color: var(--pink-deep);
}
.sidebar-nav li a:hover .nav-arrow { opacity: 1; }
.sidebar-nav li a.active .nav-arrow { opacity: 1; animation: navblink 1s steps(1) infinite; }
@keyframes navblink { 50% { opacity: 0; } }
.sidebar-nav li a:hover {
  color: var(--ink);
  background: var(--sky-soft);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.sidebar-nav li a.active {
  color: var(--ink);
  background: var(--pink);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.sidebar-nav li a .nav-icon { font-size: 12px; width: 20px; text-align: center; }

.sidebar-nav .nav-divider {
  height: 0;
  margin: 10px 14px;
  border-bottom: 4px dotted var(--pink);
  background: none;
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 5px solid var(--ink);
  background: var(--cream-2);
  font-size: 19px;
  color: var(--ink);
  opacity: 1;
}
.sidebar-footer .user-name {
  font-family: 'Press Start 2P', monospace;
  color: var(--pink-deep);
  font-size: 11px;
}
.sidebar-footer .logout-link { color: var(--sky-deep); cursor: pointer; font-size: 15px; }
.sidebar-footer .logout-link:hover { color: var(--pink-deep); }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 30px 34px 60px;
  min-height: 100vh;
  background: none;
  min-width: 0;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.page-header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 17px;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--pink-soft);
  border-left: none;
  padding-left: 0;
  position: relative;
  letter-spacing: 1px;
}
.page-header h1::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 130px;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 12px, var(--sky) 12px 24px, var(--gold) 24px 36px);
  border: 2px solid var(--ink);
  opacity: 1;
}

/* --- Panels: arcade HUD --- */
.panel {
  background: var(--white);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  color: var(--ink);
  padding: 18px;
  margin-bottom: 30px;
  position: relative;
}
.panel::before, .panel::after { display: none; }
.panel:hover { border-color: var(--ink); }

.panel-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 4px dotted var(--pink);
  letter-spacing: 1px;
}

.panel-elevated { background: var(--cream); }

/* --- Net Worth Hero: the marquee --- */
.networth-hero {
  background: var(--pink);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  color: var(--ink);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 34px;
  position: relative;
}
.networth-hero::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 3px dashed rgba(56,32,28,.35);
  background: none;
  width: auto; height: auto;
  pointer-events: none;
  z-index: 0;
}
.networth-hero::after { display: none; }
.networth-hero .nw-divider-top, .networth-hero .nw-divider-bottom { display: none; }
.networth-hero .label {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--ink);
  background: var(--gold);
  display: inline-block;
  padding: 6px 12px;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  letter-spacing: 2px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}
.networth-hero .amount {
  font-family: 'Press Start 2P', monospace;
  font-size: 36px;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--gold);
  letter-spacing: 2px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.networth-hero .sub {
  font-size: 20px;
  color: var(--ink);
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--white);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  padding: 14px 12px;
  text-align: center;
  position: relative;
}
.stat-card.assets { background: var(--gold-soft); border-top: 4px solid var(--ink); }
.stat-card.liabilities { background: var(--pink-soft); border-top: 4px solid var(--ink); }
.stat-card.income { background: var(--green-soft); border-top: 4px solid var(--ink); }
.stat-card.expenses { background: var(--sky-soft); border-top: 4px solid var(--ink); }
.stat-card .stat-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.stat-card .stat-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  color: var(--ink);
  text-shadow: none;
}
.stat-card .stat-value.green { color: var(--green); }
.stat-card .stat-value.red { color: var(--red); }
.stat-card .stat-value.gold { color: var(--gold-deep); }

/* --- Two Column Layout --- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 30px;
  overflow: visible;
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 18px; }
thead th {
  background: var(--gold);
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody td {
  padding: 8px 12px;
  border-bottom: 3px solid var(--cream-2);
  color: var(--ink);
  background: var(--white);
}
tbody tr:hover td { background: var(--sky-soft); }
tbody tr:nth-child(even) td { background: var(--cream); }
tbody tr:nth-child(even):hover td { background: var(--sky-soft); }

/* --- Buttons: chunky arcade --- */
.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 11px 16px;
  border: 4px solid var(--ink);
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: none;
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: 1px;
  background: var(--cream-2);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
}
.btn:hover { transform: none; filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink) !important; }

.btn-primary { background: var(--pink); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-shadow: none; }
.btn-primary:hover { background: var(--pink); box-shadow: 0 5px 0 var(--ink); }
.btn-green { background: var(--gold); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-shadow: none; }
.btn-green:hover { background: var(--gold); box-shadow: 0 5px 0 var(--ink); }
.btn-secondary { background: var(--sky); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--sky); border-color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.btn-danger { background: var(--pink-deep); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); color: var(--white); text-shadow: none; }
.btn-danger:hover { background: var(--pink-deep); box-shadow: 0 5px 0 var(--ink); }
.btn-sm { font-size: 13px; padding: 7px 10px; box-shadow: 0 4px 0 var(--ink); }
.btn-sm:active { transform: translateY(3px); }

/* --- Forms / Inputs --- */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="email"],
select,
textarea {
  font-family: 'VT323', monospace;
  font-size: 18px;
  background: var(--white);
  color: var(--ink);
  border: 4px solid var(--ink);
  padding: 8px 12px;
  outline: none;
  width: 100%;
  box-shadow: none;
  transition: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--sky-deep);
  box-shadow: 4px 4px 0 var(--sky-soft);
}
input::placeholder { color: #B39A8F; font-size: 17px; }

label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 7px;
  letter-spacing: 1px;
}
.sidebar label, .login-card label { color: var(--ink); }
.panel label { color: var(--ink-soft); }

.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }

/* --- Filter Bar --- */
.filter-bar {
  background: var(--cream-2);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  padding: 14px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  position: relative;
}
.filter-bar .form-group { flex: 1; min-width: 130px; margin-bottom: 0; }
.filter-bar .btn { flex-shrink: 0; }

/* --- Badges --- */
.badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  padding: 4px 8px;
  display: inline-block;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.badge-green { background: var(--green-soft); border-color: var(--ink); color: var(--green); }
.badge-gold { background: var(--gold); border-color: var(--ink); color: var(--ink); }
.badge-blue { background: var(--sky); border-color: var(--ink); color: var(--ink); }
.badge-red { background: var(--pink-soft); border-color: var(--ink); color: var(--pink-deep); }
.badge-orange { background: var(--gold-soft); border-color: var(--ink); color: var(--gold-deep); }

/* --- Alerts --- */
.alert {
  font-size: 18px;
  padding: 12px 16px;
  border: 4px solid var(--ink);
  margin-bottom: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}
.alert-success { background: var(--green-soft); color: var(--green); border-color: var(--ink); }
.alert-error { background: var(--red-soft); color: var(--pink-deep); border-color: var(--ink); }
.alert-warning { background: var(--gold-soft); color: var(--ink); border-color: var(--ink); }
.alert-info { background: var(--sky-soft); color: var(--ink); border-color: var(--ink); }

/* --- Login Page: arcade start screen --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sky);
  background-image:
    linear-gradient(rgba(255,255,255,.16) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.16) 2px, transparent 2px);
  background-size: 32px 32px;
  position: relative;
  overflow: hidden;
}
/* pixel clouds */
.login-page::before {
  content: "";
  position: absolute;
  top: 70px; left: 10%;
  width: 26px; height: 26px;
  transform: none;
  background: var(--white);
  box-shadow:
    26px 0 var(--white), 52px 0 var(--white), 78px 0 var(--white),
    26px -26px var(--white), 52px -26px var(--white),
    13px 13px var(--white), 39px 13px var(--white), 65px 13px var(--white),
    -13px 13px var(--white), 91px 13px var(--white),
    560px 60px var(--white), 586px 60px var(--white), 612px 60px var(--white),
    573px 73px var(--white), 599px 73px var(--white), 547px 73px var(--white), 625px 73px var(--white);
  border-radius: 0;
  animation: clouddrift 46s linear infinite;
  pointer-events: none;
}
@keyframes clouddrift { 0% { margin-left: 0; } 50% { margin-left: 70px; } 100% { margin-left: 0; } }

.login-card {
  background: var(--pink);
  border: 5px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  padding: 32px 30px 26px;
  width: 400px;
  max-width: 90%;
  position: relative;
  z-index: 1;
  color: var(--ink);
  text-align: center;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  width: auto; height: auto;
  border: 3px dashed rgba(56,32,28,.35);
  background: none;
  pointer-events: none;
  z-index: 0;
}
.login-card::after { display: none; }
.login-card .login-icon { text-align: center; font-size: 36px; margin-bottom: 8px; position: relative; z-index: 1; }
.login-card .login-icon img, .login-card .login-icon svg { image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(56,32,28,.3)); }
.login-card .login-title {
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--gold);
  margin-bottom: 4px;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}
.login-card .login-sub {
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: inline-block;
  padding: 5px 10px;
  letter-spacing: 1px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.login-card .pixel-divider { margin-bottom: 18px; }
.login-card label { color: var(--ink); text-align: left; position: relative; z-index: 1; }
.login-card input { position: relative; z-index: 1; }
.login-card .btn { width: 100%; margin-top: 12px; background: var(--gold); position: relative; z-index: 1; }
.login-error {
  color: var(--pink-deep);
  background: var(--red-soft);
  border: 3px solid var(--pink-deep);
  font-size: 19px;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  display: none;
  position: relative;
  z-index: 1;
}

/* --- Pixel Divider --- */
.pixel-divider {
  border: 2px solid var(--ink);
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 14px, var(--sky) 14px 28px, var(--gold) 28px 42px);
  margin: 16px 0;
}
.pixel-divider-green {
  background: repeating-linear-gradient(90deg, var(--green) 0 14px, var(--green-soft) 14px 28px);
}

/* --- Account Cards Grid --- */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.account-card {
  background: var(--white);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  padding: 16px;
  transition: none;
}
.account-card:hover { background: var(--sky-soft); border-color: var(--ink); }
/* ===== LIVE STATUS INDICATOR ===== */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 4px 8px;
  border: 2px solid var(--dark);
  background: var(--cream);
}
.live-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid var(--dark);
  flex-shrink: 0;
}
.live-dot.live { color: #1a7a1a; }
.live-dot.live::before {
  background: #33dd33;
  box-shadow: 0 0 6px #33dd33, 0 0 12px #33dd3388;
  animation: livePulse 1.6s ease-in-out infinite;
}
.live-dot.stale { color: #8a6d00; }
.live-dot.stale::before { background: var(--gold); }
.live-dot.offline { color: #a02020; }
.live-dot.offline::before { background: #cc3333; }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 4px #33dd33, 0 0 8px #33dd3366; }
  50% { box-shadow: 0 0 10px #33dd33, 0 0 20px #33dd33aa; }
}

.account-card .institution {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--pink-deep);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.account-card .account-name { font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.account-card .balance {
  font-family: 'Press Start 2P', monospace;
  font-size: 17px;
  color: var(--ink);
  text-shadow: none;
  margin-bottom: 8px;
}
.account-card .account-meta { font-size: 15px; color: var(--ink-soft); margin-bottom: 12px; }
.account-card .account-actions { display: flex; gap: 8px; }

/* --- Chart Container --- */
.chart-container { position: relative; height: 280px; width: 100%; }
.chart-container canvas { max-height: 100%; }

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 17px;
  color: var(--ink);
}
.pagination .page-info { color: var(--ink-soft); }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 12px 16px;
  border: 4px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  animation: toastIn 0.3s ease;
}
.toast.success { border-color: var(--ink); color: var(--green); background: var(--green-soft); }
.toast.error { border-color: var(--ink); color: var(--pink-deep); background: var(--red-soft); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Settings Sections --- */
.settings-section { margin-bottom: 28px; }
.settings-section h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 12px;
}

/* --- Utility Classes --- */
.text-gold { color: var(--gold-deep) !important; }
.text-green { color: var(--green) !important; }
.text-red { color: var(--pink-deep) !important; }
.text-muted { color: var(--ink-soft) !important; }
.text-white { color: var(--ink) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.hidden { display: none !important; }

.amount-positive { color: var(--green); }
.amount-negative { color: var(--pink-deep); }
.amount-neutral { color: var(--gold-deep); }

.w-full { width: 100%; }

/* --- Peggy RPG dialog (arcade cabinet motif) --- */
.peggy-dialog {
  background: var(--ink);
  color: var(--cream);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(56,32,28,.35);
  padding: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
}
.peggy-dialog img {
  width: 72px; height: 72px;
  image-rendering: pixelated;
  border: 4px solid var(--cream);
  background: var(--cream);
  flex-shrink: 0;
}
.peggy-dialog .txt { font-size: 24px; line-height: 1.5; }
.peggy-dialog .name {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.peggy-dialog .blink { animation: pblink 1s steps(1) infinite; }
@keyframes pblink { 50% { opacity: 0; } }

/* --- Pixel clouds for app pages --- */
.pixel-cloud {
  position: fixed;
  background: var(--white);
  width: 22px; height: 22px;
  box-shadow: 22px 0 var(--white), 44px 0 var(--white),
    11px 11px var(--white), 33px 11px var(--white), 55px 11px var(--white), -11px 11px var(--white);
  opacity: .8;
  z-index: 1;
  pointer-events: none;
}
.pixel-cloud.c1 { top: 20px; right: 5%; }
.pixel-cloud.c2 { top: 90px; right: 18%; transform: scale(.6); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr; }
}

/* -- SPRITE OVERRIDES -- */
.brand-logo-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.brand-sprite { image-rendering: pixelated; display: block; flex-shrink: 0;
  filter: drop-shadow(3px 3px 0 rgba(56,32,28,.3)); }
.nav-sprite { image-rendering: pixelated; display: block; }
.strip-tree { image-rendering: pixelated; }

.brand-tree-strip { display: none; }

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 16px;
  flex-shrink: 0;
}
.nav-icon svg { image-rendering: pixelated; }

.nav-divider {
  padding: 4px 0 !important;
  border: none !important;
  border-bottom: 4px dotted var(--pink) !important;
  background: none !important;
}
.nav-divider svg { display: none; }

/* ===== HOME scoreboard sub-labels ===== */
.stat-sub {
  font-family: 'VT323', monospace;
  font-size: 19px;
  color: #6a4c46;
  margin-top: 6px;
}
