@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

/* ======================================================
   Pouls BRVM — Unified Stylesheet
   Dark luxury theme — brvm-design-1
   Single source of truth for all pages (main + Ideas)
====================================================== */

/* ── VARIABLES ─────────────────────────────────────── */
:root {
  /* Core palette */
  --navy:         #080d1c;
  --navy-mid:     #0f1628;
  --navy-light:   #172035;
  --navy-card:    #1c2840;

  /* Gold accents */
  --gold:         #c9a84c;
  --gold-light:   #e8c97e;
  --gold-pale:    rgba(201,168,76,0.10);
  --gold-border:  rgba(201,168,76,0.18);

  /* Semantic aliases (used throughout PHP templates) */
  --bg:           #080d1c;
  --surface:      #172035;
  --surface-2:    #1c2840;
  --border:       rgba(201,168,76,0.15);
  --border-2:     rgba(201,168,76,0.10);
  --text:         #ffffff;
  --muted:        #7a8499;
  --muted-light:  #a0acbe;

  --primary:      #c9a84c;
  --primary-2:    #e8c97e;
  --primary-soft: rgba(201,168,76,0.10);

  --positive:     #2dd4a0;
  --positive-pale: rgba(45,212,160,0.12);
  --negative:     #f87171;
  --negative-pale: rgba(248,113,113,0.12);
  --warning:      #f59e0b;

  --radius:       0px;
  --radius-sm:    0px;

  --shadow-soft:  0 6px 18px rgba(0,0,0,0.35);
  --shadow:       0 14px 36px rgba(0,0,0,0.5);
  --shadow-hover: 0 16px 40px rgba(0,0,0,0.6);
  --table-head:   #0f1628;
  --transition:   .2s cubic-bezier(.4,0,.2,1);
}

/* ── RESET & BASE ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle film-grain noise texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9998; opacity: .35;
}

a { color: inherit; text-decoration: none; }
a.company-link { color: var(--primary); font-weight: 700; text-decoration: none; }
a.company-link:hover { color: var(--primary-2); text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: 'Cormorant Garamond', serif; }
p { margin: 0; }
ul { margin: 0; padding-left: 18px; }
small { color: var(--muted); }
option { background: var(--navy-mid); color: var(--text); }

/* ── LAYOUT ────────────────────────────────────────── */
.app { display: block; width: 100%; max-width: 100%; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,13,28,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
}
.topbar-inner {
  display: flex; gap: 12px; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
}

/* Brand — pulsing green dot via ::before */
.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 600;
  color: var(--gold-light);
  letter-spacing: .04em; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 8px var(--positive);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:.3;} }

.navlinks { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.navlinks a {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 500; font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  background: none;
  transition: color var(--transition), border-color var(--transition);
}
.navlinks a:hover {
  color: var(--gold-light);
  border-color: var(--border);
  transform: none; box-shadow: none;
}
.navlinks a.active {
  color: var(--gold-light);
  border-color: var(--border);
  background: none;
}
.navlinks a[href*="simulation.php"] { display: none !important; }

.nav-dropdown {
  position: relative;
  margin: 0;
}
.nav-dropdown summary {
  list-style: none;
}
.nav-dropdown summary::-webkit-details-marker {
  display: none;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  user-select: none;
}
.nav-dropdown-trigger:focus,
.nav-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: none;
}
.nav-dropdown-trigger::after {
  content: "▾";
  font-size: .7em;
  color: var(--gold);
  transition: transform var(--transition);
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown[open] .nav-dropdown-trigger,
.nav-dropdown--active .nav-dropdown-trigger {
  color: var(--gold-light);
  border-color: var(--border);
}
.nav-dropdown[open] .nav-dropdown-trigger::after {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  padding: 6px 0;
  background: rgba(15, 22, 40, 0.98);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  z-index: 350;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown[open] .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-menu a {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  color: var(--gold-light);
  background: rgba(201,168,76,0.08);
}

/* Auth nav (Ideas topbar) */
.nav-auth { display: flex; gap: 8px; align-items: center; }
.nav-user {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

.nav-user-dropdown {
  position: relative;
}
.nav-user-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: rgba(12, 23, 48, 0.92);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .01em;
  user-select: none;
}
.nav-user-toggle::-webkit-details-marker { display: none; }
.nav-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 14px;
  border: 1px solid rgba(201, 168, 76, 0.45);
}
.nav-user-name {
  font-weight: 700;
  color: #e7edf8;
}
.nav-user-caret {
  color: var(--gold);
  font-size: .72rem;
  transition: transform var(--transition);
}
.nav-user-dropdown[open] .nav-user-caret { transform: rotate(180deg); }

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(13, 28, 59, 0.98), rgba(9, 20, 43, 0.98));
  border: 1px solid rgba(130, 154, 197, 0.35);
  box-shadow: 0 22px 36px rgba(1, 8, 19, 0.52);
  z-index: 500;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.nav-user-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}
.nav-user-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(130, 154, 197, 0.33);
  font-size: .96rem;
  color: #c9d4e7;
  text-decoration: none;
  background: rgba(14, 29, 60, 0.4);
}
.nav-user-stat strong {
  color: #e0bb66;
  font-family: 'DM Mono', monospace;
  font-size: .9rem;
}
.nav-user-menu-link {
  display: block;
  padding: 9px 10px;
  border: 1px solid rgba(130, 154, 197, 0.33);
  font-size: .84rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f3f6fd;
  text-decoration: none;
  background: rgba(14, 29, 60, 0.38);
}
.nav-user-menu-link:hover,
.nav-user-stat:hover {
  border-color: rgba(213, 178, 95, 0.62);
  background: rgba(19, 39, 82, 0.68);
}
.nav-user-menu-link--danger {
  color: #f0aaaa;
}


.content       { padding: 20px; width: 100%; max-width: 100%; }
.ideas-content { padding: 20px; width: 100%; max-width: 1200px; margin: 0 auto; }

/* ── CARDS ─────────────────────────────────────────── */
.card, .table-card, .chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
  margin-bottom: 16px;
  width: 100%; max-width: 100%;
  transition: background var(--transition);
}
.card:hover, .table-card:hover { background: var(--surface-2); box-shadow: none; }

.card h3, .table-card h3, .chart-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 500; margin: 0 0 10px 0;
  color: var(--gold-light); letter-spacing: .02em;
}
.table-title {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.table-sub { font-size: 12px; color: var(--muted); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 28px; max-width: 520px; margin: 32px auto;
}
.form-card--wide { max-width: 760px; }

/* ── GRID LAYOUTS ──────────────────────────────────── */
.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; width: 100%; max-width: 100%;
}
.grid-2--tight { gap: 10px; }
.grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; width: 100%; max-width: 100%;
}
.grid-full { grid-column: 1 / -1; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kpi {
  border: 1px solid var(--border);
  border-radius: 0; padding: 14px;
  background: var(--surface);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .35s;
}
.kpi:hover { background: var(--surface-2); }
.kpi:hover::after { transform: scaleX(1); }
.kpi .n { font-family: 'DM Mono', monospace; font-weight: 500; font-size: 16px; }
.kpi .l { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }

/* ── TABLES ────────────────────────────────────────── */
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--table-head);
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
  font-weight: 400; font-size: .65rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
}
tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  white-space: nowrap; vertical-align: middle;
  color: var(--text);
}
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

.center { text-align: center; }
.right  { text-align: right; }
.cell-strong { font-weight: 700; }
.cell-muted  { color: var(--muted); font-weight: 500; }
.rank {
  width: 38px; text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: .72rem; color: var(--muted);
}
.perf-positive { color: var(--positive); font-weight: 700; font-family: 'DM Mono', monospace; }
.perf-negative { color: var(--negative); font-weight: 700; font-family: 'DM Mono', monospace; }

/* ── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: none;
  font-weight: 500; font-size: .75rem;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  color: var(--muted-light);
  transition: all var(--transition);
}
.btn:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
  transform: none; box-shadow: none;
}
.btn:active { transform: none; }

.btn-primary, .btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 600;
}
.btn-primary:hover, .btn.primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy);
  box-shadow: 0 8px 24px rgba(201,168,76,.3);
  transform: translateY(-2px);
}
.btn-outline, .btn.outline {
  background: none;
  color: var(--muted-light);
  border-color: var(--border);
}
.btn-sm, .btn.small { padding: 6px 12px; font-size: .7rem; }
.btn.danger { background: var(--negative-pale); border-color: rgba(248,113,113,.3); color: var(--negative); }
.btn.danger:hover { background: rgba(248,113,113,.2); }
.btn.publish { background: #7e22ce; border-color: #6b21a8; color: #fff; text-transform: none; }
.btn.publish:hover { background: #6b21a8; }

.share-btn {
  border-radius: 0;
  font-weight: 500;
  padding: 8px 13px; gap: 8px;
  border: 1px solid var(--border);
  background: none; color: var(--muted);
}
.share-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: currentColor; }
.share-icon svg { width: 16px; height: 16px; display: block; fill: currentColor; }
.share-facebook { color: #1877f2; }
.share-x        { color: var(--muted-light); }
.share-telegram { color: #229ed9; }
.share-whatsapp { color: #16a34a; }
.share-facebook:hover { border-color: rgba(24,119,242,.35); background: rgba(24,119,242,.08); box-shadow: 0 6px 16px rgba(24,119,242,.15); }
.share-x:hover        { border-color: rgba(160,172,190,.35); background: rgba(160,172,190,.08); box-shadow: 0 6px 16px rgba(160,172,190,.15); }
.share-telegram:hover { border-color: rgba(34,158,217,.35); background: rgba(34,158,217,.08); box-shadow: 0 6px 16px rgba(34,158,217,.15); }
.share-whatsapp:hover { border-color: rgba(22,163,74,.35);  background: rgba(22,163,74,.08);  box-shadow: 0 6px 16px rgba(22,163,74,.15);  }

/* ── FORM ELEMENTS ─────────────────────────────────── */
.input, .form-control {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 13px;
  font-size: 14px; font-family: inherit;
  font-weight: 400; color: var(--text);
  background: var(--navy-mid); outline: none;
  transition: var(--transition); width: 100%;
}
.input:focus, .form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.10);
}
.input::placeholder, .form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; }
select.form-control   { width: 100%; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted-light); letter-spacing: .06em; text-transform: uppercase; }
.form-error { color: var(--negative); font-size: 12px; font-weight: 600; }
.form-hint  { color: var(--muted); font-size: 12px; }
.auth-login-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.auth-login-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  font-size: .68rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.field  { display: flex; flex-direction: column; gap: 6px; }
.label  { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.form-checkbox { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.form-checkbox input { margin-top: 3px; }

.form-preview-img { max-width: 100%; border: 1px solid var(--border); border-radius: 0; }

select {
  border: 1px solid var(--border); background: var(--navy-mid);
  padding: 8px 10px; border-radius: 0;
  font-weight: 500; font-size: 12px;
  color: var(--text); outline: none;
  transition: var(--transition);
}
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.10);
}
.table-title select { min-width: 140px; max-width: 220px; }

.filter-select {
  border: 1px solid var(--border); background: var(--navy-mid);
  padding: 8px 10px; border-radius: 0;
  font-weight: 500; font-size: 12px; color: var(--text);
}
.filters-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.controls    { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ── BADGES & PILLS ────────────────────────────────── */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--gold-pale);
  font-size: 12px; font-weight: 600;
  color: var(--muted); white-space: nowrap;
  font-family: 'DM Mono', monospace;
}
.pill.good, .badge-success, .badge-bullish { color: var(--positive); border-color: rgba(45,212,160,.3);  background: var(--positive-pale); }
.pill.bad,  .badge-danger,  .badge-bearish { color: var(--negative); border-color: rgba(248,113,113,.3); background: var(--negative-pale); }
.pill.warn, .badge-warning                { color: var(--warning);  border-color: rgba(245,158,11,.3);  background: rgba(245,158,11,.12); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.badge-mini {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 0;
  background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted);
}
.badge-date-cotation {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 0;
  background: var(--gold-pale); border: 1px solid var(--border);
  color: var(--gold); font-size: 11px; font-weight: 700; vertical-align: middle;
  font-family: 'DM Mono', monospace;
}
.badge-trim {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 0;
  background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: var(--warning);
  font-size: 10px; font-weight: 700; text-transform: lowercase; white-space: nowrap;
}
.badge-trim.badge-trim-grey { background: var(--surface-2); border-color: var(--border); color: var(--muted); }

/* ── ALERT BOXES ───────────────────────────────────── */
.alert-error {
  margin: 12px 0; color: var(--negative); font-weight: 600;
  background: var(--negative-pale); border: 1px solid rgba(248,113,113,.3);
  padding: 12px 14px; border-radius: 0; font-size: 13px;
}
.alert-success {
  margin: 12px 0; color: var(--positive); font-weight: 600;
  background: var(--positive-pale); border: 1px solid rgba(45,212,160,.3);
  padding: 12px 14px; border-radius: 0; font-size: 13px;
}

/* ── PUBLISH TOAST ─────────────────────────────────── */
.publish-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2); border: 1px solid rgba(45,212,160,.4);
  color: var(--positive); font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.publish-toast__close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px;
}
.publish-toast__close:hover { color: var(--text); }

/* ── IDEAS: GRID & CARDS ───────────────────────────── */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.idea-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; box-shadow: none;
  overflow: hidden; display: flex; flex-direction: column;
  transition: background var(--transition), transform var(--transition);
  position: relative;
}
.idea-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .35s;
}
.idea-card:hover { background: var(--surface-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.idea-card:hover::after { transform: scaleX(1); }

.idea-card__thumb {
  width: 100%; height: 180px;
  object-fit: cover; background: var(--table-head);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700;
}
.idea-card__body {
  padding: 14px 16px; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}
.idea-card__title { font-size: 14px; font-weight: 600; margin: 0; line-height: 1.3; }
.idea-card__title a { color: var(--text); text-decoration: none; }
.idea-card__title a:hover { color: var(--gold-light); }
.idea-card__meta {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.idea-card__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  opacity: .9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-card__footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 14px; font-size: 12px; color: var(--muted);
}

/* ── IDEAS: DETAIL PAGE ────────────────────────────── */
.idea-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; box-shadow: none;
  padding: 20px; margin-bottom: 16px;
}
.idea-detail__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 500;
  line-height: 1.2; margin: 0 0 10px 0; color: var(--gold-light);
}
.idea-detail__meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; color: var(--muted);
  font-size: 13px; margin-bottom: 12px;
}
.idea-detail__img {
  width: 100%; border-radius: 0;
  border: 1px solid var(--border); background: var(--table-head);
}
.idea-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin-top: 12px;
}
.idea-level {
  border: 1px solid var(--border); border-radius: 0;
  padding: 10px; background: var(--surface-2);
}
.idea-level .k { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.idea-level .v { font-size: 14px; font-weight: 600; font-family: 'DM Mono', monospace; }
.stat-line { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }

/* ── IDEAS: COMMENTS ───────────────────────────────── */
.comment-list  { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.comment-card  { border: 1px solid var(--border); border-radius: 0; padding: 12px; background: var(--surface); }
.comment-card--reply {
  margin-left: 22px;
  border-left: 2px solid var(--gold-border);
  background: linear-gradient(90deg, rgba(201,168,76,.06), transparent 45%), var(--surface);
}
.comment-replies { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.comment-actions { display: flex; gap: 6px; align-items: center; }
.comment-reply-target {
  display: inline-flex;
  padding: 1px 6px;
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-size: .7rem;
  letter-spacing: .04em;
}

/* ── TOOLTIPS ──────────────────────────────────────── */
.tooltip { position: relative; cursor: help; border-bottom: 1px dotted var(--muted); }
.tooltip .tip {
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
  background: #050810; color: var(--text); padding: 8px 10px; border-radius: 0;
  border: 1px solid var(--border);
  font-size: 12px; width: 280px; opacity: 0; pointer-events: none;
  transition: .15s; z-index: 10;
}
.tooltip:hover .tip { opacity: 1; }

/* ── CHARTS ────────────────────────────────────────── */
.chart-wrap { width: 100%; max-width: 100%; height: 340px; overflow: hidden; }
canvas { display: block; max-width: 100% !important; }

/* ── DASHBOARD SECTION LAYOUT ─────────────────────── */
.layout-item-managed {
  position: relative;
  transition: max-height .22s ease, border-color .2s ease, box-shadow .2s ease;
}
.layout-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  background: rgba(4, 9, 20, .88);
  z-index: 35;
}
.layout-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 24px;
  height: 24px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}
.layout-btn:hover {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}
.layout-btn.is-active {
  background: var(--gold-pale);
  color: var(--gold-light);
  border-color: var(--gold-border);
}
.layout-item-managed.is-collapsed {
  max-height: 74px;
  overflow: hidden;
}
.layout-item-managed.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(9,18,45,0), rgba(9,18,45,.95));
}
.layout-item-managed.is-enlarged {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 1px rgba(201,168,76,.28), 0 16px 42px rgba(0,0,0,.42);
  min-height: min(78vh, 760px);
}
.layout-item-managed.is-enlarged .chart-wrap {
  height: min(72vh, 620px) !important;
}
.layout-item-managed.is-enlarged .table-scroll {
  max-height: min(62vh, 520px);
  overflow: auto;
}
.layout-item-managed.is-enlarged.grid-2 {
  grid-template-columns: 1fr;
}

/* ── CHAT WIDGET ───────────────────────────────────── */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: none; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; cursor: pointer;
  box-shadow: 0 8px 32px rgba(201,168,76,.4);
  z-index: 10000; user-select: none;
  transition: transform .3s, box-shadow .3s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(201,168,76,.5); }

.chat-widget {
  position: fixed; right: 18px; bottom: 18px;
  width: min(420px, calc(100vw - 24px));
  height: min(62vh, 440px);
  min-width: 300px;
  min-height: 220px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  z-index: 9999; overflow: hidden;
  display: flex; flex-direction: column;
  resize: both;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px;
  background: var(--table-head); border-bottom: 1px solid var(--border);
  cursor: grab; user-select: none;
  touch-action: none;
}
.chat-head:active { cursor: grabbing; }
.chat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 500; color: var(--gold-light);
}
.chat-actions { display: flex; gap: 6px; align-items: center; }
.chat-icon {
  border: 1px solid var(--border); background: none;
  width: 28px; height: 28px; border-radius: 0;
  font-weight: 700; cursor: pointer; color: var(--muted);
  transition: var(--transition);
  font-size: 12px;
  line-height: 1;
}
.chat-icon:hover { background: var(--gold-pale); color: var(--gold-light); }
.chat-icon.is-active { background: var(--gold-pale); color: var(--gold-light); border-color: var(--gold-border); }
.chat-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
}
.chat-widget.is-minimized .chat-body { display: none; }
.chat-widget.is-minimized { height: auto !important; min-height: 0; resize: none; }
.chat-widget.is-minimized .chat-head { border-bottom: none; }
.chat-widget.is-hidden { display: none; }
.chat-widget.is-expanded { border-color: var(--gold-border); }

.chatbox {
  border: 1px solid var(--border); border-radius: 0;
  padding: 10px; max-height: none; overflow: auto;
  min-height: 120px; flex: 1;
  background: var(--navy-mid);
}
.chatrow { padding: 8px 0; font-size: 13px; }
.chatrow b { font-weight: 700; color: var(--gold-light); }
.chatinput {
  flex: 1; min-width: 220px;
  border: 1px solid var(--border); border-radius: 0;
  padding: 10px; font-weight: 400;
  background: var(--navy-mid); color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color var(--transition);
}
.chatinput:focus { border-color: var(--gold); }
.chatinput::placeholder { color: var(--muted); }

/* ── TABS (profile) ────────────────────────────────── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabpage { display: block; }
.tabbtn {
  border: 1px solid var(--border); background: none;
  padding: 8px 14px; border-radius: 0;
  font-weight: 500; cursor: pointer;
  color: var(--muted); font-size: .75rem;
  letter-spacing: .06em; text-transform: uppercase;
  transition: var(--transition);
}
.tabbtn.active { background: var(--gold-pale); color: var(--gold-light); border-color: var(--gold-border); }

/* ── TA CONTROLS (profile) ─────────────────────────── */
.ta-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ta-controls select { border: 1px solid var(--border); background: var(--navy-mid); padding: 8px 10px; border-radius: 0; font-weight: 500; color: var(--text); }
.ta-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 0; background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.ta-toggle input { margin: 0; }
.ta-interpreter {
  margin-top: 10px; border: 1px solid var(--border);
  border-radius: 0; background: var(--surface); padding: 10px 12px;
}
.ta-interpreter .title { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.ta-interpreter .line  { font-size: 13px; margin: 2px 0; color: var(--text); }

/* ── COMPANY FILTER (profile) ──────────────────────── */
.company-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select.company-select {
  border: 1px solid var(--border); background: var(--navy-mid);
  padding: 10px 12px; border-radius: 0;
  font-weight: 500; max-width: min(520px, 100%); color: var(--text);
}

/* ── AI TEXT (profile) ─────────────────────────────── */
.ai-text { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.ai-text b { font-weight: 700; color: var(--gold-light); }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── CALLOUT (simulation) ──────────────────────────── */
.callout {
  border: 1px solid rgba(201,168,76,.25); background: var(--gold-pale);
  border-radius: 0; padding: 14px;
}
.callout h4 {
  margin: 0 0 6px 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 500; color: var(--gold-light);
}
.callout .small { font-size: 12px; color: var(--muted); }
.cta { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── PORTEFEUILLE: RESULTS TABLE EXTRAS ────────────── */
#resultsCard h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#resultsCard tfoot td {
  padding: 12px 10px; font-weight: 700; font-size: 13px;
  background: var(--table-head); border-top: 2px solid var(--border);
  border-bottom: none; white-space: nowrap; vertical-align: middle;
}
#resultsCard tfoot td:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#resultsCard tfoot .good { font-size: 14px; }
#resultsCard tfoot .bad  { font-size: 14px; }
#kpiVarJour.positive { color: var(--positive); }
#kpiVarJour.negative { color: var(--negative); }
.var-day-positive::before { content: "\2191\00a0"; }
.var-day-negative::before { content: "\2193\00a0"; }
.var-day-zero   { color: var(--muted); font-weight: 500; }
.cell-neutral   { color: var(--muted); font-weight: 500; }

/* ── UTILITY CLASSES ───────────────────────────────── */
.flex-row       { display: flex; gap: 8px; flex-wrap: wrap; }
.flex-between   { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.flex-between--top { align-items: flex-start; }
.flex-col       { display: flex; flex-direction: column; }
.pre-wrap       { white-space: pre-wrap; line-height: 1.6; }
.mt-sm { margin-top: 6px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 14px; }
.mb-sm { margin-bottom: 6px; }
.mb-md { margin-bottom: 12px; }
.page-heading {
  margin: 0 0 14px 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 400;
  color: var(--gold-light); letter-spacing: -.01em;
}
.page-heading--sm { font-size: 1.4rem; }
.note    { font-size: 12px; color: var(--muted); }
.small, .mini { font-size: 12px; color: var(--muted); }
.bad     { color: var(--negative); font-weight: 700; }
.good    { color: var(--positive); font-weight: 700; }
.warning { color: var(--warning);  font-weight: 700; }
.hr      { height: 1px; background: var(--border); margin: 12px 0; }
.feed-sentinel { padding: 18px; text-align: center; color: var(--muted); }
.thumb-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.search-input { min-width: 230px; max-width: 320px; }
.title-xl { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 400; color: var(--gold-light); }
.capture-hint { margin-top: 4px; display: none; color: var(--positive); font-weight: 600; }
.capture-preview { display: none; margin-top: 8px; max-width: 100%; border: 1px solid var(--border); border-radius: 0; }
.text-link { color: var(--text); text-decoration: none; }
.hide      { display: none !important; }
.span-all  { grid-column: 1 / -1; }
.comment-meta { margin-bottom: 6px; }

/* ── SPINNER ───────────────────────────────────────── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(201,168,76,.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER ────────────────────────────────────────── */
.site-footer {
  margin-top: 40px; padding: 24px 40px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px;
  color: var(--muted); background: #050810;
  letter-spacing: .04em;
}
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: var(--gold-light); }

/* ── GRAPHIQUES: LAYOUT ────────────────────────────── */
.chart-layout {
  display: flex; gap: 0; align-items: flex-start;
}
.ticker-sidebar {
  width: 190px; flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  position: sticky; top: 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
}
.ticker-sidebar::-webkit-scrollbar { width: 4px; }
.ticker-sidebar::-webkit-scrollbar-thumb { background: var(--gold-border); }
.sidebar-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; font-size: .62rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--table-head); z-index: 1;
}
.sidebar-head-pct {
  font-size: .58rem; color: var(--muted);
  font-weight: 400; letter-spacing: 0; text-transform: none;
}
#varPeriodSelect {
  background: transparent; border: none; outline: none;
  color: var(--muted); font-size: .58rem; font-weight: 400;
  font-family: inherit; cursor: pointer; padding: 0;
  -webkit-appearance: auto;
}
.sidebar-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background var(--transition);
  gap: 6px;
}
.sidebar-item:hover { background: var(--surface-2); }
.sidebar-item.active {
  background: var(--gold-pale);
  border-left: 2px solid var(--gold);
}
.sidebar-ticker-group { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar-ticker {
  font-family: 'DM Mono', monospace; font-weight: 600; font-size: 11px;
  color: var(--text); white-space: nowrap;
}
.sidebar-name {
  font-size: 9px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 118px;
}
.sidebar-pct {
  font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 700;
  white-space: nowrap; text-align: right;
}
.sidebar-pct.good { color: var(--positive); }
.sidebar-pct.bad  { color: var(--negative); }
.sidebar-pct.neutral { color: var(--muted); }
.chart-main { flex: 1; min-width: 0; }

/* ── GRAPHIQUES: DRAWING TOOLS ─────────────────────── */
.draw-wrap { position: relative; overflow: visible; }
.draw-toolbar {
  position: absolute; right: -38px; top: 0;
  display: flex; flex-direction: column; gap: 3px; z-index: 20;
}
.draw-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); padding: 0;
  line-height: 1;
}
.draw-btn:hover {
  background: var(--gold-pale); color: var(--gold-light);
  border-color: var(--gold-border);
}
.draw-btn.active {
  background: var(--gold-pale); color: var(--gold-light);
  border-color: var(--gold); border-left-width: 2px;
}
#drawCanvas { position: absolute; top: 0; left: 0; pointer-events: none; }

/* ── CHART CONTEXT MENU ─────────────────────── */
.ctx-item {
  padding: 8px 16px; cursor: pointer; color: var(--text);
  transition: background 0.15s;
}
.ctx-item:hover, .ctx-item:focus {
  background: var(--gold-pale); color: var(--gold-light); outline: none;
}
.ctx-separator {
  height: 1px; background: var(--border); margin: 4px 0;
}

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

@media (max-width: 900px) {
  .grid-2    { grid-template-columns: 1fr; }
  .idea-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wrap  { height: 300px; }
  .chart-layout { flex-direction: column; }
  .ticker-sidebar {
    width: 100%; max-height: 100px; position: static;
    display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    border-right: 1px solid var(--border); border-bottom: none;
    scrollbar-width: none;
  }
  .ticker-sidebar::-webkit-scrollbar { display: none; }
  .sidebar-head { display: none; }
  .sidebar-item {
    flex-direction: column; align-items: center;
    min-width: 68px; padding: 8px 10px; gap: 3px;
    border-bottom: none; border-right: 1px solid rgba(255,255,255,.03);
  }
  .sidebar-item.active { border-left: none; border-bottom: 2px solid var(--gold); }
  .draw-toolbar { right: -34px; }
  .draw-btn { width: 28px; height: 28px; font-size: 13px; }
}

@media (max-width: 767px) {
  #resultsCard .col-buy-price,
  #resultsCard .col-current-value,
  #resultsCard .col-day-var,
  #resultsCard .col-source { display: none; }
}

@media (max-width: 700px) {
  .grid-3 { grid-template-columns: 1fr; }
  #top10LastYear   td:nth-child(3), #top10LastYear   th:nth-child(3),
  #top10LastYear   td:nth-child(4), #top10LastYear   th:nth-child(4),
  #flop10LastYear  td:nth-child(3), #flop10LastYear  th:nth-child(3),
  #flop10LastYear  td:nth-child(4), #flop10LastYear  th:nth-child(4) { display: none; }
}

@media (max-width: 600px) {
  .topbar { padding: 10px 16px; }
  .topbar-inner { align-items: flex-start; }
  .navlinks { width: 100%; }
  .nav-auth { width: 100%; justify-content: flex-start; }
  .nav-user { width: 100%; justify-content: flex-start; }
  .nav-user-menu { left: 0; right: auto; min-width: min(280px, calc(100vw - 40px)); }
  .comment-card--reply { margin-left: 10px; }
  .ideas-grid { grid-template-columns: 1fr; }
  .form-card  { margin: 16px; padding: 20px; }
  .chat-widget {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    min-width: 0;
    resize: none;
  }
  .chat-actions { gap: 4px; }
  .chat-icon { width: 26px; height: 26px; font-size: 11px; }
  .layout-controls {
    top: 6px;
    right: 6px;
    gap: 3px;
    padding: 3px;
  }
  .layout-btn {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
}

/* .kpis 1-col déplacé dans le bloc 480px ci-dessous */

/* ══════════════════════════════════════════════════════
   ALERTES DE COURS — Modal + composants
══════════════════════════════════════════════════════ */

/* Badge sur le bouton Alertes */
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #080d1c;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 5px;
  line-height: 1;
  vertical-align: middle;
}

/* Overlay */
.alert-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,13,28,0.82);
  backdrop-filter: blur(4px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Boîte centrale */
.alert-modal-box {
  background: var(--navy-card, #1c2840);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

/* En-tête modal */
.alert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gold-border);
}
.alert-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}
.alert-modal-close {
  background: none;
  border: none;
  color: var(--muted, #7a8499);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s;
}
.alert-modal-close:hover { color: #fff; }

/* Corps modal */
#alertModalBody {
  padding: 16px 20px 20px;
}

/* En-tête de la liste */
.alert-list-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted, #7a8499);
  margin-bottom: 8px;
}

/* Liste des alertes */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 24px;
  margin-bottom: 4px;
}
.alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
}
.alert-item-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.alert-item-label {
  flex: 1;
  color: #e2e8f0;
  line-height: 1.4;
}
.alert-item-note {
  display: block;
  font-size: 11px;
  color: var(--muted, #7a8499);
  margin-top: 1px;
}
.alert-item-email {
  margin-left: 4px;
  font-size: 12px;
}
.alert-item-del {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted, #7a8499);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1;
  transition: color .15s;
}
.alert-item-del:hover { color: #f87171; }

/* Formulaire */
.alert-form { margin-top: 16px; }
.alert-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.alert-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.alert-form-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted, #7a8499);
}
.alert-form-error {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 5px;
  color: #f87171;
  font-size: 13px;
}

/* Bloc premium upgrade */
.alert-upgrade {
  text-align: center;
  padding: 20px 10px 8px;
}
.alert-upgrade-icon {
  font-size: 36px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.5));
}
.alert-upgrade h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--gold);
  margin: 0 0 10px;
}
.alert-upgrade p {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.55;
}
.alert-upgrade-features {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0 0;
  text-align: left;
  background: rgba(201,168,76,0.06);
  border: 1px solid var(--gold-border);
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 13px;
  color: #94a3b8;
}

@media (max-width: 500px) {
  .alert-form-row { grid-template-columns: 1fr; }
  .alert-modal-box { max-height: 95vh; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE MOBILE — Additions
   Breakpoints ajoutés : 768px · 480px · 375px
══════════════════════════════════════════════════════ */

/* ── Hamburger (CSS-only, visible sur mobile) ─────── */
.nav-toggle-input { display: none; }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  transition: var(--transition);
}

/* ── 768px : tablettes & grands téléphones ─────────── */
@media (max-width: 768px) {
  /* Grilles : couvre le gap 900px→480px */
  .kpis   { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }

  /* Navigation : hamburger actif */
  .nav-hamburger { display: flex; }
  .navlinks {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 4px;
  }
  .nav-toggle-input:checked ~ .navlinks { display: flex; }
  .navlinks a {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border-2);
    font-size: .8rem;
  }
  .nav-dropdown {
    width: 100%;
  }
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border-2);
  }
  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    padding: 0 0 6px;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .nav-dropdown-menu a {
    width: 100%;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    font-size: .76rem;
  }
  /* Hamburger → X */
  .nav-toggle-input:checked ~ .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-input:checked ~ .nav-hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle-input:checked ~ .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .topbar-inner { flex-wrap: nowrap; align-items: center; }
  .brand { flex: 1; }

  /* Filtres secteurs/screener → empilés verticalement */
  .filters-inline {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    white-space: normal !important;
  }
  .filters-inline .input,
  .filters-inline select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .filters-inline .label { width: 100%; }
}

/* ── 480px : téléphones standards ──────────────────── */
@media (max-width: 480px) {
  /* Grilles */
  .kpis        { grid-template-columns: 1fr; }
  .idea-levels { grid-template-columns: 1fr 1fr; }
  .content     { padding: 12px; }
  .site-footer { padding: 16px; font-size: 11px; }

  /* Polices tableaux */
  thead th { font-size: .72rem; letter-spacing: .10em; padding: 9px 8px; }
  tbody td { font-size: 12px; padding: 9px 8px; }
  table    { font-size: 12px; }
  .kpi .n  { font-size: 14px; }
  .kpi .l  { font-size: 10px; }

  /* Boutons */
  .controls .btn { font-size: .68rem; padding: 8px 10px; }

  /* Chat FAB */
  .chat-fab    { right: 12px; bottom: 12px; width: 46px; height: 46px; font-size: 18px; }
  .chat-widget { bottom: 0; right: 0; }

  /* Graphiques sidebar */
  .sidebar-item { min-width: 54px; padding: 6px 8px; }
  .sidebar-name { display: none; }
  .sidebar-pct  { font-size: 10px; }

  /* Heatmap */
  .heatmap-cell       { min-width: 58px; padding: 4px; }
  .heatmap-cell-value { font-size: 10px; }
  .heatmap-cell-label { font-size: 9px; }

  /* Scatter plot */
  .scatter-wrap     { overflow-x: hidden; }
  .scatter-wrap svg { min-width: 0 !important; width: 100% !important; }

  /* Portefeuille : masquer colonne Qté */
  #resultsCard th:nth-child(3),
  #resultsCard td:nth-child(3) { display: none; }

  /* Screener toolbar */
  .sector-select,
  .screener-search  { width: 100%; min-width: 0; }
  .toolbar-left     { width: 100%; }
  .screener-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ── 375px : iPhone SE (tabs seulement) ────────────── */
@media (max-width: 375px) {
  .tabbtn { font-size: .65rem; padding: 7px 8px; }

  /* Abréger les libellés longs des onglets */
  .tabbtn[data-tab="tab-recommendations"] { font-size: 0; line-height: 0; }
  .tabbtn[data-tab="tab-recommendations"]::after { content: "Reco."; font-size: .65rem; line-height: 1; }

  .tabbtn[data-tab="tab-overview"] { font-size: 0; line-height: 0; }
  .tabbtn[data-tab="tab-overview"]::after { content: "Cours"; font-size: .65rem; line-height: 1; }

  .tabbtn[data-tab="tab-ta"] { font-size: 0; line-height: 0; }
  .tabbtn[data-tab="tab-ta"]::after { content: "Tech."; font-size: .65rem; line-height: 1; }

  .tabbtn[data-tab="tab-finances"] { font-size: 0; line-height: 0; }
  .tabbtn[data-tab="tab-finances"]::after { content: "Finances"; font-size: .65rem; line-height: 1; }
}
