/* === ticketing/assets/style.css === Espace client DREAMCODE — thème clair aux couleurs de la marque. */
:root {
    --g: #1DBF73;
    --b: #0077FF;
    --grad: linear-gradient(135deg, var(--g), var(--b));
    --ink: #111827;
    --txt: #374151;
    --mut: #6B7280;
    --line: #E5E7EB;
    --bg: #F4F6F9;
    --card: #FFFFFF;
    --soft: #F8FAFC;
    --danger: #DC2626;
    --warn: #D97706;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--txt);
    background: var(--bg);
}
a { color: var(--b); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; color: var(--ink); letter-spacing: -.02em; }
h2 { font-size: 1.02rem; color: var(--ink); display: flex; align-items: center; gap: 7px; }
small { font-size: .82em; }
.muted { color: var(--mut); }
.ic { flex: none; vertical-align: -3px; }
code, pre, .ref { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ---------- Barre supérieure ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 28px;
    height: 62px; padding: 0 24px;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--g), var(--b)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { color: var(--g); letter-spacing: .06em; font-size: .95rem; }
.brand small { color: var(--mut); font-size: .74rem; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { padding: 8px 13px; border-radius: 8px; color: var(--txt); font-weight: 600; font-size: .92rem; }
.mainnav a:hover { background: var(--bg); text-decoration: none; }
.mainnav a.active { color: var(--b); background: rgba(0, 119, 255, .08); }
.topright { display: flex; align-items: center; gap: 12px; }
.userchip { display: flex; align-items: center; gap: 9px; color: var(--ink); padding: 4px 8px; border-radius: 10px; }
.userchip:hover { background: var(--bg); text-decoration: none; }
.uname { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: .88rem; }
.uname small { color: var(--mut); font-weight: 400; }

/* ---------- Mise en page ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 26px 24px 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-block; font-size: .86rem; color: var(--mut); margin-bottom: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.narrow { max-width: 520px; margin: 60px auto; display: grid; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: grid; gap: 14px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.stack.tight { gap: 8px; margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Boutons & champs ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: .9rem;
    cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; background: var(--soft); }
.btn.primary { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 6px 16px rgba(0, 119, 255, .22); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(0, 119, 255, .28); }
.btn.state { color: #fff; border-color: transparent; background: var(--c); }
.btn.state:hover { filter: brightness(.94); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--txt); font-weight: 600; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger, .linkbtn.danger { color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: .84rem; }
.btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--mut); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: .86rem; color: var(--b); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linkbtn:hover { text-decoration: underline; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #D5DAE1; border-radius: 9px;
    background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 30px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--b); box-shadow: 0 0 0 3px rgba(0, 119, 255, .14); }
.field { display: grid; gap: 6px; font-weight: 600; color: var(--ink); font-size: .9rem; }
.field + .field { margin-top: 16px; }
.field small { font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--txt); cursor: pointer; }
label.inline select { width: auto; padding-top: 6px; padding-bottom: 6px; }
input[type=checkbox], input[type=radio] { accent-color: var(--b); }
.unit { position: relative; display: block; }
.unit input { padding-right: 28px; }
.unit i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--mut); font-size: .85rem; }

/* ---------- Messages ---------- */
.flash { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; border: 1px solid; }
.flash.success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.flash.error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.flash.warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.flash.invite input { margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff;
    font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.hint { margin-top: 12px; font-size: .84rem; color: var(--mut); }
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 1px dashed #CBD5E1; border-radius: var(--radius); display: grid; gap: 10px; justify-items: center; }

/* ---------- Pastilles : état, priorité, type, étiquettes ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
    color: color-mix(in srgb, var(--c) 82%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 28%, #fff); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill-sm { font-size: .74rem; padding: 1px 8px 1px 6px; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; color: color-mix(in srgb, var(--c) 80%, #000); white-space: nowrap; }
.prio i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.prio-urgent { padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 12%, #fff); }
.type { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--c); white-space: nowrap; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: .74rem; font-weight: 700; color: #fff; background: var(--c); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips.big { margin: 8px 0 10px; }
.chips.big .chip { font-size: .8rem; padding: 3px 10px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--mut)); flex: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: #E2E8F0; color: #334155; font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.avatar.staff { background: var(--grad); color: #fff; }
.client-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #EEF2F7; color: #475569; font-size: .75rem; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref { font-size: .8rem; color: var(--mut); font-weight: 600; white-space: nowrap; }
h1 .ref { font-size: .95rem; margin-left: 6px; padding: 2px 8px; background: #EEF2F7; border-radius: 6px; vertical-align: middle; }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; color: var(--mut); white-space: nowrap; }
.meta.late { color: var(--danger); font-weight: 700; }
.meta.ok { color: #16A34A; font-weight: 700; }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters select { width: auto; max-width: 190px; padding: 7px 30px 7px 11px; font-size: .86rem; border-radius: 999px; }
.filters .search { position: relative; flex: 1 1 260px; max-width: 380px; color: var(--mut); }
.filters .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.filters .search input { padding: 8px 12px 8px 36px; border-radius: 999px; }
.seg { display: inline-flex; padding: 3px; background: #E9EDF2; border-radius: 999px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 0; background: none; font: inherit; font-size: .86rem; font-weight: 700; color: var(--mut); cursor: pointer; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.sm a, .seg.sm button { padding: 4px 11px; font-size: .8rem; }
.statusbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--txt); font-size: .85rem; font-weight: 600; }
.stab:hover { text-decoration: none; border-color: var(--c, #9CA3AF); }
.stab b { color: var(--ink); }
.stab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.stab.on b { color: #fff; }

/* ---------- Tableau kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(222px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x proximity; }
.col { background: #EAEEF3; border-radius: var(--radius); border-top: 3px solid var(--c); display: flex; flex-direction: column; max-height: calc(100vh - 320px); min-height: 180px; scroll-snap-align: start; }
.col > header { display: flex; align-items: center; gap: 8px; padding: 11px 13px 8px; }
.col h2 { font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; flex: 1; }
.col .count { min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; background: #fff; color: var(--ink); font-size: .78rem; font-weight: 800; }
.col-body { padding: 4px 8px 10px; display: grid; gap: 8px; overflow-y: auto; flex: 1; align-content: start; }
.col.drop { background: color-mix(in srgb, var(--c) 10%, #EAEEF3); }
/* Glisser-déposer : grand cadre « + » en haut et en bas de colonne ; entre deux cartes, l'emplacement
   reste invisible et s'ouvre en douceur (les cartes s'écartent) quand on s'en approche. */
.board.is-dragging .col-body { gap: 0; }
.board.is-dragging .col-empty { display: none; }
.board.is-dragging .tcard:not(.dragging) { pointer-events: none; }
.drop-slot { display: flex; align-items: center; justify-content: center; box-sizing: border-box; height: 8px; margin: 0; overflow: hidden; pointer-events: none;
    border: 2px dashed transparent; border-radius: 10px; background: transparent; opacity: 0;
    transition: height .18s ease, margin .18s ease, opacity .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.drop-slot i { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--c); transition: background .15s ease; }
.drop-slot i::before, .drop-slot i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; border-radius: 1px; background: var(--c); }
.drop-slot i::after { transform: rotate(90deg); }
.drop-slot.edge, .drop-slot.active { height: 46px; margin: 4px 0; opacity: 1; border-color: color-mix(in srgb, var(--c) 50%, #fff); background: color-mix(in srgb, var(--c) 6%, #fff); }
.drop-slot.edge { animation: slotIn .18s ease; }
.drop-slot.edge.top { margin-top: 0; }
.drop-slot.edge.bottom { margin-bottom: 0; }
.drop-slot.active { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 15%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.drop-slot.active i { background: var(--c); border-color: var(--c); }
.drop-slot.active i::before, .drop-slot.active i::after { background: #fff; }
.drop-slot.noop { height: 8px; margin: 0; opacity: 0; border-color: transparent; background: transparent; animation: none; }
@keyframes slotIn { from { height: 8px; opacity: 0; } }
.col-empty { text-align: center; color: #94A3B8; font-size: .82rem; padding: 18px 0; }
.col-note { padding: 6px 13px 9px; font-size: .76rem; color: var(--mut); }
.tcard { display: grid; gap: 7px; padding: 11px 12px; background: #fff; border-radius: 10px; border-left: 4px solid var(--p); color: var(--txt);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1); cursor: grab; transition: box-shadow .15s, transform .15s; }
.tcard:hover { text-decoration: none; box-shadow: 0 6px 16px rgba(16, 24, 40, .14); transform: translateY(-1px); }
.tcard.dragging { opacity: .35; box-shadow: none; border-style: dashed; }
.tcard-title { color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.35; overflow-wrap: anywhere; }
.tcard.unread .tcard-title { font-weight: 800; }
.tcard.unread .tcard-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--b); margin-right: 6px; vertical-align: 1px; }
.tcard-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; }
.tcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tcard-foot:has(.metas:empty):has(.who:empty) { display: none; }
.metas { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.who { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.who .avatar { width: 24px; height: 24px; font-size: .62rem; }

/* ---------- Liste ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.tlist { width: 100%; border-collapse: collapse; }
.tlist th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--soft); }
.tlist th:first-child { border-top-left-radius: var(--radius); }
.tlist th:last-child { border-top-right-radius: var(--radius); }
.tlist td { padding: 12px 14px; border-bottom: 1px solid #F0F2F5; vertical-align: middle; }
.tlist tr:last-child td { border-bottom: 0; }
.tlist tbody tr[data-href] { cursor: pointer; }
.tlist tbody tr:hover { background: #FAFBFD; }
.tlist .main { min-width: 300px; }
.ttitle { color: var(--ink); font-weight: 600; }
tr.unread .ttitle { font-weight: 800; }
tr.unread .ttitle::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--b); margin-right: 7px; vertical-align: 1px; }
.tsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.tlist .when { white-space: nowrap; color: var(--mut); font-size: .85rem; }
.tlist .aname { font-size: .86rem; }
.tlist .num { text-align: center; }
.tlist th.num { font-size: .68rem; }
.tlist th.num .dot { margin-right: 4px; width: 7px; height: 7px; }
.tlist tr.inactive { opacity: .55; }
.cnt { display: inline-block; min-width: 26px; padding: 1px 7px; border-radius: 999px; font-weight: 800; font-size: .82rem;
    color: color-mix(in srgb, var(--c) 82%, #000); background: color-mix(in srgb, var(--c) 13%, #fff); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------- Fiche ticket ---------- */
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; max-width: 1240px; margin: 0 auto; }
.ticket-main { display: grid; gap: 18px; min-width: 0; }
.ticket-main > .back { margin-bottom: -10px; justify-self: start; }
.ticket-side { display: grid; gap: 14px; position: sticky; top: 80px; }
.ticket-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.ticket-head h1 { overflow-wrap: anywhere; }
.ticket-head .muted { margin: 6px 0 14px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.prose { overflow-wrap: anywhere; color: var(--ink); line-height: 1.65; }
.prose pre { background: #0F172A; color: #E2E8F0; padding: 12px 14px; border-radius: 9px; overflow-x: auto; font-size: .84rem; margin: 8px 0; white-space: pre; }
.prose code { background: #EEF2F7; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.edit-mode { display: grid; }
.chk-count { font-size: .8rem; font-weight: 800; color: var(--mut); background: var(--bg); padding: 2px 9px; border-radius: 999px; }

.progress { height: 7px; background: #E9EDF2; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s; }
.progress.full i { background: #16A34A; }
.checklist { list-style: none; margin: 0 0 10px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 6px; border-radius: 8px; }
.checklist li:hover { background: var(--soft); }
.checklist label { display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer; padding: 5px 0; min-width: 0; }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box { width: 19px; height: 19px; flex: none; margin-top: 1px; border: 2px solid #CBD5E1; border-radius: 6px; background: #fff; transition: all .15s; display: grid; place-items: center; }
.checklist input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(0, 119, 255, .25); }
.checklist input:checked + .box { background: var(--g); border-color: var(--g); }
.checklist input:checked + .box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist .txt { color: var(--ink); overflow-wrap: anywhere; }
.checklist li.done .txt { color: #94A3B8; text-decoration: line-through; }
.checklist .by { color: #94A3B8; white-space: nowrap; }
.checklist form .icon-btn { opacity: 0; width: 26px; height: 26px; }
.checklist li:hover form .icon-btn, .checklist form .icon-btn:focus { opacity: 1; }
.inline-add { display: flex; gap: 8px; }
.inline-add.wrap { flex-wrap: wrap; margin-top: 12px; }
.inline-add input { flex: 1; min-width: 150px; }

.dropzone { display: block; border: 1.5px dashed #CBD5E1; border-radius: 10px; padding: 18px; text-align: center; color: var(--mut); font-weight: 500; font-size: .9rem; cursor: pointer; transition: all .15s; background: var(--soft); }
.dropzone:hover, .dropzone.over { border-color: var(--b); background: rgba(0, 119, 255, .05); color: var(--b); }
.dropzone.small { padding: 10px; font-size: .86rem; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filelist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.filelist:empty { display: none; }
.filelist li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .8rem; color: var(--ink); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 12px; }
.files.compact { margin: 10px 0 0; }
.file { display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.file.internal { border-color: #FCD34D; background: #FFFBEB; }
.thumb { width: 52px; height: 52px; flex: none; border-radius: 7px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.doc span { font-size: .66rem; font-weight: 800; color: #475569; letter-spacing: .03em; }
.thumb.doc:hover { text-decoration: none; background: #E2E8F0; }
.file-info { min-width: 0; flex: 1; display: grid; }
.file-info a { color: var(--ink); font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fil d'activité */
.activity .card-head { margin-bottom: 14px; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; position: relative; display: grid; gap: 12px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: #E2E8F0; }
.timeline li { position: relative; display: flex; gap: 12px; align-items: flex-start; }
.timeline .avatar { z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.bubble { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 11px 15px; box-shadow: var(--shadow); }
.tl-comment.staff .bubble { border-left: 3px solid var(--g); }
.tl-comment.internal .bubble { background: #FFFBEB; border-color: #FCD34D; border-left: 3px solid var(--warn); }
.bubble-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px; font-size: .88rem; color: var(--ink); }
.bubble-head time { color: var(--mut); font-size: .8rem; margin-left: auto; }
.bubble-head form { margin: -4px -6px -4px 0; }
.bubble-head .icon-btn { width: 26px; height: 26px; opacity: .4; }
.bubble-head .icon-btn:hover { opacity: 1; color: var(--danger); }
.tag-staff { font-size: .66rem; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--grad); padding: 1px 7px; border-radius: 5px; }
.tag-internal { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; color: #92400E; background: #FEF3C7; padding: 1px 7px; border-radius: 5px; }
.tl-event { font-size: .86rem; color: var(--mut); align-items: center !important; min-height: 22px; }
.tl-dot { width: 10px; height: 10px; margin: 0 9px; border-radius: 50%; background: #fff; border: 2px solid #94A3B8; z-index: 1; flex: none; box-shadow: 0 0 0 4px var(--bg); }
.tl-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tl-text b { color: var(--ink); font-weight: 600; }
.tl-text .pill, .tl-text .prio, .tl-text .type { vertical-align: middle; }
.tl-event time { font-size: .78rem; white-space: nowrap; }
.tl-event details.old { margin-top: 4px; }
.tl-event details.old summary { cursor: pointer; color: var(--b); font-size: .8rem; }
.tl-event details.old div { margin-top: 6px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--txt); }
.activity[data-filter=comments] .tl-event, .activity[data-filter=events] .tl-comment { display: none; }
.composer { display: grid; gap: 10px; }
.composer textarea { border-color: transparent; background: var(--soft); }
.composer textarea:focus { background: #fff; }
.composer.is-internal { background: #FFFBEB; border-color: #FCD34D; }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.composer-foot .btn { margin-left: auto; }
.internal-toggle { color: #92400E !important; font-weight: 600; }

/* Colonne latérale */
.side-label { display: flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 6px; }
.side-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.statebox { border-top: 4px solid var(--c); }
.status-select { font-weight: 800; color: color-mix(in srgb, var(--c) 82%, #000); background-color: color-mix(in srgb, var(--c) 11%, #fff); border-color: color-mix(in srgb, var(--c) 35%, #fff); }
.state-help { font-size: .82rem; color: var(--mut); margin: 8px 0 0; }
.next { display: grid; gap: 6px; margin-top: 12px; }
.props { display: grid; gap: 12px; }
.prop .side-label { margin-bottom: 4px; }
.prop select, .prop input { padding: 7px 11px; font-size: .9rem; }
.prop-val { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; font-size: .9rem; }
details > summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--b); list-style: none; display: inline-flex; align-items: center; gap: 5px; }
details > summary::-webkit-details-marker { display: none; }
.labelbox[open] > summary { margin-bottom: 10px; }
.labelpick { display: flex; flex-wrap: wrap; gap: 6px; }
.chipcheck { cursor: pointer; }
.chipcheck input { position: absolute; opacity: 0; pointer-events: none; }
.chipcheck span { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .8rem; font-weight: 700; border: 1.5px solid var(--c); color: var(--c); background: #fff; transition: all .12s; }
.chipcheck input:checked + span { background: var(--c); color: #fff; }
.chipcheck input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 119, 255, .25); }
.label-new { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches i { display: block; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--ink); }
.internal-card { background: #FFFDF5; border-color: #FDE68A; }
.bigval { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.bigval small { font-size: .78rem; font-weight: 500; }
.timelog { list-style: none; margin: 0 0 8px; padding: 0; font-size: .82rem; display: grid; gap: 5px; }
.timelog b { color: var(--ink); }
.infos dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: .84rem; }
.infos dt { color: var(--mut); }
.infos dd { margin: 0; text-align: right; color: var(--ink); }

/* ---------- Nouveau ticket ---------- */
.newform { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; max-width: 1160px; }
.newform .side { display: grid; gap: 0; position: sticky; top: 80px; }
.newform .side .btn { margin-top: 14px; }
.newform .side .btn.ghost { margin-top: 4px; }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: grid; gap: 2px; height: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 11px; color: var(--c); transition: all .12s; }
.choice b { color: var(--ink); }
.choice small { color: var(--mut); font-weight: 400; line-height: 1.3; }
.choice:hover > span { border-color: var(--c); }
.choice input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, #fff); }
.choice input:focus-visible + span { outline: 2px solid var(--b); outline-offset: 2px; }

/* ---------- Listes d'administration ---------- */
.rows { list-style: none; margin: 12px 0 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #F0F2F5; }
.rows li:first-child { border-top: 0; }
.rows li.inactive > .avatar, .rows li.inactive > .grow { opacity: .45; }
.rows .grow b { color: var(--ink); }
.rows .grow small { display: block; color: var(--mut); overflow: hidden; text-overflow: ellipsis; }
.rows.labels details[open] { padding-bottom: 6px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 18px; }
.inline-form h2 { width: 100%; }
.inline-form .field { margin-top: 0; }

/* ---------- Connexion ---------- */
body.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px;
    background: radial-gradient(circle at 12% 10%, rgba(29, 191, 115, .16), transparent 38%), radial-gradient(circle at 88% 90%, rgba(0, 119, 255, .14), transparent 40%), var(--bg); }
.auth-card { width: min(100%, 400px); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px 28px; box-shadow: 0 20px 50px rgba(16, 24, 40, .1); position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--g), var(--b)); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; color: var(--g); margin-bottom: 22px; }
.auth-brand:hover { text-decoration: none; }
.auth-brand img { height: 36px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card > .muted { margin: 4px 0 22px; }
.auth-card label { display: grid; gap: 6px; font-weight: 600; color: var(--ink); font-size: .9rem; }
.auth-card .btn.block { padding: 11px; margin-top: 4px; }
.auth-links { text-align: center; margin-top: 16px; font-size: .88rem; }
.auth-back { font-size: .86rem; }
.auth-back a { color: var(--mut); }

/* ---------- Adaptatif ---------- */
@media (max-width: 1000px) {
    .ticket, .newform, .grid2 { grid-template-columns: minmax(0, 1fr); }
    .ticket-side, .newform .side { position: static; }
    .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .topbar { height: auto; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px 8px; }
    .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
    .topright { margin-left: auto; gap: 6px; }
    .uname, .topright .btn span { display: none; }
    .topright .btn { padding: 8px 10px; }
    .page { padding: 18px 14px 60px; }
    .board { grid-auto-columns: 82vw; }
    .col { max-height: none; }
    .filters select { flex: 1 1 44%; max-width: none; }
    .checklist .by { display: none; }
    .checklist form .icon-btn { opacity: 1; }
    .tlist:not(.clients) th:nth-child(n+5), .tlist:not(.clients) td:nth-child(n+5) { display: none; }
}
