/* Crinance app.css — v3 rebuild */
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-6); }

/* ---- Logo (pure CSS, no external file — cannot fail to render) ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-lg); color: var(--text); letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: linear-gradient(135deg, var(--brand-300), var(--brand-600)); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(18,183,106,0.35); }
.brand-mark svg { width: 18px; height: 18px; }

/* ---- Nav ---- */
.nav { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: var(--blur); border-bottom: 1px solid var(--border); }
.nav-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.nav-links { display: flex; align-items: center; gap: var(--sp-6); }
.nav-links a:not(.btn) { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: color .15s var(--ease); }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-3); }

.icon-btn { width: 38px; height: 38px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .18s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-moon { display: block; } .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; } [data-theme="dark"] .icon-sun { display: block; }

.burger { display: none; width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); align-items: center; justify-content: center; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s var(--ease); }
.burger span:nth-child(1) { top: 13px; } .burger span:nth-child(2) { top: 18px; } .burger span:nth-child(3) { top: 23px; }
.burger.active span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-weight: 600; font-size: var(--fs-sm); border: none; cursor: pointer; border-radius: var(--r-full); padding: 12px 24px; transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease), background-color .16s var(--ease); }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--brand-500); color: var(--on-brand); box-shadow: 0 8px 24px rgba(18,183,106,.32); }
.btn-primary:hover { background: var(--brand-400); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(18,183,106,.4); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--brand-500); background: color-mix(in srgb, var(--brand-500) 8%, transparent); }
.btn-sm { padding: 9px 18px; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* ---- Layout helpers ---- */
.section { padding: var(--sp-20) 0; }
.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-balance { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 900px) { .grid-balance { grid-template-columns: 1fr; } }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.flex { display: flex; } .items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .flex-wrap { flex-wrap: wrap; }
.muted { color: var(--text-2); } .small { font-size: var(--fs-sm); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); } .mb-0 { margin-bottom: 0; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.card-hover:hover { transform: translateY(-4px); border-color: var(--brand-600); box-shadow: var(--shadow-2); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 4px 11px; border-radius: var(--r-full); }
.badge-low { background: color-mix(in srgb, var(--brand-500) 16%, transparent); color: var(--brand-400); }
.badge-mid { background: color-mix(in srgb, var(--amber-500) 16%, transparent); color: var(--amber-500); }
.badge-high { background: color-mix(in srgb, var(--red-500) 16%, transparent); color: var(--red-500); }

/* ---- Table ---- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table td { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Hero ---- */
.hero { position: relative; padding: var(--sp-20) 0 var(--sp-16); text-align: center; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 640px; z-index: -1;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, color-mix(in srgb, var(--brand-500) 26%, transparent), transparent 70%);
}
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); margin-bottom: var(--sp-6); animation: fadeUp .6s var(--ease) both; }
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); animation: pulse 2s ease-in-out infinite; }
.hero h1 { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; max-width: 800px; margin: 0 auto var(--sp-5); animation: fadeUp .6s var(--ease) .08s both; }
.hero p { font-size: var(--fs-lg); color: var(--text-2); max-width: 560px; margin: 0 auto var(--sp-8); animation: fadeUp .6s var(--ease) .16s both; }
.hero-actions { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; animation: fadeUp .6s var(--ease) .24s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(18,183,106,.5); } 50% { box-shadow: 0 0 0 5px rgba(18,183,106,0); } }

.trust-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: var(--sp-6) 0; }
.trust-strip .grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); text-align: center; }
.trust-strip .num { font-size: var(--fs-2xl); font-weight: 700; }
.trust-strip .lbl { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

.section-head { text-align: center; max-width: 560px; margin: 0 auto var(--sp-12); }
.section-head h2 { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--sp-3); }
.section-head p { color: var(--text-2); }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); padding: var(--sp-12) 0 var(--sp-8); color: var(--text-3); font-size: var(--fs-sm); }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--sp-8); margin-bottom: var(--sp-10); }
.footer-cols strong { color: var(--text); display: block; margin-bottom: var(--sp-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.footer-cols a { display: block; color: var(--text-2); margin-bottom: var(--sp-2); transition: color .15s var(--ease); }
.footer-cols a:hover { color: var(--brand-400); }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); }
.auth-card { width: 100%; max-width: 420px; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--sp-2); }
.input { width: 100%; font-family: inherit; font-size: var(--fs-base); padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 20%, transparent); }

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }

/* ---- Mobile ---- */
@media (max-width: 900px) {
  .nav-links { position: absolute; top: 76px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; gap: var(--sp-1); max-height: 0; overflow: hidden; opacity: 0; padding: 0 var(--sp-6); transition: max-height .3s var(--ease), opacity .25s var(--ease), padding .3s var(--ease); }
  .nav-links.open { max-height: 420px; opacity: 1; padding: var(--sp-4) var(--sp-6) var(--sp-6); }
  .nav-links a:not(.btn) { padding: 10px 0; }
  .nav-links .btn { margin-top: var(--sp-2); }
  .burger { display: flex; }
  .hero h1 { font-size: var(--fs-3xl); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Legacy component classes — kept for pages not yet redesigned ---- */
.eyebrow { color: var(--brand-500); font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.page-title { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.02em; margin: var(--sp-2) 0 var(--sp-6); }

.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-full); }
.btn-secondary:hover { border-color: var(--brand-500); }
.btn-ghost { background: transparent; color: var(--brand-500); border-radius: var(--r-md); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-500); color: #fff; border-radius: var(--r-md); }
.btn-danger:hover { filter: brightness(1.1); }

.badge-success { background: color-mix(in srgb, var(--brand-500) 16%, transparent); color: var(--brand-400); }
.badge-error { background: color-mix(in srgb, var(--red-500) 16%, transparent); color: var(--red-500); }
.badge-warning { background: color-mix(in srgb, var(--amber-500) 16%, transparent); color: var(--amber-500); }
.badge-info { background: color-mix(in srgb, var(--blue-500) 16%, transparent); color: var(--blue-500); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

.alert { padding: var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.alert-success { background: color-mix(in srgb, var(--brand-500) 14%, transparent); color: var(--brand-400); }
.alert-error { background: color-mix(in srgb, var(--red-500) 14%, transparent); color: var(--red-500); }
.alert-warning { background: color-mix(in srgb, var(--amber-500) 14%, transparent); color: var(--amber-500); }
.alert-info { background: color-mix(in srgb, var(--blue-500) 14%, transparent); color: var(--blue-500); }

.help-text { color: var(--text-3); font-size: var(--fs-xs); margin-top: 4px; }
.error-text { color: var(--red-500); font-size: var(--fs-xs); margin-top: 4px; }
.text-success { color: var(--brand-400); }
.text-error { color: var(--red-500); }

.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.gap-2 { gap: var(--sp-2); }
.mb-2 { margin-bottom: var(--sp-2); }
.mt-2 { margin-top: var(--sp-2); }
.mt-8 { margin-top: var(--sp-8); }
.flex-col { flex-direction: column; }

/* ---- Dashboard / admin shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: var(--sp-6) var(--sp-4); position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: transform .25s var(--ease); z-index: 200; }
.sidebar .logo { display: block; margin-bottom: var(--sp-8); }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; margin-bottom: 2px; transition: background-color .15s var(--ease), color .15s var(--ease); }
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active { background: var(--brand-500); color: var(--on-brand); font-weight: 600; }
.main { flex: 1; padding: var(--sp-8); min-width: 0; }
.topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-8); gap: var(--sp-4); flex-wrap: wrap; }
.sidebar-backdrop { display: none; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card .label { font-size: var(--fs-xs); font-weight: 600; color: var(--brand-500); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: var(--sp-2); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-2); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 190; }
  .main { padding: var(--sp-4); }
}

/* ---- Dashboard mobile top bar ---- */
.dash-topbar { display: none; align-items: center; justify-content: space-between; padding: var(--sp-4); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: var(--blur); z-index: 150; }
.sidebar-foot { margin-top: auto; padding-top: var(--sp-6); display: flex; align-items: center; gap: var(--sp-2); }
.sidebar-inner { display: flex; flex-direction: column; min-height: calc(100vh - var(--sp-12)); }

@media (max-width: 900px) {
  .dash-topbar { display: flex; }
  .shell { flex-direction: column; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topline { align-items: flex-start; }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Typography: Space Grotesk for headings & display numbers ---- */
h1, h2, h3, .page-title, .hero h1, .section-head h2, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* ---- Balance card: adapts to light/dark theme ---- */
.balance-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-100), var(--surface));
  border-color: var(--brand-300);
}
.balance-card .bc-label { color: var(--text-2); }
.balance-card .bc-value { color: var(--text); font-family: var(--font-display); }
.balance-card .bc-sub-label { color: var(--text-3); }
.balance-card .bc-sub-value { color: var(--text); }
[data-theme="dark"] .balance-card {
  background: linear-gradient(135deg, var(--brand-700), var(--ink-900));
  border-color: var(--brand-600);
}
[data-theme="dark"] .balance-card .bc-label,
[data-theme="dark"] .balance-card .bc-sub-label { color: rgba(243, 250, 246, 0.65); }
[data-theme="dark"] .balance-card .bc-value,
[data-theme="dark"] .balance-card .bc-sub-value { color: #F3FAF6; }

/* ---- Scrollable asset strip (dashboard) ---- */
.asset-scroll { display: flex; gap: var(--sp-4); overflow-x: auto; padding-bottom: var(--sp-2); -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.asset-scroll-item { flex: 0 0 auto; width: 168px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); }
.asset-scroll-item .asset-name { font-size: var(--fs-xs); color: var(--text-2); margin-top: var(--sp-2); }
.asset-scroll-item .asset-amount { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); margin-top: 2px; }

.chart-embed { height: 600px; }
@media (max-width: 900px) {
  .asset-scroll-item { width: 140px; }
  .chart-embed { height: 460px; }
}
