:root {
  --bg: #0b0e12; --bg2: #11151b; --panel: #151a21; --panel2: #1b212a; --line: #252c37; --line2: #313a47;
  --text: #eceff3; --muted: #959dab; --dim: #636b78;
  --accent: #8cc860; --accent2: #5fa33a; --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .16);
  --green: #34d399; --red: #f87171; --violet: #a78bfa; --blue: #60a5fa; --orange: #fb923c;
  --radius: 16px; --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; --title: 'Sora', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(1200px 700px at 70% -10%, #18211a 0%, var(--bg) 55%) fixed; color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--title); margin: 0; letter-spacing: -.01em; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }

/* ---------- pages simples (connexion, compte…) ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card { width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.card.wide { max-width: 560px; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.brand h1 { font-size: 20px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: url('favicon.svg') center/26px no-repeat, linear-gradient(135deg, #4d8f2c, #2f343d); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 20px rgba(140, 200, 96, .25); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select { background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; min-height: 48px; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 200, 96, .18); }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tag { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(140, 200, 96,.1); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.err { color: var(--red); margin: 0; font-weight: 600; }
.ok { color: var(--green); margin: 0; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.status { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.ok-box { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); }
.warn-box { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--text); transition: transform .08s, background .15s, border-color .15s; user-select: none; }
.btn:hover { border-color: var(--accent2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, #8cc860, #5fa33a); color: #10200a; border: 0; }
.btn.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .45); color: #fecaca; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } .card { padding: 20px; } }

/* ---------- page plan ---------- */
body.planpage { overflow: hidden; }
.app { height: 100dvh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(11, 14, 18, .85); backdrop-filter: blur(10px); position: relative; z-index: 5; }
.top .logo { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; background-size: 22px; }
.top h1 { font-size: 16.5px; white-space: nowrap; }
.top .sub { color: var(--muted); font-size: 12.5px; }
.top .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line2); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill.on i { background: var(--green); box-shadow: 0 0 10px var(--green); }
.pill.wait i { background: var(--amber); animation: blink 1s infinite; }
.pill.off i { background: var(--red); }
.pill.demo { color: #fde68a; border-color: rgba(251, 191, 36, .45); }
.pill.demo i { background: var(--amber); }
@keyframes blink { 50% { opacity: .3; } }
.menu { position: relative; }
.menu > button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; display: grid; place-items: center; }
.menu .dd { position: absolute; right: 0; top: 48px; min-width: 220px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); display: none; }
.menu.open .dd { display: block; }
.dd a, .dd button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 600; }
.dd a:hover, .dd button:hover { background: rgba(255,255,255,.06); }
.dd .who { padding: 8px 12px 10px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.zoom { position: absolute; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.zoom button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(27, 33, 42, .92); cursor: pointer; font-size: 18px; font-weight: 700; }
.zoom button:hover { border-color: var(--accent); }
.stage { position: relative; min-height: 0; display: flex; flex-direction: column; }
.planbox { flex: 1; min-height: 0; padding: 14px; display: grid; place-items: center; }
#plan { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.side { border-left: 1px solid var(--line); background: rgba(17, 21, 27, .7); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.sc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sc h3 .ic { width: 18px; height: 18px; }
.big { font-family: var(--title); font-size: 26px; font-weight: 700; }
.big small { font-size: 14px; color: var(--muted); font-weight: 600; }
.lst { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lst li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.lst li:hover { background: rgba(255,255,255,.05); }
.lst li span:last-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.empty { color: var(--dim); font-size: 13px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; font-size: 12.5px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend svg { width: 22px; height: 22px; flex: 0 0 22px; }
.sc .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* plan SVG */
.room rect.z { fill: rgba(30, 50, 86, .55); stroke: #34507f; stroke-width: 2; rx: 10; transition: fill .3s, stroke .3s; }
.room.lit rect.z { fill: rgba(251, 191, 36, .13); stroke: rgba(251, 191, 36, .55); }
.room.pres rect.z { stroke: var(--accent); stroke-width: 2.5; }
.withimg .room rect.z { fill: rgba(140, 200, 96, .04); stroke-dasharray: 6 6; stroke: rgba(140, 200, 96, .45); }
.withimg .room.lit rect.z { fill: rgba(251, 191, 36, .14); }
.withimg.hidezones .room rect.z { opacity: 0; }
.room text { fill: #c7d4ee; font: 700 15px var(--title); pointer-events: none; }
.room text.meta { fill: var(--muted); font: 600 12px var(--font); }
.room .pres-dot { fill: var(--accent); }
.dev { cursor: pointer; }
.dev .halo { fill: transparent; transition: fill .3s; }
.dev circle.b { fill: #13233f; stroke: #3b5684; stroke-width: 2; transition: fill .2s, stroke .2s; }
.dev:hover circle.b { stroke: var(--accent); }
.dev .ico { color: #9fb2d6; }
.dev.on circle.b { fill: #3a2c07; stroke: var(--amber); }
.dev.on .ico { color: var(--amber); }
.dev.on .halo { fill: url(#glow); }
.dev.act circle.b { stroke: var(--accent); fill: #0b2b38; }
.dev.act .ico { color: var(--accent); }
.dev.alert circle.b { stroke: var(--red); fill: #3b1010; }
.dev.alert .ico { color: var(--red); }
.dev .val { fill: #dbe5f7; font: 700 11.5px var(--font); paint-order: stroke; stroke: #0a1322; stroke-width: 3px; }
.dev.sel circle.b { stroke: #fff; stroke-width: 3; }
.editing .dev, .editing .room { cursor: grab; }
.editing .dev circle.b { stroke-dasharray: 4 3; }
.handle { fill: var(--accent); cursor: nwse-resize; }
.dev .x { display: none; }
.editing .dev .x { display: block; }
.dev .x circle { fill: var(--red); }
.dev .x path { stroke: #fff; stroke-width: 2; }
@keyframes pulse { 0% { r: 20; opacity: .7; } 100% { r: 34; opacity: 0; } }
.dev.act .ping { fill: none; stroke: var(--accent); stroke-width: 2; animation: pulse 1.8s infinite; }

/* barre d'édition */
.editbar { display: none; margin: 10px 14px 0; z-index: 4; background: rgba(27, 33, 42, .95); border: 1px solid var(--accent2); border-radius: 14px; padding: 8px; gap: 8px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow); }
.editing .editbar { display: flex; }
.editbar .t { font-weight: 700; font-size: 13px; color: var(--accent); padding: 0 8px; margin-right: auto; }

/* panneau de commande (popup) */
.pop { position: fixed; right: 356px; top: 76px; width: 380px; max-height: calc(100dvh - 96px); overflow-y: auto; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line2); border-radius: 20px; box-shadow: var(--shadow); z-index: 20; padding: 16px; display: none; flex-direction: column; gap: 14px; }
.pop.open { display: flex; animation: popin .16s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.pop .hd { display: flex; align-items: center; gap: 12px; }
.pop .hd .ib { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line2); }
.pop .hd .ib svg { width: 24px; height: 24px; }
.pop .hd h2 { font-size: 17px; }
.pop .hd p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.pop .hd .x { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: 20px; }
.sec { display: flex; flex-direction: column; gap: 9px; }
.sec > .lab { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }
.power { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.power .btn { min-height: 52px; font-size: 15px; }
.power .btn.sel.on { background: rgba(251, 191, 36, .18); border-color: var(--amber); color: #fde68a; }
.power .btn.sel.off { background: rgba(148, 163, 184, .12); border-color: #64748b; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.chip.sel { background: rgba(140, 200, 96, .16); border-color: var(--accent); color: #a5f3fc; }
.chip .star { color: var(--amber); }
.circ { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.circ .l1 { display: flex; align-items: center; gap: 10px; }
.circ .l1 b { flex: 1; font-size: 14px; }
.sw { width: 56px; height: 32px; border-radius: 99px; background: #26365a; border: 0; position: relative; cursor: pointer; flex: 0 0 56px; transition: background .2s; }
.sw::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #cbd5e1; transition: left .2s, background .2s; }
.sw.on { background: rgba(251, 191, 36, .55); }
.sw.on::after { left: 28px; background: #fff7d6; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid rgba(255,255,255,.25); cursor: pointer; flex: 0 0 34px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; padding: 0; border: 0; min-height: 0; box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: var(--trk, linear-gradient(90deg, #1e293b, #fbbf24)); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; background: var(--trk, linear-gradient(90deg, #1e293b, #fbbf24)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; margin-top: -8px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.rng { display: flex; align-items: center; gap: 10px; }
.rng output { min-width: 52px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.wheel { display: grid; place-items: center; position: relative; }
.wheel canvas { width: 220px; height: 220px; border-radius: 50%; touch-action: none; cursor: crosshair; }
.wheel .dot { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.5); pointer-events: none; transform: translate(-50%, -50%); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
.tabs button { min-height: 38px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-weight: 700; color: var(--muted); }
.tabs button.sel { background: var(--panel2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { font-weight: 700; text-align: right; }
.bigtemp { display: flex; align-items: baseline; justify-content: space-between; }
.bigtemp .v { font-family: var(--title); font-size: 40px; font-weight: 700; }
.bigtemp .t { color: var(--muted); font-weight: 600; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.stepper .btn { min-height: 52px; font-size: 22px; padding: 0; }
.stepper .c { text-align: center; font-family: var(--title); font-size: 22px; font-weight: 700; }
.note { font-size: 12.5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #0f1d33; border: 1px solid var(--line2); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; z-index: 50; display: none; max-width: calc(100vw - 32px); }
.toast.show { display: block; animation: popin .2s; }
.toast.bad { border-color: rgba(248,113,113,.6); color: #fecaca; }
.scrim { position: fixed; inset: 0; background: rgba(2, 6, 14, .55); z-index: 15; display: none; }
.scrim.open { display: block; }
.hiddenlist { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr) 300px; }
  .pop { right: 316px; }
}
@media (max-width: 860px) {
  body.planpage { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .planbox { padding: 6px; height: auto; display: block; }
  #plan { height: auto; aspect-ratio: var(--ar, 1.58); max-height: 70dvh; display: block; }
  .zoom { right: 12px; bottom: 12px; }
  .top .btxt { display: none; }
  .toast { top: 70px; bottom: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .top .sub { display: none; }
  .pop { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 86dvh; border-radius: 22px 22px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .editbar { position: sticky; top: 0; margin: 0; border-radius: 0; }
}
@media (max-width: 480px) {
  .top { padding: 8px 12px; gap: 8px; }
  .top h1 { font-size: 15px; }
  .pill { padding: 5px 9px; font-size: 11.5px; }
}
@media (min-width: 861px) { .scrim.open { background: transparent; } }

/* ---------- onglets + journal ---------- */
.tabs { display: flex; gap: 4px; margin-left: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13.5px; }
.tabs a.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
body.journalpage { overflow: auto; }
.jmain { max-width: 820px; margin: 0 auto; padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 12px; }
.jbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jbar .btn { min-height: 42px; padding: 0 14px; }
.jbar input[type=date] { min-height: 42px; padding: 0 12px; color-scheme: dark; }
.jchips { display: flex; gap: 6px; flex-wrap: wrap; }
.jchips .chip { border: 1px solid var(--line2); background: var(--panel); color: var(--muted); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.jchips .chip.sel { color: var(--text); border-color: var(--accent); background: rgba(140, 200, 96, .12); }
.jresume { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; }
.jresume b { font-family: var(--title); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.jresume p { margin: 6px 0 0; }
.jlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jlist li { display: grid; grid-template-columns: 52px 26px 1fr auto; gap: 8px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.jlist time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; }
.jlist .rm { color: var(--dim); font-size: 12px; white-space: nowrap; }
.jlist li.j-alarme .tx { color: var(--red); font-weight: 700; }
.jlist li.j-systeme .tx { color: var(--muted); }
@media (max-width: 560px) { .jlist li { grid-template-columns: 46px 22px 1fr; } .jlist .rm { grid-column: 3; } .top .sub { display: none; } }
.journalpage .app { height: auto; min-height: 100dvh; display: block; }

/* ---------- plan d'architecte redessiné (08/10/2026) ---------- */
#plan.arch .shell { fill: #0d1729; }
#plan.arch .aroom .fl { fill: #15243d; transition: fill .35s; }
#plan.arch .aroom .fl.hall { fill: #17294a; }
#plan.arch .aroom .fl.conc { fill: #111b2e; }
#plan.arch .aroom .pat { pointer-events: none; }
#plan.arch .aroom .st { fill: transparent; stroke: transparent; stroke-width: 7; stroke-linejoin: round; transition: fill .35s, stroke .35s; pointer-events: none; }
#plan.arch .aroom:not(.linked) .fl { fill: #121e33; }
#plan.arch .aroom.lit .st { fill: url(#litg); }
#plan.arch .aroom.lit .fl { fill: #33270f; }
#plan.arch .aroom.pres .st { stroke: rgba(140, 200, 96, .85); filter: drop-shadow(0 0 10px rgba(140, 200, 96, .6)); }
#plan.arch .aroom.pick .st { stroke: #fff; stroke-dasharray: 14 10; }
#plan.arch.editing .aroom { cursor: pointer; }
#plan.arch .wall.ext { fill: #d7e0ee; }
#plan.arch .wall.int { fill: #a9b8d0; }
#plan.arch .win { fill: #0b1a2c; }
#plan.arch .glass { stroke: #7dd3fc; stroke-width: 2.2; fill: none; }
#plan.arch .doors .leaf { stroke: #c9d5e8; stroke-width: 4; stroke-linecap: round; }
#plan.arch .doors .arc { stroke: #6f84aa; stroke-width: 1.8; stroke-dasharray: 7 6; fill: none; }
#plan.arch .doors .hinge { fill: #c9d5e8; }
#plan.arch .gdoor { stroke: #fbbf24; stroke-opacity: .55; stroke-width: 5; stroke-dasharray: 18 10; }
#plan.arch .gar { fill: none; stroke: #3d5378; stroke-width: 2; stroke-dasharray: 12 10; }
#plan.arch .fx { fill: #1b2d4b; stroke: #6d83a8; stroke-width: 2.4; }
#plan.arch .fx.rad { fill: #24395c; stroke: #4f6690; stroke-width: 1.6; }
#plan.arch .rlab { pointer-events: none; }
#plan.arch .rlab text { text-anchor: middle; paint-order: stroke; stroke: rgba(11, 14, 18, .75); stroke-width: 5px; stroke-linejoin: round; }
#plan.arch .rlab .rn { fill: #e3ebf8; font-family: var(--title); font-weight: 700; letter-spacing: -.01em; }
#plan.arch .rlab .ra { fill: #8ea0c2; font-family: var(--font); font-weight: 600; }
#plan.arch .rlab .rm { fill: var(--accent); font-family: var(--font); font-weight: 700; }
#plan.arch .scale path { stroke: #6f84aa; stroke-width: 2.5; fill: none; }
#plan.arch .scale text { fill: #6f84aa; font-family: var(--font); font-weight: 700; dominant-baseline: middle; }
#plan.arch .xroom rect.z { fill: rgba(30, 50, 86, .45); stroke: #34507f; stroke-dasharray: 10 8; }
#plan.arch .dev circle.b { fill: #101d34; }
#plan.arch .dev.on circle.b { fill: #3a2c07; }
.assign { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.assign label { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 8px; color: var(--text); font-size: 13px; border-radius: 10px; padding: 2px 4px; }
.assign label.pick { background: rgba(140, 200, 96, .1); box-shadow: inset 0 0 0 1px var(--accent2); }
.assign label small { color: var(--muted); font-weight: 600; }
.assign select { min-height: 38px; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
#plan .dev .halo, #plan .dev .ping, #plan .dev .val { pointer-events: none; }

/* ---------- vue 3D isométrique ---------- */
.zoom button.iso { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.zoom button:disabled { opacity: .4; cursor: default; }
#plan.iso .ishadow { fill: rgba(0, 0, 0, .35); filter: blur(14px); }
#plan.iso .w3 polygon { stroke-width: 1.4; stroke-linejoin: round; }
#plan.iso .w3 .ext .t { fill: #e6edf7; stroke: #e6edf7; }
#plan.iso .w3 .ext .s { fill: #a7b6cf; stroke: #a7b6cf; }
#plan.iso .w3 .ext .e { fill: #8294b3; stroke: #8294b3; }
#plan.iso .w3 .int .t { fill: #cdd7e6; stroke: #cdd7e6; }
#plan.iso .w3 .int .s { fill: #8e9fbd; stroke: #8e9fbd; }
#plan.iso .w3 .int .e { fill: #6f82a3; stroke: #6f82a3; }
#plan.iso .w3 .gl polygon { fill: rgba(125, 211, 252, .22); stroke: rgba(125, 211, 252, .55); }
#plan.iso .w3 .gl .t { fill: rgba(186, 230, 253, .6); }
#plan.arch .xroom polygon.z { fill: rgba(30, 50, 86, .45); stroke: #34507f; stroke-dasharray: 10 8; stroke-width: 2; }
#plan.iso { cursor: grab; }
#plan.iso:active { cursor: grabbing; }
#plan.iso .w3 .gl .s { fill: rgba(125, 211, 252, .22); stroke: rgba(125, 211, 252, .55); }
#plan.iso .w3 .gl .t { fill: rgba(186, 230, 253, .6); stroke: rgba(125, 211, 252, .55); }

/* ---------- vraie 3D (WebGL) ---------- */
.planbox { position: relative; }
.v3 { position: absolute; inset: 14px; display: none; border-radius: 16px; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 90% at 50% 20%, #16294a 0%, #0b1426 60%, #080f1c 100%); }
.v3 canvas { width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.v3 canvas:active { cursor: grabbing; }
.app.is3d #plan { visibility: hidden; }
.v3ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.v3ov > * { position: absolute; left: 0; top: 0; will-change: transform; }
.l3 { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; white-space: nowrap; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 8px rgba(0, 0, 0, .6); }
.l3 b { font: 700 15px var(--title); color: #fff; }
.l3 span { font: 600 11.5px var(--font); color: #dbe5f5; }
.l3 i { font: 700 11.5px var(--font); color: #67e8f9; font-style: normal; }
.l3.small b { font-size: 12.5px; }
.l3.small span { font-size: 10px; }
.l3.dim b { color: #b8c4d8; }
.d3 { pointer-events: auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #3b5684; background: rgba(14, 26, 48, .92);
  color: #b9c8e4; display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .55); transition: border-color .2s, background .2s, color .2s; }
.d3 svg { width: 17px; height: 17px; }
.d3.small { width: 27px; height: 27px; }
.d3.small svg { width: 16px; height: 16px; }
.d3:hover { border-color: var(--accent); }
.d3.on { border-color: var(--c, var(--amber)); color: var(--c, var(--amber)); background: rgba(58, 44, 7, .92); box-shadow: 0 0 18px rgba(251, 191, 36, .55), 0 4px 14px rgba(0, 0, 0, .55); }
.d3.act { border-color: var(--accent); color: var(--accent); background: rgba(11, 43, 56, .92); }
.d3.alert { border-color: var(--red); color: var(--red); background: rgba(59, 16, 16, .92); }
.d3.sel { border-color: #fff; border-width: 3px; }
.d3 em { position: absolute; top: 100%; margin-top: 3px; font: 700 11px var(--font); font-style: normal; color: #e6eefb; white-space: nowrap; text-shadow: 0 1px 3px #000; }
@media (max-width: 860px) {
  .v3 { inset: 6px; }
  .app.is3d #plan { aspect-ratio: 4 / 5 !important; max-height: 72dvh; }
  .d3, .d3.small { width: 25px; height: 25px; border-width: 1.5px; }
  .d3 svg, .d3.small svg { width: 13px; height: 13px; }
  .d3 em { font-size: 9.5px; }
  .l3 b { font-size: 11.5px; }
  .l3 span, .l3 i { font-size: 9.5px; }
}

/* ---------- accueil ---------- */
.hmain { max-width: 980px; margin: 0 auto; padding: 22px 16px 60px; }
.hello { color: var(--muted); margin: 0 0 14px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 150px; border-radius: var(--radius); border: 1px solid var(--line2); background: linear-gradient(180deg, var(--panel2), var(--panel)); color: var(--text); text-decoration: none; transition: border-color .15s, transform .08s; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(.98); }
.tile .ti { font-size: 28px; line-height: 1; }
.tile .tt { font-family: var(--title); font-size: 18px; font-weight: 800; }
.tile .td { color: var(--muted); font-size: 13.5px; flex: 1; }
.tile .pill { align-self: flex-start; }
@media (max-width: 560px) { .top .tabs { margin-left: 0; } .tabs a { padding: 7px 10px; } }

/* =====================================================================
   Habillage DOMOXA — bandeau latéral, style élégant / futuriste
   ===================================================================== */
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/mono.woff2') format('woff2'); font-display: swap; }
:root { --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; --navw: 252px; --dx: #8cc860; --dx-d: #4d8f2c; --glass: rgba(24, 29, 37, .72); }
body { background: var(--bg); }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(140, 200, 96, .11), transparent 62%),
    radial-gradient(760px 520px at 8% 115%, rgba(90, 140, 210, .07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px) 0 0 / 34px 34px;
}
.auth, .shell { position: relative; z-index: 1; }
.logo { background: url('img/domoxa-icon.png') center / cover no-repeat; box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 22px rgba(140, 200, 96, .22); }
.card { background: linear-gradient(180deg, rgba(29, 35, 45, .92), rgba(21, 26, 33, .92)); backdrop-filter: blur(14px); border-color: var(--line2); }
.card::before { content: ''; height: 2px; margin: -26px -26px 4px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, transparent, var(--dx), transparent); opacity: .7; }

.shell { display: grid; grid-template-columns: var(--navw) minmax(0, 1fr); min-height: 100dvh; }
.planpage .shell { height: 100dvh; }
.shell .app { min-width: 0; }

/* bandeau */
.nav { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 20px 14px 16px;
  background: linear-gradient(180deg, #1c2129 0%, #141820 100%); border-right: 1px solid rgba(140, 200, 96, .14);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.03), 8px 0 40px rgba(0,0,0,.25); overflow-y: auto; z-index: 30; }
.nbrand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.06); text-decoration: none; }
.nbrand img { height: 30px; display: block; }
.nsite { font: 600 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--dx); border: 1px solid rgba(140, 200, 96, .38); padding: 5px 7px; border-radius: 6px; background: rgba(140, 200, 96, .06); }
.nav-h { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #7a828f; margin: 18px 10px 8px; }
.nav > a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c7ccd4; text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s; }
.nav > a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nav > a:hover:not(.on) { background: rgba(255,255,255,.045); color: #fff; }
.nav > a.on { background: linear-gradient(90deg, rgba(140, 200, 96, .17), rgba(140, 200, 96, .02)); color: #fff; box-shadow: inset 0 0 0 1px rgba(140, 200, 96, .22); }
.nav > a.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--dx); box-shadow: 0 0 14px var(--dx); }
.nav > a.on svg { color: var(--dx); opacity: 1; }
.nav .grow { flex: 1; min-height: 12px; }
.nav .menu.session > button { width: 100%; height: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.03); text-align: left; color: var(--text); }
.nav .menu.session > button:hover { border-color: rgba(140, 200, 96, .35); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #12210a; background: linear-gradient(135deg, var(--dx), var(--dx-d)); box-shadow: 0 0 0 2px rgba(140, 200, 96, .18); }
.qui { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.qui small { color: var(--muted); font-size: 12px; }
.chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.nav .menu .dd { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
.voile { display: none; }

/* bandeau du haut de chaque page */
.shell .top { padding: 14px 24px; gap: 14px; background: rgba(11, 14, 18, .66); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.ttl { display: flex; flex-direction: column; min-width: 0; }
.kicker { font: 500 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dx); margin-bottom: 6px; }
.ttl h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbtn { display: none; width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; place-items: center; color: var(--text); }
.navbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.clock { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: capitalize; }
.pill { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; background: rgba(27, 33, 42, .8); }

/* accueil */
.hmain { max-width: 1180px; margin: 0 auto; padding: 26px 24px 70px; }
.hello { color: var(--muted); margin: 0 0 18px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 30px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line2); backdrop-filter: blur(10px); overflow: hidden; }
.kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(140, 200, 96, .55), transparent); }
.kl { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.kv { display: flex; align-items: center; gap: 9px; font: 700 21px/1.1 var(--title); }
.kv i { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.kv.on i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.kv.off i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.kv.wait i { background: var(--amber); }
.ks { color: var(--dim); font-size: 12.5px; }
.hsec { font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 6px 2px 14px; display: flex; align-items: center; gap: 12px; }
.hsec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 30px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 160px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(31, 37, 47, .9), rgba(21, 26, 33, .9)); border: 1px solid var(--line2); color: var(--text); text-decoration: none;
  transition: border-color .2s, transform .12s, box-shadow .2s; }
.tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--dx), transparent); opacity: 0; transition: opacity .2s; }
a.tile:hover { border-color: rgba(140, 200, 96, .5); box-shadow: 0 14px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(140, 200, 96, .12) inset; transform: translateY(-2px); }
a.tile:hover::before { opacity: 1; }
.tile .ti { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(140, 200, 96, .09); border: 1px solid rgba(140, 200, 96, .28); color: var(--dx); margin-bottom: 4px; }
.tile .ti svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile .tt { font-family: var(--title); font-size: 17px; font-weight: 700; }
.tile .td { color: var(--muted); font-size: 13.5px; flex: 1; }
.tile.soon { min-height: 140px; background: rgba(21, 26, 33, .55); border-style: dashed; }
.tile.soon .ti { background: rgba(255,255,255,.03); border-color: var(--line2); color: var(--muted); }
.tile .badge { position: absolute; top: 16px; right: 16px; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line2); border-radius: 99px; padding: 5px 8px; }
.tile.soon:first-child .badge { color: var(--dx); border-color: rgba(140, 200, 96, .4); }

/* journal dans le nouveau cadre */
.journalpage .shell .app { height: auto; min-height: 100dvh; display: block; }

/* mobile : bandeau escamotable */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .planpage .shell { height: auto; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 272px; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; padding-top: calc(20px + env(safe-area-inset-top)); }
  body.nav-open .nav { transform: none; }
  body.nav-open .voile { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(4, 6, 10, .55); backdrop-filter: blur(2px); }
  .navbtn { display: grid; }
  .shell .top { padding: 10px 14px; gap: 10px; }
  .clock { display: none; }
  .hmain { padding: 18px 16px 60px; }
}
@media (max-width: 480px) { .ttl h1 { font-size: 16px; } .kicker { margin-bottom: 4px; } }

.hsec::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dx); box-shadow: 0 0 10px var(--dx); }

/* ---------- bilan de santé ---------- */
.bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--dx-d), var(--dx)); transition: width .4s; }
.bar b.hi { background: linear-gradient(90deg, #d97706, var(--red)); }
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 30px; }
.al { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line2); border-left: 3px solid var(--dim); }
.al .sev { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--muted); white-space: nowrap; }
.al .ab { display: flex; flex-direction: column; min-width: 0; } .al .ab span { color: var(--muted); font-size: 13px; }
.al time { color: var(--dim); font: 500 12px/1 var(--mono); white-space: nowrap; }
.al-err, .al-crit { border-left-color: var(--red); } .al-err .sev, .al-crit .sev { color: #fecaca; background: rgba(248,113,113,.14); }
.al-warn { border-left-color: var(--amber); } .al-warn .sev { color: #fde68a; background: rgba(251,191,36,.12); }
.al-info { border-left-color: var(--blue); } .al-info .sev { color: #bfdbfe; background: rgba(96,165,250,.12); }
.empty.ok { color: var(--green); }
.dbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dbar input { min-height: 40px; padding: 0 12px; flex: 1; min-width: 180px; max-width: 360px; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.seg button.sel { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(140, 200, 96, .3); }
.dgrp { margin-bottom: 22px; }
.dgrp h3 { font: 600 14px/1.2 var(--title); display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.dgrp h3 span { font: 500 11.5px/1 var(--mono); color: var(--muted); } .dgrp h3 b { color: var(--amber); font-weight: 600; }
.dlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.dv { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; background: rgba(24, 29, 37, .6); border: 1px solid var(--line); }
.dv > i { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.dv .dn { display: flex; flex-direction: column; min-width: 0; } .dv .dn b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv .dn span { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv .ds { grid-column: 2; font: 500 11.5px/1.3 var(--mono); color: var(--muted); margin-top: 4px; }
.d-ok > i { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, .6); } .d-ok .ds { color: #86efac; }
.d-err { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.06); } .d-err > i { background: var(--red); box-shadow: 0 0 10px var(--red); } .d-err .ds { color: #fecaca; }
.d-warn { border-color: rgba(251,191,36,.35); } .d-warn > i { background: var(--amber); } .d-warn .ds { color: #fde68a; }
.d-info > i { background: var(--blue); }
.hist { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: rgba(21, 26, 33, .5); }
.hist summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.hl { list-style: none; margin: 12px 0 0; padding: 0; } .hl li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hl time { color: var(--dim); font: 500 12px/1.6 var(--mono); } .hl em { color: var(--dim); font-style: normal; }
@media (max-width: 600px) { .al { grid-template-columns: 1fr; gap: 6px; } .hl li { grid-template-columns: 1fr; } .dlist { grid-template-columns: 1fr; } }
