:root {
  --navy: #17161d;
  --navy-2: #2b2936;
  --sky: #fdb022;
  --ink: #1b1a22;
  --muted: #6b6878;
  --line: #e7e5ee;
  --bg: #f6f5f9;
  --card: #ffffff;
  --sel: #ffb020;
  --radius: 12px;
  font-family: "Segoe UI", "Rubik", "Assistant", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--bg); }
button { font: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px; background: var(--navy); color: #fff; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 44px; height: 44px; flex: none; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; }
.brand p { margin: 2px 0 0; font-size: 13px; opacity: .75; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body:not([data-mode="photos"]) .only-photos, body:not([data-mode="coverage"]) .only-coverage, body:not([data-mode="sorter"]) .only-sorter { display: none !important; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 12px; margin-inline-end: auto; margin-inline-start: 18px; }
.tabs button { border: 0; background: none; color: rgba(255,255,255,.75); padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tabs button:hover { color: #fff; }
.tabs button.on { background: #fff; color: var(--navy); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.btn.primary { background: var(--sky); border-color: var(--sky); color: var(--navy); }
.btn.primary:hover { background: #ffc34d; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .4; cursor: default; }
.menu { position: relative; }
.menu-list {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 2000; min-width: 190px;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; display: grid;
}
.menu-list[hidden] { display: none; }
.menu-list button { border: 0; background: none; text-align: start; padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.menu-list button:hover { background: var(--bg); }

/* ---------- progress ---------- */
.progress { position: relative; height: 26px; background: #efedf3; font-size: 13px; display: flex; align-items: center; padding: 0 18px; }
.progress[hidden] { display: none; }
.progress-bar { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: #fde2a3; transition: width .2s; }
.progress span { position: relative; font-weight: 600; color: var(--navy); }
.progress button { position: relative; margin-inline-start: auto; border: 1px solid #c9c5d3; background: #fff; color: var(--navy); border-radius: 7px; font-size: 12px; padding: 1px 10px; }

/* ---------- layout ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.side {
  width: 360px; flex: none; display: flex; flex-direction: column; background: var(--card);
  border-inline-end: 1px solid var(--line); min-height: 0;
}
#map { flex: 1; min-height: 0; background: #1c2833; }

.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 14px 4px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--bg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.stat b { display: block; font-size: 19px; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.daterange { padding: 2px 16px 0; font-size: 12.5px; color: var(--muted); min-height: 18px; }

.controls { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.field select { font: inherit; font-size: 14px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13.5px; }
.toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- list ---------- */
.list { flex: 1; overflow-y: auto; padding: 6px 0 20px; position: relative; }
#rows { position: relative; }
.vrow { position: absolute; inset-inline: 0; }
.empty { padding: 24px 18px; }
.drop-hint {
  border: 2px dashed #cfccd9; border-radius: var(--radius); padding: 26px 18px; text-align: center; color: var(--navy-2);
}
.drop-hint svg { width: 46px; height: 46px; color: var(--sky); }
.drop-hint p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 13px; }
.link { background: none; border: 0; color: #8a5a00; text-decoration: underline; margin-top: 8px; }

.group-h {
  display: flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 14px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--line);
}
.group-h .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.group-h .cnt { margin-inline-start: auto; font-weight: 500; color: var(--muted); }
.group-h.warn { color: #9a5b00; }

.item {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center;
  height: 62px; padding: 0 14px; cursor: pointer; border-inline-start: 3px solid transparent;
}
.item:hover { background: #f5f3fa; }
.item.sel { background: #fff6e5; border-inline-start-color: var(--sel); }
.item img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #eceaf1; display: block; }
.item .t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.item .s { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.item.nogps { cursor: default; opacity: .75; }

/* ---------- markers ---------- */
.pm { background: none; border: 0; }
.pm-in { position: relative; width: 26px; height: 26px; }
.pm-in .dot {
  position: absolute; left: 7px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.4);
}
.pm-in .arr { position: absolute; inset: 0; }
.pm-in .arr::before {
  content: ""; position: absolute; left: 8px; top: -3px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--c);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px rgba(0,0,0,.6));
}
.pm.sel .dot { background: var(--sel); width: 16px; height: 16px; left: 5px; top: 5px; }
.pm.sel { z-index: 10000 !important; }

.marker-cluster {
  background: rgba(23,22,29,.4); border-radius: 50%;
}
.marker-cluster div {
  width: 30px; height: 30px; margin: 5px; border-radius: 50%; background: var(--navy);
  color: #fff; font: 700 12px/30px "Segoe UI", Arial, sans-serif; text-align: center; border: 2px solid var(--sky);
}

.flight-label {
  background: var(--navy); color: #fff; border: 0; border-radius: 6px; font: 600 11px "Segoe UI", Arial, sans-serif;
  padding: 2px 6px; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.flight-label::before { display: none; }

/* ---------- popup ---------- */
.leaflet-popup-content { margin: 10px; width: 270px !important; }
.pop { direction: rtl; text-align: right; font-family: "Segoe UI", Arial, sans-serif; }
.pop img { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; background: #eceaf1; display: block; cursor: zoom-in; }
.pop h3 { margin: 8px 0 4px; font-size: 14px; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pop td { padding: 2px 0; vertical-align: top; }
.pop td:first-child { color: var(--muted); white-space: nowrap; padding-inline-end: 10px; }
.pop .btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pop .btns a, .pop .btns button {
  font-size: 12px; padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg);
  color: var(--navy); text-decoration: none; cursor: pointer;
}
.pop .btns .main { background: var(--navy); color: #fff; border-color: var(--navy); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- drop overlay ---------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 5000; background: rgba(23,22,29,.8); display: grid; place-items: center;
}
.drop-overlay[hidden] { display: none; }
.drop-overlay div {
  border: 3px dashed var(--sky); border-radius: 20px; padding: 60px 80px; color: #fff; font-size: 26px; font-weight: 700;
  pointer-events: none;
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 4000; background: rgba(15,14,19,.8); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.modal-card header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.modal-card h2 { flex: 1; margin: 0; font-size: 16px; direction: ltr; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-size: 20px; line-height: 1; color: var(--navy); }
.icon-btn:hover { background: #eceaf1; }
.icon-btn.close { font-size: 15px; }
.modal-body { display: grid; grid-template-columns: 1fr 340px; min-height: 0; overflow: hidden; }
.modal-img { background: #0f0e13; display: grid; place-items: center; min-height: 300px; }
.modal-img img { max-width: 100%; max-height: calc(100vh - 120px); display: block; }
.modal-meta { overflow-y: auto; padding: 12px 16px; max-height: calc(100vh - 110px); }
.modal-meta table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-meta td { padding: 4px 0; border-bottom: 1px solid #efedf3; vertical-align: top; }
.modal-meta td:first-child { color: var(--muted); padding-inline-end: 10px; white-space: nowrap; }
.modal-meta table.all td { font-size: 12px; direction: ltr; text-align: left; word-break: break-all; }
.modal-meta table.all td:first-child { white-space: normal; word-break: normal; }
.modal-meta details { margin-top: 12px; }
.modal-meta summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; }
.m-links { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.m-links a, .m-links button { font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--navy); text-decoration: none; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 6000;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  .layout { flex-direction: column-reverse; }
  .side { width: 100%; height: 45vh; border-inline-end: 0; border-top: 1px solid var(--line); }
  .modal-body { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-meta { max-height: none; }
}

/* ---------- coverage areas ---------- */
.search { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); width: 100%; }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.filters select { font: inherit; font-size: 13px; padding: 6px 6px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); min-width: 0; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.pad { padding: 18px; }

.cov-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid #efedf3; border-inline-start: 3px solid transparent; }
.cov-item:hover { background: #f5f3fa; }
.cov-item.sel { background: #fff6e5; border-inline-start-color: var(--sel); }
.cov-item .sw { width: 12px; height: 12px; border-radius: 3px; margin-top: 4px; }
.cov-main { min-width: 0; }
.cov-item .t { font-size: 14px; font-weight: 700; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-item .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-area { font-size: 13px; font-weight: 600; color: var(--navy-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; background: color-mix(in srgb, var(--b) 16%, #fff); color: color-mix(in srgb, var(--b) 70%, #000); border: 1px solid color-mix(in srgb, var(--b) 40%, #fff); }
.badge.gcp { --b: #1f9d6b; }

.leaflet-coverage-pane path { cursor: pointer; }
body[data-mode="photos"] .leaflet-coverage-pane path { pointer-events: none; fill-opacity: .12; }

.pop h3.rtl { direction: rtl; font-size: 15px; white-space: normal; }
.pop .btns .danger { color: #b3261e; border-color: #f3c9c5; background: #fdf1f0; }
.pop a { color: #8a5a00; }
.chooser { display: grid; gap: 4px; margin-top: 6px; }
.chooser button { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; text-align: start; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 9px; font-size: 13px; color: var(--ink); }
.chooser button:hover { background: var(--bg); }
.chooser .sw { width: 12px; height: 12px; border-radius: 3px; }
.chooser small { color: var(--muted); }

/* ---------- coverage form ---------- */
.form-card { width: min(720px, 100%); }
.modal-card h2.start { text-align: start; direction: rtl; }
.form-body { overflow-y: auto; padding: 6px 18px 14px; display: grid; gap: 4px; }
.form-card fieldset { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.form-card legend { font-size: 13px; font-weight: 700; color: var(--navy); padding: 0; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.f { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f input, .form-card textarea { font: inherit; font-size: 14.5px; color: var(--ink); padding: 8px 10px; border: 1px solid #d5d2de; border-radius: 9px; width: 100%; background: #fff; }
.f input:focus, .form-card textarea:focus, .search:focus { outline: 2px solid var(--sky); outline-offset: 0; border-color: var(--sky); }
.form-card textarea { resize: vertical; }
.filedrop { display: grid; gap: 2px; text-align: center; padding: 14px; border: 2px dashed #cfccd9; border-radius: var(--radius); cursor: pointer; color: var(--navy-2); }
.filedrop:hover { background: #fdf8ec; border-color: var(--sky); }
.filedrop span { font-size: 12.5px; color: var(--muted); }
.parts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.parts:empty { display: none; }
.parts li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.parts .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-weight: 600; }
.parts .sum { background: none; font-weight: 700; grid-template-columns: 1fr auto; }
.parts .x { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 2px 4px; }
.parts .x:hover { color: #b3261e; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 7px 14px; border: 1px solid #d5d2de; border-radius: 20px; font-size: 14px; color: var(--ink); background: #fff; }
.chips input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--sky); outline-offset: 2px; }
.gcp-box { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.gcp-box[hidden] { display: none; }
.gcp-current { flex-basis: 100%; }
.gcp-current:empty { display: none; }
.warn-text { color: #9a5b00; }
.btn-light, .btn-solid { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 10px; cursor: pointer; border: 1px solid #d5d2de; background: #fff; color: var(--navy); }
.btn-light[hidden] { display: none; }
.btn-light:hover { background: var(--bg); }
.btn-solid { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-2); }
.btn-solid:disabled { opacity: .5; cursor: default; }
.form-card footer { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.form-error { flex: 1; color: #b3261e; font-size: 13px; }

@media (max-width: 820px) {
  .tabs { margin-inline-start: 0; }
  .grid4 { grid-template-columns: 1fr 1fr; }
}

/* הטופס לא מתרחב מעבר לחלון: עמודות עם רוחב מינימלי 0 */
.modal { grid-template-columns: minmax(0, 1fr); }
.form-card { justify-self: center; }
.form-body { grid-template-columns: minmax(0, 1fr); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.f input { min-width: 0; }
@media (max-width: 820px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.parts .name { unicode-bidi: plaintext; text-align: start; }

/* ---------- brand: מבט על ---------- */
.brand h1 { font-size: 21px; letter-spacing: .2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy); }
.link { color: var(--ink); font-weight: 600; text-decoration-color: var(--sky); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.drop-hint svg { color: var(--sky); }
.leaflet-container a { color: #8a5a00; }

/* ---------- photo sorter ---------- */
.so-scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.so-step { padding: 14px 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 9px; grid-template-columns: minmax(0, 1fr); }
.so-step[hidden] { display: none; }
.so-step h3 { margin: 0; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.so-step h3 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--sky); color: var(--navy); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; flex: none; }
.so-step p { margin: 0; }
.so-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.so-row input { font: 13px Consolas, "Cascadia Mono", monospace; padding: 8px 9px; border: 1px solid #d5d2de; border-radius: 9px; min-width: 0; color: var(--ink); background: #fff; }
.so-row input:focus, .so-folder input:focus { outline: 2px solid var(--sky); border-color: var(--sky); }
.so-row .btn-light { padding: 7px 12px; font-size: 13px; }
.so-inline { display: flex; gap: 6px; align-items: center; font-size: 13.5px; cursor: pointer; }
.wide { width: 100%; text-align: center; }
.btn-light:disabled { opacity: .55; cursor: default; }

.so-prog { position: relative; height: 28px; background: #efedf3; border-radius: 8px; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 12.5px; }
.so-prog[hidden] { display: none; }
.so-prog i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: #fde2a3; transition: width .25s; }
.so-prog span { position: relative; flex: 1; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-prog button { position: relative; border: 1px solid #c9c5d3; background: #fff; border-radius: 6px; font-size: 12px; padding: 1px 9px; color: var(--navy); }
.so-status { font-size: 13px; color: var(--muted); }
.so-status:empty { display: none; }
.so-status.err { color: #b3261e; }
.so-status.ok { color: #1b6e4b; }

.so-group { display: grid; grid-template-columns: auto 12px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; }
.so-group.off { background: var(--bg); }
.so-group.off .so-main, .so-group.off .so-count, .so-group.off .sw { opacity: .5; }
.so-group .sw { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.so-group .t { font-size: 14px; font-weight: 700; color: var(--navy); }
.so-group .s { font-size: 12.5px; color: var(--muted); }
.so-check input { width: 17px; height: 17px; margin: 3px 0 0; cursor: pointer; }
.so-folder { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.so-folder input { font: 12.5px Consolas, "Cascadia Mono", monospace; padding: 4px 7px; border: 1px solid #d5d2de; border-radius: 7px; min-width: 0; color: var(--ink); }
.so-count { text-align: end; }
.so-count b { display: block; font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
.so-count small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.so-modes span { font-size: 13px; padding: 6px 11px; }
.so-result { border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 8px; justify-items: start; }
.so-result[hidden] { display: none; }
.so-result.ok { background: #eaf7f0; border: 1px solid #bfe3cf; }
.so-result.warn { background: #fff6e5; border: 1px solid #f1d9a6; }
.so-result ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12px; }
.so-result .muted { margin-top: 4px; word-break: break-all; }
.sw-inline { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 5px; }
.so-scroll { overflow-x: hidden; }
.so-step .field { grid-template-columns: minmax(0, 1fr); }
.so-step select { width: 100%; min-width: 0; }
.so-group .t { overflow-wrap: anywhere; }

/* ---------- measuring tool ---------- */
.ms-ctl a { display: grid !important; place-items: center; color: var(--ink); }
.ms-ctl a svg { width: 19px; height: 19px; }
.ms-ctl a.on { background: var(--sky); color: var(--navy); }
.ms-ctl a[hidden] { display: none !important; }
.leaflet-container.measuring, .leaflet-container.measuring .leaflet-grab, .leaflet-container.measuring .leaflet-interactive { cursor: crosshair !important; }
/* בזמן מדידה כל לחיצה היא נקודת מדידה: שכבות התמונות והאזורים לא תופסות את העכבר */
.measuring .leaflet-marker-pane, .measuring .leaflet-shadow-pane, .measuring .leaflet-overlay-pane,
.measuring .leaflet-coverage-pane, .measuring .leaflet-tooltip-pane, .measuring .leaflet-measureLabels-pane,
.measuring .leaflet-marker-icon, .measuring .leaflet-pane path, .measuring .leaflet-pane canvas { pointer-events: none !important; }

.ms-bar { position: absolute; z-index: 1000; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  background: var(--navy); color: #fff; border-radius: 12px; padding: 8px 10px 8px 12px; font: 14px "Segoe UI", Arial, sans-serif; box-shadow: 0 6px 22px rgba(0,0,0,.4); white-space: nowrap; }
.ms-bar[hidden] { display: none; }
.ms-bar b { color: var(--sky); font-variant-numeric: tabular-nums; }
.ms-bar .ms-hint { color: rgba(255,255,255,.55); font-size: 12px; }
.ms-bar button { font: inherit; font-size: 13px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; border-radius: 8px; padding: 4px 10px; }
.ms-bar button:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.ms-bar button.main { background: var(--sky); border-color: var(--sky); color: var(--navy); font-weight: 700; }
.ms-bar button:disabled { opacity: .4; cursor: default; }
@media (max-width: 820px) { .ms-bar .ms-hint { display: none; } }

.ms-anchor { overflow: visible; }
.ms-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--navy); color: #fff; border: 1.5px solid var(--sky); border-radius: 9px; padding: 3px 8px; font: 13px "Segoe UI", Arial, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,.45); cursor: default; }
.ms-label.end { transform: translate(-50%, -150%); }
.ms-label b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ms-label small { color: rgba(255,255,255,.7); font-size: 11.5px; }
.ms-label.seg { border: 0; background: rgba(23,22,29,.82); font-size: 11.5px; padding: 1px 6px; pointer-events: none; }
.ms-label button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; line-height: 1; padding: 0; cursor: pointer; }
.ms-label button:hover { background: #b3261e; }

/* ---------- work polygon coverage check ---------- */
.work { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr); }
.work-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--navy); }
.btn-light.small { font-size: 12.5px; padding: 5px 11px; }
.work p { margin: 0; }
#wk-body { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
#wk-body[hidden] { display: none; }
.wk-file { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.wk-file .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; unicode-bidi: plaintext; }
.wk-file button { border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 0; }
.wk-verdict { border-radius: 10px; padding: 8px 11px; font-size: 13.5px; font-weight: 600; }
.wk-verdict.ok { background: #eaf7f0; border: 1px solid #bfe3cf; color: #145a3c; }
.wk-verdict.warn { background: #fdecea; border: 1px solid #f3c9c5; color: #8f1d17; }
.wk-verdict.idle { background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.wk-verdict small { display: block; font-weight: 500; opacity: .85; margin-top: 2px; }
.wk-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.wk-row .bar { height: 8px; border-radius: 4px; background: #efedf3; overflow: hidden; }
.wk-row .bar i { display: block; height: 100%; border-radius: 4px; background: #1f9d6b; }
.wk-row .bar i.mid { background: #e0a100; }
.wk-row .bar i.low { background: #d93a2f; }
.wk-row b { color: var(--navy); font-variant-numeric: tabular-nums; text-align: end; }
.wk-opts { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; }
.wk-opts label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.wk-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.wk-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-inline-end: 4px; vertical-align: -1px; }
.wk-overlay { image-rendering: pixelated; }

/* ---------- execution report ---------- */
.wk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-solid.small { font-size: 12.5px; padding: 5px 12px; }

.report-modal { position: fixed; inset: 0; z-index: 4500; background: #5b5966; overflow-y: auto; }
.report-modal[hidden] { display: none; }
.report-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--navy); color: #fff; }
.report-bar .grow { flex: 1; font-size: 13px; opacity: .75; }
.report-bar button { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 16px; border-radius: 9px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; }
.report-bar button.main { background: var(--sky); border-color: var(--sky); color: var(--navy); }
.report-page { width: min(210mm, calc(100% - 24px)); margin: 18px auto 40px; background: #fff; color: var(--ink); padding: 14mm 14mm 12mm; box-shadow: 0 8px 40px rgba(0,0,0,.4); font-size: 13px; line-height: 1.45; }

.rp-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid var(--sky); padding-bottom: 10px; }
.rp-head .mark { width: 46px; height: 46px; border-radius: 10px; background: var(--navy); flex: none; }
.rp-head .mark svg { width: 100%; height: 100%; display: block; }
.rp-head h1 { margin: 0; font-size: 22px; color: var(--navy); }
.rp-head .brand-name { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rp-head .when { margin-inline-start: auto; font-size: 12px; color: var(--muted); text-align: end; }
.rp-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 12px 0 4px; }
.rp-meta div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.rp-meta label { color: var(--muted); }
.rp-meta span { font-weight: 600; overflow-wrap: anywhere; }
.report-page [contenteditable] { outline: none; border-bottom: 1px dashed #c9c5d3; min-width: 40px; }
.report-page [contenteditable]:focus { background: #fff8e6; }
.report-page h2 { font-size: 15px; color: var(--navy); margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); break-after: avoid; }

.rp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.rp-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; border-top: 4px solid var(--line); }
.rp-kpi.plan { border-top-color: var(--navy); }
.rp-kpi.done { border-top-color: #1f9d6b; }
.rp-kpi.left { border-top-color: #d93a2f; }
.rp-kpi.left.zero { border-top-color: #1f9d6b; }
.rp-kpi label { display: block; font-size: 12px; color: var(--muted); }
.rp-kpi b { display: block; font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.25; }
.rp-kpi small { color: var(--muted); font-size: 12px; }
.rp-progress { height: 12px; border-radius: 6px; background: #f3c9c5; overflow: hidden; margin: 10px 0 4px; }
.rp-progress i { display: block; height: 100%; background: #1f9d6b; }
.rp-progress.full { background: #1f9d6b; }
.rp-basis { margin: 0; font-size: 12px; color: var(--muted); }

.rp-map { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; break-inside: avoid; }
.rp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 5px; }
.rp-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-inline-end: 4px; vertical-align: -2px; }
.rp-legend i.line { height: 0; border-top: 2px dashed var(--ink); border-radius: 0; vertical-align: 3px; }

.report-page table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report-page th { text-align: start; font-weight: 600; color: var(--muted); border-bottom: 1.5px solid #cfccd9; padding: 4px 6px; font-size: 12px; }
.report-page td { border-bottom: 1px solid var(--line); padding: 4px 6px; font-variant-numeric: tabular-nums; }
.report-page tr { break-inside: avoid; }
.report-page td.num, .report-page th.num { text-align: end; white-space: nowrap; }
.report-page .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 5px; }
.rp-ok { color: #145a3c; font-weight: 600; }
.rp-notes { min-height: 34px; border: 1px dashed #c9c5d3 !important; border-radius: 6px; padding: 6px 8px; }
.rp-notes:empty::before { content: "אפשר לכתוב כאן הערות לפני ההדפסה"; color: #a9a5b5; }
.rp-small { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; padding-inline-start: 18px; }
.rp-small li { margin: 1px 0; }
.rp-foot { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto !important; display: block !important; background: #fff !important; }
  body.printing-report > *:not(.report-modal) { display: none !important; }
  .report-modal { position: static; overflow: visible; background: #fff; }
  .report-bar { display: none !important; }
  .report-page { width: auto; margin: 0; padding: 0; box-shadow: none; }
  .report-page [contenteditable] { border-bottom-color: transparent; }
  .rp-notes { border-color: transparent !important; padding: 0; min-height: 0; }
  .rp-notes:empty { display: none; }
  .rp-notes:empty::before { content: ""; }
  .rp-notes-h.empty { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- execution report: page frame + print fixes ---------- */
.report-page .rp-frame { width: 100%; border-collapse: collapse; font-size: inherit; }
.report-page .rp-frame > thead > tr > td, .report-page .rp-frame > tbody > tr > td, .report-page .rp-frame > tfoot > tr > td { border: 0; padding: 0; font-variant-numeric: normal; }
.report-page .rp-frame > tbody > tr, .report-page .rp-frame > thead > tr, .report-page .rp-frame > tfoot > tr { break-inside: auto; }
.rp-space { height: 0; }
.rp-sec { break-inside: avoid; }
.rp-map { max-height: 150mm; width: auto; max-width: 100%; margin: 0 auto; }

@media print {
  @page { size: A4; margin: 0; }
  .report-page { padding: 0 12mm; }
  .rp-space { height: 11mm; }
  .rp-foot { margin-top: 10px; }
}

/* ---------- quality report ---------- */
.quality-row { display: flex; align-items: center; gap: 8px; padding: 6px 14px 0; font-size: 12px; }
.quality-row .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-kpis.six .rp-kpi b { font-size: 19px; }
.rq-meters { display: grid; gap: 5px; }
.rq-meter { display: grid; grid-template-columns: 210px minmax(0, 1fr) 54px 150px; gap: 10px; align-items: center; font-size: 12.5px; break-inside: avoid; }
.rq-meter .bar { height: 8px; border-radius: 4px; background: #cde2fb; overflow: hidden; }
.rq-meter .bar i { display: block; height: 100%; background: #2a78d6; border-radius: 4px; }
.rq-meter b { text-align: end; font-variant-numeric: tabular-nums; color: var(--navy); }
.rq-meter small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.rq-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.rq-charts figure { margin: 0; break-inside: avoid; }
.rq-charts figcaption { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.rq-charts svg { width: 100%; height: auto; display: block; }
.report-page table.rq-wide { font-size: 11px; }
.report-page table.rq-wide th { font-size: 10.5px; white-space: normal; line-height: 1.2; vertical-align: bottom; }
.report-page table.rq-wide td, .report-page table.rq-wide th { padding: 3px 4px; }
.report-page table.rq-ex td.files { font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; max-width: 250px; }
.report-page .rp-sec > .rp-basis { margin-top: 4px; }
@media (max-width: 700px) { .rq-meter { grid-template-columns: minmax(0, 1fr) 60px 54px; } .rq-meter small { display: none; } .rq-charts { grid-template-columns: 1fr; } }
.report-page table.rq-ex td.files { max-width: none; width: 46%; line-height: 1.35; }
.rp-sec { break-inside: auto; }
.rp-sec.keep, .rq-meters, .rq-charts, .report-page thead { break-inside: avoid; }
.report-page h2 { break-after: avoid; page-break-after: avoid; }
.report-page table.rq-ex td.files { width: 52%; font-size: 10px; white-space: nowrap; }
.report-page table.rq-wide td .ltr { white-space: nowrap; }

/* ---------- login + user ---------- */
.login-body { display: grid; place-items: center; background: var(--navy); min-height: 100%; padding: 20px; }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 26px 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand .logo { width: 52px; height: 52px; background: var(--navy); border-radius: 12px; padding: 4px; flex: none; }
.login-brand h1 { margin: 0; font-size: 24px; color: var(--navy); }
.login-card form { display: grid; gap: 12px; }
.login-card .f span { font-size: 13px; }
.login-card .form-error { margin: 0; min-height: 18px; }
.login-card .btn-solid { padding: 10px 16px; font-size: 15px; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.8); }
.userbox[hidden] { display: none; }
.userbox span { font-weight: 600; }
.userbox button { font: inherit; font-size: 12.5px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 8px; padding: 4px 10px; }
.userbox button:hover { background: rgba(255,255,255,.14); }

/* ---------- delete confirmation ---------- */
.confirm-card { width: min(440px, 100%); justify-self: center; }
.confirm-body { padding: 14px 18px 4px; display: grid; gap: 10px; }
.confirm-body p { margin: 0; font-size: 14px; line-height: 1.5; }
.confirm-body .form-error { min-height: 18px; font-size: 13px; }
.confirm-card footer { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.btn-danger { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 10px; cursor: pointer; border: 1px solid #b3261e; background: #b3261e; color: #fff; }
.btn-danger:hover { background: #9a1f18; }
.btn-danger:disabled { opacity: .5; cursor: default; }

/* ---------- backup status ---------- */
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 0; font-size: 12.5px; }
.backup-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs button[hidden] { display: none; }
