/* ============================================================
   PLANSKI AI TRADING — Design System v2
   Poppins · Lucide Icons · Light/Dark · Micro-animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Dark theme (default) */
  --bg-0:        #080b14;
  --bg-1:        #0d1121;
  --bg-2:        #121629;
  --bg-card:     #161b30;
  --bg-hover:    #1c2240;
  --bg-input:    #111525;

  --border:      rgba(255,255,255,0.07);
  --border-md:   rgba(255,255,255,0.12);

  --text-1:      #f1f3ff;
  --text-2:      #8b91b8;
  --text-3:      #4a4f72;

  --accent:      #5b6ef5;
  --accent-2:    #4a5ce0;
  --accent-glow: rgba(91,110,245,0.25);
  --accent-bg:   rgba(91,110,245,0.12);

  --gold:        #f5a623;
  --gold-glow:   rgba(245,166,35,0.2);
  --gold-bg:     rgba(245,166,35,0.1);

  --green:       #22c55e;
  --green-bg:    rgba(34,197,94,0.1);
  --red:         #ef4444;
  --red-bg:      rgba(239,68,68,0.1);
  --orange:      #f97316;
  --orange-bg:   rgba(249,115,22,0.1);
  --blue:        #38bdf8;
  --blue-bg:     rgba(56,189,248,0.1);

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --radius-xs:   6px;
  --radius-sm:   10px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  --sidebar-w:   268px;
  --topbar-h:    62px;
  --transition:  0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.35s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg-0:        #f0f2fa;
  --bg-1:        #f7f8fe;
  --bg-2:        #ffffff;
  --bg-card:     #ffffff;
  --bg-hover:    #f0f2ff;
  --bg-input:    #f5f6ff;

  --border:      rgba(0,0,0,0.07);
  --border-md:   rgba(0,0,0,0.12);

  --text-1:      #111827;
  --text-2:      #4b5563;
  --text-3:      #9ca3af;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

/* ── RESET + BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden; /* voorkomt horizontaal scrollen op iOS */
}

body {
  font-family: 'Poppins', -apple-system, sans-serif;
  font-weight: 300;
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.65;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
  max-width: 100vw;
  position: relative; /* vereist voor overflow-x:hidden op iOS Safari */
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { font-weight: 300; color: var(--text-2); }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ── ICONS (Lucide) ─────────────────────────────────────────── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-slow), width var(--transition-slow);
  will-change: transform;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
  transition: box-shadow var(--transition);
}
.logo-mark:hover { box-shadow: 0 4px 20px var(--accent-glow); }
.logo-text-wrap { overflow: hidden; }
.logo-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.logo-sub  { font-size: 0.68rem; font-weight: 300; color: var(--text-3); letter-spacing: 0.02em; white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section {
  padding: 14px 20px 4px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.83rem;
  font-weight: 400;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item .icon { opacity: 0.65; transition: opacity var(--transition); width: 16px; height: 16px; }
.nav-item:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}
.nav-item:hover .icon { opacity: 1; }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 500;
}
.nav-item.active .icon { opacity: 1; color: var(--accent); }
.nav-item.sub { padding-left: 42px; font-size: 0.79rem; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  margin-bottom: 10px;
  transition: background var(--transition);
}
.user-card:hover { background: var(--bg-2); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  color: white; flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.user-info { overflow: hidden; flex: 1; }
.user-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.68rem; font-weight: 300; color: var(--text-3); }

.btn-logout {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  width: 100%;
  font-family: inherit;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-breadcrumb { font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.session-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 500;
  border: 1px solid var(--border-md);
  background: var(--bg-2);
}
.session-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}
.session-dot.open { background: var(--green); }
.session-dot.partial { background: var(--orange); }
.session-dot.closed { background: var(--text-3); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  background: var(--bg-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.theme-toggle .icon { width: 15px; height: 15px; }

.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-toggle .icon { width: 18px; height: 18px; }

/* ── PAGE CONTENT ───────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { font-size: 0.82rem; font-weight: 300; color: var(--text-2); margin-top: 2px; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition-slow);
}
.card:hover { border-color: var(--border-md); }
.card.hoverable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.card-title .icon { width: 15px; height: 15px; color: var(--accent); }
.card-body { padding: 20px; }

/* Glassmorphism card variant */
.card-glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-md);
}
[data-theme="light"] .card-glass {
  background: rgba(255,255,255,0.7);
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px,100%),1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { border-color: var(--border-md); box-shadow: var(--shadow-sm); }
.stat-card:hover::before { opacity: 1; }

.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon-wrap {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--stat-bg, var(--accent-bg));
}
.stat-icon-wrap .icon { width: 17px; height: 17px; color: var(--stat-color, var(--accent)); }
.stat-delta {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.stat-delta.up   { color: var(--green); background: var(--green-bg); }
.stat-delta.down { color: var(--red); background: var(--red-bg); }

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-label { font-size: 0.75rem; font-weight: 400; color: var(--text-2); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: -0.01em;
  user-select: none;
}
.btn .icon { width: 14px; height: 14px; }

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.5s, height 0.5s, opacity 0.5s;
}
.btn.ripple::after {
  width: 300px; height: 300px;
  opacity: 0;
  transition: width 0.5s, height 0.5s, opacity 0.5s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 4px 16px var(--accent-glow); color: white; opacity: 1; }

.btn-gold {
  background: var(--gold);
  color: #000;
  box-shadow: 0 2px 10px var(--gold-glow);
}
.btn-gold:hover { opacity: 0.9; color: #000; box-shadow: 0 4px 16px var(--gold-glow); }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.85; color: white; }
.btn-danger   { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.85; color: white; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-1);
  border: 1px solid var(--border-md);
}
.btn-secondary:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--accent); }

.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }

.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent-bg); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 0.77rem; border-radius: var(--radius-xs); }
.btn-sm .icon { width: 12px; height: 12px; }
.btn-lg { padding: 12px 24px; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon .icon { width: 16px; height: 16px; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.form-label.required::after { content: ' *'; color: var(--red); }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 10px 14px;
  font-size: 0.87rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition-slow);
  appearance: none;
  line-height: 1.4;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-3); font-weight: 300; }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 0.74rem; font-weight: 300; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 0.74rem; color: var(--red); margin-top: 5px; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  width: 15px; height: 15px;
}
.input-group .form-control { padding-left: 38px; }

/* Radio pills */
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { display: none; }
.radio-pill-label {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-2);
  user-select: none;
}
.radio-pill:checked + .radio-pill-label {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 400; cursor: pointer; }
.toggle { position: relative; width: 42px; height: 23px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-md);
  border-radius: var(--radius-full);
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 17px; height: 17px;
  background: white; border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(19px); box-shadow: 0 2px 6px var(--accent-glow); }

/* ── TABLES ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead tr { background: var(--bg-0); }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
  font-weight: 300;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--bg-hover); }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge .icon { width: 10px; height: 10px; }
.badge-green   { background: var(--green-bg);   color: var(--green); }
.badge-red     { background: var(--red-bg);     color: var(--red); }
.badge-orange  { background: var(--orange-bg);  color: var(--orange); }
.badge-blue    { background: var(--blue-bg);    color: var(--blue); }
.badge-accent  { background: var(--accent-bg);  color: var(--accent); }
.badge-gold    { background: var(--gold-bg);    color: var(--gold); }
.badge-muted   { background: var(--bg-hover);   color: var(--text-2); }
.badge-lg { padding: 5px 12px; font-size: 0.75rem; }

/* ── ALERTS ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 400;
  border-left: 3px solid;
  margin-bottom: 16px;
}
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green);  border-color: var(--green); }
.alert-error   { background: var(--red-bg);   color: var(--red);    border-color: var(--red); }
.alert-warning { background: var(--orange-bg);color: var(--orange); border-color: var(--orange); }
.alert-info    { background: var(--blue-bg);  color: var(--blue);   border-color: var(--blue); }
.alert-gold    { background: var(--gold-bg);  color: var(--gold);   border-color: var(--gold); }
.alert strong { font-weight: 600; }

.disclaimer-bar {
  background: var(--gold-bg);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.77rem;
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.disclaimer-bar .icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ── PROGRESS / BARS ────────────────────────────────────────── */
.progress { height: 5px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 3px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-bar.green  { background: var(--green); }
.progress-bar.red    { background: var(--red); }
.progress-bar.gold   { background: var(--gold); }

/* ── INSTRUMENT PILLS ────────────────────────────────────────── */
.instrument-us30 {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(91,110,245,0.2);
  font-weight: 700;
}
.instrument-xauusd {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(245,166,35,0.2);
  font-weight: 700;
}

/* ── QUICK TRADE RESULT ──────────────────────────────────────── */
.result-win  { color: var(--green); }
.result-loss { color: var(--red); }
.result-be   { color: var(--text-2); }

/* ── CHAT ────────────────────────────────────────────────────── */
.chat-layout { display: flex; height: calc(100vh - var(--topbar-h)); overflow: hidden; }
.chat-sidebar-list { width: 240px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-conv-item {
  display: block; padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; font-size: 0.8rem; color: var(--text-2);
  transition: background var(--transition);
}
.chat-conv-item:hover { background: var(--bg-hover); color: var(--text-1); }
.chat-conv-item.active { background: var(--accent-bg); color: var(--accent); }
.chat-conv-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-meta { font-size: 0.7rem; color: var(--text-3); margin-top: 2px; font-weight: 300; }

.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.chat-message { display: flex; gap: 12px; max-width: 85%; animation: fadeInUp 0.2s ease; }
.chat-message.user { flex-direction: row-reverse; align-self: flex-end; }

.chat-avatar {
  width: 30px; height: 30px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.chat-avatar.ai   { background: var(--accent-bg); color: var(--accent); }
.chat-avatar.user { background: var(--green-bg); color: var(--green); }
.chat-avatar .icon { width: 14px; height: 14px; }

.chat-bubble {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 300; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.chat-message.assistant .chat-bubble {
  background: var(--bg-card); border: 1px solid var(--border); border-top-left-radius: 4px;
}
.chat-message.user .chat-bubble {
  background: var(--accent); color: white; border-top-right-radius: 4px;
}
.chat-input-area { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }
.chat-input-area textarea { flex: 1; min-height: 44px; max-height: 140px; }
.chat-time { font-size: 0.68rem; color: var(--text-3); margin-top: 4px; font-weight: 300; }

/* ── UPLOAD ZONE ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone input[type=file] { display: none; }
.upload-zone-icon { color: var(--text-3); margin-bottom: 10px; }
.upload-zone-icon .icon { width: 32px; height: 32px; }
.upload-zone-text { color: var(--text-2); font-size: 0.85rem; font-weight: 300; }
.upload-zone-text strong { font-weight: 600; color: var(--text-1); }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; margin-top: 12px; }
.image-thumb {
  position: relative; aspect-ratio: 16/9;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); cursor: pointer;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.image-thumb:hover img { transform: scale(1.06); }
.image-thumb-remove {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,0.7); color: var(--red);
  border: none; border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.image-thumb:hover .image-thumb-remove { opacity: 1; }
.image-thumb-remove .icon { width: 11px; height: 11px; }
.remove-img-btn {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,0.75); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.image-thumb:hover .remove-img-btn { opacity: 1; }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1);
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: var(--radius-xs); transition: all var(--transition); font-family: inherit; }
.modal-close:hover { color: var(--text-1); background: var(--bg-hover); }
.modal-close .icon { width: 18px; height: 18px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── CALCULATOR ──────────────────────────────────────────────── */
.calc-result {
  background: var(--bg-0);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 20px;
}
.calc-result-main { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.calc-item { padding: 12px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.calc-item-label { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; font-weight: 600; }
.calc-item-value { font-size: 1rem; font-weight: 700; }

/* ── LEVELS ──────────────────────────────────────────────────── */
.levels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.level-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border-left: 3px solid var(--border-md);
  transition: all var(--transition);
}
.level-row.support     { border-left-color: var(--green); }
.level-row.resistance  { border-left-color: var(--red); }
.level-row.key_level   { border-left-color: var(--gold); }
.level-row.pivot       { border-left-color: var(--blue); }
.level-row:hover { background: var(--bg-2); }
.level-price { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.level-label { font-size: 0.78rem; color: var(--text-2); font-weight: 300; }
.level-type-badge { font-size: 0.65rem; }

/* ── STATS / HEATMAP ─────────────────────────────────────────── */
.heatmap-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heatmap-day {
  aspect-ratio: 1; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600;
  cursor: default;
  position: relative;
}
.heatmap-day.win-big    { background: rgba(34,197,94,0.6); color: white; }
.heatmap-day.win-small  { background: rgba(34,197,94,0.3); color: var(--green); }
.heatmap-day.loss-big   { background: rgba(239,68,68,0.6); color: white; }
.heatmap-day.loss-small { background: rgba(239,68,68,0.3); color: var(--red); }
.heatmap-day.be         { background: var(--bg-hover); color: var(--text-3); }
.heatmap-day.empty      { background: var(--bg-0); opacity: 0.3; }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-0);
}
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}
.login-logo { margin-bottom: 32px; }
.login-logo-mark {
  width: 50px; height: 50px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.login-logo-mark .icon { width: 24px; height: 24px; color: white; }
.login-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.login-sub { font-size: 0.85rem; font-weight: 300; color: var(--text-2); margin-top: 4px; }
.login-right {
  flex: 1;
  background: linear-gradient(135deg, #0d1121 0%, #131b3a 50%, #0d1121 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
}
@media (max-width: 768px) { .login-right { display: none; } }

.login-feature {
  margin-bottom: 28px;
  display: flex; gap: 16px; align-items: flex-start;
}
.login-feature-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-feature-icon .icon { width: 18px; height: 18px; }

/* ── SETUP ───────────────────────────────────────────────────── */
.setup-page { min-height: 100vh; background: var(--bg-0); display: flex; align-items: center; justify-content: center; padding: 24px; }
.setup-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 44px;
  width: 100%; max-width: 560px; box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.page-link {
  padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-2); text-decoration: none;
  font-size: 0.8rem; font-weight: 400; transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-text {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  color: var(--text-3); font-size: 0.78rem; font-weight: 300;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── UTILITIES ───────────────────────────────────────────────── */
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1        { gap: 4px; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

.text-xs     { font-size: 0.72rem; }
.text-sm     { font-size: 0.82rem; }
.text-base   { font-size: 0.88rem; }
.text-muted  { color: var(--text-2); }
.text-dim    { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--gold); }
.text-right  { text-align: right; }
.text-center { text-align: center; }

.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 800; }

.empty-state { text-align: center; padding: 52px 20px; }
.empty-icon  { color: var(--text-3); margin-bottom: 14px; }
.empty-icon .icon { width: 44px; height: 44px; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-text  { font-size: 0.85rem; color: var(--text-2); font-weight: 300; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border-md); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInL  { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes shimmer   { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-in   { animation: fadeInUp 0.3s ease both; }
.animate-in-2 { animation: fadeInUp 0.3s 0.1s ease both; }
.animate-in-3 { animation: fadeInUp 0.3s 0.2s ease both; }

/* Stagger for grid children */
.stagger-grid > * { animation: fadeInUp 0.3s ease both; }
.stagger-grid > *:nth-child(1) { animation-delay: 0s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.1s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.2s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.25s; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-2) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
  color: transparent;
}

/* ── AI RESPONSE MARKDOWN ────────────────────────────────────── */
.ai-response { font-size: 0.87rem; line-height: 1.75; font-weight: 300; }
.ai-response h1, .ai-response h2, .ai-response h3 { color: var(--accent); margin: 14px 0 6px; font-size: 0.95rem; }
.ai-response strong { font-weight: 600; color: var(--text-1); }
.ai-response p { margin-bottom: 8px; }
.ai-response ul, .ai-response ol { padding-left: 18px; margin-bottom: 8px; }
.ai-response li { margin-bottom: 3px; }
.ai-response code { background: var(--bg-0); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; font-family: monospace; }
.ai-response hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── VERDICT CARDS ───────────────────────────────────────────── */
.verdict-doen     { --v-color: var(--green);  --v-bg: var(--green-bg); }
.verdict-niet_doen{ --v-color: var(--red);    --v-bg: var(--red-bg); }
.verdict-wachten  { --v-color: var(--orange); --v-bg: var(--orange-bg); }
.verdict-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 700;
  background: var(--v-bg);
  color: var(--v-color);
  border: 1px solid color-mix(in srgb, var(--v-color) 20%, transparent);
}

/* ── JOURNAL MOOD ────────────────────────────────────────────── */
.mood-great    { color: #22c55e; }
.mood-good     { color: #86efac; }
.mood-neutral  { color: var(--text-3); }
.mood-bad      { color: #f97316; }
.mood-terrible { color: var(--red); }

/* ── CHECKLIST ───────────────────────────────────────────────── */
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  margin-bottom: 6px;
  transition: background var(--transition);
}
.checklist-item:hover { background: var(--bg-2); }
.checklist-item input[type=checkbox] {
  accent-color: var(--accent); width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; cursor: pointer;
}
.checklist-item.required-item { border-left: 2px solid var(--red); }
.checklist-item.checked label { text-decoration: line-through; color: var(--text-3); }
.checklist-item label { font-size: 0.85rem; font-weight: 300; cursor: pointer; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* ═══ ANTI-OVERFLOW KERN — mag nooit verwijderd worden ═══ */
  html, body { overflow-x: hidden !important; }
  .layout, .main-content, .page-content {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* ── Sidebar ── */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }

  /* ── Padding terugdringen ── */
  .page-content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; gap: 8px; }
  .card { border-radius: var(--radius-sm); }

  /* ── Topbar: verberg grote items + centreer paginatitel ── */
  .session-badge     { display: none !important; }
  .credit-pill       { display: none !important; }
  .topbar-new-btn    { display: none !important; }
  .topbar            { position: relative; }
  .topbar-breadcrumb {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    font-size: 0.95rem;
    white-space: nowrap;
    pointer-events: none;
  }

  /* ── Grids: kolommen beperken ── */
  .form-row, .grid-2, .levels-grid,
  .grid-3, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ── Dashboard stat-card-v2: verberg secundaire info ── */
  .stat-card-v2 .scv2-trend,
  .stat-card-v2 .scv2-sub  { display: none; }
  .scv2-label { white-space: normal !important; font-size: 0.72rem; line-height: 1.3; }
  .scv2-value { font-size: 1.25rem !important; }
  .scv2-icon  { width: 36px; height: 36px; flex-shrink: 0; }

  /* ── Touch-vriendelijke knoppen ── */
  .btn     { min-height: 42px; padding: 10px 14px; font-size: 0.88rem; }
  .btn-sm  { min-height: 36px; padding: 7px 12px; }

  /* ── Inputs shrinkbaar maken op mobiel ── */
  input, select, textarea { max-width: 100%; min-width: 0; }
  .form-control, select.form-control, textarea.form-control {
    min-height: 44px; font-size: 1rem; max-width: 100%;
  }

  /* ── Tabellen: scrollen BINNEN wrapper, niet de pagina ── */
  .table-wrap, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
  }
  /* Min-width op table ALLEEN binnen .table-wrap — wrapper absorbeert de overflow */
  .table-wrap table { min-width: 480px; }

  /* ── Flex rijen: altijd wrappen op mobiel ── */
  .flex:not(.no-wrap) { flex-wrap: wrap; }
  [style*="display:flex"]:not([style*="flex-direction:column"]) { max-width: 100%; }

  /* ── Login ── */
  .login-card { padding: 24px 20px; }
  .login-right { display: none; }

  /* ── Chat ── */
  .chat-sidebar-list { display: none; }

  /* ── FAB ── */
  .fab-ai { bottom: 16px; right: 12px; width: 48px; height: 48px; }
}

@media (max-width: 480px) {
  .page-content { padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.15rem; }
}

/* ── iOS Safe Area ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .fab-ai { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ── PWA ── */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* Dark mode overlay when sidebar open on mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   Chat page extras
   ============================================================ */
.chat-sidebar { width: 240px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.chat-list-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}
.chat-list-item:hover  { background: var(--bg-2); }
.chat-list-item.active { background: var(--accent-bg); }
.chat-list-link {
  flex: 1; min-width: 0;
  padding: 10px 6px 10px 14px;
  text-decoration: none; color: var(--text-2);
}
.chat-list-item.active .chat-list-link { color: var(--accent); }
.chat-list-item:hover  .chat-list-link { color: var(--text-1); }
.chat-list-item .chat-title { font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item .chat-meta  { font-size: 0.70rem; color: var(--text-3); margin-top: 3px; }
.chat-list-actions {
  display: flex; gap: 2px; padding-right: 6px;
  opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
}
.chat-list-item:hover .chat-list-actions { opacity: 1; }
.chat-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-xs); border: none;
  background: transparent; color: var(--text-3);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.chat-action-btn .icon { width: 13px; height: 13px; }
.chat-action-btn:hover        { background: var(--bg-hover); color: var(--text-1); }
.chat-action-btn.danger:hover { background: var(--red-bg);   color: var(--red); }
.chat-meta-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 0.72rem;
}
.chat-sender-name { font-weight: 600; color: var(--text-1); }
.chat-meta-sep    { color: var(--text-3); }
.chat-meta-date   { color: var(--text-2); }
.chat-meta-time   { color: var(--text-3); }
.chat-message.assistant .chat-sender-name { color: var(--accent); }
.chat-message.user .chat-sender-name      { color: var(--green); }

/* ============================================================
   Analyses grid & cards
   ============================================================ */
.analyses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.analysis-card-link { text-decoration: none; color: inherit; display: block; }
.analysis-card { transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; overflow: hidden; }
.analysis-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.analysis-thumb {
  height: 160px; background: var(--bg-0); display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.analysis-thumb img { width: 100%; height: 100%; object-fit: cover; }
.analysis-thumb-empty .icon { width: 36px; height: 36px; color: var(--text-3); }
.analysis-thumb-badge { position: absolute; top: 8px; left: 8px; }
.analysis-card-body { padding: 14px; }
.analysis-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.analysis-card-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.analysis-card-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.analysis-card-date { font-size: 0.72rem; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.analysis-card-date .icon { width: 11px; height: 11px; }

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   Verdict badge (analysis)
   ============================================================ */
.verdict-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.verdict-badge.verdict-doen  { background: var(--green-bg); color: var(--green); }
.verdict-badge.verdict-niet_doen { background: var(--red-bg, rgba(239,68,68,.15)); color: var(--red); }
.verdict-badge.verdict-wachten { background: var(--gold-bg); color: var(--gold); }

@media (max-width: 768px) {
  .chat-sidebar { display: none; }
  .analyses-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   DASHBOARD v2 — Hero, Stats, Grid, Chart, Quick Nav
   ============================================================ */

/* ── HERO BANNER ──────────────────────────────────────────── */
.hero-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3b4fd4 0%, #5b6ef5 40%, #7c5cfc 70%, #a855f7 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 24px;
  box-shadow: 0 8px 40px rgba(91,110,245,0.35);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-greeting {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  margin-bottom: 6px;
}
.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.95);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}
.hero-badge.warn {
  background: rgba(249,115,22,0.3);
  border-color: rgba(249,115,22,0.5);
}
.hero-badge .icon { width: 12px; height: 12px; }
.hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* Decorative orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-orb-1 {
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.06);
  top: -80px; right: -60px;
}
.hero-orb-2 {
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.04);
  bottom: -40px; right: 220px;
}
.hero-orb-3 {
  width: 100px; height: 100px;
  background: rgba(168,85,247,0.25);
  top: 20px; right: 340px;
}
/* Hero buttons */
.btn-white {
  background: #fff;
  color: var(--accent);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.btn-white:hover { background: #f5f6ff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.btn-white-outline {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  font-weight: 500;
}
.btn-white-outline:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }

/* ── STAT CARDS v2 ────────────────────────────────────────── */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card-v2 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.stat-card-v2::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--c, var(--accent));
}
.stat-card-v2:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.scv2-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--c-bg, var(--accent-bg));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--c, var(--accent));
}
.scv2-icon .icon { width: 20px; height: 20px; }
.scv2-body { flex: 1; min-width: 0; }
.scv2-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-1);
  margin-bottom: 4px;
}
.scv2-label {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scv2-link {
  position: absolute;
  top: 16px; right: 16px;
  color: var(--c, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
  text-decoration: none;
}
.stat-card-v2:hover .scv2-link { opacity: 1; }
.scv2-link .icon { width: 16px; height: 16px; }
.scv2-trend {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.scv2-trend.up { color: var(--green); }
.scv2-trend.down { color: var(--red); }
.scv2-trend .icon { width: 12px; height: 12px; }
.scv2-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 6px;
}

/* ── DASHBOARD MAIN GRID ──────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.dash-col-main { display: flex; flex-direction: column; gap: 20px; }
.dash-col-side  { display: flex; flex-direction: column; gap: 16px; }

/* ── WEEK CHART ───────────────────────────────────────────── */
.week-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 120px;
  padding: 0 4px;
}
.week-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  position: relative;
}
.week-bar-val {
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 16px;
  line-height: 16px;
}
.week-bar-val.pos { color: var(--green); }
.week-bar-val.neg { color: var(--red); }
.week-bar-outer {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.week-bar {
  width: 70%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.week-bar.pos  { background: var(--green); }
.week-bar.neg  { background: var(--red); }
.week-bar.zero { background: var(--border-md); height: 4px !important; }
.week-bar-day {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 500;
}
.week-bar-trades {
  font-size: 0.6rem;
  color: var(--text-3);
}

/* ── QUICK TRADE GRID ─────────────────────────────────────── */
.quick-trade-grid {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.result-btns { display: flex; gap: 6px; }
.result-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-md);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.result-btn:hover { border-color: currentColor; }
.result-btn.win  { color: var(--green); }
.result-btn.loss { color: var(--red); }
.result-btn.be   { color: var(--text-2); }
.result-btn.win.active  { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.result-btn.loss.active { background: var(--red-bg);   border-color: var(--red);   color: var(--red); }
.result-btn.be.active   { background: var(--bg-hover); border-color: var(--border-md); }

/* ── QUICK NAV GRID ───────────────────────────────────────── */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-2);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.quick-nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--qn-c, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}
.quick-nav-card:hover::before { opacity: 0.08; }
.quick-nav-card:hover { border-color: var(--qn-c, var(--accent)); transform: translateY(-2px); color: var(--text-1); }
.quick-nav-card:hover .qn-icon { color: var(--qn-c, var(--accent)); }
.qn-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: color var(--transition);
  position: relative; z-index: 1;
}
.qn-icon .icon { width: 20px; height: 20px; }
.qn-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  position: relative; z-index: 1;
}

/* ── KEY LEVEL MINI ───────────────────────────────────────── */
.level-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-left: 3px solid var(--border-md);
  margin-bottom: 2px;
  transition: background var(--transition);
}
.level-mini:hover { background: var(--bg-hover); }
.level-mini.resistance { border-left-color: var(--red); }
.level-mini.support    { border-left-color: var(--green); }
.level-mini.supply     { border-left-color: var(--red); }
.level-mini.demand     { border-left-color: var(--green); }
.level-mini.key        { border-left-color: var(--gold); }
.level-mini-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-1);
  letter-spacing: 0.01em;
}
.level-mini-label {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── BALANCE DISPLAY ──────────────────────────────────────── */
.balance-display { text-align: center; padding: 8px 0; }
.balance-amount {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

/* ── INSTRUMENT BADGE ─────────────────────────────────────── */
.badge-instrument {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  letter-spacing: 0.04em;
}

/* ── TABLE HOVER ──────────────────────────────────────────── */
.table-hover tbody tr {
  transition: background var(--transition);
}
.table-hover tbody tr:hover {
  background: var(--bg-hover);
}

/* ── REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-stagger {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-stagger.visible {
  opacity: 1;
  transform: none;
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal-stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.19s; }
.reveal-stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.26s; }

/* ── PAGE TRANSITION ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.animate-in { animation: fadeInUp 0.35s ease forwards; }

/* ── CARD HOVER GLOW ──────────────────────────────────────── */
.card { transition: box-shadow var(--transition), border-color var(--transition); }

/* ── STRATEGY MODE TABS ───────────────────────────────────── */
.strategy-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}
.strategy-mode-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  background: var(--bg-1);
  color: var(--text-2);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.strategy-mode-tab .icon { width: 15px; height: 15px; }
.strategy-mode-tab:hover { background: var(--bg-hover); color: var(--text-1); }
.strategy-mode-tab.active {
  background: var(--accent);
  color: #fff;
}
.strategy-mode-tab + .strategy-mode-tab {
  border-left: 1px solid var(--border-md);
}

/* ── RESPONSIVE DASHBOARD ─────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-col-side { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 768px) {
  .hero-banner { padding: 24px 20px; }
  .hero-title  { font-size: 1.4rem; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-col-side { display: flex; flex-direction: column; }
  .quick-nav-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-trade-grid { gap: 8px; }
  .scv2-value { font-size: 1.3rem; }
}

/* ═══════════════════════════════════════════════════════════
   PLANSKI v3 ADDITIONS — Credit pill, Markdown, Chat UX,
   News widget, Card view, Animations, Polish
   ═══════════════════════════════════════════════════════════ */

/* ── API CREDIT PILL (topbar) ─────────────────────────────── */
.credit-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: default;
  transition: all var(--transition);
  position: relative;
}
.credit-pill:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.credit-zap { width: 12px; height: 12px; }
.credit-pill .credit-amount { letter-spacing: -0.02em; }
.credit-bar-bg {
  width: 44px; height: 4px;
  background: var(--border-md);
  border-radius: 2px;
  overflow: hidden;
}
.credit-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.credit-pill.warn  .credit-bar-fill  { background: var(--orange); }
.credit-pill.warn  .credit-zap       { color: var(--orange); }
.credit-pill.warn  .credit-amount    { color: var(--orange); }
.credit-pill.danger .credit-bar-fill { background: var(--red); }
.credit-pill.danger .credit-zap      { color: var(--red); }
.credit-pill.danger .credit-amount   { color: var(--red); }

/* ── SIGNAL BELL ────────────────────────────────────────────── */
.signal-bell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.signal-bell:hover { background: var(--bg-1); color: var(--text-1); }
.signal-bell .icon { width: 18px; height: 18px; }
.signal-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--red); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-2);
}
.signal-bell.has-signals .icon { color: var(--accent); }
.signal-bell.has-signals { animation: bell-ring 2s ease infinite; }
@keyframes bell-ring {
  0%,100% { transform: rotate(0); }
  10%      { transform: rotate(12deg); }
  20%      { transform: rotate(-10deg); }
  30%      { transform: rotate(8deg); }
  40%      { transform: rotate(-6deg); }
  50%      { transform: rotate(0); }
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── CHAT: THINKING ANIMATION ─────────────────────────────── */
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}
.chat-thinking span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: thinking-bounce 1.2s ease-in-out infinite;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-7px); opacity: 1; }
}

/* ── CHAT: IMPROVED BUBBLES ───────────────────────────────── */
.chat-message {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  animation: msg-in 0.25s ease forwards;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.chat-message.user { flex-direction: row-reverse; }
.chat-message.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius) var(--radius-xs) var(--radius) var(--radius);
}
.chat-message.assistant .chat-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs) var(--radius) var(--radius) var(--radius);
}
.chat-bubble {
  padding: 12px 16px;
  font-size: 0.87rem;
  line-height: 1.7;
  max-width: 680px;
  word-break: break-word;
  transition: var(--transition);
}

/* ── MARKDOWN CONTENT STYLES ──────────────────────────────── */
.md-content h2, .md-content .md-h2 {
  font-size: 1rem; font-weight: 700;
  color: var(--accent);
  margin: 16px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}
.md-content h3, .md-content .md-h3 {
  font-size: 0.92rem; font-weight: 600;
  color: var(--text-1);
  margin: 14px 0 6px;
}
.md-content h4, .md-content .md-h4 {
  font-size: 0.86rem; font-weight: 600;
  color: var(--gold);
  margin: 10px 0 4px;
}
.md-content p, .md-content .md-p {
  margin: 0 0 10px;
  font-weight: 300;
  color: var(--text-1);
  line-height: 1.7;
}
.md-content ul { margin: 6px 0 10px 18px; list-style: disc; }
.md-content ol { margin: 6px 0 10px 18px; list-style: decimal; }
.md-content li { margin: 3px 0; font-size: 0.87rem; line-height: 1.6; }
.md-content strong { font-weight: 700; color: var(--text-1); }
.md-content em { font-style: italic; color: var(--text-2); }
.md-content hr {
  border: none; border-top: 1px solid var(--border);
  margin: 14px 0;
}
.md-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8em;
  background: var(--bg-0);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* AI response card styling */
.ai-response {
  font-size: 0.87rem;
  line-height: 1.7;
}
.ai-response.md-content h2 { color: var(--accent); }

/* ── SPIN ANIMATION ───────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; display: inline-block; }

/* ── CHAT INPUT AREA POLISH ───────────────────────────────── */
.chat-input-area {
  padding: 12px 16px 4px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
#chat-input {
  resize: none;
  min-height: 44px;
  max-height: 160px;
  font-size: 0.87rem;
}

/* ── NEWS MINI WIDGET (dashboard sidebar) ─────────────────── */
.news-item-mini {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: default;
}
.news-item-mini:last-child { border-bottom: none; }
.news-item-mini:hover { background: var(--bg-hover); }
.news-item-headline {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 2px;
}
.news-item-meta {
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 300;
}

/* ── ANALYSES: CARD GRID VIEW ─────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.view-toggle-btn {
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }
.view-toggle-btn .icon { width: 14px; height: 14px; }

.analyses-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.analysis-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}
.analysis-card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.analysis-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analysis-card-title { font-size: 0.85rem; font-weight: 600; line-height: 1.35; }
.analysis-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.analysis-card-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  background: var(--bg-0);
  border-radius: var(--radius-xs);
}
.analysis-card-level-item { text-align: center; }
.analysis-card-level-label { font-size: 0.6rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.analysis-card-level-val { font-size: 0.82rem; font-weight: 700; }
.analysis-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--text-3); margin-top: auto; }

/* ── FLOATING AI QUICK ASK ────────────────────────────────── */
.fab-ai {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.4);
  z-index: 500;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
}
.fab-ai:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}
.fab-ai .icon { width: 22px; height: 22px; }
/* Don't show FAB on chat page */
body.page-chat .fab-ai { display: none; }

/* ── DASHBOARD: MONTH PNL CARD ────────────────────────────── */
.month-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.month-stat-row:last-child { border-bottom: none; }
.month-stat-label { color: var(--text-2); }
.month-stat-val { font-weight: 700; }

/* ── IMPROVED CARD HOVER ──────────────────────────────────── */
.card.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-md);
}

/* ── TOPBAR IMPROVEMENTS ──────────────────────────────────── */
@media (max-width: 1024px) {
  .credit-pill .credit-bar-bg { display: none; }
}
@media (max-width: 768px) {
  .credit-pill .credit-amount { display: none; }
  .credit-pill { padding: 5px 8px; }
  .sidebar-toggle { display: flex !important; }
}

/* ── GLOBAL SCROLLBAR POLISH ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── BETTER EMPTY STATE ───────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 10px;
}
.empty-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty-title { font-size: 1rem; font-weight: 600; }
.empty-text  { font-size: 0.82rem; color: var(--text-2); max-width: 280px; line-height: 1.5; }

/* ── CHAT META TOP ────────────────────────────────────────── */
.chat-meta-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 0.71rem;
  color: var(--text-3);
}
.chat-sender-name { font-weight: 600; color: var(--text-2); }
.chat-message.assistant .chat-sender-name { color: var(--accent); }
.chat-message.user .chat-sender-name { color: var(--green); }
.chat-meta-sep { color: var(--text-3); }
.chat-message.user .chat-meta-top { justify-content: flex-end; }

/* ── ANALYSES PAGE HEADER TOOLS ───────────────────────────── */
.page-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── RESPONSIVE MOBILE ────────────────────────────────────── */
@media (max-width: 640px) {
  .analyses-card-grid { grid-template-columns: 1fr; }
  .fab-ai { bottom: 20px; right: 20px; width: 46px; height: 46px; }
  .fab-ai .icon { width: 18px; height: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   PLANSKI v3.1 — Stats chart, Settings credit, Analysis form
   ═══════════════════════════════════════════════════════════ */

/* ── STATS SVG CHART ──────────────────────────────────────── */
.stats-svg-chart { overflow: visible; }
.stats-svg-chart text { user-select: none; }

/* ── ANALYSIS NEW — TRADE PREVIEW ────────────────────────── */
#trade-preview-card {
  transition: all var(--transition);
}

/* ── SETTINGS CREDIT SECTION ──────────────────────────────── */
.credit-progress-bar {
  height: 10px;
  background: var(--border-md);
  border-radius: 5px;
  overflow: hidden;
}
.credit-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease;
}

/* ── BETTER FORM LAYOUT ───────────────────────────────────── */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

/* ── FLEX HELPERS ─────────────────────────────────────────── */
.flex         { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; }
.align-center { align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-5  { margin-bottom: 20px; }
.mb-6  { margin-bottom: 24px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-sm  { font-size: 0.82rem; }
.text-xs  { font-size: 0.72rem; }
.text-muted { color: var(--text-2); }
.text-green { color: var(--green) !important; }
.text-red   { color: var(--red) !important; }
.text-accent{ color: var(--accent) !important; }
.text-gold  { color: var(--gold) !important; }

/* ── BADGE EXTRA COLORS ───────────────────────────────────── */
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-gold   { background: var(--gold-bg);   color: var(--gold);   }
.badge-muted  { background: var(--bg-hover);  color: var(--text-2); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--border-md);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 3px; }
.progress-bar.green  { background: var(--green); }
.progress-bar.red    { background: var(--red); }
.progress-bar.accent { background: var(--accent); }

/* ── TABLE STYLES ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* ── CHAT SIDEBAR ACTIONS ─────────────────────────────────── */
.chat-list-item {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  transition: background var(--transition);
  position: relative;
}
.chat-list-item:hover, .chat-list-item.active {
  background: var(--bg-hover);
}
.chat-list-item.active {
  background: var(--accent-bg);
}
.chat-list-link {
  flex: 1;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-width: 0;
}
.chat-title {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-1);
}
.chat-list-item.active .chat-title { color: var(--accent); }
.chat-meta { font-size: 0.7rem; color: var(--text-3); margin-top: 2px; }
.chat-list-actions {
  display: flex;
  gap: 2px;
  padding-right: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}
.chat-list-item:hover .chat-list-actions { opacity: 1; }
.chat-action-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.chat-action-btn .icon { width: 12px; height: 12px; }
.chat-action-btn:hover { background: var(--bg-2); color: var(--text-1); }
.chat-action-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* ── CHAT AVATAR ──────────────────────────────────────────── */
.chat-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
  align-self: flex-start;
}
.chat-avatar.ai   { background: var(--accent-bg); color: var(--accent); }
.chat-avatar.user { background: linear-gradient(135deg, var(--green-bg), rgba(34,197,94,0.2)); color: var(--green); }

/* ── DISCLAIMER BAR ───────────────────────────────────────── */
.disclaimer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--orange);
  margin-bottom: 20px;
}
.disclaimer-bar .icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ── UPLOAD ZONE ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone input[type=file] { display: none; }
.upload-zone-icon .icon { width: 32px; height: 32px; color: var(--text-3); }
.upload-zone-text { font-size: 0.82rem; color: var(--text-2); }

/* ── IMAGE GRID ───────────────────────────────────────────── */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px; }
.image-thumb {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 4/3; background: var(--bg-0); cursor: zoom-in;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.image-thumb:hover img { transform: scale(1.05); }
.remove-btn {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.7); color: #fff; border: none;
  border-radius: 50%; font-size: 0.7rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.image-thumb:hover .remove-btn { opacity: 1; }

/* ── GRID HELPERS ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ── ALERT STYLES ─────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.83rem; font-weight: 500; margin-bottom: 16px;
}
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--orange-bg);color: var(--orange);border: 1px solid rgba(249,115,22,0.2); }
.alert-info    { background: var(--accent-bg);color: var(--accent);border: 1px solid rgba(91,110,245,0.2); }

/* ── PAGINATION ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px; justify-content: center; }
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: var(--radius-xs);
  font-size: 0.8rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
}
.pagination a { color: var(--text-2); border: 1px solid var(--border); }
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination span.current { background: var(--accent); color: #fff; }

/* ── SIGNALS / PUSH TOAST ─────────────────────────────────────── */
.signal-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--bg-1); border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  color: var(--text-1); padding: 14px 20px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 360px; font-size: 0.88rem; font-weight: 500;
  transform: translateX(120%); opacity: 0;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), opacity 0.35s;
}
.signal-toast.show { transform: translateX(0); opacity: 1; }

/* Signal row highlight */
.signal-row-strong { background: rgba(16,185,129,0.04); }
.signal-row-strong td:first-child { border-left: 3px solid var(--green); }
