/* Plans 7G — même langage que Étude 7G, la Bibliothèque et le Logiciel 7G : bleu 7G, Lexend, clair / sombre. */
@font-face { font-family: "Lexend"; src: url(/polices/lexend.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --bleu: #0C3D63; --bleu-2: #15507F;
  --bg: #EEF2F6; --surface: #FFFFFF; --surface2: #F4F7FA; --ink: #0E2233; --ink-soft: #43566A; --muted: #6B7D90;
  --line: #DDE4EC; --line-2: #C9D4DE; --accent: #0C3D63; --accent-doux: #DCE8F2;
  --vert: #1F8A55; --rouge: #C23A3E; --rouge-doux: #FBE4E5;
  --cR: #1E6FD9; --cU: #E07A12; --cF: #7D8A97;
  --shadow: 0 1px 0 rgba(12,61,99,.04), 0 10px 24px -16px rgba(12,61,99,.30);
  --r: 12px; --f: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A1724; --surface: #112233; --surface2: #0E1D2C; --ink: #E6EEF5; --ink-soft: #B6C4D2; --muted: #8FA2B4;
  --line: #1E3347; --line-2: #27405A; --accent: #8DC0EA; --accent-doux: #16304A; --rouge: #F07378; --rouge-doux: #3A1A1D;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 12px 26px -16px rgba(0,0,0,.7); color-scheme: dark; } }
[data-theme="dark"] {
  --bg: #0A1724; --surface: #112233; --surface2: #0E1D2C; --ink: #E6EEF5; --ink-soft: #B6C4D2; --muted: #8FA2B4;
  --line: #1E3347; --line-2: #27405A; --accent: #8DC0EA; --accent-doux: #16304A; --rouge: #F07378; --rouge-doux: #3A1A1D;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 12px 26px -16px rgba(0,0,0,.7); color-scheme: dark;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 14px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 17px; } h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); } .petit-texte { font-size: 12.5px; line-height: 1.45; margin: 8px 0 0; }
.btn { font: inherit; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--accent); }
.btn.primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; font-weight: 600; }
.btn.primaire:hover { background: var(--bleu-2); }
.btn.discret { background: transparent; }
.btn.plein { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.lien { background: none; border: 0; font: inherit; font-size: 12.5px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; justify-self: center; }

/* connexion */
.connexion { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px 16px; }
.logo-grand img { width: 64px; height: 64px; }
.sous { color: var(--muted); margin: 0 0 8px; }
.carte-connexion { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 12px; }
.carte-connexion label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.carte-connexion input { font: inherit; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface2); color: var(--ink); }
.erreur { color: var(--rouge); margin: 0; min-height: 1em; font-size: 13px; }
.aide { color: var(--muted); font-size: 12.5px; margin: 0; text-align: center; }

/* entête */
.entete { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.marque { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.marque img { width: 28px; height: 28px; } .marque small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.espace { flex: 1; } .moi { color: var(--muted); font-size: 13px; }

/* accueil */
.accueil { max-width: 980px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 16px; }
.depot { background: var(--surface); border: 2px dashed var(--line-2); border-radius: var(--r); padding: 28px 16px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.depot p { margin: 0; color: var(--muted); }
.depot-icone { font-size: 34px; color: var(--accent); }
.etat { min-height: 1.2em; color: var(--ink-soft) !important; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.carte-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.liste li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.liste li .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.liste li .date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.liste .vide { justify-content: center; color: var(--muted); background: none; border-style: dashed; }
.aide-carte ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; color: var(--ink-soft); }
.pastille { display: inline-block; padding: 0 7px; border-radius: 6px; color: #fff; font-weight: 600; font-size: 12.5px; }
i.pastille { width: 12px; height: 12px; padding: 0; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.pastille.R { background: var(--cR); } .pastille.U { background: var(--cU); } .pastille.F { background: var(--cF); }

/* éditeur */
.editeur { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 53px); }
.panneau { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.bloc { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bloc.bas { margin-top: auto; display: grid; gap: 8px; border-bottom: 0; }
.titre-plan { font-weight: 600; word-break: break-word; margin-bottom: 8px; }
.champ { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface2); color: var(--ink); }
.segments { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.segments button { flex: 1; font: inherit; font-size: 12.5px; padding: 8px 6px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; border-right: 1px solid var(--line-2); }
.segments button:last-child { border-right: 0; }
.segments button.actif { background: var(--bleu); color: #fff; font-weight: 600; }
.segments.vertical { flex-direction: column; } .segments.vertical button { border-right: 0; border-bottom: 1px solid var(--line-2); text-align: left; padding: 9px 12px; }
.segments.vertical button:last-child { border-bottom: 0; }
.segments.petit { margin-top: 8px; }
#sel-classe button[data-c="R"].actif, #rect-classe button[data-c="R"].actif { background: var(--cR); }
#sel-classe button[data-c="U"].actif, #rect-classe button[data-c="U"].actif { background: var(--cU); }
#sel-classe button[data-c="F"].actif, #rect-classe button[data-c="F"].actif { background: var(--cF); }
.sel-desc { margin: 0 0 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.actions-sel { display: grid; gap: 6px; margin-top: 8px; } .actions-sel .btn { justify-content: flex-start; font-size: 12.5px; padding: 6px 10px; }
.legende { display: grid; gap: 6px; font-size: 13px; } .legende b { color: var(--muted); font-weight: 500; margin-left: 4px; }
.coche { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.zone-vue { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.onglets { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.onglets > button { font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-soft); cursor: pointer; }
.onglets > button.actif { background: var(--accent-doux); color: var(--ink); border-color: var(--line-2); font-weight: 600; }
.onglets > button:disabled { opacity: .45; cursor: default; }
.scene-cadre { flex: 1; overflow: auto; padding: 16px; }
.scene { position: relative; margin: 0 auto; width: 100%; max-width: 1500px; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }
.scene img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene svg rect.el { fill-opacity: .04; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; }
.scene svg rect.el.R { fill: var(--cR); stroke: var(--cR); }
.scene svg rect.el.U { fill: var(--cU); stroke: var(--cU); fill-opacity: .22; }
.scene svg rect.el.F { fill: var(--cF); stroke: var(--cF); fill-opacity: .05; stroke-dasharray: 3 3; }
.scene svg rect.el.modif { stroke-width: 2.2; }
.scene svg rect.el.sel { stroke: #E5223A; stroke-width: 3; fill-opacity: .25; }
.scene svg rect.amas { fill: none; stroke: var(--cU); stroke-dasharray: 4 3; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.scene svg rect.cible { fill: none; stroke: #1F8A55; stroke-width: 2; stroke-dasharray: 8 5; vector-effect: non-scaling-stroke; pointer-events: none; }
.scene svg rect.trace { fill: rgba(30,111,217,.08); stroke: #1E6FD9; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.scene.mode-rect, .scene.mode-cible { cursor: crosshair; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 20; max-width: calc(100% - 32px); }
.toast.erreur { background: var(--rouge); color: #fff; }

@media (max-width: 820px) {
  .editeur { grid-template-columns: 1fr; height: auto; }
  .panneau { border-right: 0; border-bottom: 1px solid var(--line); }
  .bloc.bas { margin-top: 0; }
}
