/* GSB — palette Pétrole et papier (valeurs choisies par Estheban, ne pas en ajouter d'autres) */
:root {
    --bg: #EFF2F1;
    --text: #15201F;
    --accent: #1F5C59;
    --muted: #636C6B;
    --raised: #F8F9F9;
    --sunk: #E2E5E4;
    --band: #E6EAE9;
    --line: #D0D5D4;
    --wire: #A5ABAA;
    --soft-accent: #D2DDDC;
    --on-accent: #EFF2F1;
    --glass: color-mix(in srgb, #EFF2F1 72%, transparent);
    --glass-line: color-mix(in srgb, #15201F 9%, transparent);
    --shadow: 0 1px 2px color-mix(in srgb, #15201F 8%, transparent), 0 16px 44px -14px color-mix(in srgb, #15201F 26%, transparent);
    --ok: #2F6E4B;
    --error: #A3382F;
    --warn: #8A6116;
    --font: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    --r-tile: 28px;
    --r-ctl: 14px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0D1413;
        --text: #E2EAE8;
        --accent: #7DB5AE;
        --muted: #919997;
        --raised: #1A2120;
        --sunk: #202726;
        --band: #161D1C;
        --line: #2D3433;
        --wire: #5A6160;
        --soft-accent: #21312F;
        --on-accent: #0D1413;
        --glass: color-mix(in srgb, #0D1413 70%, transparent);
        --glass-line: color-mix(in srgb, #E2EAE8 9%, transparent);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 50px -16px rgba(0, 0, 0, .75);
        --ok: #7DC49B;
        --error: #E8877E;
        --warn: #D9B36A;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0D1413;
    --text: #E2EAE8;
    --accent: #7DB5AE;
    --muted: #919997;
    --raised: #1A2120;
    --sunk: #202726;
    --band: #161D1C;
    --line: #2D3433;
    --wire: #5A6160;
    --soft-accent: #21312F;
    --on-accent: #0D1413;
    --glass: color-mix(in srgb, #0D1413 70%, transparent);
    --glass-line: color-mix(in srgb, #E2EAE8 9%, transparent);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 50px -16px rgba(0, 0, 0, .75);
    --ok: #7DC49B;
    --error: #E8877E;
    --warn: #D9B36A;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    font-feature-settings: 'tnum' 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; }
.display { font-size: clamp(2.6rem, 7vw, 5.4rem); letter-spacing: -0.055em; line-height: .95; }
.h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.045em; }
.h2 { font-size: 1.45rem; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 46ch; margin-top: 18px; line-height: 1.4; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.hint { font-size: .86rem; color: var(--muted); }
.link { color: var(--accent); text-decoration: none; font-weight: 500; font-size: .95rem; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Navigation : pilule de verre ---------- */
.nav-wrap { position: fixed; top: 14px; left: 0; right: 0; z-index: 50; padding: 0 16px; pointer-events: none; }
.nav { pointer-events: auto; max-width: 780px; margin: 0 auto; height: 54px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; box-shadow: var(--shadow); }
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: saturate(170%) blur(22px);
    backdrop-filter: saturate(170%) blur(22px);
    border-radius: 999px;
}
.glass-panel {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: saturate(170%) blur(26px);
    backdrop-filter: saturate(170%) blur(26px);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; margin-right: auto; }
.brand-mark { width: 18px; height: 18px; fill: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-links a { white-space: nowrap; text-decoration: none; font-size: .93rem; color: var(--muted); padding: 8px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; transition: color .2s, background-color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--sunk); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .74rem; font-weight: 600; display: inline-grid; place-items: center; }
.nav-tools { display: flex; align-items: center; gap: 2px; }
.tool { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--muted); transition: color .2s, background-color .2s; flex: none; }
.tool:hover { color: var(--text); background: var(--sunk); }
.tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

.account { position: relative; }
.account summary { list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft-accent); color: var(--accent); display: grid; place-items: center; font-size: .78rem; font-weight: 600; cursor: pointer; flex: none; letter-spacing: 0; }
.avatar-sm { width: 36px; height: 36px; cursor: default; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; padding: 16px; display: grid; gap: 4px; background: var(--raised); }
.account-name { font-weight: 600; }
.account-meta { font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.account-menu a, .account-menu button { text-align: left; text-decoration: none; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; font-size: .95rem; }
.account-menu a:hover, .account-menu button:hover { background: var(--sunk); }

/* ---------- Boutons et champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; background: var(--sunk); color: var(--text); font-weight: 500; font-size: .96rem; text-decoration: none; white-space: nowrap; transition: background-color .2s, transform .15s, opacity .2s; }
.btn:hover { background: color-mix(in srgb, var(--sunk) 82%, var(--text)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--text)); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--sunk); color: var(--text); }
.btn-danger { background: transparent; color: var(--error); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--error) 42%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.btn-sm { height: 36px; padding: 0 14px; font-size: .9rem; }
.btn-wide { width: 100%; }

.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .86rem; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .dock-select, .dock-search {
    width: 100%; min-height: 46px; padding: 0 14px;
    background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-ctl);
    font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.45; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--wire); }
.field input:focus, .field select:focus, .field textarea:focus, .dock-select:focus, .dock-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-narrow { max-width: 130px; }
.form-error { color: var(--error); font-size: .92rem; font-weight: 500; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-actions form { display: contents; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--sunk); border-radius: 999px; margin: 8px 0 28px; }
.segmented a, .segmented button { height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none; font-size: .93rem; color: var(--muted); font-weight: 500; transition: background-color .2s, color .2s; }
.segmented a[aria-current="page"], .segmented button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent); }
.segmented-sm { margin: 0; }
.segmented button[aria-checked="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent); }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }
.addr-edit .segmented, .field .segmented { margin: 0; align-self: flex-start; }
.field-row-btn { grid-template-columns: 1fr auto; align-items: end; }
.addr-edit, .add-hosts { padding: 16px; border-radius: 18px; background: var(--sunk); }

/* Façade d'un switch : 2 rangées de 24 ports RJ45 + 4 SFP */
.face { display: flex; gap: 8px; padding: 10px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.face-rj { flex: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.face-sfp { display: grid; grid-template-columns: repeat(2, 18px); gap: 3px; align-content: start; padding-left: 8px; border-left: 1px solid var(--line); }
.fp { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border-radius: 4px; border: 1.5px solid var(--wire); background: var(--raised); cursor: pointer; }
.fp-sfp { width: 18px; aspect-ratio: 1.25; border-radius: 3px; }
.fp-top { border-bottom-width: 3.5px; }
.fp-bot { border-top-width: 3.5px; }
.fp-gap { margin-bottom: 7px; }
.fp.is-trunk { background: repeating-linear-gradient(135deg, var(--wire) 0 2px, var(--raised) 2px 4px); }
.fp.is-none { opacity: .3; cursor: default; }
.fp.is-linked::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--text); }
.fp.is-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.fp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.face-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.face-tools .btn { grid-column: 1 / -1; justify-self: start; }
.face-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .86rem; }
.face-legend li { display: inline-flex; align-items: center; gap: 6px; }
.segmented-sm button { height: 32px; padding: 0 12px; font-size: .88rem; }

.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: .8rem; font-weight: 500; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.pill-open { background: var(--soft-accent); color: var(--accent); }
.pill-needs_update { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill-accepted { background: var(--accent); color: var(--on-accent); }
.pill-rejected { background: color-mix(in srgb, var(--error) 13%, transparent); color: var(--error); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 500; font-size: .95rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); transition: opacity .4s, transform .4s; }
.toast-error { background: var(--error); color: #fff; }
:root[data-theme="dark"] .toast-error { color: var(--bg); }
.toast.is-gone { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }

/* ---------- Pages classiques ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 132px 24px 72px; }
.page-narrow { max-width: 760px; }
.page-head { margin-bottom: 44px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot { max-width: 1180px; margin: 0 auto; padding: 28px 24px 40px; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); }

/* Bento : tuiles de tailles différentes */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--raised); border-radius: var(--r-tile); padding: 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; border: 1px solid var(--glass-line); }
.tile-title { font-size: 1.32rem; letter-spacing: -0.03em; line-height: 1.15; }
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tile .btn { align-self: flex-start; margin-top: auto; }
.tile-map { grid-column: span 3; grid-row: span 2; padding: 0; overflow: hidden; text-decoration: none; position: relative; min-height: 460px; background: var(--raised); }
.mini-map { position: absolute; inset: 18px 18px 74px; }
.tile-map .tile-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 26px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tile-map:hover .tile-title { color: var(--accent); }
.tile-wide { grid-column: span 2; }
.tile-draft { background: var(--soft-accent); }
.mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-decoration: none; font-size: .95rem; padding: 8px 0; border-top: 1px solid var(--line); }
.mini-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lignes (listes) */
.rows { display: grid; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; text-decoration: none; min-width: 0; border-radius: 12px; transition: background-color .2s; }
a.row:hover { background: color-mix(in srgb, var(--sunk) 70%, transparent); }
.row-num { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.04em; color: var(--accent); min-width: 2.2ch; text-align: right; }
.row-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: .88rem; }
.rows-lg .row { padding: 18px 8px; }
.hash { color: var(--muted); font-size: .84rem; }
.empty { padding: 48px 0; display: grid; gap: 10px; }

.timeline { position: relative; display: grid; }
.timeline::before { content: ''; position: absolute; left: 33px; top: 14px; bottom: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline .row { padding: 18px 8px; }
.timeline .row-num { position: relative; z-index: 1; background: var(--bg); min-width: 52px; text-align: center; padding: 4px 0; }
.timeline li.is-head .row-num { color: var(--on-accent); background: var(--accent); border-radius: 999px; font-size: 1.25rem; }

/* Auth */
.page-auth { min-height: 100vh; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 110px 24px 48px; }
.auth-narrow { grid-template-columns: minmax(0, 520px); justify-content: center; }
.auth-form form { background: var(--raised); border-radius: var(--r-tile); padding: 32px; border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
.auth-intro .display { max-width: 12ch; }
.building { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 520px; position: relative; padding-left: 22px; }
.building::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: var(--accent); }
.building li { width: var(--w); display: flex; align-items: baseline; gap: 14px; background: var(--band); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px; }
.building-n { font-weight: 600; font-size: 1.05rem; min-width: 3ch; color: var(--accent); }
.building-l { min-width: 0; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Admin */
.bento-admin .tile-users { grid-column: span 2; grid-row: span 2; }
.bento-admin .tile-create { grid-column: span 2; }
.bento-admin .tile-teams { grid-column: span 2; }
.bento-admin .tile-log { grid-column: span 4; }
.team-list { display: grid; }
.team-list > li + li { border-top: 1px solid var(--line); }
.team-list summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 2px; cursor: pointer; list-style: none; }
.team-list summary::-webkit-details-marker { display: none; }
.team-name { font-weight: 500; }
.team-list details[open] { padding-bottom: 14px; }
.team-list details form + form { margin-top: 8px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 140px; }
.inline-form .field-narrow { flex: 0 1 110px; min-width: 90px; }
.log { display: grid; gap: 0; }
.log li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: .93rem; }
.log li + li { border-top: 1px solid var(--line); }
.panel { background: var(--raised); border-radius: var(--r-tile); padding: 26px; margin-top: 16px; display: grid; gap: 16px; border: 1px solid var(--glass-line); }
.reveal { background: var(--soft-accent); border-radius: var(--r-tile); padding: 26px; display: grid; gap: 12px; }
.reveal-pw { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.reveal-pw span { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 600; letter-spacing: .02em; color: var(--accent); word-break: break-all; }

/* ---------- Pages de schéma (plein écran) ---------- */
.page-stage { overflow: hidden; height: 100dvh; }
.stage { position: fixed; inset: 0; }
.cy { position: absolute; inset: 0; background: var(--bg); }
.stage-head { position: absolute; top: 86px; left: 24px; max-width: min(460px, calc(100vw - 48px)); pointer-events: none; display: grid; gap: 6px; justify-items: start; }
.stage-head > * { pointer-events: auto; }
.stage-title { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -0.055em; line-height: .95; }
.stage-meta { color: var(--muted); font-size: .95rem; line-height: 1.4; max-width: 40ch; }
.stage-cta { margin-top: 8px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.stage-back { font-size: .9rem; }
.stage-error { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--error); font-weight: 500; text-align: center; }

.dock { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 20; }
.dock-group { display: flex; align-items: center; }
.dock-search-wrap { position: relative; display: block; }
.dock-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.dock-search { width: 170px; min-height: 40px; height: 40px; border-radius: 999px; padding: 0 12px 0 36px; font-size: .93rem; background: var(--raised); }
.dock-select { width: auto; max-width: 220px; min-height: 40px; height: 40px; border-radius: 999px; font-size: .93rem; padding: 0 12px; }
.dock-btn { height: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: .93rem; color: var(--text); white-space: nowrap; transition: background-color .2s; }
.dock-btn:hover { background: var(--sunk); }
.dock-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn.is-on { background: var(--accent); color: var(--on-accent); }
.dock-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.dock-menu { position: relative; }
.dock-menu summary { list-style: none; cursor: pointer; }
.dock-menu summary::-webkit-details-marker { display: none; }
.menu { position: absolute; bottom: calc(100% + 12px); right: 0; min-width: 190px; padding: 8px; display: grid; background: var(--raised); }
.menu button, .menu a { text-align: left; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.menu button:hover, .menu a:hover { background: var(--sunk); }
.menu .menu-note { padding: 8px 12px 4px; font-size: .8rem; color: var(--muted); }

.side { position: absolute; top: 84px; right: 16px; bottom: 90px; width: 380px; overflow: auto; z-index: 25; overscroll-behavior: contain; background: var(--raised); }
.side-close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2; background: var(--raised); }
.side-body { padding: 26px 24px 28px; display: grid; gap: 14px; }
.side-title { font-size: 1.7rem; letter-spacing: -0.045em; padding-right: 40px; word-break: break-word; }
.side-meta { color: var(--muted); font-size: .92rem; margin-top: -6px; }
.side-note { font-size: .95rem; line-height: 1.45; }
.side-h { font-size: 1rem; letter-spacing: -0.01em; margin-top: 8px; }
.side-title-vlan { display: flex; align-items: center; gap: 12px; }
.vlan-swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 5px; }
.side-title-vlan .vlan-swatch { width: 16px; height: 34px; border-radius: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .93rem; }
.facts dt { color: var(--muted); }
.ports { display: grid; }
.ports li { display: grid; grid-template-columns: 76px 1fr; gap: 2px 12px; padding: 9px 0; font-size: .9rem; border-top: 1px solid var(--line); }
.port-name { font-weight: 500; text-align: left; }
.port-conf { color: var(--muted); }
.port-peer { grid-column: 2; text-align: left; color: var(--accent); font-size: .88rem; }
.port-peer:hover { text-decoration: underline; }
.plain { display: grid; gap: 4px; font-size: .92rem; }
.acl { border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px; }
.acl summary { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; cursor: pointer; font-weight: 500; font-size: .93rem; list-style: none; }
.acl summary::-webkit-details-marker { display: none; }
.acl summary .muted { font-weight: 400; font-size: .86rem; text-align: right; }
.acl .hint { padding-bottom: 12px; }
.rules { display: grid; gap: 4px; padding-bottom: 10px; counter-reset: r; }
.rules li { display: flex; gap: 10px; font-size: .88rem; align-items: baseline; counter-increment: r; }
.rules li::before { content: counter(r); color: var(--muted); min-width: 1.4ch; }
.rule-act { font-weight: 600; color: var(--accent); min-width: 48px; }
.rules li.is-deny .rule-act { color: var(--error); }

.sim-out { display: grid; gap: 12px; }
.sim-verdict { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.sim-verdict.is-ok { color: var(--accent); }
.sim-verdict.is-blocked { color: var(--error); }
.steps { display: grid; gap: 0; counter-reset: s; }
.steps li { position: relative; padding: 8px 0 8px 34px; font-size: .92rem; line-height: 1.4; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 600; background: var(--sunk); color: var(--muted); }
.steps li.step-pass::before { background: var(--accent); color: var(--on-accent); }
.steps li.step-block { color: var(--error); font-weight: 500; }
.steps li.step-block::before { background: var(--error); color: var(--bg); }

.banner { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; font-size: .93rem; z-index: 30; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* Changements et contrôles */
.change-list { display: grid; }
.change-list > li { border-top: 1px solid var(--line); padding: 10px 0; }
.change-head { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; text-align: left; width: 100%; align-items: baseline; }
.change-head:hover .change-title { color: var(--accent); }
.change-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); align-self: center; }
.change-dot.is-modified { background: transparent; border: 2px dashed var(--accent); }
.change-dot.is-removed { background: var(--error); }
.change-title { font-weight: 500; }
.change-verb { grid-column: 2; color: var(--muted); font-size: .86rem; }
.change-lines { display: grid; gap: 3px; margin: 6px 0 0 22px; font-size: .87rem; color: var(--muted); }
.check-ok { color: var(--accent); font-weight: 500; font-size: .93rem; }
.check-list { display: grid; gap: 6px; }
.check-list button { text-align: left; font-size: .88rem; line-height: 1.4; padding-left: 16px; position: relative; }
.check-list button::before { content: ''; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; }
.check-list .is-error button { color: var(--error); }
.check-list .is-error button::before { background: var(--error); }
.check-list .is-warning button::before { background: var(--warn); }
.check-list button:hover { text-decoration: underline; }

/* ---------- Réactif ---------- */
@media (max-width: 1000px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile-map { grid-column: span 2; grid-row: auto; min-height: 380px; }
    .bento-admin .tile-users, .bento-admin .tile-create, .bento-admin .tile-teams, .bento-admin .tile-log { grid-column: span 2; grid-row: auto; }
    .auth { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 104px; }
}

@media (max-width: 720px) {
    .nav { padding: 0 6px 0 14px; gap: 2px; }
    .brand span { display: none; }
    .nav-links a { padding: 8px 9px; font-size: .88rem; }
    .page { padding: 108px 16px 56px; }
    .bento { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .tile-map, .tile-wide, .bento-admin .tile-users, .bento-admin .tile-create, .bento-admin .tile-teams, .bento-admin .tile-log { grid-column: auto; }
    .tile-map { min-height: 300px; }
    .tile { padding: 22px; border-radius: 24px; }
    .row { gap: 12px; }
    .row .pill { display: none; }
    .rows-lg .row .pill { display: inline-flex; }
    .rows-lg .row { flex-wrap: wrap; }
    .field-row { grid-template-columns: 1fr; }
    .auth { padding: 96px 16px 40px; }
    .auth-form form { padding: 22px; }
    .building li { width: 100%; }
    .timeline::before { left: 29px; }
    .timeline .row-num { min-width: 44px; }
    .timeline .hash { display: none; }

    .stage-head { top: 80px; left: 16px; }
    .stage-meta { display: none; }
    .dock { bottom: 14px; gap: 2px; padding: 5px; }
    .dock-search { width: 120px; }
    .dock-select { max-width: 120px; }
    .dock-btn span { display: none; }
    .dock-btn { padding: 0 10px; }
    .side { top: auto; left: 8px; right: 8px; bottom: 74px; width: auto; max-height: 58dvh; }
}

@media (max-width: 400px) {
    .nav-links a { padding: 8px 7px; font-size: .84rem; }
    .dock-search { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Éditeur ---------- */
.edit-actions { position: absolute; top: 84px; right: 16px; display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 16px; z-index: 26; box-shadow: var(--shadow); }
.save-state { font-size: .86rem; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.save-state.is-ok::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.save-state.is-error { color: var(--error); font-weight: 500; }
.page-edit .side { top: 142px; }
.page-edit .stage-head { left: 96px; }

.rail { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; padding: 7px; z-index: 22; background: var(--raised); }
.rail-group { position: relative; }
.rail-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--text); position: relative; transition: background-color .2s, color .2s; }
.rail-btn:hover { background: var(--sunk); }
.rail-btn:disabled { color: var(--wire); cursor: default; background: none; }
.rail-btn.is-on { background: var(--accent); color: var(--on-accent); }
.rail-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .68rem; font-weight: 600; display: grid; place-items: center; }
.rail-badge.is-error { background: var(--error); color: var(--bg); }
.rail-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.rail-menu { position: absolute; left: calc(100% + 14px); top: -8px; width: 230px; padding: 8px; display: grid; background: var(--raised); }
.rail-menu button { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: .94rem; }
.rail-menu button:hover, .rail-menu button:focus-visible { background: var(--sunk); }
.menu-icon { width: 18px; height: 18px; filter: none; }
:root[data-theme="dark"] .menu-icon { filter: invert(.9); }
body.is-linking .cy { cursor: crosshair; }

.narrow-note { display: none; }

.side-h-row { display: flex; justify-content: space-between; align-items: baseline; }
.side-danger { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.port-list { display: grid; }
.port-edit { border-top: 1px solid var(--line); }
.port-edit:last-child { border-bottom: 1px solid var(--line); }
.port-edit summary { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 10px 0; cursor: pointer; font-size: .9rem; list-style: none; }
.port-edit summary::-webkit-details-marker { display: none; }
.port-edit[open] summary .port-name { color: var(--accent); }
.port-body { padding: 4px 0 16px; gap: 12px; }
.port-body .field input, .port-body .field select, .side .field input, .side .field select { min-height: 40px; height: 40px; font-size: .94rem; border-radius: 12px; }
.side .field textarea { font-size: .94rem; min-height: 80px; border-radius: 12px; }
.vlan-checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vlan-checks legend { font-size: .86rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; padding: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--sunk); font-size: .86rem; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.chk:has(input:checked) { background: var(--soft-accent); color: var(--accent); font-weight: 500; }
.chk-line { height: auto; padding: 8px 12px; border-radius: 12px; }
.route-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.rule-edit { display: grid; gap: 6px; counter-reset: r; }
.rule-edit li { display: grid; grid-template-columns: 74px 64px 1fr 1fr 58px auto; gap: 5px; align-items: center; }
.rule-edit select, .rule-edit input { height: 34px; min-height: 34px; padding: 0 7px; border-radius: 9px; font-size: .84rem; background: var(--raised); border: 1px solid var(--line); width: 100%; min-width: 0; }
.rule-edit input:focus, .rule-edit select:focus { outline: none; border-color: var(--accent); }
.rule-tools { display: flex; }
.rule-tools .tool { width: 30px; height: 30px; }
.rule-tools .tool svg { width: 15px; height: 15px; }
.rule-tools .tool:disabled { opacity: .3; }
.acl-body { padding-bottom: 14px; }
.route-row .tool { margin-bottom: 2px; }
.cluster-edit { padding: 12px 0; border-top: 1px solid var(--line); }
.vlan-table { display: grid; }

.dialog { width: min(560px, calc(100vw - 32px)); padding: 30px; border: 1px solid var(--glass-line); color: var(--text); background: var(--raised); }
.dialog::backdrop { background: rgba(5, 10, 9, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.side .side-close { position: sticky; }

@media (max-width: 900px) {
    .page-edit .rail, .page-edit .edit-actions, .page-edit .dock, .page-edit .side { display: none !important; }
    .page-edit .narrow-note { display: grid; gap: 12px; position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 24px; background: var(--raised); justify-items: start; }
    .page-edit .stage-head { left: 16px; }
}

/* ---------- Revue d'une proposition ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h3 { font-size: 1.12rem; letter-spacing: -0.02em; }
.review { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 460px; }
.stage-box { position: relative; overflow: hidden; }
.review-col { overflow: auto; padding: 96px 28px 40px; background: var(--raised); border-left: 1px solid var(--line); display: grid; gap: 18px; align-content: start; overscroll-behavior: contain; }
.review-title { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.045em; line-height: 1.02; }
.review-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .92rem; }
.review-desc { white-space: pre-line; line-height: 1.5; }
.note { font-size: .9rem; color: var(--muted); padding: 12px 14px; border-radius: 14px; background: var(--sunk); }
.review-sec { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.review-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.review-sec-head .muted { font-size: .86rem; text-align: right; }
.decision { display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: var(--soft-accent); }
.decision textarea, .comment-form textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); min-height: 84px; resize: vertical; font-size: .95rem; line-height: 1.45; }
.decision textarea:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.page-review .side { top: 84px; bottom: 90px; }
.page-review .stage-box .dock { bottom: 22px; }
.legend { position: absolute; top: 84px; left: 20px; display: flex; gap: 14px; padding: 8px 14px; font-size: .84rem; color: var(--muted); z-index: 15; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 14px; height: 10px; border-radius: 4px; display: inline-block; }
.lg-add { background: var(--soft-accent); border: 2px solid var(--accent); }
.lg-mod { border: 2px dashed var(--accent); }
.lg-del { border: 2px dashed var(--error); }
.comments { display: grid; gap: 14px; }
.comment { display: grid; gap: 6px; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.comment-author { font-weight: 500; }
.comment-body { white-space: pre-line; font-size: .95rem; line-height: 1.5; padding-left: 34px; }
.comment .comment-pin { margin-left: 34px; justify-self: start; }
.comment.is-system { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; color: var(--muted); padding: 8px 12px; border-radius: 12px; background: var(--sunk); }
.avatar-xs { width: 26px; height: 26px; font-size: .66rem; cursor: default; }
.comment-pin { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--soft-accent); color: var(--accent); font-size: .8rem; font-weight: 500; }
button.comment-pin:hover { text-decoration: underline; }
.pin-row { display: flex; align-items: center; gap: 10px; }
.comment-form .row-actions .hint { flex: 1; }

@media (max-width: 900px) {
    .page-review { overflow: auto; height: auto; }
    .review { position: static; display: block; }
    .review .stage-box { position: relative; height: 62dvh; }
    .review-col { padding: 24px 16px 48px; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
    .legend { top: 80px; left: 12px; gap: 10px; font-size: .78rem; padding: 6px 10px; }
    .page-review .side { top: auto; bottom: 74px; }
}
.back { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--sunk); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 500; transition: background-color .2s; }
.back:hover { background: color-mix(in srgb, var(--sunk) 80%, var(--text)); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage-head .back { margin-bottom: 6px; }

.theme-in-menu { display: none; }
@media (max-width: 720px) {
    .nav #theme-toggle { display: none; }
    .theme-in-menu { display: block; }
    .nav-links { overflow-x: auto; scrollbar-width: none; }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { padding: 7px 8px; font-size: .86rem; }
    .dock-search { width: 40px; padding-right: 0; transition: width .2s; }
    .dock-search:focus { width: 150px; padding-right: 12px; }
    .dock-search::placeholder { color: transparent; }
    .dock-select { max-width: 118px; font-size: .86rem; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
    .nav-links a[href$="/history"] { display: none; }
}

/* Plan d'adressage */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.plan-scroll { overflow-x: auto; border-radius: 22px; background: var(--raised); border: 1px solid var(--line); }
.plan-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.plan-table th, .plan-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.plan-table td:nth-child(2) { white-space: normal; min-width: 180px; }
.plan-table thead th { color: var(--muted); font-weight: 500; font-size: .86rem; }
.plan-table tbody tr:last-child > * { border-bottom: 0; }
.plan-table .num { text-align: right; }
.tnum { font-variant-numeric: tabular-nums; }
.plan-vlan { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.plan-bar { display: block; width: 100%; min-width: 90px; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.plan-bar > span { display: block; height: 100%; border-radius: 4px; }
.plan-h2 { margin: 56px 0 16px; }
.plan-details { display: grid; gap: 10px; }
.plan-vl { border-radius: 18px; background: var(--raised); border: 1px solid var(--line); }
.plan-vl > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.plan-vl > summary::-webkit-details-marker { display: none; }
.plan-vl-t { flex: 1; font-weight: 500; }
.plan-vl[open] > summary { border-bottom: 1px solid var(--line); }
.plan-vl .plan-scroll { border: 0; border-radius: 0 0 18px 18px; }
.plan-vl > p { padding: 14px 18px; }
.plan-table-sm th, .plan-table-sm td { padding: 9px 18px; }

@media print {
    .nav-wrap, .plan-actions, .foot, .skip, .toast { display: none !important; }
    body { background: #fff; color: #000; }
    .page { padding: 0 !important; max-width: none; }
    .display { font-size: 26pt; }
    .plan-scroll, .plan-vl { border-color: #bbb; background: #fff; overflow: visible; break-inside: avoid; }
    .plan-table th, .plan-table td { border-color: #ccc; padding: 5px 8px; font-size: 9pt; }
    .vlan-swatch, .plan-bar > span { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
/* Services, Wi-Fi, NAT */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 11px; border-radius: 999px; background: var(--soft-accent); font-size: .86rem; font-weight: 500; }
.port-name-vlan { display: inline-flex; align-items: center; gap: 8px; }
.ssid-row { display: grid; grid-template-columns: 1.3fr .9fr 1.2fr auto; gap: 8px; align-items: end; }
.fwd-row { display: grid; grid-template-columns: 74px 64px auto 1fr 60px auto; gap: 6px; align-items: center; }
.fwd-row input, .fwd-row select { min-width: 0; }
.svc-checks { margin-top: 4px; }
/* Cartes réseau d'une VM (vmbr0) */
.nic { padding: 12px 14px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); gap: 10px; }
.nic-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nic-name { font-weight: 600; }
.side-h-sm { font-size: 1rem; margin-top: 6px; }