/* Aloni PWA - agent mobile app. Same tokens as the public site (static/css/aloni-site.css):
   navy / cobalt / amber, IBM Plex Sans Hebrew + IBM Plex Mono for numbers. No Bootstrap - small, mobile-first. */
:root {
    --navy: #0b1630; --navy-2: #16244a;
    --cobalt: #2747d8; --cobalt-2: #1d38b5; --cobalt-soft: #e8ecfd;
    --amber: #f5a524; --amber-soft: #fff3dc;
    --green: #14895c; --green-soft: #def5ea;
    --red: #c8364b; --red-soft: #fde8eb;
    --bg: #f4f6fb; --surface: #fff; --surface-2: #f8f9fc;
    --line: #e1e6f0; --text: #0b1630; --muted: #5a6683;
    --bar-bg: #0b1630; --bar-text: #fff;
    --shadow: 0 1px 2px rgba(11, 22, 48, .06), 0 4px 14px rgba(11, 22, 48, .06);
    --sans: "IBM Plex Sans Hebrew", "Rubik", Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --r: 16px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --cobalt: #6d86ff; --cobalt-2: #8a9dff; --cobalt-soft: #1c2650;
        --amber-soft: #3a2c10; --green: #4cc99a; --green-soft: #12352a; --red: #ff7a8c; --red-soft: #3d1820;
        --bg: #070d1d; --surface: #101a33; --surface-2: #142040; --line: #22305a; --text: #e9edf8; --muted: #9aa6c4;
        --bar-bg: #0b1630; --shadow: none; color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --cobalt: #6d86ff; --cobalt-2: #8a9dff; --cobalt-soft: #1c2650;
    --amber-soft: #3a2c10; --green: #4cc99a; --green-soft: #12352a; --red: #ff7a8c; --red-soft: #3d1820;
    --bg: #070d1d; --surface: #101a33; --surface-2: #142040; --line: #22305a; --text: #e9edf8; --muted: #9aa6c4;
    --bar-bg: #0b1630; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
a { color: var(--cobalt); }
button, input, select { font: inherit; color: inherit; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[dir="ltr"], .ltr { direction: ltr; unicode-bidi: isolate; }
.skip-link { position: absolute; top: -60px; right: 16px; background: var(--amber); color: var(--navy); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip-link:focus { top: calc(var(--safe-t) + 8px); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
    padding: calc(var(--safe-t) + 10px) 16px 10px; background: var(--bar-bg); color: var(--bar-text); min-height: 58px; }
.appbar-brand { text-decoration: none; display: inline-flex; align-items: center; }
.appbar-title { flex: 1; min-width: 0; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar.has-back .appbar-brand { display: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: inherit;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; cursor: pointer; flex: none; }
.icon-btn:active { background: rgba(255,255,255,.18); }
.net-dot { color: var(--amber); font-size: 1.1rem; }

.wordmark { display: inline-block; font-family: "IBM Plex Sans", var(--sans); font-size: 1.6rem; font-weight: 700; line-height: 1;
    color: #fff; letter-spacing: -.03em; direction: ltr; }
.wm-i { position: relative; display: inline-block; }
.i-cloud { position: absolute; left: 50%; top: -.06em; width: .5em; height: .375em; transform: translateX(-50%); fill: var(--amber); }
/* on the page background (login screens): navy text in light mode, light text in dark mode */
.wordmark.on-light { color: var(--text); }
.wordmark.on-light .i-cloud { fill: var(--cobalt); }

/* ---------- layout ---------- */
.view { padding: 16px 16px calc(96px + var(--safe-b)); max-width: 720px; margin: 0 auto; outline: none; }
.view.no-tabs { padding-bottom: calc(32px + var(--safe-b)); }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + var(--safe-b)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px;
    color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 500; }
.tabbar a i { font-size: 1.3rem; }
.tabbar a.active { color: var(--cobalt); }
.tabbar a.active i { transform: translateY(-1px); }

.section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 22px 4px 10px; }
.section-h h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.section-h .sub { color: var(--muted); font-size: .85rem; }
.muted { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-pad { padding: 16px; }

/* ---------- search ---------- */
.search-hero h1 { font-size: 1.45rem; margin: 6px 4px 4px; }
.search-hero p { margin: 0 4px 14px; color: var(--muted); }
.searchbox { position: relative; }
.searchbox i.bi-search { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; pointer-events: none; }
.searchbox input { width: 100%; height: 54px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
    padding: 0 48px 0 48px; font-size: 1.05rem; box-shadow: var(--shadow); -webkit-appearance: none; appearance: none; }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.searchbox input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 4px var(--cobalt-soft); }
.searchbox .clear { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 40px; height: 40px;
    color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px;
    font-size: .9rem; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #0b1630; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #0b1630; } }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: inherit; text-decoration: none; min-height: 64px; width: 100%;
    background: none; border: 0; text-align: right; cursor: pointer; }
.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .main, .row .t1, .row .t2 { display: block; }
.row .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { flex: none; text-align: left; color: var(--muted); font-size: .85rem; }
.row .chev { color: var(--muted); flex: none; }
.avatar { width: 42px; height: 42px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center;
    background: var(--cobalt-soft); color: var(--cobalt); font-weight: 700; font-size: 1rem; }
.avatar.amber { background: var(--amber-soft); color: #9a5b00; }
.avatar.green { background: var(--green-soft); color: var(--green); }
.avatar.red { background: var(--red-soft); color: var(--red); }
.avatar i { font-size: 1.2rem; }
.group-h { padding: 10px 14px; background: var(--surface-2); color: var(--muted); font-size: .82rem; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600;
    background: var(--cobalt-soft); color: var(--cobalt); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: #9a5b00; }
.badge.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.amber, :root:not([data-theme="light"]) .avatar.amber { color: var(--amber); } }
:root[data-theme="dark"] .badge.amber, :root[data-theme="dark"] .avatar.amber { color: var(--amber); }

/* ---------- client card ---------- */
.hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(39,71,216,.55), transparent 70%); pointer-events: none; }
.hero h1 { margin: 0 0 4px; font-size: 1.35rem; line-height: 1.3; color: #fff; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: rgba(255,255,255,.75); font-size: .9rem; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero .badge { background: rgba(255,255,255,.12); color: #fff; }
.hero .badge.green { background: rgba(20,137,92,.35); color: #b8f0d6; }
.hero .badge.red { background: rgba(200,54,75,.35); color: #ffd0d7; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 0;
    background: rgba(255,255,255,.1); color: #fff; text-decoration: none; font-size: .8rem; cursor: pointer; }
.quick a i, .quick button i { font-size: 1.25rem; }
.quick .disabled { opacity: .35; pointer-events: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
    color: inherit; text-decoration: none; box-shadow: var(--shadow); min-height: 104px; }
.tile:active { transform: scale(.98); }
.tile .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    background: var(--cobalt-soft); color: var(--cobalt); }
.tile .ic.amber { background: var(--amber-soft); color: #9a5b00; }
.tile .ic.green { background: var(--green-soft); color: var(--green); }
.tile .ic.red { background: var(--red-soft); color: var(--red); }
.tile b { font-size: 1rem; }
.tile small { color: var(--muted); font-size: .8rem; margin-top: -8px; }

.kv { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; margin: 0; }
.kv dt, .kv dd { padding: 11px 14px; margin: 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { font-weight: 500; word-break: break-word; }
.kv > :nth-child(1), .kv > :nth-child(2) { border-top: 0; }
.note { padding: 14px; white-space: pre-wrap; word-break: break-word; }

.contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.contact-row .main { flex: 1; min-width: 0; }
.contact-row .t1 { font-weight: 600; direction: ltr; text-align: right; font-family: var(--mono); }
.contact-row .t1.email { font-family: var(--sans); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .t2 { color: var(--muted); font-size: .85rem; }
.act { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    background: var(--cobalt-soft); color: var(--cobalt); font-size: 1.1rem; flex: none; }
.act.wa { background: var(--green-soft); color: var(--green); }

.total-row { display: flex; justify-content: space-between; padding: 12px 14px; border-top: 2px solid var(--line); font-weight: 700; }

/* ---------- filter input on lists ---------- */
.filter { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter .searchbox { flex: 1; }
.filter .searchbox input { height: 46px; border-radius: 14px; font-size: 1rem; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.toggle input { width: 20px; height: 20px; accent-color: var(--cobalt); }

/* ---------- states ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: 8px; color: var(--line); }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%;
    animation: sk 1.2s infinite linear; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-row { display: flex; gap: 12px; align-items: center; padding: 14px; }
.skel-row + .skel-row { border-top: 1px solid var(--line); }
.skel-row .skel.a { width: 42px; height: 42px; border-radius: 13px; flex: none; }
.err-box { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); }
.err-box button { margin-inline-start: auto; }

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 999px;
    border: 1.5px solid transparent; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn-primary { background: #2747d8; color: #fff; }
.btn-primary:active { background: #1d38b5; }
.btn-primary:disabled { opacity: .6; }
.btn-line { background: transparent; border-color: var(--line); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-sm { height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.input-wrap { position: relative; }
.input { width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface); font-size: 1.05rem; }
.input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 4px var(--cobalt-soft); }
.input.is-invalid { border-color: var(--red); }
.input-wrap .input { padding-left: 50px; }
.input-wrap .pass-btn { position: absolute; left: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 1.15rem; cursor: pointer; }
.otp-input { text-align: center; letter-spacing: .5em; font-family: var(--mono); font-size: 1.6rem; direction: ltr; height: 62px; }
.auth-msg { display: flex; gap: 8px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; margin-bottom: 14px; font-size: .93rem; }
.auth-msg.err { background: var(--red-soft); color: var(--red); }
.auth-msg.ok { background: var(--green-soft); color: var(--green); }
.auth-msg.info { background: var(--cobalt-soft); color: var(--cobalt); }
.spinner-border { display: inline-block; width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
body.auth .appbar, body.auth .tabbar { display: none; }
.auth-screen { min-height: calc(100dvh - 32px); display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding-top: var(--safe-t); }
.auth-top { text-align: center; margin-bottom: 26px; }
.auth-top .wordmark { font-size: 2.8rem; }
.auth-top h1 { font-size: 1.35rem; margin: 18px 0 4px; }
.auth-top p { margin: 0; color: var(--muted); }
.auth-card { padding: 22px 18px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: .88rem; }
.auth-foot a { font-weight: 600; text-decoration: none; }
.timer { font-family: var(--mono); font-weight: 600; }
.timer.low { color: var(--red); }
.link-btn { background: none; border: 0; color: var(--cobalt); font-weight: 600; cursor: pointer; padding: 6px; }
.resend { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.install-card { display: flex; gap: 12px; align-items: center; padding: 14px; margin-top: 16px; }
.install-card .main { flex: 1; font-size: .92rem; }
.install-card b { display: block; }

/* ---------- toast ---------- */
.toast-box { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 40; max-width: 520px; margin: 0 auto;
    background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .93rem; }
:root[data-theme="dark"] .toast-box { background: #23305a; }

/* reCAPTCHA v3 badge: required text is shown on the login screen instead */
.grecaptcha-badge { visibility: hidden; }

@media (min-width: 600px) {
    .tiles { grid-template-columns: repeat(4, 1fr); }
    .view { padding-top: 24px; }
}
