:root {
  --green: #0b6e4f; --green-d: #07513a; --green-l: #e3f2ec; --bg: #f4f7f5; --card: #fff; --ink: #17211c; --muted: #5d6b64;
  --line: #d9e2dd; --warn: #b45309; --warn-bg: #fff4e0; --err: #b3261e; --blue: #1d4ed8; --wa: #128c4a;
  --r: 12px; --nav-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
main { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + 28px); outline: none; }
h1 { font-size: 1.4rem; margin: .2rem 0; } h2 { font-size: 1.1rem; margin: .2rem 0; } h3 { font-size: 1rem; margin: .2rem 0; }
a { color: var(--green-d); }
.hidden { display: none !important; }
.center { text-align: center; } .muted, .hint { color: var(--muted); } .hint, small { font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; } .row > * { flex: 1; }
.row.between { justify-content: space-between; align-items: center; } .row.between > * { flex: 0 1 auto; }
.row.wrap { flex-wrap: wrap; align-items: center; } .row.wrap > * { flex: 0 1 auto; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--green); color: #fff; }
.topbar .row { flex: 0; gap: 4px; align-items: center; }
.brand { color: #fff; text-decoration: none; font-weight: 700; }
.icon-btn { position: relative; background: transparent; color: #fff; border: 0; font-size: 1.3rem; padding: 6px 10px; cursor: pointer; border-radius: 8px; }
.icon-btn .dot { position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #ffcf33; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: .72rem; text-decoration: none; color: var(--muted); min-height: var(--nav-h); }
.bottom-nav a span { font-size: 1.3rem; } .bottom-nav a.on { color: var(--green); font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card.inset { background: var(--green-l); border-color: transparent; } .card.highlight { border-color: var(--green); border-width: 2px; }
.card.warn { background: var(--warn-bg); border-color: #f3c27a; } .card.off { opacity: .6; }
a.card { display: block; text-decoration: none; color: inherit; } a.card:active { background: var(--green-l); }
.req-card { display: flex !important; flex-direction: column; gap: 4px; }
.urg-border-debordement { border-left: 5px solid var(--err); } .urg-border-rapide { border-left: 5px solid #e08a00; } .urg-border-planifier { border-left: 5px solid var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--green); background: #fff; color: var(--green-d); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; } .btn.ghost { border-color: var(--line); color: var(--muted); font-weight: 500; }
.btn.danger { border-color: var(--err); color: var(--err); } .btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.big { min-height: 54px; font-size: 1.05rem; width: 100%; } .btn:disabled { opacity: .55; cursor: wait; }
.link { background: none; border: 0; color: var(--green-d); text-decoration: underline; font: inherit; cursor: pointer; }
.back { text-decoration: none; }

.field { display: flex; flex-direction: column; gap: 4px; flex: 1; } .lbl { font-weight: 600; font-size: .92rem; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #b9c7c0; border-radius: 10px; }
textarea { resize: vertical; } input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #7cc5a8; outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--green); }
.check, .choice { display: flex; gap: 10px; align-items: flex-start; } .choice { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-l); }
.error { color: var(--err); margin: 0; font-weight: 600; } .error:empty { display: none; }
.ok-text { color: var(--green-d); } .warn-text { color: var(--warn); font-weight: 600; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 14px; text-align: center; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.tile .ico { font-size: 2rem; } .tile:first-child { background: var(--green); color: #fff; border-color: var(--green); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #e8ecea; color: #33403a; white-space: nowrap; }
.st-new { background: #e6efff; color: #1e40af; } .st-prop { background: #fff1d0; color: #8a5a00; } .st-other { background: #ffe3d6; color: #9a3a00; }
.st-ok { background: #d5f2e3; color: #065f3f; } .st-run { background: #d9e8ff; color: #1d4ed8; } .st-done { background: #e8ecea; color: #33403a; } .st-off { background: #f6dcda; color: #8f1d17; }
.urg-debordement { background: #f8d4d1; color: #8f1d17; } .urg-rapide { background: #ffe8b8; color: #7a4d00; } .urg-planifier { background: #e0f0e8; color: #0b5a40; }
.pay { font-weight: 700; font-size: .85rem; } .pay-paye { color: var(--green-d); } .pay-partiel { color: var(--warn); } .pay-en_attente { color: var(--muted); }
.count { background: var(--line); border-radius: 99px; padding: 0 8px; font-size: .8rem; }
.slot { font-weight: 600; } .slot.big { font-size: 1.15rem; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .filters input { grid-column: 1 / -1; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.timeline li { padding-left: 12px; } .timeline time { color: var(--muted); font-size: .82rem; }

.map { height: 300px; border-radius: 10px; border: 1px solid var(--line); z-index: 0; } .map.small { height: 190px; }
.map-off { display: grid; place-items: center; background: #eef2f0; color: var(--muted); }
.geo-status { margin: 0; font-size: .92rem; } .geo-status.ok { color: var(--green-d); font-weight: 600; } .geo-status.warn { color: var(--warn); font-weight: 600; }

.plan.semaine { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { main { max-width: 1100px; } .plan.semaine { grid-template-columns: repeat(7, 1fr); } .tiles { grid-template-columns: repeat(4, 1fr); } .filters { grid-template-columns: repeat(3, 1fr) 2fr; } .filters input { grid-column: auto; } }
.plan-day { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 6px; } .plan-day.today { border-color: var(--green); border-width: 2px; }
.plan-day h3 { text-transform: capitalize; }
.plan-item { display: block; padding: 8px; border-radius: 8px; background: var(--green-l); border: 2px solid var(--green); color: inherit; text-decoration: none; font-size: .9rem; }
.plan-item.tentative { background: #fffaf0; border: 2px dashed #e0a030; } .plan-item.done { background: #eee; border-color: #bbb; }
.seg { display: flex; border: 1px solid var(--green); border-radius: 10px; overflow: hidden; } .seg button { border: 0; background: #fff; padding: 8px 14px; font: inherit; cursor: pointer; } .seg .on { background: var(--green); color: #fff; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start; justify-content: center; padding: 14px; overflow-y: auto; }
.modal > .card { width: 100%; max-width: 560px; margin-top: 30px; }
.notif { display: block; padding: 8px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid var(--line); } .notif.unread { background: #fff9e0; border-color: #f0d56a; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; max-width: 92%; padding: 12px 18px; border-radius: 10px; background: #17211c; color: #fff; transition: .2s; }
.toast.err { background: var(--err); } .toast.show { opacity: 1; transform: translate(-50%, 0); }
.login { max-width: 420px; margin: 24px auto 0; }
.big-ico { font-size: 3.5rem; } .ref { font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; color: var(--green-d); margin: 0; }
.loading { padding: 40px 0; }
.site-sum { line-height: 1.35; }
.leaflet-container { font: inherit; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
