:root {
  --navy: #0a3a4e;
  --sea: #0e7490;
  --sea-dark: #0b5468;
  --sea-light: #e7f4f8;
  --sea-50: #f3f9fb;
  --sand: #faf5ea;
  --sand-dark: #efe4cb;
  --green: #4f9a2e;
  --green-light: #edf6e7;
  --red: #c2362c;
  --red-dark: #9f2a22;
  --red-light: #fdeeec;
  --amber: #b97900;
  --amber-light: #fff5dd;
  --violet: #5b4bb7;
  --violet-light: #efedfb;
  --ink: #142a35;
  --muted: #61757f;
  --line: #e1e9ed;
  --card: #ffffff;
  --bg: #f2f6f8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(10, 58, 78, .05), 0 8px 24px rgba(10, 58, 78, .07);
  --shadow-lg: 0 4px 10px rgba(10, 58, 78, .08), 0 18px 40px rgba(10, 58, 78, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5;
  min-height: 100vh; direction: rtl; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sea); }
.hidden { display: none !important; }
.ic { flex: none; display: block; }

/* ---------- כותרת עליונה ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40'%3E%3Cpath d='M0 30 Q20 22 40 30 T80 30 T120 30 T160 30' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='2'/%3E%3C/svg%3E") repeat-x bottom,
    linear-gradient(135deg, var(--navy) 0%, var(--sea) 100%);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 14px rgba(10,58,78,.18);
}
.topbar .app-ic { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title small { opacity: .8; font-size: 13px; }
.icon-btn {
  background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 12px;
  width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.24); }
.net { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.14); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.net::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7ee08a; }
.net.off::before { background: #ffc94d; }
.net.off { background: rgba(255, 190, 60, .25); }

main { padding: 16px; max-width: 720px; margin: 0 auto; padding-bottom: 100px; }
h1 { font-size: 22px; margin: 4px 0 12px; letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 18px 0 12px; letter-spacing: -.2px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card > h2:first-child, .card .sec-title { margin-top: 0; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--navy); }
.sec-title .ic { color: var(--sea); }

/* ---------- מסך כניסה ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 18px 20px;
  background:
    radial-gradient(1200px 400px at 50% -50px, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--sea) 42%, var(--bg) 42.1%);
}
.auth-logo { text-align: center; color: #fff; margin-bottom: 22px; }
.auth-logo img { width: 104px; height: 104px; border-radius: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.auth-logo h1 { margin: 14px 0 2px; font-size: 25px; font-weight: 800; }
.auth-logo p { margin: 0; opacity: .85; font-size: 15px; }
.auth-card { max-width: 420px; width: 100%; margin: 0 auto; padding: 24px 22px; box-shadow: var(--shadow-lg); }
.auth-card h2 { margin-top: 0; font-size: 20px; }
.brand-foot { text-align: center; margin: 22px auto 0; max-width: 420px; color: var(--muted); font-size: 12.5px; }
.brand-foot img { height: 64px; display: block; margin: 0 auto 6px; }

/* ---------- שדות ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14.5px; color: #2b414c; }
label.field > span .req { color: var(--red); font-weight: 700; }
input:not([type]), input[type=text], input[type=password], input[type=tel], input[type=number], input[type=time], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfdfe;
  font-size: 16px; min-height: 50px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--sea); background: #fff; box-shadow: 0 0 0 4px rgba(14,116,144,.12); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2361757f' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 36px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 20px; min-height: 52px; font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, var(--sea) 0%, var(--sea-dark) 100%); color: #fff; cursor: pointer; width: 100%; text-decoration: none;
  box-shadow: 0 4px 14px rgba(14,116,144,.25); transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .6; }
.btn.secondary { background: var(--sea-light); color: var(--sea-dark); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #d6463b 0%, var(--red-dark) 100%); box-shadow: 0 4px 14px rgba(194,54,44,.28); }
.btn.ghost { background: #fff; color: var(--sea-dark); border: 1.5px solid var(--line); box-shadow: none; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; width: auto; border-radius: 11px; }
.link-btn { background: none; border: 0; color: var(--sea); font-weight: 600; cursor: pointer; padding: 12px; width: 100%; }

.msg { border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-weight: 500; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.msg.err { background: var(--red-light); color: var(--red-dark); }
.msg.ok { background: var(--green-light); color: #2f6b17; }
.msg.info { background: var(--sea-light); color: var(--sea-dark); }

/* ---------- מסך הבית ---------- */
.hello { display: flex; align-items: center; gap: 14px; margin: 2px 2px 16px; }
.hello .txt { flex: 1; }
.hello h1 { margin: 0; font-size: 22px; }
.hello small { color: var(--muted); }
.beach-bar {
  display: flex; align-items: center; gap: 12px; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
  background: linear-gradient(120deg, var(--sand) 0%, #fff 100%); border: 1px solid var(--sand-dark);
}
.beach-bar .b-ic { width: 46px; height: 46px; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--amber); box-shadow: 0 2px 8px rgba(185,121,0,.12); }
.beach-bar .name { flex: 1; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.beach-bar .name small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; letter-spacing: 0; }
.beach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.beach-btn { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 10px; text-align: center; cursor: pointer; font-weight: 700; font-size: 17px; box-shadow: var(--shadow); }
.beach-btn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
.beach-btn.sel { border-color: var(--sea); background: var(--sea-light); box-shadow: 0 0 0 3px rgba(14,116,144,.12); }
.area-title { color: var(--muted); font-size: 13px; margin: 18px 4px 8px; font-weight: 700; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action {
  --c: var(--sea); --cl: var(--sea-light);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(225,233,237,.7); padding: 18px 12px 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; text-align: center; min-height: 138px; justify-content: center;
  transition: transform .1s, box-shadow .15s;
}
.action:active { transform: scale(.98); }
.action .ico { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: var(--cl); color: var(--c); margin-bottom: 4px; }
.action small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.action.t-green { --c: var(--green); --cl: var(--green-light); }
.action.t-amber { --c: var(--amber); --cl: var(--amber-light); }
.action.t-violet { --c: var(--violet); --cl: var(--violet-light); }
.action.t-gray { --c: #4a5f69; --cl: #eef2f4; }
.action.urgent {
  grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 16px; min-height: 92px; padding: 16px 20px; text-align: right;
  background: linear-gradient(120deg, #d9473c 0%, var(--red-dark) 100%); color: #fff; border: 0; box-shadow: 0 8px 22px rgba(194,54,44,.3); font-size: 20px;
}
.action.urgent .ico { background: rgba(255,255,255,.18); color: #fff; margin: 0; }
.action.urgent small { color: #fff; opacity: .88; display: block; font-size: 13px; margin-top: 2px; }

.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-btn { border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius); padding: 20px 8px 16px; font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sub-btn .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--red-light); color: var(--red); }
.sub-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- מיקום ---------- */
.loc { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 10px 14px; border-radius: 14px; background: #fff; color: var(--sea-dark); margin-bottom: 14px; box-shadow: var(--shadow); }
.loc .ic { color: var(--green); }
.loc.err { color: #7a5600; }
.loc.err .ic { color: var(--amber); }
.loc button { margin-inline-start: auto; }

/* ---------- כן/לא ---------- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; background: #f1f5f7; padding: 4px; border-radius: 14px; }
.seg button { flex: 1; min-width: 64px; min-height: 44px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; font-weight: 600; color: #4a5f69; transition: background .12s, color .12s; }
.seg button.on { background: #fff; color: var(--sea-dark); box-shadow: 0 1px 4px rgba(10,58,78,.14); }
.seg button.on.bad { background: var(--red); color: #fff; }
.seg button.on.warn { background: var(--amber); color: #fff; }
.seg button.on.good { background: var(--green); color: #fff; }

/* ---------- תמונות ---------- */
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photos .ph { position: relative; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: #ddd; box-shadow: var(--shadow); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; display: grid; place-items: center; }
.photo-add { width: 88px; height: 88px; border-radius: 14px; border: 1.5px dashed #9cc7d4; color: var(--sea); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--sea-50); }

/* ---------- ציוד ---------- */
.eq-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.eq-row:last-child { border-bottom: 0; padding-bottom: 0; }
.eq-row .eq-name { font-weight: 600; margin-bottom: 8px; }
.eq-row input { margin-top: 8px; }

.guard { position: relative; }
.guard .rm { position: absolute; left: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; background: var(--red-light); color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- חתימה ---------- */
.sig-wrap { border: 1.5px dashed #9cc7d4; border-radius: 16px; background: linear-gradient(#fff, #fff) padding-box; position: relative; touch-action: none; overflow: hidden; }
.sig-wrap::after { content: ''; position: absolute; right: 24px; left: 24px; bottom: 44px; border-bottom: 1px solid #d5e3e8; pointer-events: none; }
.sig-wrap canvas { width: 100%; height: 200px; display: block; position: relative; z-index: 1; }
.sig-wrap .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #a9bec6; pointer-events: none; font-size: 17px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; padding: 14px; background: var(--sand); border: 1px solid var(--sand-dark); border-radius: 14px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin-top: 1px; accent-color: var(--sea); }

/* ---------- רשימת דיווחים ---------- */
.rep { display: flex; gap: 14px; align-items: flex-start; }
.rep .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sea-light); color: var(--sea); flex: none; }
.rep .ico.red { background: var(--red-light); color: var(--red); }
.rep .body { flex: 1; min-width: 0; }
.rep .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rep .txt { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #3a4f59; font-size: 15px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--sea-light); color: var(--sea-dark); font-weight: 600; white-space: nowrap; }
.badge.red { background: var(--red-light); color: var(--red-dark); }
.badge.amber { background: var(--amber-light); color: #7a5300; }
.badge.green { background: var(--green-light); color: #2f6b17; }

.sticky-submit { position: fixed; bottom: 0; right: 0; left: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(242,246,248,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 15; }
.sticky-submit .btn { max-width: 688px; margin: 0 auto; display: flex; }

.toast { position: fixed; bottom: 96px; right: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; z-index: 100; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; font-weight: 500; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translate(50%, 8px); } }
.success-screen { text-align: center; padding: 34px 18px; }
.success-screen .big { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--green-light); color: var(--green); }
.success-screen .big.wait { background: var(--amber-light); color: var(--amber); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.install-tip { font-size: 14px; }
.home-foot { text-align: center; margin-top: 28px; opacity: .9; }
.home-foot img { height: 54px; }
.home-foot small { display: block; color: var(--muted); font-size: 12px; }
.action.wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 78px; padding: 14px 18px; text-align: right; --c: #4a5f69; --cl: #eef2f4; }
.action.wide .ico { margin: 0; width: 46px; height: 46px; border-radius: 14px; }
.action.wide small { display: block; margin-top: 1px; }
