/* ============================================
   RADAR PLATINUM v4.3 — Newspaper Layout Theme
   Palette: Navy #1e2b47, Gold #b8956e
   Polices: DM Sans (texte), Cormorant Garamond (titres)
   Layout: 3-column newspaper for desktop
   ============================================ */

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

:root {
  --navy: #1e2b47;
  --navy-soft: #2a3a5c;
  --gold: #b8956e;
  --gold-light: #d4b896;
  --gold-muted: rgba(184,149,110,0.1);
  --green: #70A95B;
  --green-light: #f0f7ed;
  --amber: #C9A96E;
  --amber-light: #fdf6ec;
  --rose: #BB6371;
  --rose-light: #fdf0f2;
  --blue: #447780;
  --blue-light: #edf5f7;
  --bg-primary: #fafbfc;
  --bg-secondary: #ffffff;
  --bg-accent: #f4f5f7;
  --text-primary: #1e2b47;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --navy: #c9d1dc;
  --navy-soft: #a0aec0;
  --gold: #d4a574;
  --gold-light: #b8956e;
  --gold-muted: rgba(212,165,116,0.12);
  --green: #7dbd66;
  --green-light: #1a2e16;
  --rose: #e08090;
  --rose-light: #2e1518;
  --blue: #5a9aa5;
  --blue-light: #152228;
  --bg-primary: #0f1318;
  --bg-secondary: #181d25;
  --bg-accent: #1e242e;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3748;
  --border-light: #232b38;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}
[data-theme="dark"] .header { background: #111827; }
[data-theme="dark"] .gold-stripe { background: linear-gradient(90deg, #d4a574, #b8956e, #d4a574); }
[data-theme="dark"] .logo-box { background: #d4a574; color: #111827; }
[data-theme="dark"] .comp-table th { background: #1e242e; }
[data-theme="dark"] .market-kpi { border-top-color: #d4a574; }
[data-theme="dark"] .date-picker { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .date-picker option { background: #181d25; }
[data-theme="dark"] .btn-admin-header { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .btn-logout { border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .nav-tab { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .nav-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .nav-tab.active { color: #fff; }
[data-theme="dark"] .newspaper-masthead { border-color: var(--border); }
[data-theme="dark"] .masthead-rule { background: var(--border); }
[data-theme="dark"] .masthead-rule.thick { background: var(--border); }
[data-theme="dark"] .col-rule { background: var(--border); }
[data-theme="dark"] .headline-section { border-color: var(--border); }

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-primary); color: var(--text-primary); line-height: 1.65;
  font-weight: 400; transition: background 0.3s, color 0.3s;
}
.serif { font-family: 'Cormorant Garamond', Georgia, serif; }

/* ── HEADER ── */
.header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 100; background: #1e2b47; }
.header-main { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 2rem; flex-wrap: nowrap; }
.header-left { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.logo-box {
  background: var(--gold); color: #1e2b47;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; font-family: 'Cormorant Garamond', serif;
  border-radius: var(--radius-sm); flex-shrink: 0;
  text-decoration: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.logo-box:hover { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(184,149,110,0.35); }
.header-title h1 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.06em; font-family: 'Cormorant Garamond', serif; }
.header-title p { font-size: 0.7rem; opacity: 0.55; font-family: 'DM Sans', sans-serif; font-weight: 300; }
.header-right { display: flex; align-items: center; gap: 0.5rem; font-family: 'DM Sans', sans-serif; flex-shrink: 1; flex-wrap: nowrap; }
.header-date { font-size: 0.78rem; opacity: 0.75; font-weight: 400; }
.header-version { font-size: 0.65rem; opacity: 0.35; font-weight: 300; }
.header-actions { display: flex; align-items: center; gap: 0.4rem; }
.btn-admin-header {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); font-weight: 500;
  font-size: 0.72rem; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.2s; display: flex; align-items: center; gap: 0.3rem;
}
.btn-admin-header:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: #b8956e; }
.btn-admin-header.active { background: #b8956e; color: #1e2b47; border-color: #b8956e; }
.btn-theme-toggle {
  background: transparent; color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.15);
  padding: 0.25rem 0.45rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; cursor: pointer; transition: all 0.2s; line-height: 1;
}
.btn-theme-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-logout {
  background: transparent; color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); font-weight: 500;
  font-size: 0.72rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gold-stripe { height: 3px; background: linear-gradient(90deg, #b8956e, #d4b896, #b8956e); }

/* ── KPI BAR (with search integrated) ── */
.kpi-bar {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 0.5rem 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: 0.8rem;
}
.kpi-bar-spacer { flex: 1; min-width: 1rem; }
.kpi-bar .search-bar {
  max-width: 280px; padding: 0.3rem 0.6rem; font-size: 0.78rem;
}
.kpi-bar .search-input { font-size: 0.78rem; }
.kpi-bar-item { display: flex; align-items: center; gap: 0.35rem; }
.kpi-bar-value { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.kpi-bar-value.gold { color: var(--gold); }
.kpi-bar-value.green { color: var(--green); }
.kpi-bar-value.rose { color: var(--rose); }
.kpi-bar-label { color: var(--text-secondary); font-size: 0.7rem; font-weight: 400; }
.kpi-bar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 0.15rem; }
.kpi-bar-taux {
  display: flex; align-items: center; gap: 0.3rem;
  background: var(--bg-accent); padding: 0.25rem 0.55rem; border-radius: var(--radius-sm);
  font-size: 0.72rem; color: var(--text-primary);
}
.kpi-bar-taux strong { font-weight: 600; }
.kpi-bar-taux .taux-label { color: var(--text-secondary); font-size: 0.65rem; }
.sentiment-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.18rem 0.45rem; border-radius: var(--radius-sm); font-size: 0.7rem; font-weight: 600;
}
.sentiment-badge.positif { background: var(--green-light); color: var(--green); }
.sentiment-badge.negatif { background: var(--rose-light); color: var(--rose); }
.sentiment-badge.neutre { background: var(--bg-accent); color: var(--text-secondary); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem; max-width: 600px; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-muted); }
.search-icon { font-size: 0.95rem; opacity: 0.4; flex-shrink: 0; }
.search-input {
  flex: 1; border: none; background: transparent; font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif; color: var(--text-primary); outline: none; font-weight: 400;
}
.search-input::placeholder { color: var(--text-muted); }
.search-count { font-size: 0.7rem; color: var(--gold); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.search-clear {
  background: none; border: none; font-size: 1.15rem; color: var(--text-muted);
  cursor: pointer; padding: 0 0.25rem; line-height: 1; flex-shrink: 0; transition: color 0.15s;
}
.search-clear:hover { color: var(--rose); }

/* ── NAV TABS (inline in header) ── */
.nav-tabs-inline {
  display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0; align-items: stretch; margin-left: 0.5rem;
}
.nav-tab {
  padding: 0.45rem 0.75rem; font-size: 0.72rem; color: rgba(255,255,255,0.6);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
  white-space: nowrap; user-select: none; font-weight: 500;
  display: flex; align-items: center; gap: 0.25rem;
}
.nav-tab:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-tab.active { color: #fff; border-bottom-color: var(--gold); font-weight: 600; }
.nav-tab .badge {
  background: rgba(184,149,110,0.2); color: var(--gold-light); border: 1px solid rgba(184,149,110,0.3);
  padding: 0.02rem 0.35rem; border-radius: 10px; font-size: 0.58rem; font-weight: 700; margin-left: 0.15rem;
}

/* ── LAYOUT ── */
.main { max-width: 1440px; margin: 0 auto; padding: 0 2rem 1.5rem; }
.full-width { grid-column: 1 / -1; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── NEWSPAPER MASTHEAD ── */
.newspaper-masthead {
  text-align: center; padding: 1rem 0 0.5rem; margin-bottom: 0;
}
.masthead-rule { height: 1px; background: #1e2b47; margin: 0; }
.masthead-rule.thick { height: 3px; background: #1e2b47; }
.masthead-content {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0;
}
.masthead-edition {
  font-family: 'Cormorant Garamond', serif; font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.12em; color: var(--text-secondary);
  text-transform: uppercase;
}
.masthead-title {
  font-family: 'Cormorant Garamond', serif; font-size: 2rem;
  font-weight: 700; letter-spacing: 0.14em; color: var(--navy);
  text-transform: uppercase;
}
.masthead-date {
  font-family: 'Cormorant Garamond', serif; font-size: 0.72rem;
  font-weight: 500; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── HEADLINE SECTION (top story) ── */
.headline-section {
  border-bottom: 2px solid #1e2b47; padding-bottom: 1rem; margin-bottom: 1.25rem;
}
.headline-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center;
}
.headline-text h2 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem;
  font-weight: 700; line-height: 1.2; color: var(--navy); margin-bottom: 0.5rem;
}
.headline-text h2 a { color: inherit; text-decoration: none; }
.headline-text h2 a:hover { color: var(--gold); }
.headline-summary {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 0.4rem;
}
.headline-meta {
  font-size: 0.72rem; color: var(--text-muted); display: flex;
  align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.headline-img {
  width: 100%; height: 220px; border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg-accent); border: 1px solid var(--border-light);
}
.headline-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 3-COLUMN NEWSPAPER GRID ── */
.newspaper-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 0; margin-bottom: 1.5rem;
}
.newspaper-col { padding: 0 1rem; position: relative; }
.newspaper-col:first-child { padding-left: 0; }
.newspaper-col:last-child { padding-right: 0; }
.col-rule {
  position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: #d1d5db;
}
.newspaper-col:first-child .col-rule { display: none; }

/* ── FULL-WIDTH MAP (below veille + opps columns) ── */
.section-map-fullwidth {
  margin-bottom: 1.5rem;
}

/* ── SECTIONS ── */
.section { margin-bottom: 1.5rem; }
.section-header {
  border-bottom: 2px solid var(--navy); padding-bottom: 0.35rem; margin-bottom: 1rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-title {
  font-size: 0.88rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--navy); font-family: 'Cormorant Garamond', serif;
}
.section-date { font-size: 0.72rem; color: var(--text-secondary); font-weight: 400; }

/* ── FILTERS ── */
.filters { display: flex; gap: 0.35rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.chip {
  padding: 0.2rem 0.6rem; border-radius: var(--radius-xl); font-size: 0.68rem;
  border: 1px solid var(--border); background: var(--bg-secondary);
  cursor: pointer; transition: all 0.2s; user-select: none; font-weight: 500;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── ALERT BOX ── */
.alert-box {
  background: var(--rose-light); border: 1px solid rgba(187,99,113,0.25); border-left: 4px solid var(--rose);
  padding: 0.85rem 1rem; margin: 1rem 0 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; display: none;
}
.alert-box.visible { display: block; }
.alert-item { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(187,99,113,0.12); }
.alert-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.alert-title { font-weight: 700; color: var(--rose); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.alert-text { font-size: 0.85rem; }
.alert-meta { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ── NEWS (compact for newspaper) ── */
.news-grid { display: flex; flex-direction: column; gap: 0; }
.news-item {
  border-bottom: 1px solid var(--border-light); padding-bottom: 0.75rem; margin-bottom: 0.75rem;
  display: flex; gap: 0.75rem; position: relative;
}
.news-item:last-child { border-bottom: none; margin-bottom: 0; }
.news-thumb {
  flex-shrink: 0; width: 110px; height: 75px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-accent); border: 1px solid var(--border-light);
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-thumb .thumb-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 0.58rem; color: var(--text-muted); text-align: center; padding: 0.3rem;
  background: linear-gradient(135deg, var(--bg-accent), var(--gold-muted));
}
.news-thumb .thumb-placeholder .thumb-icon { font-size: 1.2rem; display: block; margin-bottom: 0.1rem; opacity: 0.4; }
.news-body { flex: 1; min-width: 0; }
.news-title { font-size: 0.82rem; font-weight: 600; color: var(--navy); margin-bottom: 0.1rem; line-height: 1.3; }
.news-title a { color: inherit; text-decoration: none; }
.news-title a:hover { text-decoration: underline; color: var(--gold); }
.news-summary { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.25rem; line-height: 1.45; font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.66rem; color: var(--text-secondary); flex-wrap: wrap; gap: 0.3rem;
}
.news-tags { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.tag {
  padding: 0.08rem 0.35rem; background: var(--gold-muted); border: 1px solid rgba(184,149,110,0.2);
  border-radius: 3px; font-size: 0.58rem; color: var(--gold); font-weight: 600;
  text-transform: uppercase; cursor: pointer; transition: all 0.15s;
}
.tag:hover { background: var(--gold); color: #fff; }
.tier-badge { font-size: 0.55rem; background: var(--bg-accent); color: var(--navy); padding: 0.06rem 0.25rem; border-radius: 3px; font-weight: 600; vertical-align: middle; }
.score-stars { color: var(--gold); letter-spacing: 1px; font-size: 0.72rem; }

/* ── BADGE NOUVEAU ── */
.badge-new {
  display: inline-block; background: var(--blue); color: #fff;
  padding: 0.06rem 0.3rem; border-radius: 3px; font-size: 0.52rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.25rem; vertical-align: middle;
  animation: pulseNew 2s ease-in-out infinite;
}
@keyframes pulseNew { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ── FEEDBACK ── */
.news-feedback { display: inline-flex; gap: 0.25rem; margin-left: 0.4rem; vertical-align: middle; }
.feedback-btn {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.12rem 0.3rem; cursor: pointer; font-size: 0.65rem; line-height: 1;
  transition: all 0.2s; color: var(--text-muted);
}
.feedback-btn:hover { border-color: var(--gold); color: var(--gold); }
.feedback-btn.voted-up { background: var(--green-light); border-color: var(--green); color: var(--green); }
.feedback-btn.voted-down { background: var(--rose-light); border-color: var(--rose); color: var(--rose); }

/* ── SIDEBAR ── */
.sidebar-panel {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.85rem; margin-bottom: 0.85rem; box-shadow: var(--shadow-sm);
}
.sidebar-panel h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gold); border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem; margin-bottom: 0.5rem; font-weight: 600;
}
.sidebar-item { padding: 0.3rem 0; border-bottom: 1px dotted var(--border-light); font-size: 0.72rem; }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item strong { color: var(--navy); }
.sidebar-item a { color: var(--blue); text-decoration: none; }
.sidebar-item a:hover { text-decoration: underline; }
.watch-category { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gold); margin-top: 0.5rem; margin-bottom: 0.15rem; display: block; }

/* ── SIDEBAR MARKET KPI CARDS ── */
.sidebar-market-kpis { background: transparent; border: none; padding: 0; box-shadow: none; }
.sidebar-kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.sidebar-kpi-card {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.65rem; text-align: center; border-top: 3px solid #b8956e; box-shadow: var(--shadow-sm);
}
.sidebar-kpi-val { font-size: 1.05rem; font-weight: 700; color: var(--navy); font-family: 'Cormorant Garamond', serif; }
.sidebar-kpi-lbl { font-size: 0.6rem; color: var(--text-secondary); margin-top: 0.1rem; font-weight: 500; }
.sidebar-kpi-src { font-size: 0.55rem; color: var(--text-muted); }

/* ── OPPORTUNITY GRID (1-col in newspaper) ── */
.opp-grid-2col { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }

/* Full-page opportunities tab: 2 columns */
#panel-opportunities .opp-grid-2col { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { #panel-opportunities .opp-grid-2col { grid-template-columns: 1fr; } }

.voir-plus-container { text-align: center; padding: 0.75rem 0; }
.btn-voir-plus, .btn-voir-moins {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--gold); padding: 0.4rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-voir-plus:hover, .btn-voir-moins:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-voir-moins { color: var(--text-secondary); }

/* ── OPPORTUNITY CARDS (compact for newspaper) ── */
.opp-card {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold); overflow: hidden; transition: all 0.2s; box-shadow: var(--shadow-sm);
  position: relative;
}
.opp-card:hover { box-shadow: var(--shadow-md); border-color: var(--gold-light); }
.opp-card-image {
  width: 100%; height: 110px; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-accent), var(--gold-muted)); position: relative; cursor: pointer;
}
.opp-card-image a { display: block; width: 100%; height: 100%; }
.opp-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opp-card-image .img-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.68rem;
}
.opp-card-image .img-placeholder .placeholder-icon { font-size: 1.6rem; margin-bottom: 0.15rem; opacity: 0.35; }
.opp-card-image .img-badge {
  position: absolute; top: 0.4rem; left: 0.4rem; background: #1e2b47; color: #b8956e;
  padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; pointer-events: none;
}
.opp-card-image .img-source-badge {
  position: absolute; top: 0.4rem; right: 0.4rem; background: rgba(30,43,71,0.85); color: #fff;
  padding: 0.08rem 0.35rem; border-radius: 3px; font-size: 0.55rem; font-weight: 600; pointer-events: none;
}
.opp-card-image .img-price-badge {
  position: absolute; bottom: 0.4rem; right: 0.4rem; background: rgba(30,43,71,0.88); color: #fff;
  padding: 0.15rem 0.45rem; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; pointer-events: none;
}
.opp-card-content { padding: 0.65rem; }
.opp-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.4rem; }
.opp-title { font-size: 0.78rem; font-weight: 600; color: var(--navy); margin-bottom: 0.25rem; line-height: 1.25; }
.opp-grid, .opp-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; margin: 0.3rem 0; }
.opp-cell { text-align: center; padding: 0.25rem; background: var(--bg-primary); border-radius: var(--radius-sm); }
.opp-val { font-size: 0.78rem; font-weight: 700; color: var(--navy); }
.opp-lbl { font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.opp-fit {
  background: var(--green-light); border-left: 3px solid var(--green);
  padding: 0.25rem 0.4rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.7rem; color: var(--green); margin-bottom: 0.25rem; font-weight: 500;
}
.opp-meta { font-size: 0.65rem; color: var(--text-muted); }
.opp-score-box {
  display: inline-block; background: var(--gold-muted); border: 1px solid rgba(184,149,110,0.3);
  padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-weight: 700; color: var(--gold); font-size: 0.75rem; flex-shrink: 0;
}
.opp-card-actions { display: flex; justify-content: flex-end; padding: 0 0.65rem 0.5rem; gap: 0.3rem; }
.btn-opp-link {
  display: inline-flex; align-items: center; gap: 0.2rem;
  background: #1e2b47; color: #fff; border: none;
  padding: 0.25rem 0.55rem; border-radius: var(--radius-sm); font-size: 0.68rem;
  font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.2s;
}
.btn-opp-link:hover { background: #2a3a5c; }

/* ── COMPETITION TABLE ── */
.comp-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.74rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.comp-table th {
  background: var(--navy); color: #fff; padding: 0.45rem 0.55rem; text-align: left;
  font-weight: 600; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.comp-table td { padding: 0.38rem 0.55rem; border-bottom: 1px solid var(--border-light); background: var(--bg-secondary); }
.comp-table tr:hover td { background: var(--gold-muted); }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table a { color: var(--blue); text-decoration: none; }
.comp-table a:hover { text-decoration: underline; }
.comp-news-cell { font-size: 0.66rem; line-height: 1.4; max-width: 280px; }
.comp-news-cell a { display: inline-block; margin-bottom: 0.1rem; }
.tier-heading {
  font-family: 'Cormorant Garamond', serif; font-size: 0.9rem; font-weight: 700;
  color: var(--navy); margin: 1.5rem 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--gold);
}
.tier-heading:first-child { margin-top: 0; }
.tier-indicator { display: inline-block; padding: 0.1rem 0.38rem; border-radius: 3px; font-size: 0.6rem; font-weight: 700; }
.tier-indicator.tier-1 { background: #b8956e; color: #1e2b47; }
.tier-indicator.tier-2 { background: #1e2b47; color: #b8956e; }
.tier-indicator.tier-3 { background: var(--bg-accent); color: var(--navy); }
.tier-indicator.tier-4 { background: var(--bg-primary); color: var(--text-muted); border: 1px solid var(--border); }

/* ── MARKET DETAILS ROW ── */
.market-details-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-bottom: 1.5rem;
}
.market-detail-block {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem; box-shadow: var(--shadow-sm);
}
.market-detail-block:empty { display: none; }
.market-detail-block h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 0.82rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--navy); padding-bottom: 0.3rem; margin-bottom: 0.6rem;
}

/* Legacy market-section for market tab */
.market-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.market-kpi {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.15rem 1rem; text-align: center; border-top: 3px solid #b8956e; box-shadow: var(--shadow-sm);
}
.kpi-value { font-size: 1.3rem; font-weight: 700; color: var(--navy); font-family: 'Cormorant Garamond', serif; }
.kpi-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.2rem; font-weight: 500; }
.kpi-source { font-size: 0.6rem; color: var(--text-muted); opacity: 0.7; }
.market-section { margin-bottom: 1.5rem; }
.market-section h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 0.85rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--navy); padding-bottom: 0.3rem; margin-bottom: 0.75rem;
}
.tendance-item { padding: 0.4rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.76rem; }
.tendance-item:last-child { border-bottom: none; }
.tendance-cat {
  display: inline-block; background: var(--gold-muted); color: var(--gold);
  border: 1px solid rgba(184,149,110,0.25); padding: 0.06rem 0.3rem; border-radius: 3px;
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase; margin-right: 0.3rem;
}
.tendance-item a { color: var(--navy); text-decoration: none; font-weight: 600; }
.tendance-item a:hover { text-decoration: underline; color: var(--gold); }
.tendance-meta { display: block; font-size: 0.62rem; color: var(--text-muted); margin-top: 0.1rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 100px; padding: 0.5rem 0; }
.chart-bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 18px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; background: linear-gradient(to top, #b8956e, #d4b896); border-radius: 2px 2px 0 0; min-height: 2px; transition: height 0.3s; }
.chart-bar-wrapper:hover .chart-bar { background: #1e2b47; }
.chart-bar-label { font-size: 0.5rem; color: var(--text-muted); margin-top: 0.15rem; writing-mode: vertical-rl; transform: rotate(180deg); }

/* ── LINE CHART container ── */
.line-chart-container { max-width: 100%; margin-top: 0.3rem; }

/* ── ARCHIVE COMPARE ── */
.compare-bar {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem;
}
.compare-bar select { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.75rem; background: var(--bg-secondary); color: var(--text-primary); }
.compare-bar button { padding: 0.35rem 0.7rem; border: none; background: var(--navy); color: #fff; border-radius: var(--radius-sm); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.compare-result { background: var(--bg-accent); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem; margin-top: 0.75rem; }
.compare-stat { display: inline-block; margin-right: 1.2rem; margin-bottom: 0.3rem; font-size: 0.78rem; }
.compare-stat .val { font-weight: 700; }
.compare-stat .val.up { color: var(--green); }
.compare-stat .val.down { color: var(--rose); }
.compare-stat .val.same { color: var(--text-muted); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 1.5rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 1.8rem; margin-bottom: 0.3rem; opacity: 0.3; }
.empty-state p { font-size: 0.78rem; font-weight: 400; }

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 1.2rem; font-size: 0.7rem;
  color: var(--text-muted); border-top: 2px solid var(--navy); margin-top: 1.5rem;
}
.footer .gold-line { display: block; width: 60px; height: 2px; background: #b8956e; margin: 0.4rem auto; }

/* ── DATE PICKER ── */
.date-picker {
  background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15);
  padding: 0.28rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.72rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif; outline: none; max-width: 160px; font-weight: 400;
}
.date-picker:hover { border-color: #b8956e; }
.date-picker:focus { border-color: #b8956e; background: rgba(255,255,255,0.14); }
.date-picker option { background: #1e2b47; color: #fff; }

/* ── ADVANCED FILTERS ── */
.adv-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.adv-select, .adv-input {
  padding: 0.38rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.75rem; font-family: 'DM Sans', sans-serif; background: var(--bg-secondary);
  color: var(--text-primary); outline: none; min-width: 120px; transition: border-color 0.2s;
}
.adv-select:focus, .adv-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-muted); }
.adv-input { max-width: 130px; }
.btn-filter-reset {
  background: var(--bg-accent); color: var(--text-secondary); border: 1px solid var(--border);
  padding: 0.38rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.72rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-filter-reset:hover { background: var(--navy); color: #fff; }

/* ── ADMIN PANEL ── */
.admin-section {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.admin-title {
  font-family: 'Cormorant Garamond', serif; font-size: 0.92rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gold); padding-bottom: 0.4rem; margin-bottom: 1rem;
}
.admin-form {
  background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 1rem; margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.adm-input {
  padding: 0.45rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.82rem; font-family: 'DM Sans', sans-serif; outline: none;
  width: 100%; background: var(--bg-secondary); transition: border-color 0.2s;
}
.adm-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-muted); }
textarea.adm-input { resize: vertical; min-height: 50px; }
.adm-input-sm {
  padding: 0.3rem 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.8rem; font-family: 'DM Sans', sans-serif; outline: none; width: 100px; background: var(--bg-secondary);
}
.adm-input-sm:focus { border-color: var(--gold); }
.btn-admin {
  background: var(--navy); color: #fff; border: none;
  padding: 0.45rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.8rem;
  font-weight: 600; cursor: pointer; margin-top: 0.5rem; margin-right: 0.5rem; transition: background 0.2s;
}
.btn-admin:hover { background: var(--navy-soft); }
.btn-admin.btn-gold { background: #b8956e; color: #1e2b47; }
.btn-admin.btn-gold:hover { background: #a68057; }
.btn-admin-del {
  background: transparent; color: var(--rose); border: 1px solid var(--rose);
  padding: 0.18rem 0.45rem; border-radius: 3px; font-size: 0.7rem; cursor: pointer; transition: all 0.15s;
}
.btn-admin-del:hover { background: var(--rose); color: #fff; }
.param-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--text-primary); }
.param-row label { min-width: 160px; font-weight: 600; color: var(--navy); }
.admin-params { margin-bottom: 0.5rem; }

/* ── MAP LEGEND ── */
.map-legend {
  background: rgba(255,255,255,0.94); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem;
  font-size: 0.68rem; color: var(--text-primary); box-shadow: var(--shadow-md); line-height: 1.8;
  border: 1px solid var(--border);
}
.map-legend strong { color: #1e2b47; font-size: 0.72rem; }
#map-container { z-index: 1; }
.leaflet-control-attribution { font-size: 0.55rem !important; }

/* ── PRINT / PDF ── */
@media print {
  .header, .kpi-bar, .footer, .btn-voir-plus, .btn-voir-moins,
  .btn-opp-link, .news-feedback, .feedback-btn, #btn-admin-toggle, .btn-logout, .btn-theme-toggle,
  .date-picker, .opp-card-actions, #opp-filters-advanced { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .main { max-width: 100%; padding: 0.5rem; }
  .newspaper-grid { grid-template-columns: 1fr 1fr; }
  .col-rule { display: none; }
  .section { page-break-inside: avoid; }
  .comp-table { font-size: 7pt; }
  @page { margin: 1.5cm; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .newspaper-grid { grid-template-columns: 1fr 1fr; }
  .newspaper-col.col-sidebar { grid-column: 1 / -1; }
  .sidebar-kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .market-details-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .newspaper-grid { grid-template-columns: 1fr; }
  .col-rule { display: none; }
  .newspaper-col { padding: 0; }
  .headline-card { grid-template-columns: 1fr; }
  .market-details-row { grid-template-columns: 1fr; }
  .sidebar-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header-main { flex-direction: column; gap: 0.4rem; padding: 0.6rem 1rem; text-align: center; }
  .header-left { flex-direction: column; justify-content: center; align-items: center; }
  .nav-tabs-inline { margin-left: 0; flex-wrap: wrap; justify-content: center; }
  .header-right { flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
  .header-actions { justify-content: center; }
  .kpi-bar { padding: 0.4rem 1rem; gap: 0.5rem; font-size: 0.75rem; justify-content: center; }
  .kpi-bar-taux { font-size: 0.68rem; padding: 0.2rem 0.4rem; }
  .kpi-bar-divider { height: 18px; }
  .kpi-bar-spacer { display: none; }
  .kpi-bar .search-bar { max-width: 100%; width: 100%; }
  .nav-tab { padding: 0.35rem 0.5rem; font-size: 0.65rem; }
  .main { padding: 0.75rem; }
  .masthead-title { font-size: 1.3rem; }
  .masthead-content { flex-direction: column; gap: 0.2rem; }
  .news-item { flex-direction: column; }
  .news-thumb { width: 100%; height: 120px; }
  #panel-opportunities .opp-grid-2col { grid-template-columns: 1fr; }
  .comp-table { font-size: 0.65rem; }
  .comp-table th, .comp-table td { padding: 0.25rem 0.35rem; }
  .market-kpi-row { grid-template-columns: 1fr 1fr; }
  .adv-filters { gap: 0.3rem; }
  .adv-select, .adv-input { min-width: 90px; font-size: 0.7rem; }
  .param-row { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .param-row label { min-width: auto; }
  #map-container { height: 250px !important; }
  .sidebar-panel { padding: 0.65rem; }
}
@media (max-width: 480px) {
  .opp-details { grid-template-columns: 1fr 1fr 1fr; }
  .news-meta { flex-direction: column; align-items: flex-start; }
  .market-kpi-row { grid-template-columns: 1fr; }
  .kpi-bar { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .header-date { font-size: 0.68rem; }
  .header-title h1 { font-size: 0.92rem; }
  .sidebar-kpi-grid { grid-template-columns: 1fr 1fr; }
}
