/* SYPManager – feuille de style principale (aucune police ni ressource externe) */
:root {
  --navy: #111111; --navy-2: #2a2a2a; --teal: #f07c00; --teal-d: #c45f00; --teal-l: #ffe7cf; --teal-xl: #fff6ed; --teal-c: #ffb36b; /* couleur de la société : remplacée par Paramètres > Options */
  --bg: #f4f4f4; --panel: #fff; --line: #e2e2e2; --text: #161616; --muted: #6e6e6e;
  --red: #c62828; --green: #2e7d32; --orange: #e08a00; --violet: #6a4bc4; --blue: #2563c9;
  --radius: 6px; --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 1px 6px rgba(20, 30, 50, .05);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--teal-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .right { text-align: right; }
.pre { white-space: pre-line; margin: .2em 0 .8em; }
.neg { color: var(--red); } .pos { color: var(--green); }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 24px; background: #fff; border-bottom: 3px solid var(--teal); padding: 0 20px; height: 54px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.brand strong { font-size: 18px; line-height: 1; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 800; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.mainnav { display: flex; gap: 4px; margin: 0 auto; }
.mainnav a { color: var(--navy); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 14px; border-radius: 4px; }
.mainnav a:hover { background: var(--teal-xl); text-decoration: none; }
.mainnav a.on { background: var(--teal); color: #fff; }
.usermenu { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.usermenu form { margin: 0; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { color: var(--red); }

.pagehead { background: #111; color: #fff; padding: 10px 24px 12px; position: relative; }
.pagehead h1 { font-size: 20px; font-weight: 500; letter-spacing: .02em; }
.crumbs { font-size: 11px; opacity: .8; }
.crumbs a { color: #fff; }
.pagemeta { position: absolute; right: 24px; top: 12px; font-size: 11px; text-align: right; opacity: .85; background: rgba(255, 255, 255, .12); padding: 4px 10px; border-radius: 4px; }

.main { padding: 16px 20px 40px; }
.main-public { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #111 linear-gradient(135deg, #111 0%, #1e1e1e 60%, #3a2410 100%); }

/* ---------- Messages ---------- */
.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 12px; border: 1px solid; }
.flash-success { background: #e9f6ec; border-color: #b9dfc0; color: #1d5e2a; }
.flash-error { background: #fdecec; border-color: #f2bcbc; color: #8e1b1b; }
.flash-warning { background: var(--teal-xl); border-color: var(--teal-l); color: #7a5600; }
.flash-info { background: #e8f3fb; border-color: #b6d7ef; color: #1f4f7a; }
.info-lock { background: #f4f6f9; border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--radius); color: var(--muted); font-size: 12px; margin-bottom: 8px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 4px; border: 1px solid #1a1a1a; background: #fff; color: #111; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--teal-xl); text-decoration: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #276b2b; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a82121; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--teal-d); }
.btn-ghost-danger { border-color: transparent; background: transparent; color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; }
form.inline { display: inline; margin: 0; }
.ib { border: 1px solid transparent; background: transparent; cursor: pointer; padding: 1px 5px; border-radius: 3px; font-size: 13px; color: var(--muted); line-height: 1.2; }
.ib:hover { background: var(--teal-l); color: var(--navy); }
.ib.del:hover { background: #fdecec; color: var(--red); }
.ib.hide { visibility: hidden; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; font-size: 13px; color: var(--text); border: 1px solid #c9d1db; border-radius: 4px; padding: 6px 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: 2px solid color-mix(in srgb, var(--teal) 35%, transparent); border-color: var(--teal); }
input[readonly] { background: transparent; border-color: transparent; }
textarea { resize: vertical; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #3b4558; margin-bottom: 10px; }
.form label em { color: var(--red); font-style: normal; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.form-inline label { margin: 0; }
.form-inline input, .form-inline select { width: auto; min-width: 120px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.fields.one { grid-template-columns: 1fr; }
.fields .full, .fields .span2 { grid-column: 1 / -1; }
.formbar { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0; }
.formbar.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 20px; }
.switches { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg > span { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg label { flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 6px 14px; border-left: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.seg input { width: auto; }
.combo { display: flex; gap: 6px; }
.combo .combo-filter { max-width: 45%; }

/* ---------- Panneaux ---------- */
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.panel-title, h3.band { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #111; background: #f3f3f3; margin: -14px -16px 12px; padding: 9px 16px; border-radius: var(--radius) var(--radius) 0 0; border-left: 3px solid var(--teal); }
h3.band { margin: 14px 0 10px; border-radius: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid3 .span2 { grid-column: span 2; }
.grid-doc { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.kv2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.kv2 p { margin: 3px 0; }

/* ---------- Tableaux ---------- */
table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.grid th { background: #1b1b1b; color: #fff; font-weight: 600; text-align: left; padding: 8px 8px; border-right: 1px solid #333; font-size: 12px; white-space: nowrap; }
table.grid th a { color: inherit; }
table.grid td { padding: 6px 8px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
table.grid tbody tr:nth-child(even) { background: #fafbfc; }
table.grid.compact td { padding: 5px 8px; }
table.grid .num, table.grid th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid tfoot td { border-top: 2px solid var(--line); background: #f7f9fb; }
table.clickable tbody tr[data-href] { cursor: pointer; }
table.clickable tbody tr[data-href]:hover { background: var(--teal-xl); }
table.grid tr.sel, table.grid tr.sel:hover { background: var(--teal-l) !important; }
tr.inactive td { color: #9aa3b2; }
td.actions, th.actions { white-space: nowrap; text-align: right; }
td.actions form { margin-left: 4px; }

/* Badges d'état */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-gris { background: #eef0f3; color: #4c5568; border-color: #dfe3e9; }
.badge-bleu { background: #e6effc; color: #1d4f9c; }
.badge-vert { background: #e4f4e6; color: #22662a; }
.badge-vert-fonce { background: #2e7d32; color: #fff; }
.badge-rouge { background: #fde8e8; color: #9d1d1d; }
.badge-orange { background: #fff1d9; color: #8a5300; }
.badge-violet { background: #efe9fb; color: #4e3594; }
.chip { display: inline-block; min-width: 64px; text-align: center; padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.chip-client { background: #ffe0c2; color: #7a3c00; }
.chip-prospect { background: #e6e6e6; color: #333; }
.chip-finale { background: #111; color: #fff; }
.chip-acompte { background: #ffd2a6; color: #7a3c00; }
.chip-avoir { background: #f2a7a7; color: #6e1414; }
.chip-devis { background: #dde3ea; }

/* ---------- Listes avec panneau latéral ---------- */
.listpage { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar select { width: auto; }
.sidepanel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 70px; }
.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #111; color: #fff; padding: 8px 12px; border-left: 3px solid var(--teal); }
.side-item { display: block; padding: 8px 12px; border-left: 3px solid var(--teal); margin: 6px 8px; background: #f7f9fb; color: var(--text); }
.side-item:hover { background: var(--teal-xl); text-decoration: none; }
.side-item strong { display: block; font-size: 12px; }
.side-item span { font-size: 11px; color: var(--muted); }
.reco { display: flex; align-items: center; gap: 12px; padding: 8px 12px; color: var(--text); border-bottom: 1px solid #f0f2f5; }
.reco:hover { background: var(--teal-xl); text-decoration: none; }
.reco-n { min-width: 44px; height: 38px; display: grid; place-items: center; background: #f3f3f3; border-left: 3px solid var(--teal); font-weight: 700; font-size: 16px; color: var(--navy); }
.apercu { padding: 12px; font-size: 13px; min-height: 160px; }
.apercu h4 { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.apercu p { margin: 4px 0; }
.ap-solde { margin-top: 12px; padding: 8px; background: #f3f3f3; display: flex; justify-content: space-between; }
.ap-actions { margin-top: 10px; display: flex; gap: 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; font-size: 12px; }
.pager a { display: inline-block; min-width: 28px; text-align: center; padding: 4px 6px; margin: 0 2px; border-radius: 3px; color: var(--navy); }
.pager a.on { background: var(--navy); color: #fff; }

/* ---------- Fiche client ---------- */
.fiche { display: grid; grid-template-columns: 240px 1fr; gap: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); min-height: 70vh; }
.fiche-nav { background: #fafafa; border-right: 1px solid var(--line); padding: 6px 0; }
.fiche-nav a { display: block; padding: 10px 16px; color: #34405a; border-bottom: 1px solid #e6ebf0; font-size: 13px; }
.fiche-nav a:hover { background: var(--teal-xl); text-decoration: none; }
.fiche-nav a.on { background: var(--teal-l); border-left: 4px solid var(--teal); font-weight: 600; }
.fiche-body { padding: 14px 18px; }
.fiche-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.fiche-head { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; margin-bottom: 8px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: #111; color: #fff; display: grid; place-items: center; font-size: 22px; }
.solde-box { margin-top: 18px; padding: 10px 14px; background: #f3f3f3; border-left: 3px solid var(--teal); }

/* ---------- Tableau de bord ---------- */
.tiles { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tile { display: flex; align-items: center; gap: 10px; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 16px; color: var(--navy); font-weight: 600; border-top: 3px solid var(--teal); }
.tile:hover { text-decoration: none; background: var(--teal-xl); }
.tile-ico { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; background: var(--teal-l); }
.tile-warn { border-top-color: var(--orange); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi strong { display: block; font-size: 26px; font-weight: 600; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 180px; align-items: end; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.bar { display: block; width: 40%; border-radius: 2px 2px 0 0; min-height: 1px; }
.bar.n { background: var(--teal); } .bar.n1 { background: #2b2b2b; }
.bar-col span { font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; justify-content: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sw.n { background: var(--teal); } .sw.n1 { background: #2b2b2b; }

/* ---------- Document ---------- */
.doc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-tabs { display: flex; gap: 2px; }
.doc-tabs a { padding: 9px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #e6e6e6; border-radius: 4px 4px 0 0; }
.doc-tabs a.on { background: #fff; color: var(--navy); box-shadow: inset 0 -3px 0 var(--teal); }
.doc-tabs a:hover { text-decoration: none; color: var(--navy); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lock { font-size: 14px; }
details.dropdown { position: relative; display: inline-block; }
details.dropdown > summary { list-style: none; }
details.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: 110%; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); border-radius: var(--radius); padding: 12px; z-index: 30; min-width: 280px; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
.content-main { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; min-width: 0;
  align-self: stretch; display: flex; flex-direction: column; } /* même hauteur que la colonne de droite (jusqu'au total) */
.content-main > #lignes-form, .content-main .lignes-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.content-main .lignes-editor > .table-scroll { flex: 1; }
.content-side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 70px; padding-bottom: 8px; }
.synthese { padding: 10px 12px; }
.donut { width: 130px; height: 130px; border-radius: 50%; margin: 6px auto 12px; background: #dfe5ec; -webkit-mask: radial-gradient(circle, transparent 38%, #000 39%); mask: radial-gradient(circle, transparent 38%, #000 39%); }
table.mini { width: 100%; font-size: 10.5px; table-layout: auto; border-collapse: collapse; }
table.mini th { color: var(--muted); font-weight: 600; text-align: right; padding: 3px; }
table.mini td { text-align: right; padding: 3px; white-space: nowrap; border-top: 1px solid #f0f2f5; font-variant-numeric: tabular-nums; }
table.mini td:first-child { text-align: left; font-weight: 600; }
table.mini tr.tot td { font-weight: 700; }
dl.totaux { margin: 0; padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13px; }
dl.totaux dt { color: #3b4558; }
dl.totaux dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; background: #f3f3f3; padding: 2px 8px; border-radius: 3px; }
dl.totaux dd.full { grid-column: 1 / -1; background: none; font-size: 11px; color: var(--muted); }
dl.totaux .big { font-weight: 700; font-size: 15px; }

/* Éditeur de lignes */
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 2px 10px; }
.ed-toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-toolbar .grow { flex: 1; }
.dirty { color: var(--orange); font-size: 12px; font-weight: 600; }
.table-scroll { overflow-x: auto; }
table.lignes { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: auto; }
table.lignes th { background: #1b1b1b; color: #fff; font-weight: 600; font-size: 11.5px; padding: 6px 4px; text-align: center; border-right: 1px solid #333; white-space: nowrap; }
table.lignes td { border-bottom: 1px solid #edf0f4; border-right: 1px solid #f3f5f8; padding: 1px 2px; vertical-align: top; }
table.lignes .cost { display: none; }
table.lignes.show-cost .cost { display: table-cell; }
table.lignes input, table.lignes textarea, table.lignes select { border-color: transparent; background: transparent; padding: 4px 5px; font-size: 12.5px; border-radius: 3px; }
table.lignes input:hover, table.lignes textarea:hover { border-color: #dfe5ec; }
table.lignes input.n { text-align: right; font-variant-numeric: tabular-nums; }
table.lignes input.forced { font-style: italic; color: var(--blue); }
table.lignes textarea { resize: none; overflow: hidden; min-height: 28px; line-height: 1.35; }
table.lignes .c-ref { width: 90px; }
table.lignes .c-des { min-width: 280px; width: 40%; }
table.lignes .c-n { width: 82px; text-align: right; white-space: nowrap; }
table.lignes .c-sm { width: 62px; }
table.lignes .c-tva { width: 78px; }
table.lignes .c-act { width: 1%; white-space: nowrap; text-align: center; color: var(--muted); }
table.lignes .c-type { font-weight: 700; font-size: 11px; }
table.lignes td.calc { padding: 5px 6px; color: #3b4558; font-variant-numeric: tabular-nums; background: #fafbfc; }
table.lignes td.v_total { font-weight: 600; color: var(--navy); }
table.lignes td .ib.reset { padding: 0 3px; }
table.lignes td:has(.ib.reset) { position: relative; }
table.lignes td .ib.reset { position: absolute; left: -2px; top: 4px; }
table.lignes tr.sel > td { background: var(--teal-xl); }
table.lignes tr.t-titre input { font-weight: 700; color: var(--navy); font-size: 13.5px; }
table.lignes tr.t-soustotal td { background: #f4f6f9; font-weight: 600; }
table.lignes tr.t-vide td.vide { height: 14px; }
table.lignes tr.empty td { text-align: center; padding: 30px; color: var(--muted); }
.rt-bar { display: flex; gap: 2px; padding: 2px 0; align-items: center; flex-wrap: wrap; }
.rt-flottante { position: absolute; z-index: 60; background: #fff; border: 1px solid #c9d3de; border-radius: 6px; box-shadow: 0 4px 14px rgba(20,40,70,.18); padding: 3px 5px; max-width: 96vw; }
.rt-flottante select { height: 26px; padding: 0 4px; font-size: 12px; width: auto; min-width: 0; }
.rt-flottante .rt-police { max-width: 130px; }
.rt-flottante input[type=color] { width: 28px; height: 24px; padding: 0 2px; border: 1px solid #c9d3de; border-radius: 3px; background: #fff; cursor: pointer; }
.rt-flottante .rt-largeur { width: 64px; height: 24px; padding: 0 4px; font-size: 12px; }
.rt-flottante .ib { min-width: 26px; height: 26px; }
.rt-sep { display: inline-block; width: 1px; height: 18px; background: #dfe5ec; margin: 0 4px; }
.rt-lbl { font-size: 11.5px; color: #5b6b7d; margin: 0 2px; }
.rt-pastille { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; }
.rt-img { display: inline-flex; align-items: center; gap: 2px; }
.rt-area { min-height: 24px; padding: 4px 6px; border: 1px solid transparent; border-radius: 3px; font-size: 12.5px; line-height: 1.35; cursor: text; overflow-wrap: anywhere; }
.rt-area[contenteditable="true"]:hover { border-color: #dfe5ec; }
.rt-area[contenteditable="true"]:focus { outline: none; border-color: #2f6db5; background: #fff; box-shadow: 0 0 0 2px rgba(47,109,181,.15); }
.rt-area[contenteditable="false"] { cursor: default; }
.rt-area p, .rt-area div { margin: 0; }
.rt-area ul, .rt-area ol { margin: 2px 0 2px 18px; padding: 0; }
.rt-area img { max-width: 100%; height: auto; vertical-align: top; cursor: pointer; }
.rt-area img.rt-choisie { outline: 2px solid #2f6db5; outline-offset: 1px; }
.rt-poignee { position: absolute; z-index: 61; width: 12px; height: 12px; background: #2f6db5; border: 2px solid #fff; border-radius: 2px; cursor: nwse-resize; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.ib.sw-r::before, .ib.sw-b::before, .ib.sw-k::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; }
.ib.sw-r::before { background: #d0021b; } .ib.sw-b::before { background: #1f3a93; } .ib.sw-k::before { background: #222; }

/* ---------- Écrans d'authentification ---------- */
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 10px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.qr { display: flex; justify-content: center; margin: 10px 0; min-height: 160px; }
.qr svg { width: 180px; height: 180px; image-rendering: pixelated; }
pre.cle { background: #f3f3f3; padding: 10px; border-radius: 4px; text-align: center; font-size: 15px; letter-spacing: .08em; white-space: pre-wrap; word-break: break-all; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.recovery code { background: #f3f3f3; padding: 8px; text-align: center; border-radius: 4px; font-size: 15px; letter-spacing: .06em; }
code.big { display: inline-block; font-size: 16px; padding: 4px 10px; background: #fff; border-radius: 4px; margin: 6px 0; user-select: all; }

.tabs { display: flex; gap: 2px; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; background: #e6e6e6; border-radius: 4px 4px 0 0; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs a.on { background: #fff; color: var(--navy); box-shadow: inset 0 -3px 0 var(--teal); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .listpage, .content-layout, .grid-doc { grid-template-columns: 1fr; }
  .sidepanel, .content-side { position: static; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .grid2, .grid3, .kpis, .kv2 { grid-template-columns: 1fr; }
  .fiche { grid-template-columns: 1fr; }
  .fiche-nav { display: flex; overflow-x: auto; }
  .fiche-nav a { white-space: nowrap; border-bottom: 0; }
  .main { padding: 12px 10px 30px; }
  .pagemeta { display: none; }
}
@media print {
  .topbar, .pagehead, .toolbar, .sidepanel, .doc-actions, .formbar, [data-print] { display: none !important; }
  body { background: #fff; }
}
table.lignes.show-cost { min-width: 1380px; }
table.lignes select.f-tva { min-width: 72px; padding-right: 2px; }
table.lignes .c-des textarea { min-width: 220px; }

/* Thème blanc / noir / orange : compléments */
.pagehead { border-bottom: 4px solid var(--teal); }
.pagehead h1 { font-weight: 700; letter-spacing: .03em; }
.pagemeta { background: rgba(255, 255, 255, .08); }
.crumbs a { color: var(--teal-c); }
table.grid th a { color: #fff; }
table.grid th a:hover { color: var(--teal-c); text-decoration: none; }
table.grid tbody tr:nth-child(even) { background: #fafafa; }
.mainnav a { color: #111; }
.kpi { border-top: 3px solid #111; }
.kpi strong { color: #111; }
.tile { border-top-color: var(--teal); color: #111; }
.tile-ico { background: var(--teal); color: #fff; }
.side-item { border-left-color: var(--teal); background: #fafafa; }
.fiche-nav a.on { background: var(--teal-xl); border-left-color: var(--teal); }
.doc-tabs a.on, .tabs a.on { color: #111; box-shadow: inset 0 -3px 0 var(--teal); }
.btn-ghost { color: var(--teal-d); border-color: transparent; }
.btn-ghost:hover { background: var(--teal-xl); }
a { color: var(--teal-d); }
.dd-title { font-weight: 700; margin: 0 0 8px; color: #111; }
.form label.radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 6px; }
.form label.radio input { width: auto; accent-color: var(--teal); }
.dropdown-menu { border-top: 3px solid var(--teal); min-width: 320px; }
.auth-card { border-top: 5px solid var(--teal); }
table.lignes td.v_total { color: #111; }
table.lignes input.forced { color: var(--teal-d); }
.badge-bleu { background: #ececec; color: #222; }
.badge-violet { background: #2a2a2a; color: #fff; }
.chip-avoir { background: #ffcfcf; color: #7a1010; }
.logo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-preview { width: 220px; min-height: 80px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 4px; padding: 6px; background: #fff; }
.logo-preview img { max-width: 100%; max-height: 110px; }
table.lignes .c-u { width: 46px; }
table.lignes .c-u input { text-align: center; }
.dirty.ok { color: var(--green); }
.dirty.err { color: var(--red); }
.panel-danger { border-top: 3px solid var(--red); }
.panel-danger .panel-title { border-left-color: var(--red); }
.tabs a.tab-danger { color: var(--red); }
.espace-haut { margin-top: 12px; }
.form label.radio span { font-weight: 400; }
/* Éditeur d'état */
.etat-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.seg-nav { display: flex; gap: 0; border: 1px solid #111; border-radius: 4px; overflow: hidden; }
.seg-nav a { padding: 8px 16px; color: #111; font-weight: 600; font-size: 13px; background: #fff; }
.seg-nav a + a { border-left: 1px solid #111; }
.seg-nav a.on { background: var(--teal); color: #fff; }
.seg-nav a:hover { text-decoration: none; }
.exemple select { min-width: 360px; }
.etat-layout { display: grid; grid-template-columns: minmax(380px, 470px) 1fr; gap: 16px; align-items: start; }
.etat-form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px 0; max-height: calc(100vh - 210px); overflow: auto; position: sticky; top: 70px; }
.etat-sec { border-bottom: 1px solid var(--line); padding: 10px 0; }
.etat-sec > summary { cursor: pointer; font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; padding: 4px 0 10px; list-style: none; }
.etat-sec > summary::before { content: "▸ "; color: var(--teal); }
.etat-sec[open] > summary::before { content: "▾ "; }
.etat-sec .fields { grid-template-columns: 1fr 1fr; }
.etat-form input[type=color] { height: 34px; padding: 2px; }
.etat-cols input { padding: 4px 6px; }
.etat-cols td.c { text-align: center; }
.etat-cols input[type=checkbox] { width: auto; accent-color: var(--teal); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.checks input { width: auto; accent-color: var(--teal); }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.etat-preview { background: #d9d9d9; border-radius: var(--radius); padding: 10px; }
.preview-head { display: flex; justify-content: space-between; font-size: 12px; color: #333; margin-bottom: 8px; }
.etat-preview iframe { width: 100%; min-width: 820px; height: 1180px; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.2); display: block; margin-bottom: 10px; }
@media (max-width: 1300px) { .etat-layout { grid-template-columns: 1fr; } .etat-form { position: static; max-height: none; } .etat-preview { overflow-x: auto; } }
.liste-modeles a { display: block; padding: 7px 8px; border-radius: 3px; color: #111; }
.liste-modeles a:hover { background: var(--teal-xl); text-decoration: none; }
/* Éditeur visuel des modèles */
.designer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; padding: 8px 12px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; position: sticky; top: 57px; z-index: 10; }
.designer-bar .grow { flex: 1; }
.designer-bar label { flex-direction: row !important; align-items: center; gap: 6px !important; margin: 0 !important; }
.designer-bar .nom-modele input { width: 260px; }
.designer-bar .exemple select { max-width: 280px; }
.designer-body { display: grid; grid-template-columns: 230px minmax(820px, 1fr) 300px; gap: 12px; align-items: start; }
.designer-elements, .designer-props { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 120px; max-height: calc(100vh - 135px); overflow: auto; padding-bottom: 10px; }
.designer-page { background: #d6d6d6; border-radius: var(--radius); padding: 12px; overflow-x: auto; }
.designer-page iframe { display: block; width: 210mm; min-width: 794px; height: 297mm; min-height: 1123px; border: 0; margin: 0 auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.item-bloc { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; color: #111; font-size: 12.5px; border-left: 3px solid transparent; }
.item-bloc:hover { background: var(--teal-xl); text-decoration: none; }
.item-bloc.on { background: var(--teal-xl); border-left-color: var(--teal); font-weight: 600; }
.item-bloc.cache span:first-child { color: #aaa; text-decoration: line-through; }
.item-bloc .oeil { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 0 2px; color: #555; }
.zone-titre { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.designer-elements .ajout { padding: 10px; }
.designer-elements .aide { padding: 0 10px; }
#props { padding: 6px 12px; }
#props .grp { border: 0; border-top: 1px solid var(--line); padding: 8px 0 4px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
#props .grp legend { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding: 0 4px 0 0; color: #111; }
#props label { margin-bottom: 8px; font-size: 11.5px; }
#props label.full, #props .coches, #props .grp > p, #props .grp > table { grid-column: 1 / -1; }
#props label.coche { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
#props label.coche input { width: auto; accent-color: var(--teal); }
#props .coches { display: flex; gap: 10px; }
#props .couleur-champ { display: flex; align-items: center; gap: 6px; }
#props .couleur-champ input[type=checkbox] { width: auto; accent-color: var(--teal); }
#props .couleur-champ input[type=color] { height: 30px; padding: 1px; }
#props .couleur-champ input[type=color]:disabled { opacity: .3; }
#props table.cols { width: 100%; border-collapse: collapse; font-size: 11.5px; }
#props table.cols th { text-align: left; font-size: 10.5px; color: var(--muted); padding: 2px; }
#props table.cols td { padding: 2px; }
#props table.cols input[type=checkbox] { width: auto; accent-color: var(--teal); }
#props table.cols input[type=number] { width: 54px; }
#props .actions-bloc { display: flex; gap: 8px; padding: 8px 0; }
.renommer input { min-width: 220px; }
@media (max-width: 1500px) { .designer-body { grid-template-columns: 200px 1fr 280px; } }
/* Identité SYPManager */
.brand-picto { width: 40px; height: 40px; object-fit: contain; background: #000; border-radius: 8px; padding: 3px; }
.brand strong { font-style: italic; font-weight: 800; letter-spacing: -.01em; font-size: 20px; }
.brand .b1 { color: #111; } .brand .b2 { color: var(--teal); }
.auth-logo { display: block; width: 220px; height: 220px; margin: -8px auto 4px; border-radius: 12px; }
.auth-logo.petit { width: 120px; height: 120px; margin-bottom: 8px; }
.auth-card { background: #fff; }
.main-public { background: #000 radial-gradient(circle at 50% 30%, #2a1a08 0%, #000 60%); }
table.lignes .ttc { display: none; }
table.lignes.show-ttc .ttc { display: table-cell; }
table.lignes.show-ttc input.f-pv_ttc { background: var(--teal-xl); font-weight: 600; }
.btn-ttc.on { background: var(--teal); border-color: var(--teal); color: #fff; }
table.lignes td.c-u { min-width: 40px; }
table.lignes .c-u input { padding: 4px 2px; min-width: 32px; }
/* Écrans de connexion en noir, comme le logo */
.main-public .auth-card { background: #0c0c0c; color: #e8e8e8; border: 1px solid #262626; border-top: 5px solid var(--teal); }
.main-public .auth-card .muted { color: #9a9a9a; }
.main-public .form label { color: #cfcfcf; }
.main-public input { background: #1a1a1a; border-color: #333; color: #fff; }
.main-public input:focus { border-color: var(--teal); }
.main-public .auth-brand { color: #fff; }
.main-public pre.cle, .main-public .recovery code { background: #1d1d1d; color: #fff; }
.main-public a { color: var(--teal-c); }
.main-public .auth-logo { margin-top: -14px; }
.numero-edit { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.numero-edit input { width: 140px; padding: 3px 6px; font-weight: 600; }
/* Articles */
table.articles td.img, table.articles th.img { width: 54px; padding: 3px; }
table.articles td.img img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 4px; display: block; }
.tag-ttc { font-size: 9.5px; font-weight: 700; color: var(--teal-d); border: 1px solid var(--teal); border-radius: 3px; padding: 0 3px; }
.reco-n.small { font-size: 12px; min-width: 90px; }
.article-grid { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.article-img { display: grid; place-items: center; min-height: 200px; background: #fafafa; border: 1px dashed var(--line); border-radius: 4px; margin-bottom: 10px; }
.article-img img { max-width: 100%; max-height: 260px; object-fit: contain; }
.prix-mode { display: inline-flex; margin-bottom: 12px; }
@media (max-width: 1100px) { .article-grid { grid-template-columns: 1fr; } }
/* Ajout depuis le catalogue dans l'éditeur de lignes */
.catalogue { position: relative; display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.catalogue input[type=search] { width: 260px; padding: 5px 8px; border-color: var(--teal); }
.catalogue .cat-desc { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.catalogue .cat-desc input { width: auto; accent-color: var(--teal); }
.cat-res { position: absolute; top: 100%; left: 0; z-index: 40; width: 560px; max-height: 420px; overflow: auto; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--teal); box-shadow: 0 8px 26px rgba(0,0,0,.18); border-radius: 0 0 6px 6px; }
.cat-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid #f0f0f0; background: #fff; padding: 6px 10px; text-align: left; cursor: pointer; font: inherit; }
.cat-item:hover { background: var(--teal-xl); }
.cat-item img, .cat-noimg { width: 44px; height: 44px; object-fit: contain; background: #f6f6f6; border-radius: 4px; display: block; }
.cat-txt strong { display: block; font-size: 12.5px; }
.cat-txt small, .cat-prix small { color: var(--muted); font-size: 11px; display: block; }
.cat-prix { text-align: right; white-space: nowrap; font-size: 12px; }
.cat-vide { padding: 12px; color: var(--muted); font-size: 12px; }

/* ---------- Planning du matériel ---------- */
.warn { color: #b86a00; }
.nowrap { white-space: nowrap; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
label.inline input[type=checkbox] { width: auto; margin: 0; }
.planning-tabs { margin: 0; }
.kpi .kpi-txt { font-size: 20px; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 8px; }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.legende i { display: inline-block; width: 16px; height: 12px; border: 1px solid #ccc; border-radius: 2px; }
.planning-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); max-height: 75vh; }
table.planning { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; }
table.planning th, table.planning td { border-right: 1px solid #ececec; border-bottom: 1px solid #ececec; text-align: center; padding: 0; min-width: 26px; height: 24px; }
table.planning thead th { position: sticky; top: 0; z-index: 2; background: #1b1b1b; color: #fff; font-weight: 600; padding: 3px 0; line-height: 1.2; }
table.planning thead th.we { background: #3a3a3a; }
table.planning thead th.today { background: var(--teal); }
table.planning .pl-art { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 3px 8px; min-width: 210px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.planning thead .pl-art { z-index: 3; background: #1b1b1b; }
table.planning td.we { background: #f6f6f6; }
table.planning td.today { box-shadow: inset 2px 0 0 var(--teal), inset -2px 0 0 var(--teal); }
table.planning tr.pl-cat td { background: #fff4e8; color: #7a3c00; font-weight: 700; text-align: left; padding: 4px 8px; position: sticky; left: 0; }
table.planning td a { display: block; line-height: 24px; color: inherit; font-weight: 700; text-decoration: none; }
.pl-libre { background: #fff; }
.pl-partiel, table.planning td.pl-partiel { background: #ffd9ad; color: #6b3500; }
.pl-complet, table.planning td.pl-complet { background: var(--teal); color: #fff; }
.pl-surbook, table.planning td.pl-surbook { background: #c62828; color: #fff; }
.pl-option, table.planning td.pl-option { background: repeating-linear-gradient(135deg, #fff 0 4px, #ffd9ad 4px 7px); color: #7a3c00; }
table.planning td.pl-avec-option { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,255,255,.45) 5px 7px); }
tr.pl-ligne-option td { background: #fffaf3; }
.dispo-alerte { border-left: 4px solid #c62828; }
.dispo-ok { border-left: 4px solid #2e7d32; }
.dispo-info { border-left: 4px solid var(--teal); }
.dispo-table td, .dispo-table th { padding: 4px 8px; }
table.planning td.pl-art a { display: inline; line-height: inherit; font-weight: 600; color: var(--navy); }
table.planning td.pl-art { height: 26px; }
.planning-tabs { margin: 0 0 10px; }
.dates-presta { grid-template-columns: repeat(5, minmax(120px, 1fr)); align-items: end; }
.dates-edit { margin: -4px 0 10px; }
.dates-edit .fields { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.dispo-panel summary { cursor: pointer; padding: 2px 0; }
.dispo-panel table { margin-top: 8px; }
.planning-liste { grid-template-columns: 3fr 2fr; }
@media (max-width: 1100px) { .planning-liste, .dates-presta { grid-template-columns: 1fr; } }
table.lignes tr.dispo-manque td { background: #fdecec !important; }
table.lignes tr.dispo-manque td:first-child { box-shadow: inset 4px 0 0 #c62828; }
table.lignes tr.dispo-avert td:first-child { box-shadow: inset 4px 0 0 var(--teal); }
.dispo-head { margin-bottom: 6px; }
.dispo-table tr.dispo-manque td { background: #fdecec; }
.dispo-table tr.dispo-avert td { background: var(--teal-xl); }
.planning-kpis { grid-template-columns: repeat(4, 1fr); }
.pl-encours { position: relative; }
.legende i.pl-encours, table.planning td.pl-encours.pl-vide { background: repeating-linear-gradient(135deg, #fff 0 4px, #ffe7cf 4px 7px); }
table.planning td.pl-encours::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--teal) transparent transparent; }
table.planning td.pl-avert { box-shadow: inset 0 0 0 2px var(--teal); }
table.planning td.pl-surbook.pl-avert { box-shadow: none; }
.pl-warn { color: #b86a00; font-size: 11px; margin-left: 1px; }
table.planning td.pl-complet .pl-warn, table.planning td.pl-surbook .pl-warn { color: #fff; }

/* ---------- Travail à plusieurs : verrou ---------- */
.verrou-banniere { display: flex; align-items: center; gap: 14px; background: var(--teal-xl); border: 1px solid var(--teal-l); border-left: 5px solid var(--teal); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; color: #5a3d00; }
.verrou-banniere .verrou-ico { font-size: 22px; }
.verrou-banniere .verrou-txt { flex: 1; }
.verrou-banniere form.inline, .verrou-banniere .btn { flex: none; }
.verrou-banniere.perdu { background: #fdecec; border-color: #f2bcbc; border-left-color: #c62828; color: #6e1414; }
.verrou-banniere.libre { background: #e9f6ec; border-color: #b9dfc0; border-left-color: #2e7d32; color: #1d5e2a; }
body.lecture-seule #lignes-editor { opacity: .75; }
.coche-confiance { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 4px 0 12px; }
.coche-confiance input { width: auto; margin: 0; }
.modele-entete summary { cursor: pointer; padding: 2px 0; }
.modele-entete form { margin-top: 12px; }
.modele-choix { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--teal-xl); border: 1px solid var(--teal-l); border-left: 5px solid var(--teal); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.modele-choix select { width: auto; min-width: 280px; }
.rt-flottante.hide, .rt-poignee.hide, .rt-img.hide, .rt-flottante input.hide { display: none; }

/* Changement d'état direct (badge cliquable) */
button.etat-rapide { border: 0; cursor: pointer; font: inherit; font-size: 11px; line-height: inherit; }
button.etat-rapide:hover, button.etat-rapide[aria-expanded="true"] { filter: brightness(.92); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 35%, transparent); }
button.etat-rapide .etat-fleche { font-size: 8px; opacity: .7; margin-left: 2px; }
.etat-menu { position: absolute; z-index: 80; background: #fff; border: 1px solid #d5dce4; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18); padding: 4px; min-width: 180px; }
.etat-menu-titre { font-size: 11px; color: #6b7a8a; padding: 3px 8px 5px; text-transform: uppercase; letter-spacing: .03em; }
.etat-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.etat-menu-item:hover, .etat-menu-item:focus { background: #fff4e8; outline: none; }
dialog.dlg-reglement { border: 0; border-radius: 8px; padding: 18px 20px; width: min(380px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
dialog.dlg-reglement::backdrop { background: rgba(0,0,0,.45); }
dialog.dlg-reglement .dlg-titre { margin: 0 0 6px; font-size: 16px; }
dialog.dlg-reglement label { display: block; margin-top: 10px; }
dialog.dlg-reglement label span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
dialog.dlg-reglement input, dialog.dlg-reglement select { width: 100%; }
dialog.dlg-reglement .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
form.hide { display: none; }
.toolbar label.coche { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; } .toolbar label.coche input { width: auto; margin: 0; }

/* Sélection de plusieurs lignes (copier / couper / coller) */
table.lignes .c-type { display: inline-block; min-width: 18px; padding: 1px 3px; margin-right: 2px; border-radius: 3px; cursor: pointer; user-select: none; text-align: center; }
table.lignes .c-type:hover { background: var(--teal-l); }
table.lignes tr.choisie > td { background: var(--teal-l); }
table.lignes tr.choisie .c-type { background: var(--teal); color: #fff; box-shadow: inset 3px 0 0 var(--teal-d); }
.pp-btns { display: inline-flex; gap: 4px; }

/* Fiche devis / facture : champs obligatoires regroupés en haut */
.panel-obligatoire { border-left: 3px solid var(--teal); }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields-4 .span2 { grid-column: span 2; }
.fields-4 .span3 { grid-column: span 3; }
@media (max-width: 900px) { .fields-4 { grid-template-columns: 1fr 1fr; } .fields-4 .span3 { grid-column: span 2; } }
.si-location { display: none; }
[data-dates-bloc].dates-requises .si-location { display: inline; }
label.manquant > span, p.manquant b { color: #c62828; }
label.manquant input, label.manquant select { border-color: #e57373; background: #fff6f6; }
.obligatoires-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 18px; }
.obligatoires-fiche p { margin: 2px 0; }
.manque-liste { color: #c62828; font-size: 12.5px; margin: 6px 0 0; }
.w-ordre { width: 64px !important; }
.coche-valider { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; } .coche-valider input { width: auto; }
.form label.coche-valider { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; }
.w-court { width: 74px !important; } .w-moyen { width: 120px !important; }
form[data-statut="particulier"] .si-societe, form[data-statut="societe"] .si-particulier { display: none !important; }

/* Choix de la société */
.choix-societes { display: grid; gap: 8px; margin-top: 10px; }
.choix-societes .btn-bloc { width: 100%; text-align: left; padding: 12px 14px; font-size: 1.05em; }

/* Remplissage depuis le SIRET */
.siret-ligne { display: flex; gap: 6px; align-items: flex-end; }
.siret-ligne input { flex: 1; }
.siret-msg { display: block; font-size: 12px; margin-top: 3px; }
.rempli-siret { background: var(--teal-xl) !important; transition: background .4s; }

/* Bouton Retour : toujours au même endroit, à gauche du titre de la page */
.pagehead { padding-left: 128px; }
.btn-retour { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px;
  color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.btn-retour:hover { background: var(--teal); border-color: transparent; color: #fff; }
@media (max-width: 700px) { .pagehead { padding-left: 64px; } .btn-retour span { display: none; } }
@media print { .btn-retour { display: none; } }
.fields .siret-champ { grid-column: span 2; }
.siret-ligne input { min-width: 150px; }

/* Enregistrer / Valider : grisé sans modification, mis en évidence dès qu'il y a quelque chose à enregistrer */
button.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); box-shadow: none; }
.btn.btn-modifie { background: var(--teal-d); border-color: var(--teal-d); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-d) 25%, transparent); animation: pulse-modif 1.6s ease-in-out 2; }
@keyframes pulse-modif { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal-d) 12%, transparent); } }
.dirty.err { color: var(--teal-d); font-weight: 600; }

/* Éditeur de lignes : largeur des colonnes à la souris, outils du tableau */
table.lignes thead th { position: relative; }
table.lignes .col-poignee { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }
table.lignes .col-poignee:hover { background: color-mix(in srgb, var(--teal) 55%, transparent); }
.ed-outils { display: inline-flex; gap: 4px; }
body.redim-colonne, body.redim-colonne * { cursor: col-resize !important; user-select: none; }
table.lignes td input, table.lignes td select { max-width: 100%; box-sizing: border-box; }
.sauvegarde-choix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.couleur-theme { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.couleur-theme input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.brand-picto { filter: var(--logo-filtre, none); }
.agendas .lien-agenda { width: 100%; font-size: 12px; font-family: monospace; }
