:root {
  --bg: #eef5f9;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --border: #e9edf2;
  --text: #212529;
  --muted: #67757c;
  --primary: #1e88e5;
  --primary-2: #1565c0;
  --primary-soft: #e3f2fd;
  --accent: #26c6da;
  --accent-2: #00acc1;
  --sidebar: #ffffff;
  --sidebar-head: #1a233a;
  --topbar: #1e88e5;
  --ok: #21c1d6;
  --ok-soft: #e0f7fa;
  --warn: #ffb22b;
  --warn-soft: #fff8e1;
  --err: #fc4b6c;
  --err-soft: #fde8ec;
  --code-bg: #1a233a;
  --code-fg: #d7e0f0;
  --radius: 8px;
  --shadow: 0 0 20px rgba(0, 0, 0, .05);
  --sidebar-w: 260px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --font: "Roboto", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, .mp-body {
  margin: 0;
  min-height: 100vh;
  font: 400 14.5px/1.55 var(--font);
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); padding: .08rem .35rem; border-radius: 4px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .86rem; margin: .5rem 0 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ MaterialPro shell */

.mp-body { display: flex; min-height: 100vh; }
.mp-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  background: var(--sidebar);
  box-shadow: 1px 0 20px rgba(0, 0, 0, .06);
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.mp-sidebar-head {
  background: var(--sidebar-head) center / cover no-repeat;
  background-image: linear-gradient(135deg, #1a233a 0%, #263550 100%);
  color: #fff;
  padding: 1.4rem 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .85rem;
}
.mp-sidebar-logo {
  height: 42px; width: auto; max-width: 100%;
  object-fit: contain; align-self: flex-start;
  filter: brightness(0) invert(1);
  opacity: .95;
}
.mp-sidebar-user strong { display: block; font-weight: 500; font-size: .95rem; }
.mp-sidebar-user span { font-size: .8rem; opacity: .7; font-weight: 300; }

.mp-nav { padding: 1rem .75rem 1.5rem; overflow: auto; flex: 1; }
.mp-nav-label {
  font-size: .7rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: #99abb4;
  margin: .85rem .65rem .35rem;
}
.mp-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .9rem; margin: .15rem 0;
  border-radius: 999px; color: #67757c; font-weight: 400;
  transition: background .15s, color .15s;
}
.mp-nav a:hover { background: #f2f4f8; text-decoration: none; color: var(--text); }
.mp-nav a.is-active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(38, 198, 218, .35);
}
.mp-nav-ico { width: 1.25rem; display: inline-grid; place-items: center; opacity: .9; }
.mp-nav-ico svg { display: block; }

.mp-shell {
  flex: 1; margin-left: var(--sidebar-w);
  min-width: 0; display: flex; flex-direction: column; min-height: 100vh;
}
.mp-shell-login { margin-left: 0; }
.mp-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .85rem;
  min-height: 64px; padding: 0 1.25rem;
  background: var(--topbar); color: #fff;
  box-shadow: 0 2px 8px rgba(30, 136, 229, .25);
}
.mp-menu-btn {
  display: none; border: 0; background: transparent; color: #fff;
  font-size: 1.35rem; cursor: pointer; padding: .25rem .4rem;
}
.mp-top-brand {
  display: flex; align-items: center; gap: .55rem;
  color: #fff; font-size: 1.05rem; font-weight: 400;
}
.mp-top-brand:hover { text-decoration: none; color: #fff; }
.mp-top-brand img {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; object-fit: contain;
}
.mp-top-brand strong { font-weight: 500; }
.mp-topbar-spacer { flex: 1; }
.mp-topbar-user { display: flex; align-items: center; gap: .65rem; }
.mp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.22); color: #fff; font-weight: 500;
}
.mp-username { font-size: .9rem; opacity: .95; }
.btn.light, .btn.ghost.light {
  color: #fff; border-color: rgba(255,255,255,.35); background: transparent;
}
.btn.ghost.light:hover { background: rgba(255,255,255,.12); }

.mp-main { flex: 1; padding: 1.5rem 1.75rem 2rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.mp-footer {
  padding: .9rem 1.75rem 1.4rem; color: var(--muted); font-size: .8rem;
  max-width: 1400px; width: 100%; margin: 0 auto;
}

.login-wrap {
  min-height: calc(100vh - 140px);
  display: grid; place-items: center; padding: 1.5rem;
}
.login-card { width: min(28rem, 100%); margin: 0; }
.login-brand { text-align: center; margin-bottom: 1.25rem; }
.login-logo { height: 52px; width: auto; max-width: 220px; margin-bottom: .85rem; }
.login-brand h1 { margin: 0 0 .25rem; font-size: 1.4rem; font-weight: 500; color: #455a64; }
.login-hero { max-width: 28rem; margin: 1.5rem auto 1.25rem; }
.hero {
  padding: 1.5rem 1.75rem; margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.hero h1 { margin: 0 0 .35rem; font-size: 1.45rem; font-weight: 500; letter-spacing: -.01em; color: var(--text); }
.hero p { margin: 0; max-width: 60rem; color: var(--muted); opacity: 1; }
.hero code { background: var(--primary-soft); color: var(--primary); }

.section-title { font-size: 1.1rem; margin: 2rem 0 .8rem; display: flex; align-items: center; gap: .5rem; }
.count {
  display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem;
  border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 500;
}

.banner { padding: .85rem 1.1rem; border-radius: var(--radius); margin: 0 0 1rem; border: 0; font-size: .92rem; box-shadow: var(--shadow); }
.banner.info { background: var(--primary-soft); color: var(--primary-2); }
.banner.warn { background: var(--warn-soft); color: #b78103; }
.banner.error { background: var(--err-soft); color: var(--err); }

.note { margin: 0 0 1rem; font-size: .82rem; color: var(--muted); }
.note code { font-size: .9em; }

.empty {
  padding: 2.5rem; text-align: center; color: var(--muted);
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}

/* legacy topbar aliases (si pages hors layout) */
.topbar { display: none; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; }
.footer { display: none; }
.topbar-user { display: none; }

/* ------------------------------------------------------------------ boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: 4px;
  border: 1px solid transparent; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(30,136,229,.35); }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.small { padding: .28rem .65rem; font-size: .84rem; border-radius: 4px; }
.btn small { opacity: .75; font-weight: 400; }

/* ------------------------------------------------------------------ images de base */

.bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.base-card {
  display: flex; gap: 1rem; padding: 1.1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.base-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.base-body { display: flex; flex-direction: column; gap: .2rem; }
.base-body small { color: var(--muted); }
.base-meta { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

.base-icon {
  flex: none; width: 44px; height: 44px; border-radius: 11px;
  background: var(--primary-soft) center / 24px no-repeat;
}
.base-dev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m8 8-4 4 4 4M16 8l4 4-4 4M14 5l-4 14'/%3E%3C/svg%3E"); }
.base-desktop { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); }
.base-docker-php { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2'%3E%3Cpath d='M12 3v18M8 7h8M7 12h10M9 17h6'/%3E%3C/svg%3E"); }
.base-docker-node { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 2 8.5 5v10L12 22l-8.5-5V7z'/%3E%3C/svg%3E"); }
.base-docker-python { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2'%3E%3Cpath d='M12 3c-3 0-4 2-4 4v2h8V7c0-2-1-4-4-4zM8 9H6c-2 0-3 1.5-3 3.5S4 16 6 16h2M16 9h2c2 0 3 1.5 3 3.5S20 16 18 16h-2M8 15v2c0 2 1 4 4 4s4-2 4-4v-2'/%3E%3C/svg%3E"); }
.base-docker-nginx { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E"); }
.base-docker-debian { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235277c3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3a7 7 0 0 1 7 7c0 5-7 11-7 11S5 15 5 10a7 7 0 0 1 7-7z'/%3E%3C/svg%3E"); }
.ova-only[hidden], .docker-only[hidden] { display: none !important; }

/* ------------------------------------------------------------------ liste VMs */

.vm-list { display: flex; flex-direction: column; gap: .6rem; }
.vm-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .85rem 1.2rem;
  padding: .9rem 1.1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.vm-row.is-building { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.vm-name { font-weight: 600; font-size: 1.02rem; color: var(--text); }
.vm-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tag { font-size: .76rem; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.svc { background: var(--primary-soft); color: var(--primary); }
.vm-status { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.vm-status small { color: var(--muted); text-align: right; max-width: 16rem; }
.vm-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.vm-progress {
  grid-column: 1 / -1;
  padding-top: .15rem;
}

.status {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 99px;
  background: var(--surface-2); color: var(--muted);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.success { background: var(--ok-soft); color: var(--ok); }
.status.failed { background: var(--err-soft); color: var(--err); }
.status.running, .status.queued { background: var(--primary-soft); color: var(--primary); }
.status.running::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ------------------------------------------------------------------ éditeur */

.editor { display: block; width: 100%; max-width: none; padding-bottom: 5.5rem; }
.editor-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.title-input {
  flex: 1; font: 700 1.6rem/1.2 inherit; color: var(--text);
  border: 0; border-bottom: 2px solid transparent; background: transparent; padding: .2rem 0; outline: none;
}
.title-input:focus { border-bottom-color: var(--primary); }

.card {
  background: var(--surface); border: 0; border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin-bottom: 1.15rem; box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 1rem; font-size: 1.05rem; font-weight: 500;
  display: flex; align-items: center; gap: .55rem; color: #455a64;
}
.step {
  display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .78rem;
}
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary h2 { margin: 0; }
details summary h2::after { content: "▸"; color: var(--muted); margin-left: auto; transition: transform .15s; }
details[open] summary h2 { margin-bottom: 1rem; }
details[open] summary h2::after { transform: rotate(90deg); }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; font-weight: 500; color: var(--muted); margin-bottom: .8rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; font: inherit; font-size: .93rem; color: var(--text);
  padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.invalid { border-color: var(--err) !important; box-shadow: 0 0 0 3px var(--err-soft) !important; }
.code-input { font-family: var(--mono); font-size: .85rem; }

.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-bottom: .8rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-weight: 400; margin: 0; }
label.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.base-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.base-option {
  flex-direction: row; align-items: center; gap: .7rem; margin: 0; cursor: pointer;
  padding: .65rem; border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 400;
}
.base-option input { position: absolute; opacity: 0; pointer-events: none; }
.base-option .base-icon { width: 36px; height: 36px; background-size: 20px; }
.base-option strong { display: block; font-size: .9rem; }
.base-option small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.base-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.base-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-soft); }

.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-2); margin-bottom: 1rem; }
.segmented label { margin: 0; flex-direction: row; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { padding: .35rem 1rem; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* paquets */
.pkg-selected { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2rem; margin-bottom: .8rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .6rem; border-radius: 99px; font: inherit; font-size: .82rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip.selected { background: var(--primary-soft); border-color: transparent; cursor: default; padding-right: .25rem; }
.chip.selected.warn { background: var(--warn-soft); color: var(--warn); }
.chip.selected button {
  border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1;
  width: 1.3rem; height: 1.3rem; border-radius: 50%; opacity: .6;
}
.chip.selected button:hover { opacity: 1; background: rgba(0, 0, 0, .08); }
.badge { font-size: .66rem; font-weight: 700; text-transform: uppercase; padding: .05rem .35rem; border-radius: 4px; letter-spacing: .03em; }
.badge.unfree { background: var(--warn-soft); color: var(--warn); }

.pkg-search { position: relative; }
.pkg-results {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 360px; overflow: auto; padding: .3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20, 30, 60, .18);
}
.result {
  display: grid; grid-template-columns: 1fr auto; gap: 0 .8rem; width: 100%; text-align: left;
  padding: .5rem .65rem; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.result:hover { background: var(--surface-2); }
.r-main { font-weight: 600; font-size: .9rem; }
.r-main small { color: var(--muted); font-weight: 400; }
.r-desc { grid-column: 1; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-add { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .8rem; color: var(--primary); font-weight: 600; }
.result.on .r-add { color: var(--ok); }
.r-info { padding: .7rem; color: var(--muted); font-size: .88rem; }
.r-info.error { color: var(--err); }

.pkg-groups { display: grid; gap: .7rem; margin-top: 1rem; }
.pkg-group h4 { margin: 0 0 .35rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pkg-group > div { display: flex; flex-wrap: wrap; gap: .3rem; }

/* services */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .55rem; }
.service {
  flex-direction: row; align-items: flex-start; gap: .6rem; margin: 0; cursor: pointer;
  padding: .7rem; border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 400;
}
.service input { margin-top: .2rem; accent-color: var(--primary); }
.service strong { display: block; font-size: .9rem; }
.service small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.service em { display: block; font-style: normal; font-size: .72rem; color: var(--primary); margin-top: .2rem; }
.service.on { border-color: var(--primary); background: var(--primary-soft); }

.errors { background: var(--err-soft); color: var(--err); border-radius: var(--radius); padding: .7rem 1rem; font-size: .88rem; margin-bottom: .65rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.editor-bar {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 40;
  padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom, 0));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .06);
}
.editor-bar-inner {
  max-width: 1400px; margin: 0 auto; width: 100%;
  padding: 0 1.75rem; box-sizing: border-box;
}
@media (max-width: 960px) {
  .editor-bar { left: 0; }
}
.editor-bar-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.editor-bar-actions .btn.primary {
  padding: .75rem 1.2rem; font-size: 1rem; width: 100%;
}

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 1rem; }
.panel-head { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; font-size: .95rem; }
#builds { max-height: 320px; overflow: auto; }
.build { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.build:last-child { border-bottom: 0; }
.build-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.build-error { color: var(--err); font-size: .84rem; margin-top: .4rem; padding: 0 1rem 0 0; }
.build-files, .build-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.build-progress { margin-top: .55rem; }
.build-progress-meta {
  display: flex; justify-content: space-between; gap: .5rem;
  font-size: .78rem; color: var(--muted); margin-bottom: .3rem;
}
.build-progress-meta strong { color: var(--text); font-weight: 600; }

.progress-track {
  height: .45rem; border-radius: 99px; background: var(--surface-2);
  overflow: hidden; border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #7dd3fc));
  transition: width .35s ease;
}
.progress-fill.indeterminate {
  width: 35% !important;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.progress-dialog {
  border: 0; border-radius: var(--radius); padding: 0; max-width: 26rem; width: calc(100% - 2rem);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.progress-dialog::backdrop { background: rgba(10, 15, 26, .55); backdrop-filter: blur(2px); }
.progress-dialog-body { padding: 1.25rem 1.4rem 1.35rem; }
.progress-dialog-body h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.progress-dialog-body .muted { margin: 0 0 .9rem; font-size: .9rem; }
.progress-pct { margin: .55rem 0 0; font-size: .82rem; color: var(--muted); text-align: right; }
.pad { padding: 1rem; }

.preview { position: relative; display: flex; flex-direction: column; min-height: 320px; flex: 1; background: var(--code-bg); border-color: var(--code-bg); }
.tabs { display: flex; overflow-x: auto; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.tab {
  padding: .6rem .9rem; border: 0; background: transparent; color: #8c9ab5; font: 500 .82rem var(--mono);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: #d7e0f0; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.code { margin: 0; padding: 1rem 1.1rem; overflow: auto; flex: 1; color: var(--code-fg); font: .8rem/1.6 var(--mono); tab-size: 2; }
.code code { background: none; padding: 0; font-size: inherit; }
/* Blocs de commande sur fond clair (doc, install) */
.code-light {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  overflow: auto;
  max-height: 8rem;
  border-radius: var(--radius);
  background: #f0f4f8;
  border: 1px solid var(--border);
  color: #1a233a;
  font: .85rem/1.55 var(--mono);
  tab-size: 2;
}
.code-light code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy { position: absolute; top: 2.9rem; right: .8rem; color: #aab6cc; border-color: rgba(255, 255, 255, .15); }
.copy:hover { background: rgba(255, 255, 255, .08); }
.t-c { color: #6c7a96; font-style: italic; }
.t-s { color: #a5d6a7; }
.t-k { color: #c792ea; }
.t-b { color: #f78c6c; }
.t-n { color: #f78c6c; }
.t-a { color: #82aaff; }

/* journal */
.log-dialog {
  width: min(1100px, 94vw); height: min(80vh, 900px); padding: 0; border: 0; border-radius: 14px;
  background: var(--code-bg); color: var(--code-fg); box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}
.log-dialog[open] { display: flex; flex-direction: column; }
.log-dialog::backdrop { background: rgba(10, 15, 26, .6); backdrop-filter: blur(2px); }
.log-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.log-head h3 { margin: 0; font-size: .95rem; }
.log-head .btn { color: #c6d0e2; border-color: rgba(255, 255, 255, .15); }
.log { flex: 1; margin: 0; padding: 1rem; overflow: auto; font: .78rem/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 5.25rem; z-index: 100; transform: translate(-50%, 1rem);
  padding: .7rem 1.1rem; border-radius: 10px; background: #17202e; color: #fff; font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: min(640px, 92vw);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--ok); }
.toast.error { background: var(--err); }

.topbar-user { display: flex; align-items: center; gap: .65rem; margin-left: auto; }
.topbar nav { flex: 1; flex-wrap: wrap; }

/* Software Center / Magasin */
.sw-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 1rem;
}
.sw-card {
  display: flex; gap: .75rem; padding: 1rem;
  border: 0; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.sw-icon { flex: 0 0 auto; line-height: 0; }
.sw-icon img, .sw-icon svg { border-radius: 10px; display: block; }
.sw-body { min-width: 0; }
.sw-body h3 { margin: 0 0 .25rem; font-size: .98rem; }
.sw-meta { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem .55rem; align-items: center; font-size: .8rem; }
.sw-version {
  display: inline-block; padding: .1rem .4rem; border-radius: 6px;
  background: var(--surface-2); font-family: var(--mono); font-size: .75rem;
}
.sw-badge {
  display: inline-block; padding: .1rem .4rem; border-radius: 6px;
  background: color-mix(in srgb, var(--err) 18%, transparent); color: var(--err); font-size: .72rem;
}
.sw-desc { margin: .4rem 0 0; font-size: .84rem; color: var(--muted); line-height: 1.35; }
.sw-status { margin: .45rem 0 0; font-size: .78rem; color: var(--primary); font-weight: 600; }
.sw-icon-cell { width: 2.5rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
.inline-flags { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; margin: 0; }

/* MDM — profils */
.mdm-profiles-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 1rem; margin-bottom: .85rem;
}
.mdm-profiles-meta { margin: 0; font-size: .88rem; }
.mdm-profile-tabs {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem;
}
.mdm-profile-tab {
  display: flex; flex-direction: column; gap: .15rem;
  min-width: 8.5rem; padding: .65rem 1rem;
  border: 0; border-radius: 999px;
  background: var(--surface); color: inherit; text-decoration: none;
  box-shadow: var(--shadow);
  transition: background .15s, color .15s, box-shadow .15s;
}
.mdm-profile-tab:hover { background: var(--surface-2); text-decoration: none; }
.mdm-profile-tab.is-active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(38, 198, 218, .35);
}
.mdm-profile-tab.is-active .mdm-profile-tab-count { color: rgba(255,255,255,.85); }
.mdm-profile-tab-name { font-weight: 600; font-size: .92rem; }
.mdm-profile-tab-count { font-size: .78rem; color: var(--muted); }
.mdm-profile-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .65rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.mdm-inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; flex: 1; min-width: 12rem; }
.mdm-inline-form input[type="text"] { flex: 1; min-width: 10rem; margin: 0; }
.mdm-profile-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mdm-profile-create {
  margin-top: .9rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.mdm-profile-create > summary {
  cursor: pointer; color: var(--muted); font-size: .9rem; user-select: none;
  list-style: none;
}
.mdm-profile-create > summary::-webkit-details-marker { display: none; }
.mdm-profile-create > summary::before { content: "+ "; font-weight: 700; color: var(--primary); }
.mdm-profile-create[open] > summary::before { content: "− "; }
.mdm-profile-create > summary:hover { color: inherit; }
.mdm-create-form {
  display: grid; gap: .75rem; margin-top: .85rem;
  grid-template-columns: 1fr auto; align-items: end;
}
.mdm-create-form .check {
  grid-column: 1 / -1; display: flex; align-items: center; gap: .45rem; margin: 0;
  font-size: .88rem; color: var(--muted);
}
.mdm-create-form label:not(.check) { margin: 0; }
.mdm-create-form button { justify-self: start; }

@media (max-width: 960px) {
  .mp-sidebar { transform: translateX(-105%); }
  .mp-sidebar-open .mp-sidebar { transform: translateX(0); }
  .mp-shell { margin-left: 0; }
  .mp-menu-btn { display: inline-flex; }
  .mp-body.mp-sidebar-open::before {
    content: ""; position: fixed; inset: 0; z-index: 35;
    background: rgba(26, 35, 58, .45);
  }
  .mp-username { display: none; }
}

@media (max-width: 720px) {
  .mp-main { padding: 1rem; }
  .editor { padding-bottom: 7rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .vm-row { grid-template-columns: 1fr; }
  .vm-status { align-items: flex-start; }
  .vm-status small { text-align: left; max-width: none; }
  .vm-actions { flex-wrap: wrap; justify-content: flex-start; }
  .editor-bar-actions .btn.primary { width: 100%; margin-right: 0; }
  .mdm-create-form { grid-template-columns: 1fr; }
  .mdm-profile-toolbar { flex-direction: column; align-items: stretch; }
  .mdm-inline-form { width: 100%; }
}
