/* BarziBall adult apps (coach, parent). Same palette and logo as the child app; calmer, denser, fewer clicks. */
:root {
  --bg: #F7F5F0; --card: #fff; --ink: #1E2440; --muted: #636A8A; --line: #ECE8E0; --soft: #F3F1FA;
  --brand: #FF7A1A; --brand-d: #D9590A; --brand-l: #FFE6D2;
  --deed: #13B08B; --deed-l: #DDF6EE; --thanks: #8457F0; --thanks-l: #EEE7FF;
  --ok: #138A63; --ok-l: #DDF4EA; --warn: #9A6400; --warn-l: #FFF1C2; --bad: #C2333F; --bad-l: #FDE4E6; --info: #2B6FD6; --info-l: #E2EDFD;
  --r: 14px; --sh: 0 1px 2px rgba(30,36,64,.05), 0 4px 16px rgba(30,36,64,.05);
  --font: system-ui, -apple-system, "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #E9E4F5; font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; text-align: inherit; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid #3BA4FF; outline-offset: 2px; border-radius: 8px; }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* ---------- demo bar (not part of the app) ---------- */
.mbar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: #1E2440; color: #fff; font-size: 14px; direction: rtl; }
.mbar .mt { font-weight: 700; margin-inline-end: auto; }
.mbar .mt small { font-weight: 400; opacity: .7; margin-inline-start: 6px; }
.mbar button { background: rgba(255,255,255,.1); padding: 6px 12px; border-radius: 99px; font-size: 14px; }
.mbar button:hover { background: rgba(255,255,255,.2); }
.mbar button.on { background: var(--brand); }
.mbar .grp { display: flex; gap: 4px; }
@media (max-width: 700px) { .mbar .mt small, #bar-frame, .mbar .wide { display: none; } .mbar { padding: 6px 8px; gap: 5px; } .mbar button { padding: 5px 9px; font-size: 13px; } }

/* ---------- app container ---------- */
#app { position: relative; container-type: inline-size; background: var(--bg); height: calc(100vh - 48px); height: calc(100dvh - 48px); overflow: hidden; }
body.frame #app { width: 390px; height: min(844px, calc(100dvh - 90px)); margin: 20px auto; border-radius: 46px; border: 12px solid #15182B; box-shadow: 0 30px 60px rgba(30,36,64,.3); }
@media (max-width: 700px) {
  body { display: flex; flex-direction: column; height: 100dvh; }
  .mbar { flex: none; padding-top: calc(6px + env(safe-area-inset-top)); }
  #app, body.frame #app { flex: 1; min-height: 0; height: auto; width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; height: 100%; }
.side { display: none; }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.top h1 { font-size: 21px; flex: 1; min-width: 0; }
.top .sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.content { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.content > .seg { align-self: flex-start; }
.mbrand { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; font-weight: 800; font-size: 17px; }
.mbrand .role { margin-inline-start: auto; }
.logo { flex: none; display: block; }
.tabs { display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 4px 2px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 12px; color: var(--muted); position: relative; min-height: 50px; justify-content: center; }
.tab.on { color: var(--brand-d); font-weight: 700; }
.tab .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); }

@container (min-width: 820px) {
  .shell { flex-direction: row; }
  .tabs, .mbrand { display: none; }
  .side { display: flex; flex-direction: column; width: 236px; flex: none; background: #fff; border-inline-end: 1px solid var(--line); padding: 16px 12px; gap: 2px; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; line-height: 1.15; padding: 0 6px 6px; }
  .brand-sub { padding: 0 8px 14px; font-size: 13px; color: var(--muted); }
  .snav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-weight: 600; color: #4A5072; position: relative; }
  .snav:hover { background: var(--soft); }
  .snav.on { background: var(--brand-l); color: var(--brand-d); }
  .snav .badge { margin-inline-start: auto; }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
  .top { padding: 20px 28px 10px; }
  .top h1 { font-size: 26px; }
  .content { padding: 4px 28px 32px; gap: 16px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
  .kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .phone-only { display: none !important; }
}
@container (max-width: 819px) { .desk-only { display: none !important; } }

/* ---------- building blocks ---------- */
.ic { width: 20px; height: 20px; flex: none; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card h2 .act { margin-inline-start: auto; font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700; background: var(--soft); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn-p { background: var(--brand); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: var(--bad-l); color: var(--bad); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--info); font-weight: 600; }
.link:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.p-ok { background: var(--ok-l); color: var(--ok); }
.p-warn { background: var(--warn-l); color: var(--warn); }
.p-bad { background: var(--bad-l); color: var(--bad); }
.p-info { background: var(--info-l); color: var(--info); }
.p-mute { background: #EEEDF2; color: var(--muted); }
.p-deed { background: var(--deed-l); color: #0C7C61; }
.p-thanks { background: var(--thanks-l); color: #5A31C4; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-l); color: var(--brand-d); font-weight: 800; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--soft); font-size: 14px; font-weight: 600; }
.chip.on { background: var(--ink); color: #fff; }
.chip input { margin: 0; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(30,36,64,.12); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 26px; line-height: 1.15; }
.kpi b span { font-size: 15px; color: var(--muted); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: #EEEAE2; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* lists and tables */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.li:last-child { border-bottom: 0; }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; overflow-wrap: anywhere; }
.li .t small { display: block; color: var(--muted); font-size: 13px; }
button.li { width: 100%; text-align: start; }
button.li:hover { background: #FBFAF7; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: #fff; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FBFAF7; }
.tbl tr.sel td { background: #FFF8F1; }
.tbl .nm { font-weight: 700; white-space: nowrap; }
.tbl input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
.tbl input.switch { width: 44px; height: 26px; }
.dots { display: inline-flex; gap: 3px; direction: ltr; }
.dots i { width: 11px; height: 11px; border-radius: 3px; background: #E6E2DA; display: inline-block; }
.dots i.y { background: var(--deed); }
.dots i.l { background: #F2B544; }
.dots i.n { background: #F0B8BE; }
.dots i.c { outline: 2px solid var(--ink); outline-offset: 1px; }
.bulk { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 8px 24px rgba(30,36,64,.25); }
.bulk .btn { background: rgba(255,255,255,.14); color: #fff; }
.bulk .btn-p { background: var(--brand); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: #4A5072; }
.field input, .field select, .field textarea, .inp { border: 1px solid #DAD6CE; background: #fff; border-radius: 10px; padding: 9px 11px; font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; min-height: 42px; }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: 2px solid #3BA4FF; border-color: transparent; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.form { display: grid; gap: 12px; }
@container (min-width: 820px) { .form.two { grid-template-columns: 1fr 1fr; } .form .full { grid-column: 1 / -1; } }
.set { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.set:last-child { border-bottom: 0; }
.set .t { flex: 1; min-width: 0; }
.set .t small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #D5D1E0; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: right .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch:checked { background: var(--ok); }
.switch:checked::after { right: 21px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--info-l); color: #1F4E94; font-size: 13.5px; }
.note.warn { background: var(--warn-l); color: #6E4800; }
.note.ok { background: var(--ok-l); color: #0D6A4B; }
.steps { display: flex; gap: 8px; counter-reset: s; flex-wrap: wrap; }
.steps li { list-style: none; flex: 1; min-width: 150px; background: var(--soft); border-radius: 10px; padding: 8px 10px 8px 10px; font-size: 13.5px; counter-increment: s; display: flex; gap: 8px; }
.steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.steps { padding: 0; margin: 0; }

/* charts */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(0, 1.4fr) 2fr 34px; align-items: center; gap: 8px; font-size: 14px; }
.hb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb b { text-align: end; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; direction: ltr; }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted); }
.vb i { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 2px 2px; display: block; min-height: 2px; }
.vb.cur i { background: repeating-linear-gradient(45deg, var(--brand), var(--brand) 5px, #FFB27A 5px, #FFB27A 10px); }
.vb b { color: var(--ink); font-size: 12px; }

/* overlays */
.sheet-bg { position: absolute; inset: 0; background: rgba(30,36,64,.35); z-index: 20; animation: fade .15s; }
.sheet { position: absolute; z-index: 21; background: #fff; display: flex; flex-direction: column; gap: 12px; padding: 16px; inset-inline: 0; bottom: 0; border-radius: 18px 18px 0 0; max-height: 88%; overflow: auto; animation: up .2s ease-out; }
@container (min-width: 820px) { .sheet { inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 520px; border-radius: 16px; animation: fade .15s; } }
.sheet h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.sheet .x { margin-inline-start: auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.sheet .x:hover { background: var(--soft); }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }
.toast { position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; z-index: 40; width: max-content; max-width: 90%; text-align: center; animation: fade .2s; }
.toast.out { opacity: 0; transition: opacity .3s; }
.sample { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0 8px; }

/* sign-in */
.auth { height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; text-align: center; }
.auth .box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: 18px; box-shadow: var(--sh); padding: 22px; text-align: start; }
.auth h1 { font-size: 22px; text-align: center; }
.auth .lead { color: var(--muted); text-align: center; font-size: 14.5px; }
.otp { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.otp input { width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700; border: 1px solid #DAD6CE; border-radius: 10px; }
.wa { display: flex; gap: 10px; align-items: flex-start; background: #E7F8EE; border-radius: 12px; padding: 10px 12px; font-size: 14px; text-align: start; }
.wa .wa-ic { width: 30px; height: 30px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; flex: none; font-size: 16px; }
