/* BOW Chantiers : styles propres à chaque écran */
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.break { overflow-wrap: anywhere; }
.lead { font-size: 1.05rem; color: var(--ink-2); margin-bottom: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* connexion */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; }
.auth-logo { height: 54px; width: auto; margin-bottom: 18px; }
.auth-actions { margin-top: 20px; }

/* tâches */
.task { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.task.prio { border-left: 4px solid var(--alert); }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; color: transparent; display: grid; place-items: center; flex: none; padding: 0; }
.tick:active { transform: scale(.92); }
@media (hover: hover) { .tick:hover { border-color: var(--ok); color: var(--ok); } }
.task.done { opacity: .65; }
.task.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.done .bold { text-decoration: line-through; }
.done-box { margin-top: 12px; }
.done-box summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 8px 0; }

/* signalements */
.note .thumb { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; flex: none; border: 1px solid var(--line-2); }
.note .thumb img { width: 100%; height: 100%; object-fit: cover; }
.note.resolved { opacity: .8; }
.photo-prev img { max-height: 180px; width: auto; border-radius: 12px; border: 1px solid var(--line-2); margin-top: 8px; }

/* planning, accueil */
.objective { margin-top: 10px; padding: 10px 12px; background: var(--bg-2); border-radius: 12px; border-left: 3px solid var(--ink); }
.plan-link { text-decoration: none; display: block; }
.plan-entry.dim { opacity: .55; }
.day { margin-bottom: 4px; }
.day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.day-head h2 { font-size: 1.05rem; flex: 1; min-width: 150px; }
.day.today .day-head h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.day-empty { padding: 4px 2px 8px; }
.day.weekend .day-head h2 { color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-height: 104px;
}
.tile svg.i { width: 26px; height: 26px; margin-bottom: auto; }
@media (hover: hover) { .tile:hover { border-color: var(--ink); } }

/* heures */
.ts-entry { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.ts-entry + .ts-entry { border-top: 1px solid var(--line); }
.just { margin-top: 4px; }
.ts-group { margin-bottom: 26px; }
.recap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.neg { color: var(--alert); }

/* stock */
.qty { text-align: right; line-height: 1; }
.qty .n { font-size: 2.4rem; font-weight: 600; letter-spacing: -.02em; }
.qty .u { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.cancelled { opacity: .5; text-decoration: line-through; }
.plus { color: var(--ok); }

/* fiches */
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 16px; }
.search input { flex: 1; border: 0; outline: 0; min-height: 48px; font-size: 16px; background: transparent; }
.search:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; }
.seg-chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 500; white-space: nowrap; }
.seg-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fiche-cover { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg-2); border: 1px solid var(--line); }
.fiche-cover.ph { display: grid; place-items: center; color: var(--muted); }
.warn-box { margin-bottom: 8px; }
.progress { margin-top: 2px; }
.progress-bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.progress-bar > div { height: 100%; background: var(--ink); width: 0; transition: width .25s ease; }
.step { padding: 16px; }
.step.done { opacity: .6; }
.step-n { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 600; flex: none; font-size: 1.05rem; }
.step.done .step-n { background: var(--ok); }
.step-n.sm { width: 28px; height: 28px; font-size: .85rem; }
.step h3 { font-size: 1.15rem; }
.step-text { margin-top: 8px; font-size: 1.04rem; line-height: 1.55; }
.step-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; margin-top: 12px; border: 1px solid var(--line-2); }
.step-check { margin-top: 10px; font-weight: 600; }
.step-edit { margin-top: 10px; }
.save-bar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); margin-top: 20px; background: var(--bg); padding: 8px 0; z-index: 5; }
@media (min-width: 1000px) { .save-bar { bottom: 0; } }

/* équipe, réglages */
.card.off { opacity: .6; }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox .input { font-size: 14px; }
.days-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (min-width: 700px) { .days-grid { grid-template-columns: repeat(4, 1fr); } }

/* absences : calendrier visuel */
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); -webkit-overflow-scrolling: touch; }
.cal { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .8rem; }
.cal th, .cal td { padding: 0; text-align: center; border-left: 1px solid var(--line); }
.cal thead th { height: 50px; font-weight: 600; line-height: 1.15; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.cal thead th span { display: block; font-size: .62rem; color: var(--muted); font-weight: 500; }
.cal th.who { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; padding: 6px 10px; width: 118px; border-left: 0; border-right: 1px solid var(--line-2); white-space: nowrap; font-weight: 500; overflow: hidden; }
.cal tbody tr + tr > * { border-top: 1px solid var(--line); }
.cal td { height: 54px; }
.cal .we { background: var(--bg-2); }
.cal .now { background: #f3ead2; }
.cell { display: block; width: 100%; height: 100%; min-height: 54px; border: 0; padding: 0; }
.t-conge { background: #5b7fa3; }
.t-recup { background: #7b6a8c; }
.t-ferie { background: #7f9a86; }
.t-maladie { background: #b3392b; }
.t-absent, .t-autre { background: #8d8a85; }
.t-maladie.p-justifie { background: #b3392b; }
.t-maladie.p-injustifie { background: repeating-linear-gradient(45deg, #b3392b 0 5px, #f2c9c3 5px 10px); }
.t-maladie.p-attente { background: #e0a39a; }
.cell.pend { opacity: .55; box-shadow: inset 0 0 0 2px #fff; }
.chip.abs { color: #fff; }
.chip.abs.p-injustifie { color: #5c1a12; }
.chip.abs.pend { opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.sw.pend { opacity: .55; }
.away-strip { margin-bottom: 14px; }

@media (min-width: 1000px) {
  .main:has(.wide) { max-width: none; }
  .cal th.who { width: 150px; }
  .cal td { height: 68px; }
  .cell { min-height: 68px; }
  .cal thead th { height: 56px; font-size: .9rem; }
}

/* glisser-déposer sur le calendrier d'absences */
.cal { user-select: none; -webkit-user-select: none; }
.cal td { position: relative; }
.cal.edit td:not(.sel) { cursor: crosshair; }
.cal tbody td:hover:not(.we) { background-image: linear-gradient(rgba(17, 17, 17, .04), rgba(17, 17, 17, .04)); }
.cal td .cell { cursor: grab; }
.hd { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 1; }
.hd.l { left: 0; border-left: 3px solid rgba(255, 255, 255, .85); }
.hd.r { right: 0; border-right: 3px solid rgba(255, 255, 255, .85); }
.cal td.sel { background: rgba(91, 127, 163, .35) !important; box-shadow: inset 0 0 0 1px #5b7fa3; }
.cal td.ghost { background: rgba(17, 17, 17, .18) !important; box-shadow: inset 0 0 0 2px var(--ink); }
body.dragging, body.dragging * { cursor: grabbing !important; }
.drag-hint { margin-top: 8px; }

/* double authentification */
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code, code.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.02rem; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; text-align: center; letter-spacing: .06em; }
code.secret { display: inline-block; margin-top: 6px; word-break: break-all; text-align: left; }

/* notifications, rentabilité, lecture */
.bell { position: relative; }
.bell .count { top: 2px; left: auto; right: 0; margin: 0; }
.card.unread { border-left: 4px solid var(--alert); }

.fin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fin-grid.fin-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .fin-grid.fin-4 { grid-template-columns: repeat(4, 1fr); } }
.fin-n { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.fin-lines { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.fin-lines > div { padding: 3px 0; }

/* mode lecture des fiches */
.reader { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; }
.reader-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.reader-bar { height: 6px; background: var(--bg-2); }
.reader-bar > div { height: 100%; background: var(--ink); transition: width .2s; }
.reader-body { flex: 1; overflow-y: auto; padding: 22px 18px; max-width: 760px; width: 100%; margin: 0 auto; }
.reader-title { font-size: 1.9rem; margin-bottom: 12px; }
.reader-text { font-size: 1.35rem; line-height: 1.6; margin-top: 14px; }
.reader-photo { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 14px; margin-top: 14px; background: #fff; border: 1px solid var(--line-2); }
.reader-done { margin-top: 22px; min-height: 56px; font-size: 1.1rem; }
.reader-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; padding: 12px 14px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--paper); }
.reader-nav .btn { min-height: 62px; font-size: 1.2rem; }
.quick .btn { min-height: 54px; font-size: 1.05rem; }
