:root {
  --red: #b3261e; --red-d: #8c1d18; --ink: #1d1b1a; --muted: #6b6461; --line: #e4dedb;
  --bg: #f6f3f1; --card: #fff; --ok: #1e7b3c; --warn: #b26a00; --grey: #77706d; --blue: #1f5fa8;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--red); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 650; }
.logo { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.zone-tag { font-size: 13px; opacity: .9; padding: 2px 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; }
.zone-tag:empty { display: none; }
.user-btn { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.tabs { position: sticky; top: 50px; z-index: 999; display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tabs a { padding: 11px 14px; text-decoration: none; color: var(--muted); font-weight: 550; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--red); border-color: var(--red); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.pad { padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.big-choice { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.big-choice a { display: block; padding: 26px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.big-choice a:hover { border-color: var(--red); }
.big-choice b { display: block; font-size: 20px; margin-bottom: 4px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 550; }
input, select, textarea { font: inherit; color: var(--ink); padding: 9px 10px; border: 1px solid #cfc7c3; border-radius: 8px; background: #fff; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(179,38,30,.25); border-color: var(--red); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-d); }
.btn.danger { color: var(--red); border-color: #e9b9b5; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.search { display: flex; gap: 8px; }
.search input { font-size: 17px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 650; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf8f7; }
.tbl-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: #eee; color: #444; white-space: nowrap; }
.pill.ok { background: #e3f3e8; color: var(--ok); }
.pill.def { background: #fbe4e2; color: var(--red); }
.pill.anu { background: #ece9e8; color: var(--grey); }
.pill.oth { background: #fff1dc; color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fbe4e2; color: var(--red-d); border-radius: 99px; padding: 4px 6px 4px 11px; font-size: 13px; font-weight: 600; }
.chip button { border: 0; background: rgba(0,0,0,.08); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }
.map { height: 340px; border-radius: var(--r); border: 1px solid var(--line); background: #e8e4e1; }
.map.full { height: calc(100vh - 230px); min-height: 380px; }
.map-off { display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2000; background: #222; color: #fff; padding: 11px 18px; border-radius: 10px; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.luc { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.luc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.luc-head b { min-width: 92px; }
.mat { font-size: 13px; margin: 8px 0 0; padding-left: 0; list-style: none; }
.mat li { display: flex; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px dashed var(--line); }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi b { display: block; font-size: 24px; }
.bar { height: 8px; background: var(--red); border-radius: 4px; }
/* teren */
.field { max-width: 560px; margin: 0 auto; }
.field .idbox { font-size: 30px; text-align: center; font-weight: 700; letter-spacing: .05em; padding: 14px; }
.gps-btn { width: 100%; padding: 20px; font-size: 19px; border-radius: 14px; margin: 12px 0 6px; }
.gps-info { text-align: center; font-size: 14px; color: var(--muted); min-height: 22px; }
.notice { background: #fff1dc; border: 1px solid #f1d29f; color: #6b4300; border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.okbox { background: #e3f3e8; border: 1px solid #b6dcc2; color: #14532a; border-radius: var(--r); padding: 12px 14px; margin: 10px 0; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; }
@media (max-width: 640px) {
  main { padding: 12px; }
  .brand span:last-child { display: none; }
  .hide-m { display: none; }
  .map.full { height: calc(100vh - 260px); }
}
