/* ─────────────────────────────────────────────────────────────────
   CU Wire Data — Enterprise Design System
   Bloomberg/PitchBook aesthetic: data-dense, utility-first

   Used by: app.html, dashboard.html, market.html, scorecard.html,
   targeting.html, map.html, login.html, index.html, about.html,
   privacy.html, terms.html, set-password.html, 404.html,
   report.html, cu-network.html, cuso.html, cuso-graph.html

   NOT used by: Wire pages (thecreditunionwire.html, wire-article.html)
   ───────────────────────────────────────────────────────────────── */

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

/* ── CSS Variables — Dark Mode Default ── */
:root{
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --mono:'JetBrains Mono','SF Mono',Consolas,monospace;

  --bg:#0b0e11;
  --surface:#141720;
  --surface2:#1a1e2a;
  --surface3:#212636;
  --border:#2a2f3d;
  --border2:#333a4a;
  --text:#e1e4ea;
  --text2:#a8adb8;
  --text3:#6b7280;
  --text4:#4b5060;

  --accent:#3b82f6;
  --accent-dim:rgba(59,130,246,.1);
  --accent-hover:#2563eb;
  --gold:#3b82f6;
  --gold-dim:rgba(59,130,246,.08);

  --green:#10b981;
  --green-dim:rgba(16,185,129,.1);
  --red:#ef4444;
  --red-dim:rgba(239,68,68,.1);
  --yellow:#f59e0b;
  --yellow-dim:rgba(245,158,11,.1);
  --blue:#60a5fa;

  --glass:rgba(20,23,32,.97);
  --glow:rgba(59,130,246,.08);
  --r:3px;
}

/* ── Light Mode ── */
.light{
  --bg:#f5f6f8;
  --surface:#fff;
  --surface2:#f0f1f4;
  --surface3:#e8eaee;
  --border:#d4d7de;
  --border2:#e0e3ea;
  --text:#111827;
  --text2:#374151;
  --text3:#6b7280;
  --text4:#9ca3af;

  --accent:#2563eb;
  --accent-dim:rgba(37,99,235,.06);
  --accent-hover:#1d4ed8;
  --gold:#2563eb;
  --gold-dim:rgba(37,99,235,.06);

  --green:#059669;
  --green-dim:rgba(5,150,105,.06);
  --red:#dc2626;
  --red-dim:rgba(220,38,38,.06);
  --yellow:#d97706;
  --yellow-dim:rgba(217,119,6,.06);
  --blue:#2563eb;

  --glass:rgba(255,255,255,.97);
  --glow:rgba(37,99,235,.06);
}

/* ── Backward Compatibility — light-default pages ── */
[data-theme="light-default"]{
  --bg:#f5f6f8;--surface:#fff;--surface2:#f0f1f4;--surface3:#e8eaee;
  --border:#d4d7de;--border2:#e0e3ea;
  --text:#111827;--text2:#374151;--text3:#6b7280;--text4:#9ca3af;
  --accent:#2563eb;--accent-dim:rgba(37,99,235,.06);--accent-hover:#1d4ed8;
  --gold:#2563eb;--gold-dim:rgba(37,99,235,.06);
  --green:#059669;--red:#dc2626;--yellow:#d97706;--blue:#2563eb;
  --glass:rgba(255,255,255,.97);--glow:rgba(37,99,235,.06);--r:3px;
}
[data-theme="light-default"].dark{
  --bg:#0b0e11;--surface:#141720;--surface2:#1a1e2a;--surface3:#212636;
  --border:#2a2f3d;--border2:#333a4a;
  --text:#e1e4ea;--text2:#a8adb8;--text3:#6b7280;--text4:#4b5060;
  --accent:#3b82f6;--accent-dim:rgba(59,130,246,.1);--accent-hover:#2563eb;
  --gold:#3b82f6;--gold-dim:rgba(59,130,246,.08);
  --green:#10b981;--red:#ef4444;--yellow:#f59e0b;--blue:#60a5fa;
  --glass:rgba(20,23,32,.97);--glow:rgba(59,130,246,.08);
}

/* ── Base ── */
html{scroll-behavior:smooth}
body{
  font-family:var(--font);
  color:var(--text);
  font-size:13px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  background:var(--bg);
}

/* ── Animations (minimal) ── */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* ── Focus (Accessibility) ── */
*:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}

/* ── Skip Link ── */
.skip-link{
  position:absolute;top:-100%;left:8px;z-index:9999;
  padding:6px 14px;background:var(--accent);color:#fff;
  font-size:12px;font-weight:700;border-radius:0 0 3px 3px;
  text-decoration:none;transition:top .2s;
}
.skip-link:focus{top:0}

/* ─────────────────────────────────────────────────────────────────
   Navigation — Enterprise Terminal Toolbar
   ───────────────────────────────────────────────────────────────── */
nav{
  display:flex;justify-content:space-between;align-items:center;
  padding:0 24px;height:42px;
  position:sticky;top:0;z-index:100;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}

.site-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:0 24px;height:42px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:100;
}

.logo{
  font-size:14px;font-weight:700;
  color:var(--text);text-decoration:none;
  letter-spacing:-.2px;flex-shrink:0;
}
.logo span{color:var(--accent)}

/* Universal Search */
.site-header .header-search{position:relative;flex:1;max-width:400px;margin:0 16px}
.uni-search{width:100%;padding:5px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--r);color:var(--text);font-size:11px;font-family:var(--font);outline:none}
.uni-search:focus{border-color:var(--accent)}
.uni-search::placeholder{color:var(--text4)}
.uni-results{display:none;position:absolute;top:100%;left:0;right:0;margin-top:2px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r);max-height:400px;overflow-y:auto;z-index:200}
.uni-results.open{display:block}
.us-section{border-bottom:1px solid var(--border)}
.us-section:last-child{border-bottom:none}
.us-header{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:var(--surface2)}
.us-label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--accent);font-family:var(--mono)}
.us-viewall{font-size:9px;font-weight:600;color:var(--text4);text-decoration:none}
.us-viewall:hover{color:var(--accent)}
.us-item{display:block;padding:6px 10px;text-decoration:none;transition:background .05s;border-bottom:1px solid var(--border)}
.us-item:last-child{border-bottom:none}
.us-item:hover{background:var(--accent-dim)}
.us-item-name{font-size:12px;font-weight:600;color:var(--text)}
.us-item-meta{font-size:10px;color:var(--text4)}

.nav-right,.header-nav-row{display:flex;align-items:center;gap:6px}

.header-right{display:flex;align-items:center;gap:2px}
.header-right a{
  font-size:11px;color:var(--text3);text-decoration:none;
  font-weight:600;text-transform:uppercase;letter-spacing:.4px;
  padding:10px 10px;border-bottom:2px solid transparent;
  transition:color .1s,border-color .1s;
}
.header-right a:hover{color:var(--text)}
.header-right a.active{color:var(--accent);border-bottom-color:var(--accent)}
.nav-account{font-size:10px!important;opacity:.6;text-transform:uppercase!important}
#signout{opacity:.5}
#signout:hover{opacity:1}
#adminLink{font-size:10px!important;opacity:.5}

.nav-links{display:flex;gap:2px;align-items:center}
.nav-links a{
  color:var(--text3);text-decoration:none;
  font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;
  padding:10px 10px;border-bottom:2px solid transparent;
  transition:color .1s,border-color .1s;
}
.nav-links a:hover{color:var(--text)}
.nav-links a.active{color:var(--accent);border-bottom-color:var(--accent)}

/* Tools dropdown */
.nav-dropdown{position:relative;display:inline-block}
.nav-dropdown-trigger{cursor:pointer}
.nav-dropdown-menu{
  display:none;position:absolute;top:100%;right:0;margin-top:2px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:4px 0;min-width:280px;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.15);
  flex-direction:column;
}
.nav-dropdown-menu.open{display:flex}
.header-right .nav-dropdown-menu a,
.nav-dropdown-menu a{
  display:block;padding:6px 14px;font-size:11px;color:var(--text2);
  text-decoration:none;font-weight:600;text-transform:uppercase;letter-spacing:.3px;
  white-space:nowrap;border-bottom:none;
}
.header-right .nav-dropdown-menu a:hover,
.nav-dropdown-menu a:hover{background:var(--surface2);color:var(--accent)}
.nav-dropdown-menu .dd-label{display:block;font-size:11px;font-weight:700}
.nav-dropdown-menu .dd-desc{display:block;font-size:10px;font-weight:400;color:var(--text4);text-transform:none;letter-spacing:0;margin-top:1px}
.nav-dropdown-menu a:hover .dd-desc{color:var(--text3)}

.nav-btn{
  padding:6px 14px;background:var(--accent);border-radius:var(--r);
  font-size:11px;text-decoration:none;font-weight:700;color:#fff;
  text-transform:uppercase;letter-spacing:.3px;
  transition:background .15s;
}
.nav-btn:hover{background:var(--accent-hover)}

.dm-toggle{
  background:none;border:1px solid var(--border);border-radius:var(--r);
  padding:3px 8px;cursor:pointer;font-size:13px;
  color:var(--text4);font-family:var(--font);transition:all .1s;
}
.dm-toggle:hover{border-color:var(--accent);color:var(--text2)}

/* Hamburger Menu */
.hamburger{
  display:none;background:none;border:none;
  font-size:18px;cursor:pointer;color:var(--text);padding:4px;
}
.hamburger.open{transform:rotate(90deg)}

/* ── Mobile Nav ── */
@media(max-width:768px){
  nav,.site-header{padding:0 14px;height:40px}
  .hamburger{display:block}
  .header-search{display:none}

  .nav-links{
    display:none;position:absolute;top:100%;right:0;left:0;
    flex-direction:column;background:var(--surface);
    border-bottom:1px solid var(--border);padding:8px 14px;gap:0;z-index:99;
  }
  .nav-links.open{display:flex}
  .nav-links a{font-size:12px;padding:10px 0;border-bottom:1px solid var(--border);width:100%}
  .nav-links a:last-child{border-bottom:none}

  .site-header{flex-wrap:wrap}
  .site-header .header-right{
    display:none;width:100%;flex-direction:column;gap:0;
    padding-top:8px;border-top:1px solid var(--border);margin-top:8px;
  }
  .header-right.open{display:flex}
  .header-right a{
    padding:10px 0;font-size:12px;border-bottom:1px solid var(--border);
    min-height:40px;display:flex;align-items:center;
  }
  .header-right a:last-child{border-bottom:none}

  .nav-dropdown{display:block}
  .nav-dropdown-trigger{display:flex;align-items:center;padding:10px 0;font-size:12px;border-bottom:1px solid var(--border);min-height:40px}
  .nav-dropdown-menu{position:static;border:none;border-radius:0;margin:0;padding:0 0 0 14px;background:transparent;display:none}
  .nav-dropdown-menu.open{display:block}
  .nav-dropdown-menu a{padding:8px 0;font-size:11px;border-bottom:1px solid var(--border)}
  .nav-account{font-size:12px!important;opacity:1!important}
}

/* ── Footer ── */
footer{
  border-top:1px solid var(--border);
  padding:20px 24px;text-align:center;
  font-size:11px;color:var(--text4);
}
footer a{color:var(--text3);text-decoration:none}
footer a:hover{color:var(--accent)}
.footer-disclaimer{
  max-width:600px;margin:0 auto 8px;
  font-size:10px;color:var(--text4);line-height:1.5;
}

/* ── Responsive ── */
@media(max-width:480px){
  body{font-size:13px}
  footer{padding:16px 14px;font-size:10px}
}

/* ── Reduced Motion ── */
@media(prefers-reduced-motion:reduce){
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important}
}
