:root {
  --bg: #efe4c8; --card: #f8f1de; --ink: #1d2b22; --muted: #5d6b5f; --green: #1d3b2a;
  --rust: #b0603a; --red: #a3291f; --line: #d6c7a0; --ok: #4f7a2a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, "Inter", "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* Login */
#login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 3px solid var(--green); padding: 28px 22px; text-align: center; }
.login-card img { width: 72px; }
.kicker { letter-spacing: .25em; font-size: 11px; font-weight: 700; color: var(--green); text-transform: uppercase; }
h1 { margin: 4px 0 6px; font-size: 26px; color: var(--green); letter-spacing: .02em; }
.bar { width: 70px; height: 3px; background: var(--rust); margin: 0 auto 18px; }
.field { text-align: left; margin: 12px 0; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); background: #fffaf0; border-radius: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; background: var(--green); color: #f3e9cf; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.danger { background: var(--red); }
.btn.small { width: auto; padding: 7px 11px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.roles { display: flex; gap: 6px; margin-top: 8px; }
.roles button { flex: 1; padding: 8px 4px; border: 1px solid var(--line); background: #fffaf0; border-radius: 8px; font-size: 12px; cursor: pointer; }
.roles button.on { background: var(--green); color: #f3e9cf; border-color: var(--green); }

/* App shell */
#app { display: flex; flex-direction: column; height: 100%; }
header { background: var(--green); color: #f3e9cf; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
header img { width: 30px; filter: invert(92%) sepia(15%) saturate(300%) hue-rotate(5deg); }
header .t { flex: 1; min-width: 0; }
header .t b { display: block; font-size: 15px; letter-spacing: .03em; }
header .t span { font-size: 12px; opacity: .8; }
header select { background: transparent; color: #f3e9cf; border: 1px solid #ffffff55; border-radius: 6px; padding: 4px; font-size: 12px; }
header select option { color: var(--ink); }
main { flex: 1; overflow-y: auto; padding: 14px 16px 90px; }
main.map-mode { padding: 0; overflow: hidden; position: relative; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 1000; }
nav button { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 1px 9px; font-size: 10.5px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav button .i { font-size: 19px; line-height: 1; }
nav button.on { color: var(--green); font-weight: 700; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.card h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--rust); }
.card h3 { margin: 10px 0 4px; font-size: 15px; }
.hero { background: var(--green); color: #f3e9cf; border: 0; }
.hero h2 { color: #e9b98f; }
.hero .poste { font-size: 44px; font-weight: 800; line-height: 1; }
.hero .sub { opacity: .85; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li .r { margin-left: auto; color: var(--muted); text-align: right; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff; }
.chip { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.interdits { background: var(--red); color: #fff; border: 0; }
.interdits h2 { color: #ffd9cc; }
.interdits li { font-weight: 700; }
ul.dash { padding-left: 18px; margin: 4px 0; }
ul.dash li { margin: 3px 0; }
a.tel { color: var(--green); font-weight: 700; text-decoration: none; }
.check { display: flex; gap: 8px; flex-wrap: wrap; }
.check label { border: 1px solid var(--line); background: #fffaf0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.check input { margin-right: 4px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 2000; font-size: 14px; max-width: 90%; }
.tag-gps { font-size: 11px; color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { text-align: left; padding: 6px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
table.t select { padding: 4px; border-radius: 6px; border: 1px solid var(--line); background: #fffaf0; max-width: 110px; }
.danger-box { border: 2px solid var(--red); }
.seg { display: flex; border: 1px solid var(--green); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; padding: 8px; background: transparent; color: var(--green); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--green); color: #f3e9cf; }

/* Map */
#map { position: absolute; inset: 0 0 58px 0; }
.map-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 900; display: flex; gap: 6px; flex-wrap: wrap; }
.map-tools select, .map-tools button { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; }
.lbl { background: #f8f1de; border: 0; box-shadow: none; font-weight: 700; font-size: 11px; color: #1d2b22; padding: 0 3px; }
.leaflet-tooltip-left.lbl::before, .leaflet-tooltip-right.lbl::before { display: none; }
.me-poste { border: 3px solid #fff; box-shadow: 0 0 0 3px var(--red); border-radius: 50%; }
.pk { background: #2c5a8c; color: #fff; font-weight: 800; font-size: 11px; border-radius: 4px; padding: 1px 4px; border: 1.5px solid #fff; white-space: nowrap; }
@media (min-width: 760px) { main { max-width: 720px; margin: 0 auto; width: 100%; } main.map-mode { max-width: none; } }
.nolbl .lbl { display: none; }
