:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface-2:  #21262d;
  --border:     #30363d;
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --green:  #3fb950;
  --yellow: #d29922;
  --red:    #f85149;
  --blue:   #58a6ff;
  --violet: #a78bfa;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Ecrans ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Ecran verrouille ── */
.lock-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-width: 440px;
  margin: 0 auto;
}

.lock-header {
  text-align: center;
  margin-bottom: 44px;
}

.lock-icon { margin-bottom: 16px; }
.lock-icon img { border-radius: 16px; }

.lock-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.meta-info {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.lock-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
input[type="password"]:focus { border-color: var(--blue); }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: #0d1117;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { opacity: 0.75; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.error-msg {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* ── Ecran principal ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(13, 17, 23, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 16px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--surface-2); }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 12px 48px;
}

/* ── Cartes ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}

/* ── Bandeau verdict ── */
.verdict-banner {
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 10px;
  text-align: center;
}
.verdict-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 4px;
}
.verdict-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.verdict-actions {
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.9;
  text-align: left;
}
.verdict-action-line { margin-top: 5px; }

.verdict-banner.action-possible {
  background: rgba(63, 185, 80, 0.13);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--green);
}
.verdict-banner.a-surveiller {
  background: rgba(210, 153, 34, 0.13);
  border: 1px solid rgba(210, 153, 34, 0.4);
  color: var(--yellow);
}
.verdict-banner.rien-a-faire {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--blue);
}

/* ── Lignes de stats ── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); font-size: 14px; }
.stat-value { font-weight: 600; font-size: 14px; text-align: right; }

/* ── Couleurs ── */
.text-green  { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red    { color: var(--red); }
.text-blue   { color: var(--blue); }
.text-muted  { color: var(--text-muted); }

/* ── Valeur totale ── */
.total-value {
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  padding: 18px 0 16px;
  letter-spacing: -1px;
}

/* ── Barres d'enveloppes ── */
.envelope-bar { margin-bottom: 12px; }
.envelope-bar:last-child { margin-bottom: 0; }
.envelope-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 14px;
}
.bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.bar-pea    { background: var(--blue); }
.bar-linxea { background: var(--green); }
.bar-yomoni { background: var(--violet); }
.bar-crypto { background: var(--yellow); }

/* ── Holdings PEA ── */
.holding {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 8px;
}
.holding:last-child { margin-bottom: 0; }

.holding-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.holding-name-sub {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}

.holding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.holding-stat {}
.holding-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}
.holding-stat-value {
  font-size: 14px;
  font-weight: 600;
}

.alloc-wrap { margin-top: 10px; }
.alloc-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.alloc-track {
  position: relative;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: visible;
}
.alloc-cur {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  background: var(--blue);
  opacity: 0.8;
}
.alloc-tgt {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--green);
  border-radius: 1px;
  transform: translateX(-50%);
}

/* ── Abondement ── */
.abondement-box {
  margin-top: 14px;
  background: rgba(63, 185, 80, 0.07);
  border: 1px solid rgba(63, 185, 80, 0.25);
  border-radius: 8px;
  padding: 13px;
}
.abondement-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.badge-green  { background: rgba(63,185,80,0.2);   color: var(--green); }
.badge-yellow { background: rgba(210,153,34,0.2);  color: var(--yellow); }
.badge-red    { background: rgba(248,81,73,0.2);   color: var(--red); }
.badge-blue   { background: rgba(88,166,255,0.15); color: var(--blue); }
.badge-muted  { background: var(--surface-2);      color: var(--text-muted); }

/* ── Supports Linxea ── */
.support {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.support:last-child { margin-bottom: 0; }
.support-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.support-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Alertes ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-yellow {
  background: rgba(210,153,34,0.1);
  border: 1px solid rgba(210,153,34,0.3);
  color: var(--yellow);
}

/* ── Agenda ── */
.agenda-item {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  min-width: 72px;
  flex-shrink: 0;
}
.agenda-desc { font-size: 14px; }

/* ── Radar ── */
.radar-fiche {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.radar-fiche:last-child { margin-bottom: 0; }

.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}
.radar-secteur { font-weight: 700; font-size: 16px; }
.radar-horizon { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.radar-objectif {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.radar-criteres { font-size: 12px; line-height: 1.5; }
.radar-criteres-title {
  font-weight: 700;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 4px;
}
.radar-critere {
  padding-left: 14px;
  position: relative;
  color: var(--text-muted);
}
.radar-critere::before { content: '\2022'; position: absolute; left: 3px; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── No data ── */
.no-data {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 6px 0 2px;
}

/* ── Pied de page ── */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px 0 4px;
}
