/* ─────────────────────────────────────────────────────────────────────────────
   Composants spécifiques finance — compléments à style.css
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Page d'accueil ──────────────────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a6e 50%, var(--blue) 100%);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  color: #fff;
  margin-bottom: 20px;
}
.hero-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.hero-sub { color: rgba(255,255,255,.7); font-size: .9rem; margin-top: 4px; }

/* ── Barre KPI portefeuille ──────────────────────────────────────────────────── */
.pf-kpi-bar {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.pf-kpi-item {
  flex: 1;
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.pf-kpi-item:last-child { border-right: none; }
.pf-kpi-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-4);
  margin-bottom: 3px;
}
.pf-kpi-main {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pf-kpi-main.ok { color: var(--ok); }
.pf-kpi-main.err { color: var(--err); }

/* ── Tableau ticker (expandable rows) ───────────────────────────────────────── */
.ticker-row-main td { cursor: pointer; }
.ticker-row-detail { display: none; }
.ticker-row-detail.open { display: table-row; }
.ticker-row-detail > td {
  background: var(--blue-50);
  padding: 16px 20px;
}
.orders-mini-table {
  width: 100%;
  font-size: .8rem;
  border-collapse: collapse;
}
.orders-mini-table th {
  background: var(--blue-100);
  padding: 5px 10px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--info-text);
  text-align: right;
}
.orders-mini-table th:first-child { text-align: left; }
.orders-mini-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-lt);
  text-align: right;
  color: var(--text-2);
}
.orders-mini-table td:first-child { text-align: left; }
.btn-icon {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--tr);
  font-size: .8rem;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.del:hover { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }
.expand-arrow {
  display: inline-block;
  transition: transform var(--tr);
  color: var(--text-4);
}
.expanded .expand-arrow { transform: rotate(90deg); }

/* ── Portfolio charts grid ───────────────────────────────────────────────────── */
.pf-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-top: 20px;
}
.pf-chart-block { position: relative; }
.pf-chart-block.full-width { grid-column: 1 / -1; }

/* ── Donut chart SVG ─────────────────────────────────────────────────────────── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}
.donut-svg-wrap { position: relative; flex-shrink: 0; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center-val { font-size: 1rem; font-weight: 800; color: var(--text); }
.donut-center-label { font-size: .7rem; color: var(--text-4); }
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-2);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--r-xs);
  transition: background var(--tr);
}
.donut-legend-item:hover { background: var(--bg); }
.donut-legend-dot { width: 10px; height: 10px; border-radius: var(--r-full); flex-shrink: 0; }
.donut-legend-name { flex: 1; font-weight: 500; }
.donut-legend-pct { font-weight: 700; color: var(--text); margin-left: auto; }

/* ── Heatmap mensuelle ───────────────────────────────────────────────────────── */
.heatmap-wrap { overflow-x: auto; }
.heatmap-grid {
  display: grid;
  gap: 3px;
}
.heatmap-cell {
  width: 46px;
  height: 34px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  cursor: default;
  transition: transform var(--tr);
  font-variant-numeric: tabular-nums;
  position: relative;
}
.heatmap-cell:hover { transform: scale(1.12); z-index: 10; }
.heatmap-cell[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  font-size: .7rem;
  white-space: nowrap;
  pointer-events: none;
  margin-bottom: 4px;
}
.heatmap-label {
  font-size: .7rem;
  color: var(--text-4);
  text-align: center;
  padding: 2px 0;
}

/* ── Page liste ──────────────────────────────────────────────────────────────── */
.liste-layout {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 1fr;
  gap: 16px;
  align-items: start;
}
.liste-kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.liste-kpi-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 120px;
  text-align: center;
  box-shadow: var(--sh-xs);
}
.liste-kpi-chip .lkc-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-4); font-weight: 700; }
.liste-kpi-chip .lkc-val { font-size: 1rem; font-weight: 700; margin-top: 2px; }

/* ── Marchés ─────────────────────────────────────────────────────────────────── */
.marches-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.marches-search-bar .form-input { max-width: 300px; }
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  transition: all var(--tr);
}
.filter-chip.active, .filter-chip:hover {
  background: var(--blue-50);
  color: var(--blue);
  border-color: var(--blue-100);
}

/* ── Page Admin ──────────────────────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  box-shadow: var(--sh-sm);
}
.stat-card-val { font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.stat-card-label { font-size: .8rem; color: var(--text-3); }
.stat-card-delta { font-size: .8rem; margin-top: 4px; font-weight: 600; }
.stat-card-delta.up { color: var(--ok); }
.stat-card-delta.down { color: var(--err); }

/* ── Auth page (index.html) ──────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-hero {
  background: linear-gradient(145deg, var(--navy) 0%, #1e3a6e 60%, var(--blue) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(37,99,235,.3);
  border-radius: var(--r-full);
  top: -100px; right: -100px;
  filter: blur(60px);
}
.auth-hero-logo { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; margin-bottom: 12px; }
.auth-hero-sub { color: rgba(255,255,255,.7); text-align: center; max-width: 360px; line-height: 1.6; }
.auth-features { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 360px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.07);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .875rem;
}
.auth-feature-icon { font-size: 1.2rem; }
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-box-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-box-sub { color: var(--text-3); font-size: .9rem; margin-bottom: 28px; }
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: all var(--tr);
  color: var(--text-3);
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-xs);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-4);
  font-size: .8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-google {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tr);
  text-decoration: none;
}
.btn-google:hover { background: var(--bg); box-shadow: var(--sh-sm); text-decoration: none; color: var(--text); }
@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
