:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f0f2f7;
    --border: #e3e6ee;
    --text: #1d2233;
    --muted: #6b7286;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef0ff;
    --waiting: #d97706;
    --waiting-soft: #fff4e0;
    --answered: #059669;
    --answered-soft: #e3f8ef;
    --closed: #6b7286;
    --closed-soft: #eef0f4;
    --agent: #7c3aed;
    --agent-soft: #f5f0ff;
    --danger: #dc2626;
    --unread: #2563eb;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 2px 8px rgba(20, 24, 40, .04);
    --shadow-lg: 0 10px 30px rgba(20, 24, 40, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- Barre du haut ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.3rem; }
.brand-mark.big { font-size: 2.6rem; display: block; }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; white-space: nowrap; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav a.active { color: var(--primary); background: var(--primary-soft); }
.tag-admin { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); color: var(--muted); padding: 1px 5px; border-radius: 4px; }
.pill-count { background: var(--unread); color: #fff; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-panel { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; display: flex; flex-direction: column; }
.usermenu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.usermenu-head small { color: var(--muted); }
.usermenu-panel a { padding: 8px 10px; border-radius: 8px; color: var(--text); }
.usermenu-panel a:hover { background: var(--surface-2); text-decoration: none; }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; vertical-align: middle; }
.avatar.small { width: 28px; height: 28px; font-size: .72rem; }
.avatar.agent { background: var(--agent-soft); font-size: .95rem; object-fit: cover; }

/* ---------- Mise en page ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 16px 80px; }
.narrow { max-width: 560px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.lead { margin: 6px 0 0; }
.back { display: inline-block; color: var(--muted); margin-bottom: 12px; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--surface-2); color: var(--text); white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--answered); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.link-danger { background: none; border: 0; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; padding: 0; }
.link-danger:hover { color: var(--danger); text-decoration: underline; }

/* ---------- Messages flash ---------- */
.flash { padding: 12px 40px 12px 16px; border-radius: 10px; margin-bottom: 16px; position: relative; border: 1px solid; }
.flash-success { background: var(--answered-soft); border-color: #b5ebd3; color: #065f46; }
.flash-error { background: #fdecec; border-color: #f6c4c4; color: #991b1b; }
.flash-close { position: absolute; right: 10px; top: 8px; background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- Onglets, recherche ---------- */
.tabs-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs-row .tabs { margin-bottom: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); font-weight: 500; font-size: .9rem; }
.tab:hover { text-decoration: none; color: var(--text); border-color: #cfd3df; }
.tab.active { background: var(--text); border-color: var(--text); color: #fff; }
.tab .count { font-size: .78rem; background: var(--surface-2); color: var(--muted); padding: 0 7px; border-radius: 999px; }
.tab.active .count { background: rgba(255,255,255,.18); color: #fff; }
.tab-unread { color: var(--unread); border-color: #c7d7fb; background: #f2f6ff; }
.swatch { width: 8px; height: 8px; border-radius: 50%; }
.swatch-waiting { background: var(--waiting); }
.swatch-answered { background: var(--answered); }
.swatch-closed { background: var(--closed); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.segmented a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-size: .88rem; font-weight: 500; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search input { width: 320px; max-width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7286' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3 3'/%3E%3C/svg%3E") no-repeat 12px center; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Liste des demandes ---------- */
.topic-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.topic-list li + li { border-top: 1px solid var(--border); }
.topic-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; color: var(--text); transition: background .12s; }
.topic-row:hover { background: #fafbfd; text-decoration: none; }
.topic-row.is-unread { background: #f7f9ff; }
.topic-row.is-unread .topic-title { font-weight: 700; }
.topic-row.is-closed .topic-title { color: var(--muted); }
.topic-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.topic-title { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .84rem; flex-wrap: wrap; }
.topic-side { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.chip { background: var(--surface-2); color: var(--text); padding: 1px 9px; border-radius: 6px; font-size: .82rem; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--unread); display: inline-block; flex-shrink: 0; box-shadow: 0 0 0 3px #dbe6fe; }

/* ---------- Statuts ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-waiting { color: var(--waiting); background: var(--waiting-soft); }
.status-answered { color: var(--answered); background: var(--answered-soft); }
.status-closed { color: var(--closed); background: var(--closed-soft); }
.status-thinking { color: var(--agent); background: var(--agent-soft); }
.status-escalated { color: #be185d; background: #fde7f1; }
.status-thinking::before { display: none; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- États vides ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty.small { padding: 28px; }
.empty-icon { font-size: 2.6rem; margin-bottom: 8px; }
.empty h2 { font-size: 1.3rem; margin-bottom: 6px; }
.empty p { margin: 0 0 20px; }
.empty.small p { margin: 0; }

/* ---------- Formulaires ---------- */
.form-card { max-width: 820px; }
.field { margin-bottom: 18px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.field > label.required::after, .field legend.required::after { content: " *"; color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=password], .field input[type=search], .field textarea, .field select,
.login-card input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: var(--surface); color: var(--text);
}
.field input:focus, .field textarea:focus, .login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-help { display: block; color: var(--muted); font-size: .84rem; margin: -2px 0 8px; }
.field .field-help:last-child { margin: 6px 0 0; }
.field-errors { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: .87rem; }
.has-error input, .has-error .tox-tinymce { border-color: var(--danger) !important; }
.field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.field-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.input-with-btn { display: flex; gap: 8px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--border); border-radius: 11px; padding: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice-card:hover { border-color: #c9cde0; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card input { margin-top: 4px; accent-color: var(--primary); }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-body small { color: var(--muted); }
.tox-tinymce { border-radius: 9px !important; border-color: var(--border) !important; }

/* ---------- Fiche d'une demande ---------- */
.topic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.topic-head-main { min-width: 0; flex: 1 1 420px; }
.topic-head-status { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.topic-head h1 { margin-bottom: 10px; overflow-wrap: anywhere; }
.topic-facts { display: flex; gap: 20px; flex-wrap: wrap; font-size: .92rem; }
.topic-facts .label { color: var(--muted); margin-right: 4px; }
.url { overflow-wrap: anywhere; }
.topic-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fffbeb; border: 1px dashed #f3c969; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: .9rem; flex-wrap: wrap; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fbfbfd; font-size: .92rem; flex-wrap: wrap; }
.msg-head .when { color: var(--muted); font-size: .84rem; }
.msg-tool { margin-left: auto; }
.msg-body { padding: 16px 18px; overflow-wrap: anywhere; }
.msg-agent { border-color: #e2d6fb; }
.msg-agent .msg-head { background: var(--agent-soft); border-bottom-color: #e9e0fc; }
.msg-staff { border-left: 3px solid var(--answered); }
.msg-ghost { border-style: dashed; box-shadow: none; }
.msg-ghost .msg-body { color: var(--agent); display: flex; align-items: center; gap: 10px; }
.badge { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.badge-agent { background: #ede4ff; color: var(--agent); }
.badge-admin { background: var(--answered-soft); color: var(--answered); }
.badge-off { background: #fdecec; color: var(--danger); }

.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.rich pre { background: #1f2333; color: #e8eaf2; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .87rem; }
.rich code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.rich pre code { background: none; padding: 0; }
.rich blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--border); color: var(--muted); }
.rich table { border-collapse: collapse; }
.rich td, .rich th { border: 1px solid var(--border); padding: 5px 9px; }

.resolve-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--answered-soft); border: 1px solid #b5ebd3; border-radius: var(--radius); padding: 16px 18px; margin-top: 18px; flex-wrap: wrap; }
.resolve-callout > div:first-child { display: flex; flex-direction: column; }
.resolve-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.closed-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 18px; border-radius: var(--radius); background: var(--closed-soft); color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.reply-card { margin-top: 18px; padding: 18px; scroll-margin-top: 80px; }
.reply-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }

.lightbox { position: fixed; inset: 0; background: rgba(15, 18, 30, .85); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Rubriques ---------- */
.form-note { margin: 4px 0 8px; padding: 10px 14px; background: var(--surface-2); border-radius: 9px; color: var(--muted); font-size: .9rem; }
.rubrique-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 6px; color: var(--rub); background: color-mix(in srgb, var(--rub) 10%, white); white-space: nowrap; }
.rubrique-link:hover { text-decoration: none; filter: brightness(.95); }
.page-head .rubrique-chip { margin-bottom: 6px; }
.rubrique-title { display: flex; align-items: center; gap: 10px; }
.page-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rubrique-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rubrique-filter a { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .88rem; font-weight: 500; }
.rubrique-filter a:hover { text-decoration: none; color: var(--text); }
.rubrique-filter a.active { border-color: var(--rub, var(--text)); color: var(--rub, var(--text)); background: color-mix(in srgb, var(--rub, #1d2233) 8%, white); }
.rubrique-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rubrique-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--rub); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.rubrique-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.rubrique-card-main, .rubrique-pick { display: flex; flex-direction: column; gap: 6px; padding: 20px; color: var(--text); flex: 1; }
.rubrique-card-main:hover, .rubrique-pick:hover { text-decoration: none; }
.rubrique-pick:hover { transform: translateY(-2px); }
.rubrique-card h2 { margin: 4px 0 0; font-size: 1.15rem; }
.rubrique-card p { margin: 0; font-size: .92rem; }
.rubrique-icon { font-size: 1.8rem; }
.rubrique-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rubrique-card-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: #fbfbfd; }
.rubrique-go { margin-top: 10px; color: var(--rub); font-weight: 600; }
.unread-mini { display: inline-flex; align-items: center; gap: 6px; color: var(--unread); font-size: .85rem; font-weight: 600; }

/* ---------- Mes sujets : rangés par qui doit agir ---------- */
.who-grid { display: flex; flex-direction: column; gap: 22px; margin-bottom: 22px; }
.who-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.who-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.02rem; }
.who-head p { margin: 0; }
.who-head .count { font-size: .78rem; background: var(--surface-2); color: var(--muted); padding: 0 8px; border-radius: 999px; font-weight: 600; }
.who-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--who); }
.who { --who: var(--closed); }
.who-user { --who: var(--unread); }
.who-agent { --who: var(--agent); }
.who-admin { --who: #db2777; }
.who-user .topic-list { border-left: 3px solid var(--who); }
.who-empty { margin: 0; padding: 12px 16px; border: 1px dashed var(--border); border-radius: var(--radius); }
.who-closed .topic-list { opacity: .85; }
.see-more { display: inline-block; margin-top: 10px; font-size: .9rem; }

/* ---------- Listes d'UUID ---------- */
.mono, .mono input, input.mono { font-family: ui-monospace, "SF Mono", "Ubuntu Mono", Menlo, monospace; }
.uuid-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.uuid-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.uuid-row .field-errors { grid-column: 1 / -1; margin: 0; }
.uuid-row.has-error input { border-color: var(--danger); }
.uuid-remove { width: 36px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1rem; }
.uuid-remove:hover { color: var(--danger); border-color: #f6c4c4; background: #fdecec; }
.uuid-card { padding: 14px 18px; margin-bottom: 14px; }
.uuid-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.uuid-card-head .count { font-size: .78rem; background: var(--surface-2); color: var(--muted); padding: 0 8px; border-radius: 999px; margin-left: 4px; }
.uuid-values { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.uuid-values li { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 3px 4px 3px 10px; }
.uuid-values code { background: none; font-size: .88rem; }
.uuid-copy { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.uuid-copy:hover { background: var(--surface); color: var(--primary); }

/* ---------- Demande Hotfix ---------- */
.choice-cards-3 { grid-template-columns: repeat(3, 1fr); }
.choice-card.bug-critique:has(input:checked) { border-color: #dc2626; background: #fef2f2; }
.choice-card.bug-important:has(input:checked) { border-color: #ea580c; background: #fff7ed; }
.choice-card.bug-mineur:has(input:checked) { border-color: #ca8a04; background: #fefce8; }
.bug-chip.bug-critique { background: #fee2e2; color: #b91c1c; }
.bug-chip.bug-important { background: #ffedd5; color: #c2410c; }
.bug-chip.bug-mineur { background: #fef9c3; color: #a16207; }
.form-note code { background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.status-hotfix::before { display: none; }
.status-hotfix { background: #eef2ff; color: #3730a3; }
.status-hotfix.hf-cree { background: var(--closed-soft); color: var(--muted); }
.status-hotfix.hf-definition { background: #f3e8ff; color: #7e22ce; }
.status-hotfix.hf-dev { background: #dbeafe; color: #1d4ed8; }
.status-hotfix.hf-test { background: #fef3c7; color: #b45309; }
.status-hotfix.hf-pret { background: #dcfce7; color: #15803d; }
.status-hotfix.hf-livre { background: #d1fae5; color: #047857; }
.hotfix-card { padding: 18px 20px; margin-bottom: 14px; }
.hf-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.hf-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; color: var(--muted); font-size: .82rem; }
.hf-steps li::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.hf-steps li:first-child::before { display: none; }
.hf-steps li.done::before, .hf-steps li.current::before { background: var(--answered); }
.hf-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 2px solid var(--border); z-index: 1; font-size: 1rem; filter: grayscale(1); opacity: .6; }
.hf-steps li.done .hf-dot { border-color: var(--answered); filter: none; opacity: 1; }
.hf-steps li.current .hf-dot { border-color: var(--primary); background: var(--primary-soft); filter: none; opacity: 1; box-shadow: 0 0 0 4px var(--primary-soft); }
.hf-steps li.current { color: var(--text); font-weight: 700; }
.hf-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.hf-ticket { font-weight: 600; }
.hf-workflow { background: #dbeafe; color: #1e40af; border-radius: 999px; padding: 1px 10px; font-size: .82rem; font-weight: 600; }
.hf-error { margin: 10px 0 0; color: var(--danger); font-size: .88rem; }
.badge-gitlab { background: #fff1e6; color: #c2410c; }
.avatar.gitlab { background: #fff1e6; }
.msg-gitlab { border-color: #fed7aa; }
.msg-gitlab .msg-head { background: #fff7ed; border-bottom-color: #fde4c8; }
.msg-event { list-style: none; display: flex; justify-content: center; align-items: baseline; gap: 10px; color: var(--muted); font-size: .88rem; }
.msg-event .rich p { margin: 0; }
.msg-event .when { font-size: .8rem; }
.hf-group { margin-bottom: 18px; }
@media (max-width: 680px) {
    .choice-cards-3 { grid-template-columns: 1fr; }
    .hf-label { display: none; }
    .hf-steps li.current .hf-label { display: block; position: absolute; top: 42px; white-space: nowrap; }
    .hf-steps { margin-bottom: 30px; }
}

/* ---------- Remontée à un admin ---------- */
.escalated-chip { color: #be185d; font-size: .84rem; font-weight: 500; }
.pill-escalated { background: #db2777; }
.escalated-banner { display: flex; gap: 12px; align-items: flex-start; background: #fdf2f8; border: 1px solid #f9c6dd; color: #831843; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.escalated-banner div { display: flex; flex-direction: column; }
.escalated-icon { font-size: 1.3rem; line-height: 1.2; }
.btn-escalate { background: #fff; border-color: #f3b4d1; color: #be185d; }
.btn-escalate:hover { background: #fdf2f8; }
.resolve-callout { flex-wrap: wrap; }
.escalate-hint { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-inactive td { opacity: .55; }
.admin-grid .card:first-child { padding: 16px; overflow-x: auto; }

/* ---------- Connexion ---------- */
.page-login { background: linear-gradient(160deg, #eef0ff 0%, #f5f6fa 55%); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; }
.login-card .field span { display: block; font-weight: 600; margin-bottom: 6px; }
.login-card label.field { display: block; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 1.5rem; margin-top: 6px; font-weight: 500; }
.login-brand p { margin: 4px 0 0; }

/* ---------- Petits écrans ---------- */
@media (max-width: 860px) {
    .topbar-inner { gap: 12px; }
    .btn-new { padding: 8px 12px; }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 16px; }
    .mainnav { order: 3; flex-basis: 100%; }
    .topbar-right { margin-left: auto; }
    .grid-2, .choice-cards { grid-template-columns: 1fr; }
    .topic-row { grid-template-columns: 1fr; gap: 6px; }
    .topic-side { font-size: .8rem; }
    .search, .search input { width: 100%; }
    .page-head { align-items: stretch; flex-direction: column; }
    .container { padding-top: 18px; }
}
