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

:root {
  --gold:          #DAA520;
  --gold-light:    #FFD700;
  --gold-mid:      #C8960C;
  --gold-dark:     #7a5500;
  --gold-border:   #3a2400;
  --silver:        #C0C0C0;
  --silver-light:  #E8E8E8;
  --silver-dark:   #707070;
  --bg:            #000000;
  --bg2:           #080808;
  --bg3:           #111111;
  --card:          #0d0d0d;
  --card2:         #161616;
  --border:        #2a1800;
  --border2:       #1a1000;
  --text:          #e8d9b8;
  --text-muted:    #7a6540;
  --red:           #e05555;
  --green:         #44bb44;
  --radius:        14px;
}

/* ── Gold Foil Text ───────────────────────────────────────────────────────── */
.foil {
  background: linear-gradient(105deg, #7a5500 0%, #c8960c 15%, #ffd700 30%, #fff5b0 45%, #ffd700 55%, #c8960c 70%, #f0c040 82%, #7a5500 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: foil-shine 6s linear infinite;
}

@keyframes foil-shine { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

/* ── Login Screen ─────────────────────────────────────────────────────────── */
#loginScreen {
  position: fixed; inset: 0; background: #000; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; padding-top: env(safe-area-inset-top, 24px);
}

#loginScreen.hidden { display: none; }

.login-chest { width: 100px; height: 100px; margin-bottom: 20px; filter: drop-shadow(0 0 30px rgba(218,165,32,0.4)); }
.login-title { font-size: 2rem; font-weight: 900; letter-spacing: 1px; text-align: center; margin-bottom: 4px; line-height: 1.1; }
.login-subtitle { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; text-align: center; margin-bottom: 40px; }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }

.login-input {
  width: 100%; background: #111; border: 1px solid var(--gold-border); border-radius: 10px;
  color: var(--text); padding: 14px 16px; font-size: 1rem; transition: border-color 0.2s; -webkit-appearance: none;
}
.login-input:focus { outline: none; border-color: var(--gold-dark); background: #161616; }
.login-input::placeholder { color: var(--text-muted); }

.login-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-mid), var(--gold-light), var(--gold-mid));
  background-size: 200% auto; border: none; border-radius: 10px;
  color: #000; font-size: 1rem; font-weight: 900; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s; -webkit-appearance: none; margin-top: 4px;
}
.login-btn:hover  { background-position: right center; transform: translateY(-1px); }

.demo-divider { text-align: center; color: var(--text-muted); font-size: 0.72rem; letter-spacing: 1px; margin: 6px 0 2px; }
.demo-btn {
  width: 100%; max-width: 360px; padding: 13px;
  background: transparent; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; color: rgba(255,255,255,0.7); font-size: 0.9rem;
  font-weight: 600; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s;
  -webkit-appearance: none;
}
.demo-btn:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.35); }
.demo-note { font-size: 0.65rem; text-align: center; margin-top: 6px; letter-spacing: 0.5px; }

.demo-header-badge {
  background: linear-gradient(135deg,#4a90d9,#2266aa); color: #fff;
  font-size: 0.6rem; font-weight: 900; letter-spacing: 1.5px;
  padding: 3px 9px; border-radius: 20px; margin-right: 8px;
  text-transform: uppercase; animation: demo-pulse 2s ease-in-out infinite;
}
@keyframes demo-pulse { 0%,100%{opacity:1} 50%{opacity:0.65} }
.login-btn:active { transform: translateY(0); }

.login-error { color: var(--red); font-size: 0.82rem; text-align: center; min-height: 20px; margin-top: -6px; }

/* ── App Wrapper ──────────────────────────────────────────────────────────── */
#appWrapper { display: none; }

/* ── Bottom Bar ──────────────────────────────────────────────────────────── */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: #000; border-top: 1px solid var(--gold-border);
}

.bottom-bar-user {
  font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

.bottom-logout-btn {
  background: linear-gradient(135deg, #1a0e00, #2d1a00);
  border: 1px solid var(--gold-border); border-radius: 20px;
  color: var(--gold); font-size: 0.78rem; font-weight: 700;
  padding: 8px 20px; cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.2s;
}
.bottom-logout-btn:hover  { border-color: var(--gold-dark); background: #2d1a00; }
.bottom-logout-btn:active { transform: scale(0.97); }

/* ── Home Screen ─────────────────────────────────────────────────────────── */
.home-screen {
  max-width: 600px; margin: 0 auto; padding: 32px 16px 40px;
  display: flex; flex-direction: column; align-items: center;
}

.home-logo {
  width: 220px; height: auto; border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 0 60px rgba(218,165,32,0.35), 0 0 120px rgba(218,165,32,0.15);
}

.home-tagline {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 3px;
  margin-bottom: 36px;
}

.home-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%;
}

@media (max-width: 400px) {
  .home-tiles { grid-template-columns: repeat(2, 1fr); }
}

.home-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px 12px 18px;
  background: linear-gradient(145deg, #0d0700, #1a0e00);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; gap: 10px;
  min-height: 100px;
}

.home-tile:hover {
  border-color: var(--gold-dark);
  background: linear-gradient(145deg, #1a0e00, #2a1600);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(218,165,32,0.15);
}

.home-tile:active { transform: translateY(0); }

.home-tile-icon { font-size: 2rem; line-height: 1; }

.home-tile-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--gold); text-align: center;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: #000; border-bottom: 1px solid var(--gold-border);
  padding: 10px 16px 8px; position: sticky; top: 0; z-index: 200;
}
.header-inner { max-width: 800px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.header-title { display: flex; align-items: center; gap: 10px; }
.header-title img { width: 32px; height: 32px; border-radius: 6px; }
.header-title h1 { font-size: 1.1rem; font-weight: 900; letter-spacing: 0.5px; }
.header-title h1 span { display: block; font-size: 0.58rem; font-weight: 400; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; -webkit-text-fill-color: var(--text-muted); background: none; }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-user { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.logout-btn { background: none; border: 1px solid var(--gold-border); border-radius: 6px; color: var(--text-muted); font-size: 0.68rem; padding: 4px 8px; cursor: pointer; }
.logout-btn:hover { border-color: var(--gold-dark); color: var(--gold); }

/* ── Top Navigation ──────────────────────────────────────────────────────── */
.top-nav {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 12px; background: #000; border-bottom: 1px solid var(--border);
  position: sticky; top: 53px; z-index: 190;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  flex-shrink: 0; padding: 8px 16px; background: transparent;
  border: 1px solid transparent; border-radius: 20px;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
.nav-btn.active {
  background: linear-gradient(135deg, #1a0e00, #2d1a00);
  color: var(--gold-light); border-color: var(--gold-border);
}
.nav-btn:hover:not(.active) { background: #111; color: var(--text); }

/* ── Section Panels ──────────────────────────────────────────────────────── */
.section-panel { display: none; }
.section-panel.active { display: block; }

.section-main { max-width: 800px; margin: 0 auto; padding: 14px 14px; }

.section-page-title {
  font-size: 1.4rem; font-weight: 900; margin-bottom: 16px; letter-spacing: 0.5px;
}

/* ── Tab Nav (inner) ─────────────────────────────────────────────────────── */
.tab-nav {
  display: flex; gap: 3px; background: #0a0a0a; padding: 4px;
  border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 9px 4px; background: transparent; border: none; border-radius: 10px;
  color: var(--text-muted); font-size: 0.78rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px;
}
.tab-btn.active { background: linear-gradient(135deg, #1a0e00, #2d1a00); color: var(--gold-light); border: 1px solid var(--gold-border); }
.tab-btn:hover:not(.active) { background: #141414; color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sub-tabs */
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

/* ── Section Header ──────────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border: none; border-radius: 8px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.15s;
  background: var(--card2); color: var(--text); border: 1px solid var(--border);
  -webkit-appearance: none;
}
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-primary { background: linear-gradient(135deg, #1a0e00, #2d1a00); color: var(--gold-light); border-color: var(--gold-border); }
.btn-primary:hover { border-color: var(--gold); }
.btn-outline { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-outline:hover { border-color: var(--gold-border); color: var(--text); }
.btn-danger { background: rgba(224,85,85,0.12); color: var(--red); border-color: rgba(224,85,85,0.2); }
.btn-danger:hover { background: rgba(224,85,85,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-icon {
  width: 32px; height: 32px; background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.85rem; transition: all 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover         { border-color: var(--gold-border); color: var(--gold); }
.btn-icon.danger:hover  { border-color: rgba(224,85,85,0.4); color: var(--red); }
.btn-link { background: none; border: none; color: var(--text-muted); font-size: 0.78rem; cursor: pointer; text-decoration: underline; padding: 0; }

/* ── FAB ─────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 24px; right: 20px; width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-mid), var(--gold-light));
  border: none; border-radius: 50%; color: #000; font-size: 1.5rem; font-weight: 900;
  cursor: pointer; box-shadow: 0 4px 20px rgba(218,165,32,0.3); z-index: 150;
  display: flex; align-items: center; justify-content: center; transition: transform 0.2s;
}
.fab:hover  { transform: scale(1.05); }
.fab:active { transform: scale(0.96); }

/* ── Spot Prices Bar ─────────────────────────────────────────────────────── */
.spot-bar { max-width: 800px; margin: 0 auto; display: flex; gap: 10px; padding: 10px 16px; background: #000; border-bottom: 1px solid var(--border); }
.spot-price { display: flex; align-items: center; gap: 10px; flex: 1; background: var(--card); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--border); }
.spot-price .metal-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 900; letter-spacing: -0.5px; flex-shrink: 0; }
.spot-price.gold-price   .metal-icon { background: radial-gradient(circle at 35% 35%, #FFD700, #8B6914); color: #000; }
.spot-price.silver-price .metal-icon { background: radial-gradient(circle at 35% 35%, #E8E8E8, #707070); color: #111; }
.spot-price .price-info { flex: 1; min-width: 0; }
.spot-price .price-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.spot-price .price-value { font-size: 1.05rem; font-weight: 800; }
.spot-price .price-unit  { font-size: 0.58rem; color: var(--text-muted); }
.price-updated { font-size: 0.6rem; color: var(--text-muted); text-align: center; padding: 4px 16px 2px; background: #000; max-width: 800px; margin: 0 auto; border-bottom: 1px solid var(--border2); }
.price-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); margin-right: 4px; animation: pulse 2s infinite; }

@keyframes price-flash { 0%,100% { opacity:1; } 50% { opacity:0.3; color: #fff; } }
.price-flash { animation: price-flash 0.6s ease; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Summary Cards ───────────────────────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.summary-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 12px; position: relative; overflow: hidden; }
.summary-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.summary-card.gold::before   { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark)); }
.summary-card.silver::before { background: linear-gradient(90deg, var(--silver-dark), var(--silver-light), var(--silver-dark)); }
.summary-card.total::before  { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-mid), var(--gold-light), var(--gold-dark)); background-size: 200%; animation: foil-shine 4s linear infinite; }
.summary-card .card-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.summary-card .card-value { font-size: 1.4rem; font-weight: 900; line-height: 1.1; }
.summary-card .card-sub   { font-size: 0.62rem; color: var(--text-muted); margin-top: 5px; }
.summary-card.total { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-color: var(--gold-border); }
.summary-card.total .card-value { font-size: 1.9rem; }
.pnl-badge { font-size: 0.78rem; font-weight: 800; padding: 5px 12px; border-radius: 20px; }
.pnl-badge.positive { background: rgba(68,187,68,0.12); color: var(--green); border: 1px solid rgba(68,187,68,0.2); }
.pnl-badge.negative { background: rgba(224,85,85,0.12);  color: var(--red);   border: 1px solid rgba(224,85,85,0.2); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.muted    { color: var(--text-muted); }

/* ── Holdings by Company ─────────────────────────────────────────────────── */
.company-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.company-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--card2); border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.company-name  { font-size: 0.95rem; font-weight: 800; }
.company-total { font-size: 0.9rem; font-weight: 800; }
.company-chevron { color: var(--text-muted); transition: transform 0.2s; font-size: 0.75rem; margin-left: 8px; }
.company-block.collapsed .company-chevron { transform: rotate(-90deg); }
.company-block.collapsed .company-rows    { display: none; }
.company-rows { padding: 2px 14px 6px; }
.holding-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border2); gap: 10px; }
.holding-row:last-child { border-bottom: none; }
.holding-metal-badge { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 900; flex-shrink: 0; }
.holding-metal-badge.gold   { background: rgba(218,165,32,0.15); color: var(--gold-light); border: 1px solid var(--gold-border); }
.holding-metal-badge.silver { background: rgba(192,192,192,0.1);  color: var(--silver-light); border: 1px solid #2a2a2a; }
.holding-info { flex: 1; min-width: 0; }
.holding-oz  { font-size: 0.88rem; font-weight: 700; }
.holding-avg { font-size: 0.63rem; color: var(--text-muted); margin-top: 2px; }
.holding-values { text-align: right; flex-shrink: 0; }
.holding-current-val { font-size: 0.9rem; font-weight: 700; }
.holding-pnl { font-size: 0.68rem; font-weight: 700; margin-top: 2px; }
.company-select-btns { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.sel-btn { background: #0d0d0d; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: 0.68rem; padding: 4px 10px; cursor: pointer; }
.sel-btn:hover { border-color: var(--gold-border); color: var(--gold); }

/* ── Purchases ───────────────────────────────────────────────────────────── */
.purchases-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-select { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 0.82rem; -webkit-appearance: none; }
.filter-totals { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: 0.78rem; }
.ft-label { color: var(--text-muted); font-weight: 700; }
.ft-oz    { color: var(--text-muted); }
.ft-cost  { color: var(--text-muted); }
.ft-value { color: var(--gold-light); font-weight: 700; }
.ft-pnl   { font-weight: 800; }

.select-all-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--card2); border-radius: 8px; margin-bottom: 8px; font-size: 0.78rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.purchase-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; transition: border-color 0.15s; }
.purchase-card.selected { border-color: var(--gold-border); background: #100800; }
.purchase-checkbox input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--gold); flex-shrink: 0; }
.purchase-metal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.purchase-metal-dot.gold   { background: var(--gold-light); }
.purchase-metal-dot.silver { background: var(--silver-light); }
.purchase-info { flex: 1; min-width: 0; }
.purchase-main { display: flex; align-items: baseline; gap: 6px; }
.purchase-oz   { font-size: 0.9rem; font-weight: 800; }
.purchase-metal-label { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.purchase-metal-label.gold   { background: rgba(218,165,32,0.15); color: var(--gold-light); }
.purchase-metal-label.silver { background: rgba(192,192,192,0.1); color: var(--silver-light); }
.purchase-sub  { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-value-col { text-align: right; flex-shrink: 0; }
.purchase-paid { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.purchase-gain { font-size: 0.68rem; font-weight: 700; margin-top: 2px; }
.purchase-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* ── Companies ───────────────────────────────────────────────────────────── */
.company-list-item { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.company-list-name { font-size: 0.9rem; font-weight: 700; }
.company-list-sub  { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── Selection Bar ───────────────────────────────────────────────────────── */
.selection-bar {
  position: fixed; bottom: -200px; left: 0; right: 0; z-index: 180;
  background: #0a0500; border-top: 1px solid var(--gold-border);
  padding: 14px 16px; transition: bottom 0.25s cubic-bezier(0.4,0,0.2,1);
  max-width: 640px; margin: 0 auto;
}
.selection-bar.visible { bottom: 0; }
.sel-bar-top  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.8rem; font-weight: 700; }
.sel-bar-clear { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: 0.7rem; padding: 3px 8px; cursor: pointer; }
.sel-bar-oz   { display: flex; gap: 12px; font-size: 0.72rem; font-weight: 700; margin-bottom: 8px; }
.sel-bar-numbers { display: flex; gap: 12px; flex-wrap: wrap; }
.sel-bar-item { flex: 1; min-width: 0; }
.sel-bar-label { font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sel-bar-val  { font-size: 0.9rem; font-weight: 700; }
.sel-bar-pnl  { font-size: 0.82rem; font-weight: 800; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 2rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.85rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label   { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-input, .form-select {
  background: #111; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 11px 12px; font-size: 0.9rem; width: 100%;
  -webkit-appearance: none; transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--gold-dark); }
.form-input::placeholder { color: #3a2a10; }
.form-textarea { resize: vertical; min-height: 70px; font-family: inherit; }

.form-radio-group { display: flex; gap: 16px; }
.form-radio { display: flex; align-items: center; gap: 8px; }
.form-radio input { width: 16px; height: 16px; accent-color: var(--gold); }
.form-radio label { font-size: 0.9rem; cursor: pointer; font-weight: 600; }
.gold-label   { color: var(--gold-light); }
.silver-label { color: var(--silver-light); }
.gold-coin, .silver-coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.gold-coin   { background: radial-gradient(circle at 35% 35%, #FFD700, #8B6914); }
.silver-coin { background: radial-gradient(circle at 35% 35%, #E8E8E8, #707070); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border2); }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 400; align-items: flex-end; justify-content: center; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal {
  background: #0a0500; border: 1px solid var(--gold-border); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.modal-title  { font-size: 1.05rem; font-weight: 900; }
.modal-close  { background: none; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; }
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body   { padding: 16px 18px 24px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1a1000; border: 1px solid var(--gold-border); color: var(--gold-light);
  padding: 10px 20px; border-radius: 22px; font-size: 0.85rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 500; white-space: nowrap;
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error   { background: #1a0000; border-color: rgba(224,85,85,0.4); color: var(--red); }

/* ── Watchlists ──────────────────────────────────────────────────────────── */
.watchlist-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.watchlist-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--card2); border-bottom: 1px solid var(--border); }
.watchlist-name  { font-size: 0.95rem; font-weight: 800; }
.watchlist-owner { font-size: 0.7rem; margin-top: 2px; }
.watchlist-items { padding: 8px 14px 12px; }
.watchlist-item  { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border2); font-size: 0.82rem; }
.watchlist-item:last-child { border-bottom: none; }
.wi-symbol { font-weight: 800; font-size: 0.88rem; width: 70px; flex-shrink: 0; color: var(--gold-light); }
.wi-name   { flex: 1; color: var(--text-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-type   { font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; flex-shrink: 0; }
.badge-stock  { background: rgba(218,165,32,0.12); color: var(--gold-light); border: 1px solid var(--gold-border); }
.badge-etf    { background: rgba(100,149,237,0.12); color: #6495ed; border: 1px solid rgba(100,149,237,0.2); }
.badge-crypto { background: rgba(255,165,0,0.12); color: orange; border: 1px solid rgba(255,165,0,0.2); }
.wi-price  { font-weight: 800; font-size: 0.88rem; width: 90px; text-align: right; flex-shrink: 0; }
.wi-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 3px 6px; border-radius: 4px; flex-shrink: 0; }
.wi-remove:hover { color: var(--red); }

/* ── Portfolio Summary Bar ───────────────────────────────────────────────── */
.portfolio-summary-bar { display: flex; gap: 16px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.psb-item { flex: 1; min-width: 80px; }
.psb-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.psb-val   { font-size: 1rem; font-weight: 800; }

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
.dt-header  { display: flex; gap: 0; background: var(--card2); border-bottom: 1px solid var(--border); padding: 0; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dt-row     { display: flex; gap: 0; border-bottom: 1px solid var(--border2); font-size: 0.8rem; }
.dt-row:last-child { border-bottom: none; }
.dt-row:hover { background: #0a0500; }
.dt-col     { flex: 1; min-width: 70px; padding: 10px 10px; display: flex; flex-direction: column; justify-content: center; }
.dt-header .dt-col { padding: 8px 10px; }
.dt-actions { flex: 0 0 auto; min-width: auto; display: flex; flex-direction: row; gap: 4px; align-items: center; }
.symbol-badge { display: inline-block; font-weight: 800; font-size: 0.82rem; color: var(--gold-light); }
.symbol-badge.crypto { color: orange; }

/* ── Crypto Price Cards ──────────────────────────────────────────────────── */
.crypto-price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.crypto-price-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.cpc-symbol { font-size: 0.75rem; font-weight: 900; color: orange; letter-spacing: 1px; }
.cpc-name   { font-size: 0.62rem; color: var(--text-muted); margin: 2px 0; }
.cpc-price  { font-size: 0.9rem; font-weight: 800; }

/* ── Cash Dashboard ──────────────────────────────────────────────────────── */

/* Entity summary cards */
.cash-entity-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px;
}
@media (min-width: 500px) { .cash-entity-grid { grid-template-columns: repeat(4, 1fr); } }

.cash-entity-card {
  background: linear-gradient(145deg, #0d0700, #1a0e00);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  padding: 14px 12px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.cash-entity-card:hover { border-color: var(--gold-dark); transform: translateY(-1px); }
.cash-entity-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 6px; }
.cash-entity-value { font-size: 1rem; font-weight: 900; }

/* Totals bar */
.cash-totals-bar {
  display: flex; gap: 0; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 4px;
}
.cash-total-item { flex: 1; padding: 12px 14px; text-align: center; }
.cash-total-sep  { width: 1px; background: var(--border); }
.cash-total-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px; }
.cash-total-value { font-size: 0.95rem; font-weight: 900; }

/* Crypto Holdings on Cash Dashboard */
.cash-crypto-section {
  background: var(--card); border: 1px solid var(--gold-border);
  border-radius: var(--radius); margin-top: 12px; overflow: hidden;
}
.crypto-dash-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: linear-gradient(135deg,#0d0700,#1a0e00);
  border-bottom: 1px solid var(--gold-border);
}
.crypto-dash-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.crypto-dash-total { font-size: 1.1rem; font-weight: 900; }
.crypto-dash-subhdr {
  display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1.2fr;
  padding: 5px 14px; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); border-bottom: 1px solid var(--border2);
}
.crypto-dash-row {
  display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1.2fr;
  padding: 10px 14px; border-bottom: 1px solid var(--border2); align-items: center;
}
.crypto-dash-row:last-child { border-bottom: none; }
.crypto-dash-coin { display: flex; flex-direction: column; gap: 2px; }
.crypto-dash-symbol { font-size: 0.88rem; font-weight: 900; color: var(--gold); }
.crypto-dash-wallet { font-size: 0.65rem; }
.crypto-dash-amount { font-size: 0.82rem; font-weight: 600; }
.crypto-dash-amount.editable-amount { cursor: pointer; padding: 3px 6px; border-radius: 5px; transition: background 0.15s; }
.crypto-dash-amount.editable-amount:hover { background: rgba(218,165,32,0.12); }
.crypto-dash-price { font-size: 0.78rem; }
.crypto-dash-value { font-size: 0.88rem; font-weight: 800; text-align: right; }

/* Entity filter pills */
.cash-entity-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cash-filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.72rem; font-weight: 700;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px;
}
.cash-filter-btn.active  { background: linear-gradient(135deg,#1a0e00,#2d1a00); border-color: var(--gold-border); color: var(--gold-light); }
.cash-filter-btn:hover:not(.active) { border-color: var(--gold-dark); color: var(--text); }

/* Entity blocks in overview */
.cash-entity-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.cash-entity-block-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: linear-gradient(135deg,#0d0700,#1a0e00); border-bottom: 1px solid var(--border); }
.cash-entity-block-title { font-size: 1rem; font-weight: 900; letter-spacing: 0.5px; }
.cash-entity-block-total { font-size: 1.1rem; font-weight: 900; }

/* Category sections */
.cash-cat-section { border-bottom: 1px solid var(--border2); }
.cash-cat-section:last-child { border-bottom: none; }
.cash-cat-header { display: flex; justify-content: space-between; align-items: center; padding: 7px 16px; background: #0a0500; }
.cash-cat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.cash-cat-total { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }

/* Account rows */
.cash-acct-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border2); }
.cash-acct-row:last-child { border-bottom: none; }
.cash-acct-name { font-size: 0.85rem; font-weight: 600; }
.cash-acct-bank { font-size: 0.72rem; }
.cash-acct-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cash-acct-date  { font-size: 0.65rem; }
.cash-acct-balance { font-size: 0.9rem; font-weight: 800; color: var(--gold); }

/* Admin update panel */
.cash-update-block { margin-bottom: 20px; }
.cash-update-entity-title { font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); padding: 8px 0; border-bottom: 1px solid var(--gold-border); margin-bottom: 4px; }
.cash-update-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cash-update-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border2); }
.cash-update-row:last-child { border-bottom: none; }
.cash-update-name { flex: 1; font-size: 0.85rem; font-weight: 600; min-width: 0; }
.cash-update-bank { font-size: 0.7rem; }
.cash-update-cat  { font-size: 0.65rem; width: 80px; text-align: right; flex-shrink: 0; }
.cash-update-bal  { font-size: 0.9rem; font-weight: 800; color: var(--gold); min-width: 110px; text-align: right; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; flex-shrink: 0; }
.cash-update-bal:hover { background: rgba(218,165,32,0.12); }
.cash-inline-input { background: #1a1000; border: 1px solid var(--gold-dark); border-radius: 6px; color: var(--gold); font-size: 0.9rem; font-weight: 800; padding: 4px 8px; width: 120px; text-align: right; }

/* Manage accounts list */
.cash-account-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border2); }
.cash-account-row:last-child { border-bottom: none; }
.ca-info { flex: 1; min-width: 0; }
.ca-name  { font-size: 0.88rem; font-weight: 700; }
.ca-type  { font-size: 0.7rem; color: var(--text-muted); }
.ca-notes { font-size: 0.7rem; color: var(--text-muted); }
.ca-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ca-balance { font-size: 0.95rem; font-weight: 800; color: var(--gold); }
.ca-actions { display: flex; gap: 5px; }

/* ── Home Screen Net Worth Banner ────────────────────────────────────────── */
.home-networth-banner {
  width: 100%; background: linear-gradient(135deg, #0d0700 0%, #1a0e00 50%, #0d0700 100%);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 20px; cursor: pointer;
  text-align: center; transition: all 0.2s;
  box-shadow: 0 0 30px rgba(218,165,32,0.1);
}
.home-networth-banner:hover { border-color: var(--gold-dark); box-shadow: 0 0 50px rgba(218,165,32,0.2); }
.home-nw-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 6px; }
.home-nw-value { font-size: 2rem; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.home-nw-cta   { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; }

/* ── Net Worth Section ───────────────────────────────────────────────────── */
.nw-total-block {
  text-align: center; padding: 28px 0 20px;
  border-bottom: 1px solid var(--gold-border); margin-bottom: 20px;
}
.nw-total-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 8px; }
.nw-total-value { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.nw-updated     { font-size: 0.65rem; margin-top: 8px; }

.nw-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.nw-row-left  { display: flex; align-items: center; gap: 12px; padding: 14px 14px 0; }
.nw-row-icon  { font-size: 1.4rem; flex-shrink: 0; }
.nw-row-label { font-size: 0.95rem; font-weight: 800; }
.nw-row-sub   { font-size: 0.68rem; margin-top: 2px; }
.nw-row-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 14px 10px; }
.nw-row-value { font-size: 1.05rem; font-weight: 900; }
.nw-row-pct   { font-size: 0.72rem; min-width: 38px; text-align: right; }
.nw-row-btn   { background: none; border: 1px solid var(--gold-border); border-radius: 20px; color: var(--gold); padding: 3px 10px; cursor: pointer; font-size: 1rem; }
.nw-row-btn:hover { background: rgba(218,165,32,0.1); }
.nw-bar-wrap  { height: 3px; background: var(--border2); }
.nw-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); transition: width 0.6s ease; }

.nw-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; margin-top: 8px;
  background: linear-gradient(135deg, #0d0700, #1a0e00);
  border: 1px solid var(--gold-border); border-radius: var(--radius);
}
.nw-total-row-label { font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.nw-total-row-value { font-size: 1.3rem; font-weight: 900; }

/* ── Company Loans ───────────────────────────────────────────────────────── */
.loans-summary-bar {
  display: flex; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 4px;
}
.loan-sum-item  { flex: 1; padding: 12px 14px; text-align: center; }
.loan-sum-sep   { width: 1px; background: var(--border); }
.loan-sum-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px; }
.loan-sum-val   { font-size: 0.95rem; font-weight: 900; }

.loan-group-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.loan-group-header { padding: 12px 14px; background: linear-gradient(135deg,#0d0700,#1a0e00); border-bottom: 1px solid var(--border); }
.loan-group-name   { font-size: 0.95rem; font-weight: 900; margin-bottom: 6px; }
.loan-group-totals { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.72rem; }

.loan-list-header { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; padding: 5px 14px; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); background: #0a0500; border-bottom: 1px solid var(--border2); }
.loan-list-row    { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; padding: 8px 14px; border-bottom: 1px solid var(--border2); font-size: 0.82rem; }
.loan-list-row:last-child { border-bottom: none; }

.loan-edit-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 40px; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border2); font-size: 0.82rem; }
.loan-edit-row:last-child { border-bottom: none; }
.loan-edit-date { font-size: 0.72rem; }
.loan-edit-principal, .loan-edit-accrued { cursor: pointer; padding: 3px 6px; border-radius: 5px; font-weight: 700; color: var(--gold); transition: background 0.15s; }
.loan-edit-principal:hover, .loan-edit-accrued:hover { background: rgba(218,165,32,0.12); }

/* ── Liabilities ─────────────────────────────────────────────────────────── */
.liab-summary-bar   { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 0 4px; }
.liab-sum-item      { background: rgba(220,50,50,0.08); border: 1px solid rgba(220,50,50,0.25); border-radius: 10px; padding: 8px 14px; min-width: 110px; }
.liab-sum-label     { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 3px; }
.liab-sum-val       { font-size: 0.95rem; font-weight: 900; }
.liab-group-block   { background: var(--card); border: 1px solid rgba(220,50,50,0.3); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.liab-group-header  { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(40,0,0,0.6); border-bottom: 1px solid rgba(220,50,50,0.2); }
.liab-group-label   { font-size: 0.82rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.liab-group-total   { font-size: 0.9rem; font-weight: 900; }
.liab-row           { padding: 10px 14px; border-bottom: 1px solid var(--border2); }
.liab-row:last-child { border-bottom: none; }
.liab-row-main      { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.liab-name          { font-size: 0.88rem; font-weight: 700; }
.liab-lender        { font-size: 0.75rem; }
.liab-badges        { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.liab-sync-badge    { font-size: 0.65rem; background: rgba(218,165,32,0.12); border: 1px solid var(--gold-border); color: var(--gold); border-radius: 10px; padding: 2px 7px; }
.liab-nw-badge      { font-size: 0.65rem; border-radius: 10px; padding: 2px 7px; }
.liab-nw-badge.nw-on  { background: rgba(220,50,50,0.15); border: 1px solid rgba(220,50,50,0.35); color: #ff6666; }
.liab-nw-badge.nw-off { background: var(--bg3); border: 1px solid var(--border2); color: var(--text-muted); }
.liab-row-nums      { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.liab-num-item      { min-width: 70px; }
.liab-num-label     { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 2px; }
.liab-num-val       { font-size: 0.88rem; font-weight: 700; }
.liab-num-val.danger{ color: var(--red, #cc3333); }
.liab-actions       { display: flex; gap: 6px; margin-left: auto; }
.liab-util-bar-wrap { height: 3px; background: var(--bg3); border-radius: 2px; margin-top: 8px; }
.liab-util-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

/* ── Business Valuation Row ─────────────────────────────────────────────── */
.biz-valuation-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.biz-val-item      { background: var(--bg3); border-radius: 8px; padding: 7px 10px; }
.biz-val-tcl       { background: rgba(218,165,32,0.08); border: 1px solid var(--gold-border); }
.biz-val-label     { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.biz-val-num       { font-size: 0.88rem; font-weight: 800; }

.form-section-label   { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border2); }
.biz-valuation-section { margin-top: 4px; }
.biz-tcl-calc      { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(218,165,32,0.06); border: 1px solid var(--gold-border); border-radius: 8px; margin-top: 8px; }
.biz-tcl-calc-label { font-size: 0.75rem; color: var(--text-muted); }
.biz-tcl-calc-value { font-size: 1rem; font-weight: 900; }

/* ── Other Assets ────────────────────────────────────────────────────────── */
.oa-group-block  { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.oa-group-header { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: linear-gradient(135deg,#0d0700,#1a0e00); border-bottom: 1px solid var(--border); }
.oa-group-label  { font-size: 0.85rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.oa-group-total  { font-size: 0.9rem; font-weight: 900; }
.oa-list-row     { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border2); font-size: 0.82rem; }
.oa-list-row:last-child { border-bottom: none; }
.oa-name         { flex: 1; }
.oa-value-wrap   { display: flex; align-items: center; gap: 8px; }
.oa-value        { font-weight: 700; min-width: 90px; text-align: right; }
.oa-total-bar    { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border: 1px solid var(--gold-border); border-radius: var(--radius); background: rgba(218,165,32,0.06); margin-top: 6px; }
.oa-total-label  { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.oa-total-value  { font-size: 1.1rem; font-weight: 900; }

/* ── Real Estate / Homes ─────────────────────────────────────────────────── */
.re-summary { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; }
.re-summary span { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; }

.asset-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; display: flex; flex-direction: column; }
.asset-card-img { width: 100%; height: 180px; background: #0a0a0a; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.asset-card-img img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 3rem; color: var(--border); }
.img-loading { font-size: 0.75rem; color: var(--text-muted); }
.asset-card-body { padding: 14px; }
.asset-card-name { font-size: 1.05rem; font-weight: 900; margin-bottom: 4px; }
.asset-card-type { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.asset-card-address { font-size: 0.78rem; margin-bottom: 10px; }
.asset-card-notes   { font-size: 0.75rem; margin-top: 8px; }
.asset-card-financials { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.acf-item  { flex: 1; min-width: 80px; background: var(--bg3); border-radius: 8px; padding: 8px 10px; }
.acf-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.acf-val   { font-size: 0.92rem; font-weight: 800; }
.asset-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border2); }
.acf-tcl { grid-column: span 2; background: rgba(218,165,32,0.08) !important; border: 1px solid var(--gold-border) !important; }

/* ── Real Estate Summary Bar ─────────────────────────────────────────────── */
.re-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.78rem; color: var(--text-muted); padding: 8px 0 14px; align-items: center; }
.re-summary strong { font-weight: 800; }
.re-sum-sep { color: var(--border); }

/* ── Portfolio Block ─────────────────────────────────────────────────────── */
.portfolio-block {
  background: var(--card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.portfolio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0d0700, #1a0e00);
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.portfolio-header:hover { background: linear-gradient(135deg, #1a0e00, #261500); }

.portfolio-header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.portfolio-icon { font-size: 1.6rem; flex-shrink: 0; }

.portfolio-name { font-size: 1rem; font-weight: 900; line-height: 1.2; }
.portfolio-meta { font-size: 0.68rem; margin-top: 2px; }

.portfolio-header-right { text-align: right; flex-shrink: 0; }
.portfolio-tcl-label { font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.portfolio-tcl-value { font-size: 1.2rem; font-weight: 900; line-height: 1.1; }
.portfolio-chevron {
  font-size: 0.75rem;
  color: var(--gold-dark);
  margin-top: 4px;
  transition: transform 0.25s;
  display: block;
}

.portfolio-summary-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: #0a0500;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.portfolio-summary-bar strong { font-weight: 700; }

.portfolio-properties { padding: 14px; }
.portfolio-properties.hidden { display: none; }
.portfolio-properties .asset-card:last-child { margin-bottom: 0; }

@media (min-width: 600px) {
  .asset-card { flex-direction: row; }
  .asset-card-img { width: 200px; height: auto; min-height: 150px; flex-shrink: 0; }
}

/* ── Businesses ──────────────────────────────────────────────────────────── */
.business-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; display: flex; flex-direction: column; }
.business-card-logo { width: 100%; height: 120px; background: #0a0a0a; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.business-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.biz-logo-placeholder { width: 64px; height: 64px; border-radius: 12px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; color: var(--gold-dark); }
.business-card-body    { padding: 14px; flex: 1; }
.business-card-name    { font-size: 1.05rem; font-weight: 900; margin-bottom: 3px; }
.business-card-industry { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.business-card-desc    { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; }
.business-financials-section { border-top: 1px solid var(--border2); margin-top: 12px; padding-top: 10px; }
.bf-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bf-title  { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.bf-list   { display: flex; flex-direction: column; gap: 6px; }
.bf-item   { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg3); border-radius: 8px; padding: 8px 10px; }
.bf-item-info { flex: 1; min-width: 0; }
.bf-file-name { font-size: 0.78rem; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-year { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; display: block; }
.bf-item-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.bf-del-doc { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.bf-del-doc:hover { color: var(--red); }

@media (min-width: 600px) {
  .business-card { flex-direction: row; }
  .business-card-logo { width: 160px; min-height: 140px; height: auto; flex-shrink: 0; }
}

/* ── Upload Areas ────────────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border); border-radius: 10px; padding: 20px;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  background: #050505; min-height: 80px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--gold-border); background: #0a0500; }
.upload-prompt { font-size: 0.8rem; color: var(--text-muted); }
.upload-link   { color: var(--gold); text-decoration: underline; cursor: pointer; }
.upload-preview img { max-height: 120px; max-width: 100%; border-radius: 6px; object-fit: contain; }
.upload-selected { font-size: 0.78rem; color: var(--text-muted); }
.file-selected { background: var(--bg3); border-radius: 6px; padding: 6px 12px; font-size: 0.78rem; }

/* ── Admin Users Table ───────────────────────────────────────────────────── */
.users-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
.ut-header { display: flex; background: var(--card2); border-bottom: 1px solid var(--border); padding: 0; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ut-row    { display: flex; border-bottom: 1px solid var(--border2); font-size: 0.8rem; }
.ut-row:last-child { border-bottom: none; }
.ut-row:hover { background: #0a0500; }
.ut-col    { flex: 1; min-width: 80px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; }
.ut-header .ut-col { padding: 8px 12px; }
.ut-actions { flex: 0 0 220px; display: flex; flex-direction: row; gap: 5px; align-items: center; flex-wrap: wrap; }

.role-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.role-badge.admin  { background: rgba(218,165,32,0.15); color: var(--gold-light); border: 1px solid var(--gold-border); }
.role-badge.viewer { background: rgba(192,192,192,0.1);  color: var(--silver-light); border: 1px solid #2a2a2a; }

.status-active   { color: var(--green); font-size: 0.78rem; font-weight: 700; }
.status-inactive { color: var(--red);   font-size: 0.78rem; font-weight: 700; }

/* ── Permissions Table ───────────────────────────────────────────────────── */
.perms-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.perms-header { display: flex; background: var(--card2); border-bottom: 1px solid var(--border); font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.perms-row    { display: flex; border-bottom: 1px solid var(--border2); }
.perms-row:last-child { border-bottom: none; }
.perms-col    { flex: 1; padding: 10px 12px; display: flex; align-items: center; font-size: 0.82rem; }
.perms-col:first-child { flex: 3; }
.perms-col input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }
.perms-header .perms-col { padding: 8px 12px; }

/* ── Misc & Utilities ────────────────────────────────────────────────────── */
.cash-total { font-size: 1rem; font-weight: 700; }
.homes-summary { }
