/* ==========================================================================
   Espace agents — back-office
   ========================================================================== */
body.admin { background: #F2F0EA; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 10% -10%, #E2EFEA 0, transparent 60%),
  radial-gradient(900px 400px at 110% 110%, #FDF3DC 0, transparent 60%), var(--bg); }
.login-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 2rem; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.login-brand { display: flex; gap: .8rem; align-items: center; }
.login-brand > span { display: grid; }
.login-brand small { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.login-brand strong { font-family: var(--font-head); font-size: 1.45rem; font-weight: 800; }
.login-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: .6rem .75rem; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 1rem .75rem; overflow-y: auto; }
.side-brand { display: flex; gap: .65rem; align-items: center; padding: .25rem .5rem 1.25rem; }
.side-brand > span { display: grid; }
.side-brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.side-brand strong { font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; }
.side-nav { display: grid; gap: .15rem; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; min-height: 44px;
  color: var(--ink-2); text-decoration: none; font-weight: 700; border: 0; background: none; width: 100%; text-align: left;
  transition: background-color .15s, color .15s;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary-hover); }
.nav-item.subtle { font-weight: 400; font-size: .925rem; min-height: 40px; }
.nav-item .count { margin-left: auto; background: var(--primary); color: #fff; font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: grid; gap: .1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.user { display: flex; gap: .6rem; align-items: center; padding: .6rem .25rem 0 .5rem; margin-top: .4rem; border-top: 1px solid var(--line-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sun-soft); color: #6B4700; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.user small { font-size: .8rem; }

.main-col { min-width: 0; }
.main { padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2.25rem) 3rem; max-width: 1480px; }
.main:focus { outline: none; }
.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 90; transform: translateX(-102%); transition: transform .26s var(--ease); box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(20,30,28,.4); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 60; background: var(--surface); border-bottom: 1px solid var(--line); height: 60px; align-items: center; gap: .6rem; padding: 0 .5rem; }
  .topbar > span { display: grid; }
}

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: .2rem; }
.eyebrow-sm { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; } .kpi b { font-size: 1.6rem !important; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: .2rem; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: #cfc9bb; box-shadow: var(--shadow-sm); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--muted); font-weight: 700; font-size: .9rem; }
.kpi-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi b { font-family: var(--font-head); font-size: 2.1rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .85rem; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1150px) { .grid-2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.panel-body { padding: 1rem 1.1rem 1.15rem; }
.link { color: var(--primary); font-weight: 700; text-decoration: none; font-size: .9rem; background: none; border: 0; padding: .35rem .2rem; white-space: nowrap; }
.link:hover { text-decoration: underline; }

.rlist { list-style: none; margin: 0; padding: .35rem; }
.ritem { display: grid; grid-template-columns: 40px 1fr auto; gap: .8rem; align-items: center; padding: .6rem .7rem; border-radius: 12px; width: 100%; text-align: left; border: 0; background: none; min-height: 60px; }
.ritem:hover { background: var(--bg); }
.cat-dot { width: 40px; height: 40px; border-radius: 11px; background: var(--bg); color: var(--primary); display: grid; place-items: center; position: relative; }
.cat-dot .flag { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.ritem strong { display: block; font-size: .95rem; line-height: 1.3; }
.ritem small { color: var(--muted); font-size: .84rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

.bars { display: grid; gap: .65rem; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 28px; gap: .75rem; align-items: center; font-size: .9rem; }
.bar-row > span:first-child { display: flex; gap: .45rem; align-items: center; min-width: 0; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: inherit; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; margin: .2rem 0 .8rem; background: var(--line-2); }
.stack span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .875rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.works { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .8rem; }
.works li { display: grid; gap: .35rem; }
.works .top { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.works .top span { color: var(--muted); white-space: nowrap; }
.progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* ---------- Barre d'outils & liste ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.search { position: relative; flex: 1 1 240px; max-width: 380px; }
.search .ic { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 2.6rem; min-height: 44px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: .4rem .8rem; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--ink-2); white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; gap: .35rem; }
.seg button:hover { color: var(--ink); background: var(--bg); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg .n { font-size: .78rem; opacity: .7; font-variant-numeric: tabular-nums; }
.select-sm { min-height: 44px; width: auto; }
.count-line { color: var(--muted); font-size: .9rem; margin-left: auto; }

.rows { display: grid; }
.row {
  display: grid; grid-template-columns: 112px minmax(170px, 1.1fr) minmax(180px, 1.6fr) 104px 96px minmax(130px, .9fr) 150px;
  gap: 1rem; align-items: center; padding: .7rem 1.1rem; border: 0; border-top: 1px solid var(--line-2);
  text-align: left; background: none; width: 100%; font-size: .94rem; min-height: 56px;
}
.row:hover { background: var(--surface-2); }
.row-head { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-top: 0; min-height: 44px; }
.row-head:hover { background: none; }
.ref { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .875rem; }
.cell-cat { display: flex; gap: .55rem; align-items: center; min-width: 0; }
.cell-cat > .ic { color: var(--primary); }
.danger-flag { color: var(--danger); display: inline-grid; }
.tdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .45rem; flex: none; }
.c-meta-m { display: none; }
.row.is-new .ref::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--info); margin-left: .4rem; vertical-align: middle; }
@media (max-width: 1200px) {
  .row { grid-template-columns: 1fr auto; grid-template-areas: "cat status" "addr addr" "meta meta"; gap: .3rem .75rem; padding: .85rem 1rem; }
  .row-head { display: none; }
  .c-cat { grid-area: cat; font-weight: 700; }
  .c-status { grid-area: status; }
  .c-addr { grid-area: addr; color: var(--ink-2); }
  .c-ref, .c-date, .c-prio, .c-team { display: none !important; }
  .c-meta-m { grid-area: meta; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; font-size: .85rem; color: var(--muted); }
}

/* ---------- Tiroir de détail ---------- */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(640px, 100vw); max-width: 100vw; border-radius: 0; }
dialog.drawer[open] { display: flex; flex-direction: column; overflow: hidden; animation: drawer-in .26s var(--ease); }
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } }
.drawer-head { padding: 1rem 1rem 1rem 1.4rem; border-bottom: 1px solid var(--line-2); display: flex; gap: 1rem; align-items: flex-start; }
.drawer-head h2 { font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: .55rem; }
.drawer-head .addr { color: var(--ink-2); margin-top: .25rem; display: flex; gap: .35rem; align-items: flex-start; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem 2.5rem; display: grid; gap: 1.5rem; align-content: start; overscroll-behavior: contain; }
.dsec h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .55rem; font-family: var(--font-body); font-weight: 700; }
.status-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-pick button { --c: var(--ink); border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: .35rem .8rem; font-weight: 700; font-size: .875rem; min-height: 40px; display: inline-flex; gap: .4rem; align-items: center; color: var(--ink-2); }
.status-pick button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status-pick button:hover { border-color: var(--c); }
.status-pick button[aria-pressed="true"] { border-color: var(--c); background: var(--c); color: #fff; }
.status-pick button[aria-pressed="true"]::before { background: #fff; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }
.two-col .select, .two-col .input { min-height: 44px; }
.alert-box { display: flex; gap: .6rem; align-items: flex-start; background: var(--danger-soft); color: #7A1810; border-radius: 12px; padding: .7rem .85rem; font-weight: 700; }
.quote { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: .8rem .95rem; color: var(--ink); line-height: 1.6; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.pgrid button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--line-2); }
.pgrid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--ease); }
.pgrid button:hover img { transform: scale(1.04); }
.mini-map { height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.coords-line { margin-top: .5rem; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; font-variant-numeric: tabular-nums; }
.coords-line a { font-weight: 700; display: inline-flex; gap: .3rem; align-items: center; }
.contact-line { display: flex; flex-wrap: wrap; gap: .5rem; }
.plan-box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: .9rem 1rem 1rem; }
.plan-form { display: grid; grid-template-columns: 1.2fr .9fr .8fr 1.3fr; gap: .5rem; align-items: end; }
.plan-form .field label { font-size: .8rem; }
.plan-form .input, .plan-form .select { min-height: 42px; padding-top: .45rem; padding-bottom: .45rem; }
.plan-form .btn { grid-column: 1 / -1; justify-self: end; margin-top: .25rem; }
@media (max-width: 560px) { .plan-form { grid-template-columns: 1fr 1fr; } }
.linked { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .35rem; }
.linked button { width: 100%; display: flex; gap: .6rem; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem; min-height: 44px; }
.linked button:hover { border-color: #cbc5b7; }
.timeline { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .75rem; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: .75rem; }
.timeline .tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; background: var(--c, #A5ADAB); }
.timeline strong { font-size: .93rem; }
.timeline small { display: block; color: var(--muted); font-size: .8125rem; }
.note { background: var(--sun-soft); border-radius: 10px; padding: .5rem .7rem; margin-top: .3rem; font-size: .92rem; color: #4A3300; }
.note-form { display: grid; gap: .5rem; }
.note-form .textarea { min-height: 76px; }
.note-form .btn { justify-self: end; }

/* ---------- Carte ---------- */
.map-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.fchip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .875rem; cursor: pointer; min-height: 40px; }
.fchip:has(input:checked) { border-color: var(--ink-2); }
.fchip input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.fchip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.full-map { height: calc(100dvh - 190px); min-height: 440px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.pop { display: grid; gap: .35rem; min-width: 190px; font-family: var(--font-body); }
.pop strong { font-size: .95rem; }
.pop small { color: var(--muted); }
.pop .btn { margin-top: .25rem; color: #fff; }

/* ---------- Planning ---------- */
.week-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.week { display: grid; grid-template-columns: 184px repeat(6, minmax(150px, 1fr)); min-width: 1080px; }
.wk-h { padding: .65rem .8rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .92rem; background: var(--surface); text-transform: capitalize; }
.wk-h small { display: block; color: var(--muted); font-weight: 400; text-transform: none; }
.wk-h.today { color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.wk-corner { position: sticky; left: 0; z-index: 2; text-transform: none; color: var(--muted); display: flex; align-items: flex-end; }
.wk-team { padding: .75rem .8rem; border-top: 1px solid var(--line-2); display: flex; gap: .55rem; align-items: flex-start; position: sticky; left: 0; background: var(--surface); z-index: 1; border-right: 1px solid var(--line-2); }
.wk-team .tdot { margin: .4rem 0 0; }
.wk-team strong { display: block; font-size: .92rem; line-height: 1.3; }
.wk-team small { color: var(--muted); font-size: .8rem; }
.wk-cell { border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); padding: .4rem; display: flex; flex-direction: column; gap: .35rem; min-height: 104px; }
.wk-cell.today { background: #F4F9F6; }
.wk-cell.weekend { background: repeating-linear-gradient(-45deg, #FBFAF7 0 8px, #F6F4EF 8px 16px); }
.ev { --c: #1D6B58; text-align: left; border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); border-radius: 8px; padding: .38rem .5rem; font-size: .84rem; line-height: 1.3; width: 100%; color: var(--ink); transition: background-color .15s; }
.ev:hover { background: color-mix(in srgb, var(--c) 17%, #fff); }
.ev b { display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ev b .ic { color: var(--c); }
.ev.done { opacity: .62; }
.ev.done .ev-t { text-decoration: line-through; }
.add-ev { margin-top: auto; border: 1px dashed var(--line); background: none; border-radius: 8px; color: var(--muted); min-height: 30px; display: grid; place-items: center; opacity: 0; transition: opacity .15s, border-color .15s; }
.wk-cell:hover .add-ev, .add-ev:focus-visible { opacity: 1; }
.add-ev:hover { border-color: var(--primary); color: var(--primary); }
@media (hover: none) { .add-ev { opacity: 1; } }
.week-summary { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .8rem .2rem 0; color: var(--muted); font-size: .9rem; }
.week-summary b { color: var(--ink); }

.gantt { overflow-x: auto; }
.g-inner { min-width: 880px; position: relative; padding-bottom: .25rem; }
.g-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; border-bottom: 1px solid var(--line-2); min-height: 48px; }
.g-row:last-child { border-bottom: 0; }
.g-label { padding: .4rem 1.1rem; font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.g-track { position: relative; height: 48px; }
.g-head { min-height: 36px; border-bottom: 1px solid var(--line); }
.g-head .g-track { height: 36px; }
.g-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-2); padding: .5rem .5rem; font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.g-bar { position: absolute; top: 12px; height: 24px; border-radius: 7px; background: var(--c); color: #fff; font-size: .76rem; font-weight: 700; padding: 0 .55rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden; border: 0; min-width: 12px; }
.g-bar:hover { filter: brightness(1.1); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.g-today span { position: absolute; top: 2px; left: 5px; font-size: .7rem; color: var(--danger); font-weight: 700; white-space: nowrap; background: var(--surface); padding: 0 .2rem; }

/* ---------- Annonces ---------- */
.arow { display: grid; grid-template-columns: 104px 1fr auto; gap: 1rem; align-items: center; padding: .85rem 1.1rem; border-top: 1px solid var(--line-2); }
.arow:first-child { border-top: 0; }
.arow img { width: 104px; height: 64px; object-fit: cover; border-radius: 10px; }
.arow h3 { font-size: 1rem; font-weight: 700; }
.ameta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; align-items: center; font-size: .86rem; color: var(--muted); margin-top: .3rem; }
.ameta > span { display: inline-flex; align-items: center; gap: .3rem; }
.aact { display: flex; gap: .3rem; align-items: center; }
.arow.is-draft { background: repeating-linear-gradient(-45deg, #fff 0 10px, #FBFAF7 10px 20px); }
.switch { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 700; color: var(--ink-2); cursor: pointer; min-height: 44px; padding: 0 .4rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: #CFCABF; position: relative; cursor: pointer; transition: background-color .2s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 720px) {
  .arow { grid-template-columns: 68px 1fr; }
  .arow img { width: 68px; height: 50px; }
  .aact { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Dialogues formulaires ---------- */
.dlg-form { width: min(620px, 100%); }
.dlg-form.wide { width: min(760px, 100%); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-preview { display: flex; gap: .8rem; align-items: center; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: .6rem; }
.form-preview img { width: 120px; height: 68px; border-radius: 8px; object-fit: cover; }
.dlg-confirm { width: min(420px, 100%); }
.dlg-photo { background: #0f1413; padding: 0; width: min(1000px, 100%); }
.dlg-photo img { width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; }
.dlg-photo .bar { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: .4rem .5rem .4rem 1rem; }
.dlg-photo .icon-btn { color: #fff; }
.dlg-photo .icon-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- Équipes ---------- */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.team { --c: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.team-top { height: 6px; background: var(--c); }
.team-body { padding: 1rem 1.1rem 1.1rem; display: grid; gap: .85rem; }
.team-body h2 { font-size: 1.15rem; font-weight: 800; }
.members { display: flex; flex-wrap: wrap; gap: .35rem; }
.member { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem .2rem .2rem; border-radius: 99px; background: var(--bg); font-size: .875rem; }
.member i { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 700; }
.team-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.team-stats div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: .5rem .7rem; }
.team-stats b { font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; display: block; line-height: 1.2; }
.team-stats span { font-size: .8rem; color: var(--muted); }
.team-add { border: 1.5px dashed #C9C3B5; background: transparent; border-radius: 16px; min-height: 180px; display: grid; place-items: center; align-content: center; gap: .5rem; color: var(--ink-2); font-weight: 700; }
.team-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.color-row { display: flex; gap: .45rem; flex-wrap: wrap; }
.color-row label { position: relative; }
.color-row input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.color-row span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.color-row input:checked + span { box-shadow: 0 0 0 2.5px var(--ink); }
.color-row input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
