/* GoodCRM Avocats — interface de travail, sobre et rapide */
:root {
  --fond: #f4f3ef; --carte: #fff; --encre: #1d1c24; --nuit: #26252e;
  --laiton: #a8834e; --ligne: #e3dfd5; --muted: #77736a;
  --rouge: #a13a3a; --vert: #3e6b4a; --ambre: #b07f1e;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: var(--fond); color: var(--encre); line-height: 1.55; font-size: 15.5px; }
a { color: var(--nuit); }
img, video { max-width: 100%; }
code { background: var(--ligne); padding: .1em .4em; border-radius: 3px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--ligne); margin: 1.2rem 0; }

.topbar { background: var(--nuit); color: #f3f1ec; position: sticky; top: 0; z-index: 20; }
.topbar-in { width: min(1200px, 95%); margin-inline: auto; display: flex; align-items: center; gap: 1.4rem; padding: .8rem 0; flex-wrap: wrap; }
.brand { color: #f3f1ec; text-decoration: none; font-weight: 600; }
.brand-mark { color: #d8b98a; }
.topbar .nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar .nav a { color: rgba(243,241,236,.82); text-decoration: none; font-size: .93rem; }
.topbar .nav a.on, .topbar .nav a:hover { color: #d8b98a; }
.topbar .out { margin-left: auto; opacity: .8; }

.wrap { width: min(1200px, 95%); margin: 1.4rem auto 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem 0 2.2rem; }

.card { background: var(--carte); border: 1px solid var(--ligne); border-radius: 8px; padding: 1.3rem 1.4rem; margin-bottom: 1.3rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.08rem; margin-bottom: .9rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.fil { margin-bottom: .8rem; font-size: .9rem; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.stat b { display: block; font-size: 1.9rem; color: var(--laiton); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .86rem; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: 1fr; } }

label { display: block; font-size: .84rem; font-weight: 600; color: #565248; margin: .8rem 0 .25rem; }
input, select, textarea { width: 100%; padding: .6rem .7rem; font: inherit; border: 1px solid var(--ligne); border-radius: 5px; background: var(--fond); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--laiton); outline-offset: 1px; }
textarea { resize: vertical; }

.btn { display: inline-block; background: var(--nuit); color: #f3f1ec; border: 0; border-radius: 5px; padding: .6rem 1.1rem; font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; margin-top: .6rem; }
.btn:hover { background: var(--laiton); }
.btn.primary { background: var(--laiton); }
.btn.primary:hover { background: var(--nuit); }
.btn.small { padding: .45rem .85rem; font-size: .86rem; }
.btn.tiny { padding: .15rem .5rem; font-size: .78rem; margin: 0; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--ligne); }
.btn.ghost:hover { color: var(--rouge); border-color: var(--rouge); background: transparent; }
.btn.danger { background: transparent; color: var(--rouge); border: 1px solid var(--rouge); }
.btn.danger:hover { background: var(--rouge); color: #fff; }
.btn.block { width: 100%; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

.flash { background: #e7efe4; border: 1px solid #c9dcc4; color: #2f4d34; border-radius: 5px; padding: .7rem 1rem; margin-bottom: 1rem; }
.flash.err { background: #f7e6e4; border-color: #e4c4c0; color: #7c3128; }

.badge { display: inline-block; background: var(--ligne); border-radius: 20px; padding: .1rem .6rem; font-size: .76rem; }
.badge-actif { background: #e0ecdd; color: #2f4d34; }
.badge-clos { background: #eee; color: #777; }
.badge-alerte { background: #f5e3c8; color: #7a5a1e; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--ligne); font-size: .92rem; vertical-align: top; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--nuit); color: #d8b98a; font-size: .82rem; font-weight: 600; }
.avatar.grand { width: 52px; height: 52px; font-size: 1.05rem; }

.liste { list-style: none; }
.liste li { padding: .45rem 0; border-bottom: 1px solid var(--ligne); display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.liste li.fait { opacity: .55; text-decoration: line-through; }
.liste li.fait .badge, .liste li.fait .date { text-decoration: none; }
.date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.date.urgent { color: var(--ambre); font-weight: 600; }
.date.depasse { color: var(--rouge); font-weight: 600; }
.inline { display: inline; margin: 0; }
.coche { background: none; border: 0; font-size: 1.05rem; cursor: pointer; padding: 0 .2rem; }

.ligne-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ligne-form input, .ligne-form select { width: auto; flex: 1; min-width: 130px; }
.ligne-form .btn { margin-top: 0; }

.fiche-tete { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.onglets { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
.onglets a { text-decoration: none; font-size: .84rem; padding: .3rem .7rem; border: 1px solid var(--ligne); border-radius: 20px; color: var(--muted); }
.onglets a:hover { border-color: var(--laiton); color: var(--encre); }
.confidentiel { font-size: .82rem; color: var(--muted); margin: -0.6rem 0 1rem .2rem; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; }
.pdf-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pdf-actions .btn { margin-top: 0; }

.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 780px) { .grille-3 { grid-template-columns: 1fr; } }

.bloc-ajout { border: 1px dashed var(--ligne); border-radius: 6px; padding: .7rem 1rem; margin-bottom: 1rem; background: var(--fond); }
.bloc-ajout summary { cursor: pointer; font-weight: 600; font-size: .93rem; }
.bloc-ajout-ouvert { border: 1px dashed var(--ligne); border-radius: 6px; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--fond); }

.dossier { border: 1px solid var(--ligne); border-radius: 6px; padding: .8rem 1rem; margin-bottom: 1rem; }
.dossier summary { cursor: pointer; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.sous-titre { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .9rem 0 .3rem; }

.rdv-item { border: 1px solid var(--ligne); border-radius: 6px; padding: .7rem 1rem; margin-bottom: .7rem; }
.rdv-item.futur { border-left: 3px solid var(--laiton); }
.rdv-item summary { cursor: pointer; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }

.timeline { border-left: 2px solid var(--ligne); margin-left: .4rem; padding-left: 1.1rem; }
.tl-item { position: relative; padding: .3rem 0 1rem; }
.tl-item::before { content: ""; position: absolute; left: -1.47rem; top: .65rem; width: 9px; height: 9px; border-radius: 50%; background: var(--laiton); }
.tl-item header { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; }
.tl-item header form { margin-left: auto; }

.media-btns { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.media-btns .btn { margin-top: 0; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-top: .8rem; }
.media-item { border: 1px solid var(--ligne); border-radius: 6px; padding: .4rem; background: var(--fond); }
.media-item img, .media-item video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; background: #000; }
.media-item figcaption { font-size: .76rem; color: var(--muted); margin-top: .3rem; }
.media-item form { margin-top: .3rem; }

.gate { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--nuit); padding: 1rem; }
.gate-card { width: min(430px, 100%); }
.gate-card h1 { margin-bottom: .4rem; }


/* ============================================================
   Confort mobile (PWA) — ajout GoodWebsites 07.2026
   Les tableaux défilent horizontalement dans leur carte au lieu
   de faire déborder toute la page sur téléphone.
   ============================================================ */
@media (max-width: 640px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .card, .wrap { max-width: 100%; overflow-x: hidden; }
}
