/* ===================================================================
   RobotBru — Dark theme dashboard
   =================================================================== */

:root {
  /* surfaces */
  --bg:            #0f0f0f;
  --bg-2:          #141414;
  --surface:       rgba(255,255,255,0.03);
  --surface-2:     rgba(255,255,255,0.05);
  --surface-3:     rgba(255,255,255,0.08);
  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);

  /* text */
  --text:          #f5f5f5;
  --text-2:        #8b8b9e;
  --text-3:        #5a5a6e;

  /* accent */
  --accent:        #f97316;
  --accent-2:      #fb923c;
  --accent-3:      #ea580c;
  --accent-glow:   rgba(249,115,22,0.35);
  --accent-soft:   rgba(249,115,22,0.12);

  /* semantic */
  --bull:          #22d3ee;
  --bear:          #f43f5e;
  --neutral:       #94a3b8;

  /* verdicts */
  --v-acheter:     #22d3ee;
  --v-renforcer:   #34d399;
  --v-conserver:   #fbbf24;
  --v-alleger:     #fb923c;
  --v-vendre:      #f43f5e;

  /* layout */
  --sidebar-w: 220px;
  --radius:     16px;
  --radius-sm:  10px;
  --gap:        18px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
}

/* ============================ reset ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

/* ============================ background orbs =================== */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(249,115,22,0.08), transparent 70%);
  top: -160px; right: -120px;
}
body::after {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(34,211,238,0.05), transparent 70%);
  bottom: -140px; left: 180px;
}

/* ============================ layout ============================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================ sidebar =========================== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(15,15,15,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 20px 14px;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar__logo img { width: 36px; height: 36px; }
.sidebar__logo span {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.5px;
}
.sidebar__logo b { color: var(--accent); }

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar__nav a, .sidebar__nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  text-align: left;
  width: 100%;
}
.sidebar__nav a:hover, .sidebar__nav button:hover { background: var(--surface-2); color: var(--text); }
.sidebar__nav a.active {
  background: var(--accent-soft);
  color: var(--accent-2);
}
.sidebar__nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar__nav a svg, .sidebar__nav button svg { width: 19px; height: 19px; flex-shrink: 0; }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.sidebar__user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-info strong { display: block; font-size: 0.85rem; }
.sidebar__user-info small { font-size: 0.72rem; color: var(--text-3); }
.sidebar__logout {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar__logout:hover { background: rgba(244,63,94,0.12); color: var(--bear); }
.sidebar__logout svg { width: 17px; height: 17px; }

/* ============================ main ============================= */
.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================ header =========================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,15,15,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header__title h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.4px; }
.header__title p { font-size: 0.8rem; color: var(--text-2); }

.header__kpis {
  display: flex;
  gap: 26px;
  align-items: center;
}
.header__kpi { text-align: right; }
.header__kpi label { display: block; font-size: 0.68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; }
.header__kpi .amount { font-size: 1rem; font-weight: 700; }

.header__actions { display: flex; gap: 10px; align-items: center; }

/* ============================ icon button ====================== */
.iconbtn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: var(--transition);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.iconbtn svg { width: 18px; height: 18px; }

/* ============================ content ========================== */
.content {
  padding: 26px 28px 60px;
  flex: 1;
}

/* ============================ bento grid ======================= */
.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}
.bento--wide { grid-column: span 2; }

/* ============================ card ============================= */
.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card__head h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.card__head .card__sub { font-size: 0.78rem; color: var(--text-3); }
.card__link { font-size: 0.8rem; color: var(--accent-2); font-weight: 500; }
.card__link:hover { color: var(--accent); }

/* big value */
.bigval { margin: 4px 0 10px; }
.bigval .amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -1px; }
.bigval .amount small { font-size: 1rem; font-weight: 600; color: var(--text-2); }
.bigval .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; font-weight: 600; margin-left: 8px; }

/* delta directions */
.delta--up { color: var(--bull); }
.delta--down { color: var(--bear); }
.delta--flat { color: var(--neutral); }

/* ============================ sparkline ======================== */
.sparkline { width: 100%; height: 40px; margin-top: 8px; }

/* ============================ donut / allocation ============== */
.alloc-list { display: flex; flex-direction: column; gap: 12px; }
.alloc-item { display: flex; align-items: center; gap: 10px; }
.alloc-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alloc-item .label { flex: 1; font-size: 0.82rem; color: var(--text-2); }
.alloc-item .val { font-size: 0.82rem; font-weight: 600; font-family: var(--mono); }
.alloc-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.alloc-bar__fill { height: 100%; border-radius: 3px; transition: width 0.9s cubic-bezier(0.4,0,0.2,1); }

/* ============================ alerts ========================== */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.alert .alert__icon { flex-shrink: 0; margin-top: 1px; }
.alert--warn { border-left: 3px solid var(--v-conserver); }
.alert--danger, .alert--error { border-left: 3px solid var(--bear); }
.alert--info, .alert--success { border-left: 3px solid var(--bull); }
.alert--warning { border-left: 3px solid var(--v-conserver); }

/* ============================ gauge =========================== */
.gauge-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.gauge {
  position: relative;
  width: 130px; height: 130px;
  flex-shrink: 0;
}
.gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge__track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.gauge__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1);
}
.gauge__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge__center .score { font-size: 1.8rem; font-weight: 800; }
.gauge__center .lbl { font-size: 0.68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; }

.gauge-rows { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 10px; }
.gauge-row { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; }
.gauge-row .glabel { width: 80px; color: var(--text-2); }
.gauge-row .gbar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.gauge-row .gbar__fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.gauge-row .gval { font-family: var(--mono); font-weight: 600; min-width: 32px; text-align: right; }

/* ============================ table =========================== */
.table-wrap { overflow-x: auto; }
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text-2); }
thead th .sort-ico { opacity: 0.5; font-size: 0.7rem; margin-left: 3px; }
thead th.sorted { color: var(--accent-2); }
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

.right { text-align: right; }

.ticker { font-weight: 700; }
.ticker small { display: block; font-size: 0.72rem; color: var(--text-3); font-weight: 400; }
.cell-pct { font-family: var(--mono); font-weight: 600; }
.cell-pct.pos, .pos { color: var(--bull); }
.cell-pct.neg, .neg { color: var(--bear); }

/* ============================ verdict badge =================== */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.verdict::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.verdict--acheter  { color: var(--v-acheter);  background: rgba(34,211,238,0.12); }
.verdict--acheter::before  { background: var(--v-acheter); }
.verdict--renforcer  { color: var(--v-renforcer);  background: rgba(52,211,153,0.12); }
.verdict--renforcer::before  { background: var(--v-renforcer); }
.verdict--conserver  { color: var(--v-conserver);  background: rgba(251,191,36,0.12); }
.verdict--conserver::before  { background: var(--v-conserver); }
.verdict--alleger   { color: var(--v-alleger);   background: rgba(251,146,60,0.12); }
.verdict--alleger::before   { background: var(--v-alleger); }
.verdict--vendre    { color: var(--v-vendre);    background: rgba(244,63,94,0.12); }
.verdict--vendre::before    { background: var(--v-vendre); }

/* legacy badge compatibility */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
.badge-done, .badge-success { color: var(--bull); background: rgba(34,211,238,0.12); }
.badge-running, .badge-pending { color: var(--accent-2); background: var(--accent-soft); }
.badge-error { color: var(--bear); background: rgba(244,63,94,0.12); }

/* ============================ filters ========================= */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition);
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
  box-shadow: 0 0 16px var(--accent-glow);
}
.chip--group { display: flex; gap: 0; }
.chip--group .chip { border-radius: 0; }
.chip--group .chip:first-child { border-radius: 999px 0 0 999px; }
.chip--group .chip:last-child { border-radius: 0 999px 999px 0; }
.chip--group .chip + .chip { border-left: none; }

.filter-search {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.filter-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-search svg { width: 15px; height: 15px; color: var(--text-3); }
.filter-search input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 0.82rem; width: 100%;
}

/* ============================ asset cards ===================== */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--gap);
}
.asset-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.asset-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.asset-card.expanded { grid-column: span 2; box-shadow: 0 16px 48px rgba(0,0,0,0.45); }

.asset-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
}
.asset-card__ticker { display: flex; align-items: center; gap: 12px; }
.asset-card__ticker .logo-circle {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem;
  border: 1px solid var(--border);
}
.asset-card__ticker .name { font-weight: 700; }
.asset-card__ticker .name small { display: block; font-size: 0.72rem; color: var(--text-3); font-weight: 400; }

.asset-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}
.asset-card.expanded .asset-card__body { max-height: 1400px; }

/* tabs */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}
.tab-btn {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }

/* technical panel */
.tech-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 0.83rem; border-bottom: 1px solid var(--border); }
.tech-row:last-child { border-bottom: none; }
.tech-row .tlabel { color: var(--text-2); }
.tech-row .tval { font-family: var(--mono); font-weight: 600; }

/* indicator cells */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.indicator-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  text-align: center;
}
.indicator-cell .iname { font-size: 0.66rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; }
.indicator-cell .ival { font-size: 0.92rem; font-weight: 700; font-family: var(--mono); margin: 2px 0; }
.indicator-cell .isig { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; }
.isig--buy { color: var(--bull); }
.isig--sell { color: var(--bear); }
.isig--neutral { color: var(--neutral); }

/* horizon bars (diverging) */
.horizon { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.horizon-row { display: grid; grid-template-columns: 60px 1fr 50px; gap: 8px; align-items: center; font-size: 0.8rem; }
.horizon-row .hlabel { color: var(--text-2); }
.horizon-row .htrack { height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.horizon-row .htrack::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.horizon-row .hbar { position: absolute; top: 0; bottom: 0; border-radius: 4px; transition: all 0.9s ease; }
.hbar--bull { background: var(--bull); }
.hbar--bear { background: var(--bear); }
.horizon-row .hval { font-family: var(--mono); font-weight: 600; text-align: right; }

/* watch panel */
.watch-list { display: flex; flex-direction: column; gap: 10px; }
.watch-item { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.watch-item .whead { display: flex; justify-content: space-between; margin-bottom: 6px; }
.watch-item .wlabel { font-size: 0.78rem; font-weight: 600; }
.watch-item .wdesc { font-size: 0.78rem; color: var(--text-2); }

/* advisor panel */
.advice-box { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.advice-box .ahead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.advice-box .atitle { font-weight: 700; font-size: 0.9rem; }
.advice-box .abody { font-size: 0.83rem; color: var(--text-2); line-height: 1.6; }
.advice-box .aargs { font-size: 0.78rem; color: var(--text-3); margin-top: 8px; font-style: italic; }

/* ============================ buttons ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--accent-glow); }
.btn--ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn--danger { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.3); color: var(--bear); }
.btn--danger:hover { background: rgba(244,63,94,0.2); }
.btn--sm { padding: 6px 12px; font-size: 0.78rem; }
.btn--block { width: 100%; }
/* legacy compat */
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 0.85rem; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; border-radius: 8px; }

/* ============================ loading ========================= */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 20px;
}
.spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 4px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-2); font-size: 0.9rem; }
.loading-sub { color: var(--text-3); font-size: 0.8rem; }

/* progress steps */
.loading-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.loading-step { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-3); }
.loading-step.done { color: var(--bull); }
.loading-step .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-3); flex-shrink: 0; }
.loading-step.done .dot { background: var(--bull); border-color: var(--bull); }
.loading-step.active .dot { border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============================ pixelart numbers ================ */
.pixnum { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.pixnum svg { display: block; }

/* ============================ staggered reveal =============== */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.in { animation: revealIn 0.5s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes revealIn { to { opacity: 1; transform: translateY(0); } }

/* ============================ privacy ========================= */
.amount { position: relative; }
body.privacy .amount { color: transparent; text-shadow: none; }
body.privacy .amount::after { content: '••••'; color: var(--text-3); }
body.privacy .amount > * { visibility: hidden; }
body.privacy .pixnum { filter: blur(7px); }

/* ============================ login =========================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 34px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}
.login-card__logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-card__logo img { width: 56px; height: 56px; margin-bottom: 12px; }
.login-card__logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.login-card__logo h1 b { color: var(--accent); }
.login-card__logo p { font-size: 0.82rem; color: var(--text-2); margin-top: 4px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.78rem; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder { color: var(--text-3); }
.field-error { border-color: var(--bear) !important; }
.error-msg { color: var(--bear); font-size: 0.78rem; margin-top: 6px; }

/* ============================ footer ========================== */
.footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ============================ misc ============================ */
.section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); }
.text-up { color: var(--bull); }
.text-down { color: var(--bear); }
.text-flat { color: var(--neutral); }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.5; }

/* mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px; right: 20px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 24px var(--accent-glow);
  z-index: 200;
  font-size: 1.4rem;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ============================ history / timeline ============= */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  flex-wrap: wrap;
}
.timeline-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.timeline-item__date { font-size: 0.78rem; color: var(--text-3); min-width: 120px; font-family: var(--mono); }
.timeline-item__title { flex: 1; font-weight: 600; min-width: 120px; }
.timeline-item__title small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-2); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status--done, .status--completed { color: var(--bull); background: rgba(34,211,238,0.12); }
.status--running, .status--pending { color: var(--accent-2); background: var(--accent-soft); }
.status--error { color: var(--bear); background: rgba(244,63,94,0.12); }

/* score badge */
.score-badge {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1rem;
  padding: 4px 10px;
  border-radius: 8px;
  min-width: 44px;
  text-align: center;
}
.score-badge--good { color: var(--bull); background: rgba(34,211,238,0.12); }
.score-badge--mid  { color: var(--v-conserver); background: rgba(251,191,36,0.12); }
.score-badge--bad  { color: var(--bear); background: rgba(244,63,94,0.12); }

/* ============================ portfolio grid ================== */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.pf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.pf-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.pf-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.pf-card .pf-val { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; margin: 10px 0; }
.pf-card .pf-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-2); }
.pf-card .pf-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ============================ responsive ===================== */
@media (max-width: 1024px) {
  .header__kpis { gap: 18px; }
  .header__kpi .amount { font-size: 0.9rem; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .main { grid-column: 1; }
  .content { padding: 18px 16px 80px; }
  .header { padding: 12px 16px; }
  .header__kpis { display: none; }
  .bento { grid-template-columns: 1fr; }
  .bento--wide { grid-column: span 1; }
  .asset-grid { grid-template-columns: 1fr; }
  .asset-card.expanded { grid-column: span 1; }
  .bigval .amount { font-size: 1.6rem; }
  .header__title h1 { font-size: 1.1rem; }
  .pf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .filters { gap: 6px; }
  .chip { padding: 5px 10px; font-size: 0.72rem; }
  .card { padding: 16px; }
}
