﻿:root {
  color-scheme: dark;
  --bg: #030814;
  --ink: #edf5ff;
  --muted: #a7bdd7;
  --blue: #34bfff;
  --green: #39f78b;
  --gold: #ffd35e;
  --border: #2b527d;
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(200px, 18.5vw) minmax(0, 1fr); background: radial-gradient(ellipse at 75% 0, #082043 0%, transparent 43%), var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; color: var(--ink); background: #10244c; border: 1px solid #5181c2; border-radius: .6rem; padding: .42rem .8rem; }
button:hover, a:hover { color: #8adfff; }
:focus-visible { outline: 2px solid #7ae4ff; outline-offset: 3px; }
input, select { min-width: 0; width: 100%; color: var(--ink); background: #081426; border: 1px solid #36557f; padding: .5rem .65rem; border-radius: .45rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.7vw, 2.5rem); line-height: 1.15; }
h2 { font-size: 1.13rem; }
.sidebar { position: sticky; top: 0; align-self: start; min-height: 100vh; display: flex; flex-direction: column; gap: .75rem; padding: 0 .85rem 1rem; border-right: 1px solid #124878; background: linear-gradient(145deg, #041223, #030a16 66%, #082752); }
.brand { display: block; margin: 0 -.85rem; }
.brand img { display: block; width: 100%; height: auto; }
nav { display: grid; gap: .15rem; }
nav a, .integrations a { display: flex; align-items: center; gap: .8rem; padding: .42rem .7rem; border-radius: .65rem; font-weight: 600; }
nav a span, .integrations a span { width: 1.55rem; text-align: center; color: #a3d8ff; font-size: 1.25rem; }
nav a[aria-current] { border: 1px solid #60e8ff; background: linear-gradient(100deg, #043376, #0648b7); box-shadow: inset 0 0 12px #008aff, 0 0 12px #008aff; }
.integrations h2 { margin-bottom: .35rem; }
.integrations a { padding-inline: 0; }
.system { margin-top: auto; color: var(--muted); font-size: .82rem; padding: .65rem; border: 1px solid #22476a; border-radius: .7rem; background: #08182b; }
.system[data-online="true"]::before { content: "●"; color: var(--green); margin-right: .5rem; }
main { min-width: 0; padding: 0 1rem 4rem; background: url(assets/decor.png) no-repeat bottom right; }
.topbar { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#search { display: flex; align-items: center; gap: .55rem; width: min(100%, 33rem); padding: .25rem .65rem; border: 1px solid #42648e; border-radius: .8rem; background: #091426; }
#search input { border: 0; padding: .3rem 0; background: transparent; }
#search span { font-size: 1.4rem; }
kbd { white-space: nowrap; color: var(--muted); font-size: .75rem; background: #182b4f; padding: .18rem .35rem; border-radius: .25rem; }
.account { display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
#alert-count { color: #fff; background: #a82443; border-radius: 1rem; padding: .1rem .42rem; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.7rem; margin-bottom: .8rem; padding: .75rem 1rem; border: 1px solid #3475b7; border-radius: .85rem; background: url(assets/banniere.png) no-repeat 62% center / auto 100%, linear-gradient(110deg, #101c3d, #063164 58%, #071326); box-shadow: inset 0 -2px 6px #3273a969; }
.hero p { margin-top: .35rem; color: #d3e4ff; }
.hero time { padding: .45rem .8rem; white-space: nowrap; background: #091c36; color: #d9eaff; border: 1px solid #387db5; border-radius: .65rem; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin-bottom: .9rem; }
.panel { min-width: 0; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: .9rem; background: linear-gradient(155deg, #0b1c34, #051021 42%, #06162a); box-shadow: inset 0 -1px 5px #176ea449; }
.metric { display: flex; align-items: center; gap: .75rem; border-bottom-color: var(--blue); box-shadow: inset 0 -2px 9px #0f9cdf64; }
.metric:nth-child(2), .metric:last-child { border-bottom-color: var(--gold); box-shadow: inset 0 -2px 9px #e6a82650; }
.metric i { display: grid; place-items: center; flex: 0 0 2.7rem; height: 2.7rem; border-radius: 50%; color: #69dbff; background: #073a71; font-size: 1.35rem; font-style: normal; }
.metric:nth-child(2) i, .metric:last-child i { color: var(--green); background: #073b28; }
.metric:nth-child(3) i { color: #c4adff; background: #29205e; }
.metric small, .metric strong { display: block; }
.metric strong { font-size: clamp(1rem, 1.65vw, 1.7rem); white-space: nowrap; }
.grid { display: grid; grid-template-columns: 1.12fr 1fr .83fr; gap: .8rem; }
.grid .panel { min-height: 9rem; }
.grid .chart-panel { min-height: 12rem; }
.grid .wide { grid-column: span 2; }
.panel h2 { margin-bottom: .55rem; }
.panel h2 span { color: var(--gold); margin-right: .35rem; }
.empty { color: var(--muted); padding: .6rem 0; }
.chart { display: grid; align-content: center; min-height: 8.5rem; padding: .65rem; border: 1px solid #223958; border-radius: .35rem; background: repeating-linear-gradient(to top, transparent 0 24px, #1a2e4a 25px 26px), repeating-linear-gradient(to right, transparent 0 54px, #1a2e4a 55px 56px); }
.chart .empty { background: #071224e8; padding: .5rem; }
.stock { display: flex; align-items: center; gap: 1rem; }
.donut { display: grid; place-items: center; flex: 0 0 6.6rem; aspect-ratio: 1; border-radius: 50%; }
.donut span { display: grid; place-content: center; text-align: center; width: 72%; height: 72%; border-radius: 50%; background: #061324; font-weight: 700; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; justify-content: space-between; gap: .7rem; padding: .35rem 0; border-top: 1px solid #1e3858; }
.stock .rows { flex: 1; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: .2rem; margin-right: .4rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .6rem; text-align: left; border: 1px solid #233b5b; }
th { background: #152b48; }
td small { display: block; color: var(--muted); }
.section-title { margin: .75rem 0 1rem; }
.auth { max-width: 30rem; margin: 1rem auto; }
.auth h1 { margin-bottom: 1rem; }
.auth form, dialog form, .section-form { display: grid; gap: .75rem; }
.auth label, dialog label, .section-form label { display: grid; gap: .25rem; }
#message { margin: .75rem 0; padding: .7rem 1rem; border: 1px solid #6c5772; background: #22182d; border-radius: .65rem; }
dialog { width: min(95vw, 32rem); padding: 1rem; color: var(--ink); background: #0a192e; border: 1px solid #4285b8; border-radius: .8rem; }
dialog::backdrop { background: #000a; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1250px) {
  .metric { padding-inline: .55rem; gap: .45rem; }
  .metric i { display: none; }
  .hero { background-position: 70% center, center; }
}
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-position: right center, center; }
  .hero time { display: none; }
  .hero p { max-width: 24rem; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { display: block; }
  .sidebar { position: static; min-height: 0; padding: .4rem .65rem .6rem; gap: .4rem; }
  .brand { margin: 0; width: 12rem; }
  nav { display: flex; overflow: auto; padding: .3rem; }
  nav a { white-space: nowrap; }
  .integrations, .system, .account strong, kbd { display: none; }
  main { padding-inline: .65rem; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid .wide { grid-column: auto; }
  .hero { background-image: linear-gradient(100deg, #101c3d, #063164 58%, #071326); }
  .metrics { gap: .45rem; }
}
.system span, .legend, .badge { float: right; }
.integrations b { margin-left: auto; color: var(--green); text-shadow: 0 0 10px var(--green); }
.pro { border-radius: 2rem; background: #ffce2c; padding: .18rem .65rem; color: #221400; font-weight: 800; }
.ball { display: block; width: 2.15rem; aspect-ratio: 1; background: radial-gradient(circle, #f8fbff 0 17%, #171a24 18% 24%, transparent 25%), linear-gradient(#f24254 0 44%, #101a2b 45% 55%, #e7f2ff 56%); border: 2px solid #bbcce0; border-radius: 50%; box-shadow: 0 0 12px #3974ac; }
.periods { display: flex; gap: .55rem; }
.periods time { font-size: .79rem; }
.periods b { display: block; }
.positive, em { color: var(--green); font-style: normal; }
.negative { color: #ff6678; }
.legend, .badge { font-size: .75rem; }
.legend span:first-child { color: var(--blue); }
.legend span:last-child { color: var(--green); }
.badge { color: var(--green); background: #074728; padding: .15rem .5rem; border-radius: 1rem; }
.graph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; font-size: .75rem; }
.graph svg { display: block; width: 100%; height: 7.65rem; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #263d60 calc(25% - 1px) 25%), repeating-linear-gradient(to right, transparent 0 calc(16.66% - 1px), #263d60 calc(16.66% - 1px) 16.66%); }
.graph polyline { fill: none; stroke-width: 3; }
.axis, .dates { display: flex; justify-content: space-between; }
.axis { flex-direction: column; align-items: end; padding-bottom: 1.1rem; }
.dates { margin-top: .2rem; }
.live { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .55rem; font-size: .83rem; }
.live p { padding-bottom: .45rem; }
.live img { display: block; width: 100%; border-radius: .5rem; }
.live button { width: 100%; margin-top: .35rem; padding-inline: .2rem; background: #3a17a1; border-color: #8251ff; }
.detail { font-size: .83rem; }
.detail strong { white-space: nowrap; font-size: .81rem; }
.detail small { display: block; color: var(--muted); }
.donut { background: conic-gradient(#0b9eff 0 42%, #763af0 42% 63%, #ffbc00 63% 81%, #12df58 81% 93%, #91a5cd 93%); }
.stock .rows { font-size: .85rem; }
#products td:nth-child(7) { color: var(--green); font-weight: 700; }
#products button { padding: .15rem .55rem; }
@media (max-width: 1300px) { .periods time:nth-child(n+2) { display: none; } }
@media (max-width: 450px) { .account .ball, .account .pro { display: none; } }
.donut-empty { background: #19324f; }

/* ---- Cadrage (ajouté par Claude, 03/12) : aucune règle de la maquette n'est modifiée, seulement complétée ---- */
/* Menu latéral : toujours la hauteur de l'écran, défile seul si l'écran est bas. */
.sidebar { height: 100vh; overflow-y: auto; scrollbar-width: thin; }
/* Bannière Pikachu centrée dans l'espace libre entre le texte et les boutons de période. */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; background: linear-gradient(110deg, #101c3d, #063164 58%, #071326); }
.hero::before { content: ""; grid-column: 2; grid-row: 1; align-self: stretch; margin-block: -.75rem; background: url(assets/banniere.png) no-repeat center / contain; }
.hero > div:first-child { grid-column: 1; grid-row: 1; }
.periods { grid-column: 3; grid-row: 1; }
@media (max-width: 720px) {
  .sidebar { height: auto; overflow: visible; }
  .hero { display: flex; }
  .hero::before { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav { scrollbar-width: none; }
}
/* Pas de défilement horizontal parasite. */
html, body { overflow-x: hidden; }
/* Très grands écrans : contenu centré, largeur limitée. */
main > * { max-width: 1700px; margin-inline: auto; }
