/* Owner app. Phone first, RTL. The business colour (--biz) is an accent only; white cards on a pale background. */
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 200 900; font-display: swap; src: url("fonts/noto-hebrew-var.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 200 900; font-display: swap; src: url("fonts/noto-latin-var.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --biz: #0b5fff; --biz-ink: #ffffff;
  --bg: #f4f6fa; --card: #ffffff; --ink: #0d0d0d; --mute: #556070; --line: #dfe5f0; --field: #f9fbff;
  --ok: #0f7a41; --ok-bg: #e5f5ec; --warn-bg: #fff4d6; --warn-ink: #6b4a00; --warn-line: #e0b84a; --bad: #b3261e;
  --wa: #128c4b; --wa-ink: #ffffff; --shadow: 0 8px 24px rgba(18, 40, 90, .07);
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --card: #181c24; --ink: #eef1f6; --mute: #a3adbd; --line: #2b3240; --field: #11151c;
    --ok: #5fd394; --ok-bg: #143322; --warn-bg: #3a2f12; --warn-ink: #ffd98a; --warn-line: #8a6a1f; --bad: #ff8a80;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Noto Sans Hebrew", system-ui, sans-serif; font-weight: 400; font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: 40px; }
[hidden] { display: none !important; }
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--biz); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.col { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.band { height: 6px; background: var(--biz); }

/* top bar */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; flex: none; }
.back { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); font-weight: 700; font-size: 15px; }

/* type */
h1 { font-size: clamp(22px, 6vw, 28px); line-height: 1.25; font-weight: 900; margin: 20px 0 8px; }
.h2 { font-size: 19px; font-weight: 800; margin: 22px 0 10px; }
.card .h2 { margin-top: 0; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.center { text-align: center; }
.pad { padding: 28px 16px; }
.view { padding-top: 4px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin: 12px 0; }
.lbl { display: block; font-weight: 700; font-size: 15px; margin: 12px 0 6px; }
.lbl:first-child { margin-top: 0; }
input[type="text"], input[type="tel"], input[type="date"], textarea {
  display: block; width: 100%; min-height: 48px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 17px; background: var(--field); color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; min-height: 110px; }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .85; }
input:focus, textarea:focus { border-color: var(--biz); outline: none; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 10px 16px; margin: 10px 0 0;
  border: 2px solid transparent; border-radius: 14px; font-weight: 800; font-size: 17px; text-decoration: none; text-align: center; }
.btn.big { min-height: 58px; font-size: 19px; }
.btn.main { background: var(--biz); color: var(--biz-ink); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.wa { background: var(--wa); color: var(--wa-ink); }
.btn.danger { color: var(--bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.small-btn { min-height: 44px; font-size: 15px; width: auto; display: inline-flex; padding: 6px 16px; }
.link-btn { background: none; border: 0; color: var(--biz); font-weight: 700; min-height: 44px; padding: 0 6px; text-decoration: underline; }
.file-btn { cursor: pointer; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-row .btn { flex: 1 1 130px; margin: 0; min-height: 48px; font-size: 15px; }
#v-home > .btn.big:first-child { margin-top: 18px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.five { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.stat span { display: block; font-size: 13px; color: var(--mute); font-weight: 600; }
.stat b { display: block; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.stats.five .stat:last-child { grid-column: 1 / -1; }
@media (min-width: 420px) { .stats.five { grid-template-columns: repeat(3, 1fr); } .stats.five .stat:last-child { grid-column: auto; } }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.proj { display: block; width: 100%; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); min-height: 64px; }
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.proj-title { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.proj-sub { color: var(--mute); font-size: 14px; margin-top: 2px; }
.proj-money { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin-top: 6px; }
.proj-money b { font-weight: 800; }
.rem-title { font-weight: 700; overflow-wrap: anywhere; }
.rem-sub { color: var(--mute); font-size: 14px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-head .h2 { margin: 0; }
.line-sum { font-weight: 800; white-space: nowrap; }

/* chips */
.chip { flex: none; display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); white-space: nowrap; }
.chip.on { background: var(--biz); border-color: var(--biz); color: var(--biz-ink); }
.chip.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

/* status steps */
.steps { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; gap: 4px; }
.steps li { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--mute); padding-top: 8px; border-top: 4px solid var(--line); min-width: 0; }
.steps li.done { border-top-color: var(--biz); color: var(--ink); }
.steps li.now { border-top-color: var(--biz); color: var(--biz); font-weight: 900; }
@media (prefers-color-scheme: dark) { .steps li.now { color: var(--ink); } }

/* record */
.rec { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 170px; height: 170px; border-radius: 50%;
  border: 0; background: var(--biz); color: var(--biz-ink); font-weight: 900; font-size: 19px; margin: 8px auto 4px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.rec-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--biz-ink); }
.rec.on .rec-dot { border-radius: 6px; animation: pulse 1s ease-in-out infinite; }
.rec:disabled { opacity: .6; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rec.on .rec-dot { animation: none; } }
.timer { font-size: 28px; font-weight: 900; margin: 6px 0 0; font-variant-numeric: tabular-nums; direction: ltr; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; text-align: start; }

/* editor lines */
.line { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 10px; box-shadow: var(--shadow); }
.line-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.line-num { font-weight: 800; color: var(--mute); font-size: 14px; }
.line-del { background: none; border: 0; color: var(--bad); font-weight: 700; min-height: 44px; padding: 0 8px; font-size: 14px; }
.line-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.line-grid .lbl { font-size: 13px; margin-top: 8px; }
.line-total { margin-top: 8px; font-size: 15px; display: flex; justify-content: space-between; }
.line.missing { border-color: var(--warn-line); }
.miss input { border-color: var(--warn-line); background: var(--warn-bg); }
.miss-note { color: var(--warn-ink); font-size: 13px; font-weight: 700; margin-top: 4px; }
.heard p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* VAT segmented choice */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 14px; text-align: center; padding: 4px; background: var(--field); cursor: pointer; }
.seg input:checked + span { background: var(--biz); border-color: var(--biz); color: var(--biz-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--biz); outline-offset: 2px; }

/* totals */
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 20px; font-weight: 900; }

/* project docs */
.doc-lines { list-style: none; margin: 8px 0 0; padding: 0; font-size: 15px; }
.doc-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.doc-lines li span { overflow-wrap: anywhere; }
.doc-sum { display: flex; justify-content: space-between; font-weight: 900; margin-top: 8px; font-size: 17px; }
.actions { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 420px) { .actions { grid-template-columns: 1fr 1fr; column-gap: 8px; } }

img.receipt { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; background: var(--field); }

/* share sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet .h2 { margin-top: 0; }
.msg { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; max-height: 200px; overflow-y: auto; margin: 6px 0 4px; }
@media (min-width: 600px) { .sheet-back { align-items: center; } .sheet { border-radius: 20px; } }

/* toast */
.toast { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); inset-inline: 16px; max-width: 528px; margin: 0 auto; z-index: 40;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 700; text-align: center; }
.toast.bad { background: var(--bad); color: var(--bg); }
